Package gov.nasa.arc.mct.policy

Examples of gov.nasa.arc.mct.policy.PolicyInfo


public class PolicyManagerTest {
 
  private class TestComponentProvider extends AbstractComponentProvider {
    @Override
    public Collection<PolicyInfo> getPolicyInfos() {
      return Collections.singletonList(new PolicyInfo(MY_POLICY_CATEGORY_KEY, SamplePolicy.class));
    }
View Full Code Here


            super(null, "test");
        }
       
        @Override
        public Collection<PolicyInfo> getPolicyInfos() {
            return Collections.singleton(new PolicyInfo(PolicyInfo.CategoryType.COMPOSITION_POLICY_CATEGORY.getKey(),TestPolicyClass.class));
        }
View Full Code Here

    @SuppressWarnings({ "serial"})
    @BeforeMethod
    public void setup() {
        MockitoAnnotations.initMocks(this);
        Mockito.when(provider.getPolicyInfos()).thenReturn(Collections.singleton(new PolicyInfo(PolicyInfo.CategoryType.CAN_OBJECT_BE_CONTAINED_CATEGORY.getKey(),policy.getClass())));
        PolicyManagerImpl.getInstance().refreshExtendedPolicies(Collections.singletonList(provider));
        action = new PlaceObjectsInCollectionAction() {
            @Override
            protected String getNewCollection(Collection<AbstractComponent> sourceComponents) {
                PlaceObjectsInCollectionActionTest.this.sourceComponents = sourceComponents;
View Full Code Here

        new ViewInfo(StaticGraphicalView.class, GraphicalManifestation.VIEW_ROLE_NAME, ViewType.OBJECT),
        new ViewInfo(StaticGraphicalView.class, GraphicalManifestation.VIEW_ROLE_NAME, ViewType.EMBEDDED)
        );    
   
    public GraphicalComponentProvider(){
      policyInfos = Arrays.asList(new PolicyInfo(PolicyInfo.CategoryType.FILTER_VIEW_ROLE.getKey(), GraphicalStringPolicy.class),
                    new PolicyInfo(PolicyInfo.CategoryType.FILTER_VIEW_ROLE.getKey(), GraphicalViewPolicy.class));
    }
View Full Code Here

 
  private static final ImageIcon ICON =
      new ImageIcon(PlotViewProvider.class.getResource("/icons/mct_icon_menu_plot.png"));
 
  public PlotViewProvider() {
    policyInfos = Arrays.asList(new PolicyInfo(PolicyInfo.CategoryType.FILTER_VIEW_ROLE.getKey(), PlotViewPolicy.class),
                    new PolicyInfo(PolicyInfo.CategoryType.FILTER_VIEW_ROLE.getKey(), PlotStringPolicy.class)
                  );
   
    viewInfos = Arrays.asList(
        new ViewInfo(PlotViewManifestation.class, PlotViewManifestation.VIEW_ROLE_NAME, "gov.nasa.arc.mct.fastplot.view.PlotViewRole", ViewType.OBJECT),
        new ViewInfo(PlotViewManifestation.class, PlotViewManifestation.VIEW_ROLE_NAME, "gov.nasa.arc.mct.fastplot.view.PlotViewRole", ViewType.CENTER),
View Full Code Here

    }   
           
    @Override
    public Collection<PolicyInfo> getPolicyInfos() {
        return Arrays.asList(
                new PolicyInfo(CategoryType.OBJECT_INSPECTION_POLICY_CATEGORY.getKey(),
                               ObjectPermissionPolicy.class),
                new PolicyInfo(CategoryType.COMPOSITION_POLICY_CATEGORY.getKey(),
                               LeafCannotAddChildDetectionPolicy.class,
                               CannotDragOrDropMySandbox.class,
                               SameComponentsCannotBeLinkedPolicy.class),
                new PolicyInfo(CategoryType.ACCEPT_DELEGATE_MODEL_CATEGORY.getKey(),
                               LeafCannotAddChildDetectionPolicy.class,
                               SameComponentsCannotBeLinkedPolicy.class),
                new PolicyInfo(CategoryType.COMPONENT_NAMING_POLICY_CATEGORY.getKey(),
                               ReservedWordsNamingPolicy.class),
                new PolicyInfo(CategoryType.ALLOW_COMPONENT_RENAME_POLICY_CATEGORY.getKey(),
                               ChangeOwnershipPolicy.class,
                               CheckBuiltinComponentPolicy.class,
                               ReservedWordsNamingPolicy.class,
                               ObjectPermissionPolicy.class),                           
                new PolicyInfo(CategoryType.FILTER_VIEW_ROLE.getKey(),
                               DropboxFilterViewPolicy.class,
                               AllCannotBeInspectedPolicy.class),
                new PolicyInfo(CategoryType.CAN_DELETE_COMPONENT_POLICY_CATEGORY.getKey(),
                               CanDeleteComponentPolicy.class),
                new PolicyInfo(CategoryType.CAN_REMOVE_MANIFESTATION_CATEGORY.getKey(),
                        CanRemoveComponentPolicy.class),
                new PolicyInfo(CategoryType.CAN_DUPLICATE_OBJECT.getKey(),
                                CantDuplicateDropBoxesPolicy.class,
                               CheckComponentOwnerIsUserPolicy.class),
                new PolicyInfo(CategoryType.COMPOSITION_POLICY_CATEGORY.getKey(),
                               CheckComponentOwnerIsUserPolicy.class),               
                new PolicyInfo(CategoryType.CAN_OBJECT_BE_CONTAINED_CATEGORY.getKey(),
                                CannotDragOrDropMySandbox.class),
                new PolicyInfo(CategoryType.SHOW_HIDE_CTRL_MANIFESTATION.getKey(),
                               DisciplineUsersViewControlPolicy.class));
    }
View Full Code Here

    }

    @Override
    public Collection<PolicyInfo> getPolicyInfos() {
        return Arrays.asList(
                        new PolicyInfo(PolicyInfo.CategoryType.FILTER_VIEW_ROLE.getKey(), CanvasFilterViewPolicy.class),
                        new PolicyInfo(PolicyInfo.CategoryType.COMPOSITION_POLICY_CATEGORY.getKey(), EmbeddedCanvasViewsAreNotWriteable.class));
    }
View Full Code Here

    private static class MockProvider extends AbstractComponentProvider {

        @Override
        public Collection<PolicyInfo> getPolicyInfos() {
            return Arrays.asList(new PolicyInfo(
                                        PolicyInfo.CategoryType.COMPOSITION_POLICY_CATEGORY.getKey(),
                                        MockPolicy.class),
                                 new PolicyInfo(
                                        PolicyInfo.CategoryType.OBJECT_INSPECTION_POLICY_CATEGORY.getKey(),
                                        MockPolicy.class));
        }
View Full Code Here

     * in PolicyInfo.CatetoryType, which is an enum.
     * A new category can also be added by passing in a unique String to
     * the category name in PolicyInfo constructor.
     */
    return Collections.singletonList(
        new PolicyInfo(PolicyInfo.CategoryType.FILTER_VIEW_ROLE.getKey(),
                 FilterViewPolicy.class));
   
    /*
     * External plugins can execute a policy category by accessing the
     * PolicyManager, which is available as an OSGi service.
View Full Code Here

  public MultiComponentProvider() {
    infos = Arrays.asList(new ComponentTypeInfo(
        bundle.getString("display_name")
        bundle.getString("description"),
        MultiComponent.class));
    policies.add(new PolicyInfo(PolicyInfo.CategoryType.FILTER_VIEW_ROLE.getKey(), EvaluatorViewPolicy.class));
    policies.add(new PolicyInfo(PolicyInfo.CategoryType.FILTER_VIEW_ROLE.getKey(), EnumeratorViewPolicy.class));
    policies.add(new PolicyInfo(PolicyInfo.CategoryType.CAN_REMOVE_MANIFESTATION_CATEGORY.getKey(), MultiChildRemovalPolicy.class));
    policies.add(new PolicyInfo(PolicyInfo.CategoryType.COMPOSITION_POLICY_CATEGORY.getKey(), MultiCompositionPolicy.class));
  }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.policy.PolicyInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.