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);
}
}
}
Aggregations