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