final Processor theProcessor = ap.getProcessor(); String tagName = ProcessorHelper.getTagNameForClassName(theProcessor.getClass().getName()); ProcessorEditor pe = ProcessorHelper.getEditorForTagName(tagName); if (pe != null) {
/** * Return a custom renderer to draw the cell correctly for each node type */ public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); Object userObject = ((DefaultMutableTreeNode) value).getUserObject(); setVerticalTextPosition(SwingConstants.BOTTOM); if (userObject instanceof ProcessorFactory) { ProcessorFactory pf = (ProcessorFactory) userObject; Class processorClass = pf.getProcessorClass(); String tagName = ProcessorHelper .getTagNameForClassName(processorClass.getName()); ImageIcon icon = ProcessorHelper.getIconForTagName(tagName); if (icon != null) { setIcon(icon); } } return this; } }
private void doChildren(ScuflModel model) { Processor[] processors = model.getProcessors(); for (int i = 0; i < processors.length; i++) { // Create a new node for the factory corresponding to this processor String tagName = ProcessorHelper.getTagNameForClassName(processors[i].getClass().getName()); XMLHandler xh = ProcessorHelper.getXMLHandlerForTagName(tagName); logger.info(tagName + ":" + processors[i].getName()); if (xh != null) { ProcessorFactory pf = xh.getFactory(xh.elementForProcessor(processors[i])); pf.setName(processors[i].getName()); if (processors[i].getDescription().equals("") == false) { pf.setDescription(processors[i].getDescription()); } else { if (processors[i] instanceof WorkflowProcessor) { // Nested workflow with no description, explicitly set // it to say // this otherwise a 'fetch descriptions' will attempt to // load it // in online mode, this could well fail. pf.setDescription("<font color=\"red\">No description supplied for nested workflow</font>"); } } add(new DefaultMutableTreeNode(pf)); } } } }
theMenu.addSeparator(); String tagName = ProcessorHelper.getTagNameForClassName(theProcessor.getClass().getName()); ProcessorEditor pe = ProcessorHelper.getEditorForTagName(tagName); if (pe != null) {