Changeset 1987
- Timestamp:
- 03/10/08 08:20:34
(9 months ago)
- Author:
- apatel
- Message:
initial setup to perform poilcy customization, this includes common policy customization interface as well as editor and action. Later, I may remove CPL editor in favor of using Module editor.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1884 |
r1987 |
|
| 21 | 21 | policyEditorProxy = CDS Framework Policy Editor Opener |
|---|
| 22 | 22 | linkageEditor = CDS Framework Linkage Editor |
|---|
| | 23 | cpleditor = CDS Framewrok Custom Policy Editor |
|---|
| 23 | 24 | |
|---|
| 24 | 25 | ## properties |
|---|
| r1970 |
r1987 |
|
| 531 | 531 | <participant |
|---|
| 532 | 532 | class="com.tresys.framework.plugin.editor.custom.CPLDocumentSetupParticipant" |
|---|
| 533 | | extensions="fdic"> |
|---|
| | 533 | extensions="fcpl"> |
|---|
| 534 | 534 | </participant> |
|---|
| 535 | 535 | </extension> |
|---|
| r1949 |
r1987 |
|
| 16 | 16 | |
|---|
| 17 | 17 | import com.tresys.framework.compiler.AbstractToken; |
|---|
| | 18 | import com.tresys.framework.compiler.custom.ICustomPolicy; |
|---|
| 18 | 19 | import com.tresys.framework.compiler.dictionary.Verb; |
|---|
| 19 | 20 | |
|---|
| 20 | 21 | public abstract class Access |
|---|
| 21 | | implements IPolicyVisitable |
|---|
| | 22 | implements IPolicyVisitable, ICustomPolicy |
|---|
| 22 | 23 | { |
|---|
| 23 | 24 | |
|---|
| … | … | |
| 181 | 182 | return m_verb; |
|---|
| 182 | 183 | } |
|---|
| | 184 | |
|---|
| | 185 | public boolean supportsCustomPolicy() |
|---|
| | 186 | { |
|---|
| | 187 | return true; |
|---|
| | 188 | } |
|---|
| | 189 | |
|---|
| | 190 | public boolean hasCustomization() |
|---|
| | 191 | { |
|---|
| | 192 | return false; |
|---|
| | 193 | } |
|---|
| | 194 | |
|---|
| 183 | 195 | } |
|---|
| r1949 |
r1987 |
|
| 216 | 216 | return false; |
|---|
| 217 | 217 | } |
|---|
| | 218 | |
|---|
| | 219 | public boolean supportsCustomPolicy() |
|---|
| | 220 | { |
|---|
| | 221 | return false; |
|---|
| | 222 | } |
|---|
| | 223 | |
|---|
| | 224 | public boolean hasCustomization() |
|---|
| | 225 | { |
|---|
| | 226 | return false; |
|---|
| | 227 | } |
|---|
| | 228 | |
|---|
| 218 | 229 | } |
|---|
| r1949 |
r1987 |
|
| 173 | 173 | } |
|---|
| 174 | 174 | |
|---|
| | 175 | public boolean supportsCustomPolicy() |
|---|
| | 176 | { |
|---|
| | 177 | return false; |
|---|
| | 178 | } |
|---|
| | 179 | |
|---|
| | 180 | public boolean hasCustomization() |
|---|
| | 181 | { |
|---|
| | 182 | return false; |
|---|
| | 183 | } |
|---|
| 175 | 184 | |
|---|
| 176 | 185 | } |
|---|
| r1949 |
r1987 |
|
| 22 | 22 | import com.tresys.framework.compiler.ErrorHandler; |
|---|
| 23 | 23 | import com.tresys.framework.compiler.AbstractToken; |
|---|
| | 24 | import com.tresys.framework.compiler.custom.ICustomPolicy; |
|---|
| 24 | 25 | |
|---|
| 25 | 26 | /** |
|---|
| … | … | |
| 39 | 40 | public abstract class Component |
|---|
| 40 | 41 | extends Object |
|---|
| 41 | | implements Comparable/*<Component>*/, IPolicyVisitable |
|---|
| | 42 | implements Comparable/*<Component>*/, IPolicyVisitable, ICustomPolicy |
|---|
| 42 | 43 | { |
|---|
| 43 | 44 | |
|---|
| r1949 |
r1987 |
|
| 55 | 55 | i_visitor.Visit(this); |
|---|
| 56 | 56 | } |
|---|
| | 57 | |
|---|
| | 58 | public boolean supportsCustomPolicy() |
|---|
| | 59 | { |
|---|
| | 60 | return false; |
|---|
| | 61 | } |
|---|
| | 62 | |
|---|
| | 63 | public boolean hasCustomization() |
|---|
| | 64 | { |
|---|
| | 65 | return false; |
|---|
| | 66 | } |
|---|
| | 67 | |
|---|
| 57 | 68 | } |
|---|
| r1949 |
r1987 |
|
| 356 | 356 | return false; |
|---|
| 357 | 357 | } |
|---|
| | 358 | |
|---|
| | 359 | public boolean supportsCustomPolicy() |
|---|
| | 360 | { |
|---|
| | 361 | return true; |
|---|
| | 362 | } |
|---|
| | 363 | |
|---|
| | 364 | public boolean hasCustomization() |
|---|
| | 365 | { |
|---|
| | 366 | return false; |
|---|
| | 367 | } |
|---|
| | 368 | |
|---|
| 358 | 369 | } |
|---|
| r1949 |
r1987 |
|
| 18 | 18 | import com.tresys.framework.compiler.AbstractToken; |
|---|
| 19 | 19 | import com.tresys.framework.compiler.Utility; |
|---|
| | 20 | import com.tresys.framework.compiler.custom.ICustomPolicy; |
|---|
| 20 | 21 | import com.tresys.framework.compiler.dictionary.EntryAccessDefn; |
|---|
| 21 | 22 | |
|---|
| … | … | |
| 37 | 38 | */ |
|---|
| 38 | 39 | public final class Enter |
|---|
| 39 | | implements IPolicyVisitable |
|---|
| | 40 | implements IPolicyVisitable, ICustomPolicy |
|---|
| 40 | 41 | { |
|---|
| 41 | 42 | |
|---|
| … | … | |
| 219 | 220 | } |
|---|
| 220 | 221 | |
|---|
| | 222 | public boolean supportsCustomPolicy() |
|---|
| | 223 | { |
|---|
| | 224 | return true; |
|---|
| | 225 | } |
|---|
| | 226 | |
|---|
| | 227 | public boolean hasCustomization() |
|---|
| | 228 | { |
|---|
| | 229 | return false; |
|---|
| | 230 | } |
|---|
| 221 | 231 | |
|---|
| 222 | 232 | |
|---|
| r1949 |
r1987 |
|
| 97 | 97 | i_visitor.Visit(this); |
|---|
| 98 | 98 | } |
|---|
| | 99 | |
|---|
| | 100 | public boolean supportsCustomPolicy() |
|---|
| | 101 | { |
|---|
| | 102 | return true; |
|---|
| | 103 | } |
|---|
| | 104 | |
|---|
| | 105 | public boolean hasCustomization() |
|---|
| | 106 | { |
|---|
| | 107 | return false; |
|---|
| | 108 | } |
|---|
| | 109 | |
|---|
| 99 | 110 | } |
|---|
| r1949 |
r1987 |
|
| 142 | 142 | accesses.clear(); |
|---|
| 143 | 143 | } |
|---|
| | 144 | |
|---|
| | 145 | public boolean supportsCustomPolicy() |
|---|
| | 146 | { |
|---|
| | 147 | return true; |
|---|
| | 148 | } |
|---|
| | 149 | |
|---|
| | 150 | public boolean hasCustomization() |
|---|
| | 151 | { |
|---|
| | 152 | return false; |
|---|
| | 153 | } |
|---|
| | 154 | |
|---|
| 144 | 155 | } |
|---|
| r1949 |
r1987 |
|
| 161 | 161 | return false; |
|---|
| 162 | 162 | } |
|---|
| | 163 | |
|---|
| | 164 | public boolean supportsCustomPolicy() |
|---|
| | 165 | { |
|---|
| | 166 | return true; |
|---|
| | 167 | } |
|---|
| | 168 | |
|---|
| | 169 | public boolean hasCustomization() |
|---|
| | 170 | { |
|---|
| | 171 | return false; |
|---|
| | 172 | } |
|---|
| | 173 | |
|---|
| 163 | 174 | } |
|---|
| r1972 |
r1987 |
|
| 6 | 6 | * CPLEditor.java |
|---|
| 7 | 7 | * |
|---|
| 8 | | * $Rev$ |
|---|
| | 8 | * $Rev:1972 $ |
|---|
| 9 | 9 | * $Date$ |
|---|
| 10 | 10 | */ |
|---|
| … | … | |
| 13 | 13 | |
|---|
| 14 | 14 | import org.eclipse.ui.editors.text.TextEditor; |
|---|
| | 15 | import org.eclipse.ui.internal.editors.text.TextEditorDefaultsPreferencePage; |
|---|
| | 16 | |
|---|
| 15 | 17 | |
|---|
| 16 | 18 | public class CPLEditor |
|---|
| 17 | 19 | extends TextEditor |
|---|
| 18 | 20 | { |
|---|
| 19 | | |
|---|
| 20 | | |
|---|
| 21 | 21 | /** |
|---|
| 22 | 22 | * domain foo |
|---|
| … | … | |
| 25 | 25 | * SEFramework_domain(foo_t); |
|---|
| 26 | 26 | * allow foo_t self:capability { dac_override }; |
|---|
| | 27 | * } |
|---|
| 27 | 28 | */ |
|---|
| 28 | | protected void initializeEditor () |
|---|
| | 29 | public void initializeEditor () |
|---|
| 29 | 30 | { |
|---|
| 30 | 31 | super.initializeEditor (); |
|---|
| 31 | | // http://mobilerated.com/dl/1207 |
|---|
| 32 | 32 | } |
|---|
| | 33 | |
|---|
| 33 | 34 | } |
|---|
| r1825 |
r1987 |
|
| 9 | 9 | package com.tresys.framework.plugin.editor.policy.graphic; |
|---|
| 10 | 10 | |
|---|
| | 11 | import java.util.Iterator; |
|---|
| | 12 | |
|---|
| 11 | 13 | import org.eclipse.jface.action.IAction; |
|---|
| 12 | 14 | import org.eclipse.jface.action.IMenuManager; |
|---|
| | 15 | import org.eclipse.jface.dialogs.Dialog; |
|---|
| | 16 | import org.eclipse.jface.dialogs.ErrorDialog; |
|---|
| 13 | 17 | import org.eclipse.ui.actions.ActionFactory; |
|---|
| 14 | 18 | |
|---|
| … | … | |
| 17 | 21 | import org.eclipse.gef.ui.actions.ActionRegistry; |
|---|
| 18 | 22 | import org.eclipse.gef.ui.actions.GEFActionConstants; |
|---|
| | 23 | |
|---|
| | 24 | import com.tresys.framework.compiler.linkage.refpolicy.InfoDirection; |
|---|
| | 25 | import com.tresys.framework.plugin.editor.custom.AddCustomPolicy; |
|---|
| 19 | 26 | |
|---|
| 20 | 27 | |
|---|
| … | … | |
| 66 | 73 | GEFActionConstants.GROUP_EDIT, |
|---|
| 67 | 74 | getAction(ActionFactory.DELETE.getId())); |
|---|
| | 75 | |
|---|
| | 76 | menu.appendToGroup( |
|---|
| | 77 | GEFActionConstants.GROUP_EDIT, |
|---|
| | 78 | getAction(AddCustomPolicy.ID)); |
|---|
| 68 | 79 | } |
|---|
| 69 | 80 | |
|---|
| … | … | |
| 72 | 83 | return actionRegistry.getAction(actionId); |
|---|
| 73 | 84 | } |
|---|
| 74 | | |
|---|
| | 85 | |
|---|
| | 86 | public void add (IAction action) |
|---|
| | 87 | { |
|---|
| | 88 | super.add (action); |
|---|
| | 89 | } |
|---|
| 75 | 90 | } |
|---|
| r1949 |
r1987 |
|
| 41 | 41 | IPolicyVisitor m_visitor; |
|---|
| 42 | 42 | |
|---|
| 43 | | GraphicPolicyMetaVisitor (IPolicyVisitor i_PolicyVisitor) |
|---|
| | 43 | public GraphicPolicyMetaVisitor (IPolicyVisitor i_PolicyVisitor) |
|---|
| 44 | 44 | { |
|---|
| 45 | 45 | m_visitor = i_PolicyVisitor; |
|---|
| r1825 |
r1987 |
|
| 31 | 31 | import com.tresys.framework.plugin.editor.policy.graphic.model.BaseResourceShape; |
|---|
| 32 | 32 | import com.tresys.framework.plugin.editor.policy.graphic.model.ControlResourceShape; |
|---|
| | 33 | import com.tresys.framework.plugin.editor.policy.graphic.model.DomainShape; |
|---|
| 33 | 34 | import com.tresys.framework.plugin.editor.policy.graphic.model.IDomainShape; |
|---|
| 34 | 35 | import com.tresys.framework.plugin.editor.policy.graphic.model.ResourceShape; |
|---|
| … | … | |
| 228 | 229 | primRemoveEntryConnection(connection); |
|---|
| 229 | 230 | } |
|---|
| | 231 | |
|---|
| | 232 | public boolean supportsCustomPolicy() |
|---|
| | 233 | { |
|---|
| | 234 | if (getModel() instanceof ResourceShape) |
|---|
| | 235 | { |
|---|
| | 236 | return true; |
|---|
| | 237 | } |
|---|
| | 238 | else if (getModel () instanceof UserDomainShape) |
|---|
| | 239 | { |
|---|
| | 240 | return true; |
|---|
| | 241 | } |
|---|
| | 242 | else if (getModel() instanceof EntryPointShape) |
|---|
| | 243 | { |
|---|
| | 244 | return true; |
|---|
| | 245 | } |
|---|
| | 246 | else if (getModel() instanceof DomainShape) |
|---|
| | 247 | { |
|---|
| | 248 | return true; |
|---|
| | 249 | } |
|---|
| | 250 | return false; |
|---|
| | 251 | } |
|---|
| 230 | 252 | } |
|---|
Download in other formats:
* Generating other formats may take time.