Search in sources :

Example 6 with NodeTreeEditPart

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

the class DynamicTabbedPropertySection method setInput.

// private ISelection lastSelection;
/*
     * @Override (non-Java)
     * 
     * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection# setInput(org.eclipse.ui.IWorkbenchPart,
     * org.eclipse.jface.viewers.ISelection)
     */
@Override
public void setInput(final IWorkbenchPart workbenchPart, final ISelection selection) {
    if (!(selection instanceof IStructuredSelection)) {
        return;
    }
    curRowSize = 0;
    Object input = ((IStructuredSelection) selection).getFirstElement();
    if (input instanceof NodeContainerPart) {
        NodeContainerPart nContainer = (NodeContainerPart) input;
        elem = (Element) nContainer.getParent().getModel();
    } else if (input instanceof NodeTreeEditPart) {
        NodeTreeEditPart nTreePart = (NodeTreeEditPart) input;
        elem = (Element) nTreePart.getModel();
    } else if (!(input instanceof NodeReturnsTreeEditPart)) {
        EditPart editPart = (EditPart) input;
        elem = (Element) editPart.getModel();
    }
    if (elem instanceof NodeLabel) {
        elem = ((NodeLabel) elem).getNode();
    }
    if (elem instanceof ConnectionLabel) {
        elem = ((ConnectionLabel) elem).getConnection();
    }
    if (workbenchPart instanceof AbstractMultiPageTalendEditor) {
        part = (AbstractMultiPageTalendEditor) workbenchPart;
    } else {
        if (elem instanceof INode) {
            part = (AbstractMultiPageTalendEditor) ((IProcess2) ((INode) elem).getProcess()).getEditor();
        } else if (elem instanceof IConnection) {
            IConnection conn;
            conn = (IConnection) elem;
            part = (AbstractMultiPageTalendEditor) ((IProcess2) conn.getSource().getProcess()).getEditor();
        } else {
            part = (AbstractMultiPageTalendEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
        }
    }
    super.setInput(part, selection);
    commandStackEventListener = null;
    if ((currentComponent == null) || (!currentComponent.equals(elem.getElementName()))) {
        forceRedraw = true;
        elem.setPropertyValue(updataComponentParamName, Boolean.TRUE);
    }
    currentComponent = elem.getElementName();
}
Also used : INode(org.talend.core.model.process.INode) NodeContainerPart(org.talend.designer.core.ui.editor.nodecontainer.NodeContainerPart) NodeTreeEditPart(org.talend.designer.core.ui.editor.outline.NodeTreeEditPart) Element(org.talend.core.model.process.Element) AbstractMultiPageTalendEditor(org.talend.designer.core.ui.AbstractMultiPageTalendEditor) EditPart(org.eclipse.gef.EditPart) NodeTreeEditPart(org.talend.designer.core.ui.editor.outline.NodeTreeEditPart) NodeReturnsTreeEditPart(org.talend.designer.core.ui.editor.outline.NodeReturnsTreeEditPart) IConnection(org.talend.core.model.process.IConnection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ConnectionLabel(org.talend.designer.core.ui.editor.connections.ConnectionLabel) NodeLabel(org.talend.designer.core.ui.editor.nodes.NodeLabel) IProcess2(org.talend.core.model.process.IProcess2) NodeReturnsTreeEditPart(org.talend.designer.core.ui.editor.outline.NodeReturnsTreeEditPart) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject)

Aggregations

NodeTreeEditPart (org.talend.designer.core.ui.editor.outline.NodeTreeEditPart)6 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 Node (org.talend.designer.core.ui.editor.nodes.Node)4 NodePart (org.talend.designer.core.ui.editor.nodes.NodePart)4 EditPart (org.eclipse.gef.EditPart)3 INode (org.talend.core.model.process.INode)3 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)3 ConnLabelEditPart (org.talend.designer.core.ui.editor.connections.ConnLabelEditPart)3 NodeLabelEditPart (org.talend.designer.core.ui.editor.nodes.NodeLabelEditPart)3 NodeReturnsTreeEditPart (org.talend.designer.core.ui.editor.outline.NodeReturnsTreeEditPart)3 ISelection (org.eclipse.jface.viewers.ISelection)2 AbstractMultiPageTalendEditor (org.talend.designer.core.ui.AbstractMultiPageTalendEditor)2 ConnectionPart (org.talend.designer.core.ui.editor.connections.ConnectionPart)2 NoteEditPart (org.talend.designer.core.ui.editor.notes.NoteEditPart)2 Process (org.talend.designer.core.ui.editor.process.Process)2 ProcessPart (org.talend.designer.core.ui.editor.process.ProcessPart)2 ArrayList (java.util.ArrayList)1 EventObject (java.util.EventObject)1 List (java.util.List)1 PlatformObject (org.eclipse.core.runtime.PlatformObject)1