public void actionPerformed(ActionEvent a) { // Swap this alternate with the one one lower in the // list List theList = parentProcessor.getAlternatesList(); Object o = theList.get(alternateIndex); theList.remove(o); theList.add(alternateIndex - 1, o); parentProcessor.fireModelEvent(new ScuflModelEvent(parentProcessor, "Alternates reordered")); } });
public void actionPerformed(ActionEvent a) { // Swap this alternate with the one one lower in the // list List theList = parentProcessor.getAlternatesList(); Object o = theList.get(alternateIndex); theList.remove(o); theList.add(alternateIndex + 1, o); parentProcessor.fireModelEvent(new ScuflModelEvent(parentProcessor, "Alternates reordered")); } });
final int numberOfAlternates = parentProcessor.getAlternatesList().size(); final int alternateIndex = parentProcessor.getAlternatesList().indexOf(alternate); if (numberOfAlternates > 1 && alternateIndex != -1) { if (alternateIndex > 0) {
/** * The method which is called when the process needs to be executed */ public Map execute(Map inputMap, IProcessorTask parentTask) throws TaskExecutionException { if (parentTask.getProcessor().getAlternatesList().size() == 0) { JOptionPane.showMessageDialog(null, "No implementation for the abstract processor. Add an alternate to " + processor.getName(), "Abstract processor " + processor.getName() + " incomplete", JOptionPane.ERROR_MESSAGE); throw new TaskExecutionException( "No implementation for the abstract processor. Add an alternate to " + processor.getName()); } else { logger.info("Encountered Abstract Processor, using alternate."); throw new TaskExecutionException("Using alternate to " + processor.getName()); } }