@Test public void testCanHandle() { ActionContext context = mockActionContextObject(); Assert.assertTrue(context.getSelectedManifestations().size() == 1); Assert.assertNotNull(context); Mockito.when(manifestation.getManifestedComponent()).thenReturn(abstractComp); Assert.assertNotNull(abstractComp); }
@Override public boolean canHandle(ActionContext context) { currentContext = context; if ( (manifestation == null) && currentContext.getSelectedManifestations().iterator().hasNext()) { manifestation = currentContext.getSelectedManifestations().iterator().next(); } return (context.getSelectedManifestations().size() == 1) && isExecutableButtonComponent(context.getSelectedManifestations().iterator().next().getManifestedComponent()); }
ExecutableButtonAction extends ContextAwareAction { @Override public boolean canHandle(ActionContext context) { currentContext = context; if ( (manifestation == null) && currentContext.getSelectedManifestations().iterator().hasNext()) { manifestation = currentContext.getSelectedManifestations().iterator().next(); } return (context.getSelectedManifestations().size() == 1) && isExecutableButtonComponent(context.getSelectedManifestations().iterator().next().getManifestedComponent()); } }
ExecutableButtonAction extends ContextAwareAction { @Override public boolean canHandle(ActionContext context) { currentContext = context; if ( (manifestation == null) && currentContext.getSelectedManifestations().iterator().hasNext()) { manifestation = currentContext.getSelectedManifestations().iterator().next(); } return (context.getSelectedManifestations().size() == 1) && isExecutableButtonComponent(context.getSelectedManifestations().iterator().next().getManifestedComponent()); } ExecutableButtonAction(); }
ExecutableButtonAction extends ContextAwareAction { @Override public boolean canHandle(ActionContext context) { currentContext = context; if ( (manifestation == null) && currentContext.getSelectedManifestations().iterator().hasNext()) { manifestation = currentContext.getSelectedManifestations().iterator().next(); } return (context.getSelectedManifestations().size() == 1) && isExecutableButtonComponent(context.getSelectedManifestations().iterator().next().getManifestedComponent()); } ExecutableButtonAction(); @Override boolean canHandle(ActionContext context); @Override boolean isEnabled(); @Override void actionPerformed(ActionEvent e); }
ExecutableButtonAction extends ContextAwareAction { @Override public boolean canHandle(ActionContext context) { currentContext = context; if ( (manifestation == null) && currentContext.getSelectedManifestations().iterator().hasNext()) { manifestation = currentContext.getSelectedManifestations().iterator().next(); } return (context.getSelectedManifestations().size() == 1) && isExecutableButtonComponent(context.getSelectedManifestations().iterator().next().getManifestedComponent()); } ExecutableButtonAction(); @Override boolean canHandle(ActionContext context); @Override boolean isEnabled(); @Override void actionPerformed(ActionEvent e);  }