Search in sources :

Example 1 with DisplaySubjobCommand

use of org.talend.designer.core.ui.editor.cmd.DisplaySubjobCommand in project tdi-studio-se by Talend.

the class DisplaySubjobAction method run.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
public void run() {
    List editparts = getSelectedObjects();
    if (editparts.size() == 1) {
        Object o = editparts.get(0);
        if (o instanceof NodePart) {
            NodePart part = (NodePart) o;
            Node node = (Node) part.getModel();
            if (node.getJobletNode() != null) {
                node = (Node) node.getJobletNode();
            }
            DisplaySubjobCommand displaySubjobCommand = new DisplaySubjobCommand(node.getNodeContainer().getSubjobContainer());
            execute(displaySubjobCommand);
        } else if (o instanceof SubjobContainerPart) {
            SubjobContainerPart part = (SubjobContainerPart) o;
            SubjobContainer subjob = (SubjobContainer) part.getModel();
            DisplaySubjobCommand displaySubjobCommand = new DisplaySubjobCommand(subjob);
            execute(displaySubjobCommand);
        }
    }
}
Also used : DisplaySubjobCommand(org.talend.designer.core.ui.editor.cmd.DisplaySubjobCommand) SubjobContainer(org.talend.designer.core.ui.editor.subjobcontainer.SubjobContainer) Node(org.talend.designer.core.ui.editor.nodes.Node) List(java.util.List) NodePart(org.talend.designer.core.ui.editor.nodes.NodePart) SubjobContainerPart(org.talend.designer.core.ui.editor.subjobcontainer.SubjobContainerPart)

Aggregations

List (java.util.List)1 DisplaySubjobCommand (org.talend.designer.core.ui.editor.cmd.DisplaySubjobCommand)1 Node (org.talend.designer.core.ui.editor.nodes.Node)1 NodePart (org.talend.designer.core.ui.editor.nodes.NodePart)1 SubjobContainer (org.talend.designer.core.ui.editor.subjobcontainer.SubjobContainer)1 SubjobContainerPart (org.talend.designer.core.ui.editor.subjobcontainer.SubjobContainerPart)1