@Test public void testCannotHandle() { if (DetectGraphicsDevices.getInstance().getNumberGraphicsDevices() == DetectGraphicsDevices.MINIMUM_MONITOR_CHECK) { ActionContextImpl failContext = new ActionContextImpl(); failContext.addTargetViewComponent(viewManifestation1); Assert.assertTrue(failAction.canHandle(failContext)); failContext.addTargetViewComponent(viewManifestationRootComponent); Assert.assertFalse(failAction.canHandle(failContext)); } }
@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()) { return false; } for (View manifestation : selectedManifestations) { if (manifestation.getManifestedComponent() == PlatformAccess.getPlatform().getRootComponent()) { return false; } } return true; }
PlaceObjectsInCollectionAction extends ContextAwareAction { @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()) { return false; } for (View manifestation : selectedManifestations) { if (manifestation.getManifestedComponent() == PlatformAccess.getPlatform().getRootComponent()) { return false; } } return true; } }
PlaceObjectsInCollectionAction extends ContextAwareAction { @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()) { return false; } for (View manifestation : selectedManifestations) { if (manifestation.getManifestedComponent() == PlatformAccess.getPlatform().getRootComponent()) { return false; } } return true; } PlaceObjectsInCollectionAction(); }
PlaceObjectsInCollectionAction extends ContextAwareAction { @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()) { return false; } for (View manifestation : selectedManifestations) { if (manifestation.getManifestedComponent() == PlatformAccess.getPlatform().getRootComponent()) { return false; } } return true; } PlaceObjectsInCollectionAction(); @Override void actionPerformed(ActionEvent e); @Override boolean canHandle(ActionContext context); @Override boolean isEnabled(); }
PlaceObjectsInCollectionAction extends ContextAwareAction { @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()) { return false; } for (View manifestation : selectedManifestations) { if (manifestation.getManifestedComponent() == PlatformAccess.getPlatform().getRootComponent()) { return false; } } return true; } PlaceObjectsInCollectionAction(); @Override void actionPerformed(ActionEvent e); @Override boolean canHandle(ActionContext context); @Override boolean isEnabled();  }