Package gov.nasa.arc.mct.policy

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


          .singleton(component);
      AbstractComponent targetComponent = model
          .getModifiedComponentAt(row, column, isInsertRow,
              isInsertColumn);

      final ExecutionResult result = checkDropPolicy(targetComponent,
          sourceComponents, this);

      if (result.getStatus()) {
        model.setValueAt(component, row, column, isInsertRow,
            isInsertColumn);
        recreateTable();
      } else {
        // Action is _not_ permitted under policy constraint
        SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {
            // Inform the user that policy prohibited the
            // operation.
            OptionBox.showMessageDialog(
                TableViewManifestation.this,
                result.getMessage(),
                "Composition Error - ",
                OptionBox.ERROR_MESSAGE);
          }
        });
      }
View Full Code Here


    if (MultiColView.class.isAssignableFrom(viewInfo.getViewClass())) {
      result = canView(context.getProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), AbstractComponent.class));
    }

    return new ExecutionResult(context, result, null);
  }
View Full Code Here

  public PolicyManager getPolicyManager() {
    return new PolicyManager() {
     
      @Override
      public ExecutionResult execute(String categoryKey, PolicyContext context) {
        return new ExecutionResult(context, true, "");
      }
    };
  }
View Full Code Here

                PolicyContext context = new PolicyContext();
                context.setProperty(PolicyContext.PropertyName.SOURCE_COMPONENTS.getName(),Collections.singleton(referencedComponent));
                String policyCategoryKey = PolicyInfo.CategoryType.CAN_OBJECT_BE_CONTAINED_CATEGORY.getKey();
                Platform platform = PlatformAccess.getPlatform();
                PolicyManager policyManager = platform.getPolicyManager();
                ExecutionResult result = policyManager.execute(policyCategoryKey, context);
                return result.getStatus();
            }
           
            @Override
            protected Transferable createTransferable(JComponent c) {
                return new ViewRoleSelection(viewTransferCallback.getViewsToTransfer().toArray(new View[0]));
View Full Code Here

    MockitoAnnotations.initMocks(this);
    allComponents.clear();
    Mockito.when(component.getDisplayName()).thenReturn("test");
    List<AbstractComponent> rootChildren = new ArrayList<AbstractComponent>();
    Mockito.when(component.getComponents()).thenReturn(rootChildren);
    ExecutionResult trueResult = new ExecutionResult(null, true, "");
    Mockito.when(policyManager.execute(Mockito.anyString(), Mockito.any(PolicyContext.class))).thenReturn(trueResult);
    (new ServiceAccess()).bind(policyManager);
    List<AbstractComponent> row0Children = new ArrayList<AbstractComponent>();
    List<AbstractComponent> row1Children = new ArrayList<AbstractComponent>();
   
View Full Code Here

TOP

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

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.