@Test(dependsOnMethods = {"testIsEnabled"}) public void testActionPerformedFailedCase() { reset(); setResult = false; action.actionPerformed(new ActionEvent(viewManifestation1, 0,"")); Assert.assertEquals(success,0); Assert.assertEquals(fail,1); Assert.assertEquals(sourceComponents.size(), 2); }
@Override public void actionPerformed(ActionEvent e) { Set<AbstractComponent> sourceComponents = new LinkedHashSet<AbstractComponent>(); for (View manifestation : selectedManifestations) sourceComponents.add(manifestation.getManifestedComponent()); final String name = getNewMulti(sourceComponents); if (name.isEmpty()) return; final AbstractComponent multi = createNewMulti(sourceComponents); if (multi == null) { showErrorInCreateMulti(); } else { multi.setDisplayName(name); SwingUtilities.invokeLater(new Runnable() { public void run() { openNewMulti(name, multi); } }); } }
PlaceObjectsInMultiAction extends ContextAwareAction { @Override public void actionPerformed(ActionEvent e) { Set<AbstractComponent> sourceComponents = new LinkedHashSet<AbstractComponent>(); for (View manifestation : selectedManifestations) sourceComponents.add(manifestation.getManifestedComponent()); final String name = getNewMulti(sourceComponents); if (name.isEmpty()) return; final AbstractComponent multi = createNewMulti(sourceComponents); if (multi == null) { showErrorInCreateMulti(); } else { multi.setDisplayName(name); SwingUtilities.invokeLater(new Runnable() { public void run() { openNewMulti(name, multi); } }); } } }
PlaceObjectsInMultiAction extends ContextAwareAction { @Override public void actionPerformed(ActionEvent e) { Set<AbstractComponent> sourceComponents = new LinkedHashSet<AbstractComponent>(); for (View manifestation : selectedManifestations) sourceComponents.add(manifestation.getManifestedComponent()); final String name = getNewMulti(sourceComponents); if (name.isEmpty()) return; final AbstractComponent multi = createNewMulti(sourceComponents); if (multi == null) { showErrorInCreateMulti(); } else { multi.setDisplayName(name); SwingUtilities.invokeLater(new Runnable() { public void run() { openNewMulti(name, multi); } }); } } PlaceObjectsInMultiAction(); }
PlaceObjectsInMultiAction extends ContextAwareAction { @Override public void actionPerformed(ActionEvent e) { Set<AbstractComponent> sourceComponents = new LinkedHashSet<AbstractComponent>(); for (View manifestation : selectedManifestations) sourceComponents.add(manifestation.getManifestedComponent()); final String name = getNewMulti(sourceComponents); if (name.isEmpty()) return; final AbstractComponent multi = createNewMulti(sourceComponents); if (multi == null) { showErrorInCreateMulti(); } else { multi.setDisplayName(name); SwingUtilities.invokeLater(new Runnable() { public void run() { openNewMulti(name, multi); } }); } } PlaceObjectsInMultiAction(); @Override void actionPerformed(ActionEvent e); @Override boolean canHandle(ActionContext context); @Override boolean isEnabled(); }
PlaceObjectsInMultiAction extends ContextAwareAction { @Override public void actionPerformed(ActionEvent e) { Set<AbstractComponent> sourceComponents = new LinkedHashSet<AbstractComponent>(); for (View manifestation : selectedManifestations) sourceComponents.add(manifestation.getManifestedComponent()); final String name = getNewMulti(sourceComponents); if (name.isEmpty()) return; final AbstractComponent multi = createNewMulti(sourceComponents); if (multi == null) { showErrorInCreateMulti(); } else { multi.setDisplayName(name); SwingUtilities.invokeLater(new Runnable() { public void run() { openNewMulti(name, multi); } }); } } PlaceObjectsInMultiAction(); @Override void actionPerformed(ActionEvent e); @Override boolean canHandle(ActionContext context); @Override boolean isEnabled();  }