コード例 #1
0
 /**
  * Opens the new enum.
  *
  * @param name display name.
  * @param e component.
  */
 void openNewActivity(String name, AbstractComponent e) {
   if (DetectGraphicsDevices.getInstance().getNumberGraphicsDevices()
       > DetectGraphicsDevices.MINIMUM_MONITOR_CHECK) {
     GraphicsConfiguration graphicsConfig =
         DetectGraphicsDevices.getInstance().getSingleGraphicDeviceConfig(graphicsDeviceName);
     e.open(graphicsConfig);
   } else {
     e.open();
   }
 }
コード例 #2
0
  @Override
  public boolean canHandle(ActionContext context) {
    actionContext = (ActionContextImpl) context;

    if (DetectGraphicsDevices.getInstance().getNumberGraphicsDevices()
        > DetectGraphicsDevices.MINIMUM_MONITOR_CHECK) {
      graphicsDeviceName =
          actionContext
              .getTargetHousing()
              .getHostedFrame()
              .getGraphicsConfiguration()
              .getDevice()
              .getIDstring();
      graphicsDeviceName = graphicsDeviceName.replace("\\", "");
    }

    selectedManifestations = context.getSelectedManifestations();
    if (selectedManifestations.isEmpty()) {
      // No objects selected to add to a new collections
      return false;
    }

    // Guards against attempting to put a top level object into a collection as this will result in
    // that collection becoming a child of itself. The prime example of this is the "All" entry in
    // the tree. All necessary contains everything so adding All to All would result in All being a
    // child
    for (View manifestation : selectedManifestations) {
      if (manifestation.getManifestedComponent()
          == PlatformAccess.getPlatform().getRootComponent()) {
        return false;
      }
    }

    return true;
  }
コード例 #3
0
  @Override
  public boolean canHandle(ActionContext context) {

    if (DetectGraphicsDevices.getInstance().getNumberGraphicsDevices()
        > DetectGraphicsDevices.MINIMUM_MONITOR_CHECK) {

      if (context.getWindowManifestation() != null) {
        graphicsDeviceName = getActiveGraphicsDeviceName(context.getWindowManifestation());
      }
    }

    selectedManifestations = context.getSelectedManifestations();
    if (selectedManifestations.isEmpty()) {
      // No objects selected to add to a new Enumerator
      return false;
    }
    return true;
  }