Changeset 1987

Show
Ignore:
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
  • branches/custome_policy/framework-plugin/plugin.properties

    r1884 r1987  
    2121policyEditorProxy = CDS Framework Policy Editor Opener 
    2222linkageEditor = CDS Framework Linkage Editor 
     23cpleditor = CDS Framewrok Custom Policy Editor 
    2324 
    2425## properties 
  • branches/custome_policy/framework-plugin/plugin.xml

    r1970 r1987  
    531531         <participant 
    532532               class="com.tresys.framework.plugin.editor.custom.CPLDocumentSetupParticipant" 
    533                extensions="fdic"> 
     533               extensions="fcpl"> 
    534534         </participant> 
    535535      </extension> 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/Access.java

    r1949 r1987  
    1616 
    1717import com.tresys.framework.compiler.AbstractToken; 
     18import com.tresys.framework.compiler.custom.ICustomPolicy; 
    1819import com.tresys.framework.compiler.dictionary.Verb; 
    1920 
    2021public abstract class Access  
    21         implements IPolicyVisitable  
     22        implements IPolicyVisitable, ICustomPolicy 
    2223{ 
    2324 
     
    181182                return m_verb; 
    182183        } 
     184         
     185        public boolean supportsCustomPolicy() 
     186        { 
     187                return true; 
     188        } 
     189         
     190        public boolean hasCustomization() 
     191        { 
     192                return false; 
     193        } 
     194 
    183195} 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/BaseDomain.java

    r1949 r1987  
    216216                return false; 
    217217        } 
     218         
     219        public boolean supportsCustomPolicy() 
     220        { 
     221                return false; 
     222        } 
     223         
     224        public boolean hasCustomization() 
     225        { 
     226                return false; 
     227        } 
     228 
    218229} 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/BaseResource.java

    r1949 r1987  
    173173        } 
    174174 
     175        public boolean supportsCustomPolicy() 
     176        { 
     177                return false; 
     178        } 
     179         
     180        public boolean hasCustomization() 
     181        { 
     182                return false; 
     183        } 
    175184 
    176185} 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/Component.java

    r1949 r1987  
    2222import com.tresys.framework.compiler.ErrorHandler; 
    2323import com.tresys.framework.compiler.AbstractToken; 
     24import com.tresys.framework.compiler.custom.ICustomPolicy; 
    2425 
    2526/** 
     
    3940public abstract class Component  
    4041        extends Object 
    41         implements Comparable/*<Component>*/, IPolicyVisitable  
     42        implements Comparable/*<Component>*/, IPolicyVisitable, ICustomPolicy 
    4243{ 
    4344 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/Conditional.java

    r1949 r1987  
    5555                i_visitor.Visit(this); 
    5656        } 
     57         
     58        public boolean supportsCustomPolicy() 
     59        { 
     60                return false; 
     61        } 
     62         
     63        public boolean hasCustomization() 
     64        { 
     65                return false; 
     66        } 
     67 
    5768} 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/Domain.java

    r1949 r1987  
    356356                return false; 
    357357        } 
     358         
     359        public boolean supportsCustomPolicy() 
     360        { 
     361                return true; 
     362        } 
     363         
     364        public boolean hasCustomization() 
     365        { 
     366                return false; 
     367        } 
     368 
    358369} 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/Enter.java

    r1949 r1987  
    1818import com.tresys.framework.compiler.AbstractToken; 
    1919import com.tresys.framework.compiler.Utility; 
     20import com.tresys.framework.compiler.custom.ICustomPolicy; 
    2021import com.tresys.framework.compiler.dictionary.EntryAccessDefn; 
    2122 
     
    3738 */ 
    3839public final class Enter  
    39         implements IPolicyVisitable  
     40        implements IPolicyVisitable, ICustomPolicy  
    4041{ 
    4142 
     
    219220        } 
    220221         
     222        public boolean supportsCustomPolicy() 
     223        { 
     224                return true; 
     225        } 
     226         
     227        public boolean hasCustomization() 
     228        { 
     229                return false; 
     230        } 
    221231 
    222232 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/EntrypointResource.java

    r1949 r1987  
    9797                i_visitor.Visit(this); 
    9898        } 
     99         
     100        public boolean supportsCustomPolicy() 
     101        { 
     102                return true; 
     103        } 
     104         
     105        public boolean hasCustomization() 
     106        { 
     107                return false; 
     108        } 
     109 
    99110} 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/Resource.java

    r1949 r1987  
    142142                accesses.clear(); 
    143143        } 
     144         
     145        public boolean supportsCustomPolicy() 
     146        { 
     147                return true; 
     148        } 
     149         
     150        public boolean hasCustomization() 
     151        { 
     152                return false; 
     153        } 
     154 
    144155} 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/UserDomain.java

    r1949 r1987  
    161161                return false; 
    162162        } 
     163         
     164        public boolean supportsCustomPolicy() 
     165        { 
     166                return true; 
     167        } 
     168         
     169        public boolean hasCustomization() 
     170        { 
     171                return false; 
     172        } 
     173 
    163174} 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/custom/CPLEditor.java

    r1972 r1987  
    66 * CPLEditor.java 
    77 * 
    8  * $Rev
     8 * $Rev:1972
    99 * $Date$ 
    1010 */ 
     
    1313 
    1414import org.eclipse.ui.editors.text.TextEditor; 
     15import org.eclipse.ui.internal.editors.text.TextEditorDefaultsPreferencePage; 
     16 
    1517 
    1618public class CPLEditor 
    1719        extends TextEditor 
    1820{ 
    19  
    20          
    2121        /** 
    2222         * domain foo 
     
    2525         *      SEFramework_domain(foo_t); 
    2626         *      allow foo_t self:capability { dac_override }; 
     27         * } 
    2728         */ 
    28         protected void initializeEditor () 
     29        public void initializeEditor () 
    2930        { 
    3031                super.initializeEditor (); 
    31 //              http://mobilerated.com/dl/1207 
    3232        } 
     33         
    3334} 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/GraphicPolicyEditorContextMenuProvider.java

    r1825 r1987  
    99package com.tresys.framework.plugin.editor.policy.graphic; 
    1010 
     11import java.util.Iterator; 
     12 
    1113import org.eclipse.jface.action.IAction; 
    1214import org.eclipse.jface.action.IMenuManager; 
     15import org.eclipse.jface.dialogs.Dialog; 
     16import org.eclipse.jface.dialogs.ErrorDialog; 
    1317import org.eclipse.ui.actions.ActionFactory; 
    1418 
     
    1721import org.eclipse.gef.ui.actions.ActionRegistry; 
    1822import org.eclipse.gef.ui.actions.GEFActionConstants; 
     23 
     24import com.tresys.framework.compiler.linkage.refpolicy.InfoDirection; 
     25import com.tresys.framework.plugin.editor.custom.AddCustomPolicy; 
    1926 
    2027 
     
    6673                                GEFActionConstants.GROUP_EDIT, 
    6774                                getAction(ActionFactory.DELETE.getId())); 
     75                 
     76                menu.appendToGroup( 
     77                        GEFActionConstants.GROUP_EDIT, 
     78                        getAction(AddCustomPolicy.ID)); 
    6879        } 
    6980         
     
    7283                return actionRegistry.getAction(actionId); 
    7384        } 
    74  
     85         
     86        public void add (IAction action) 
     87        { 
     88                super.add (action); 
     89        } 
    7590} 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/GraphicPolicyMetaVisitor.java

    r1949 r1987  
    4141        IPolicyVisitor m_visitor; 
    4242         
    43         GraphicPolicyMetaVisitor (IPolicyVisitor i_PolicyVisitor) 
     43        public GraphicPolicyMetaVisitor (IPolicyVisitor i_PolicyVisitor) 
    4444        { 
    4545                m_visitor = i_PolicyVisitor; 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/ShapeEditPart.java

    r1825 r1987  
    3131import com.tresys.framework.plugin.editor.policy.graphic.model.BaseResourceShape; 
    3232import com.tresys.framework.plugin.editor.policy.graphic.model.ControlResourceShape; 
     33import com.tresys.framework.plugin.editor.policy.graphic.model.DomainShape; 
    3334import com.tresys.framework.plugin.editor.policy.graphic.model.IDomainShape; 
    3435import com.tresys.framework.plugin.editor.policy.graphic.model.ResourceShape; 
     
    228229                primRemoveEntryConnection(connection); 
    229230        } 
     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        } 
    230252}