use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.
the class SectionFilter method getRepositoryNode.
public static RepositoryNode getRepositoryNode(Object object) {
if (object instanceof RepositoryNode) {
return (RepositoryNode) object;
}
if (object instanceof IAdaptable) {
// see ProcessPart.getAdapter()
IAdaptable adaptable = (IAdaptable) object;
Object adapter = adaptable.getAdapter(RepositoryNode.class);
if (adapter != null) {
return (RepositoryNode) adapter;
}
}
return null;
}
use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.
the class ExportTreeViewer method expandParent.
private void expandParent(TreeViewer viewer, RepositoryNode node) {
RepositoryNode parent = node.getParent();
if (parent != null) {
expandParent(viewer, parent);
viewer.setExpandedState(parent, true);
}
}
use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.
the class ConfigExternalLibPage method getSelectedRoutine.
public RoutineItem getSelectedRoutine() {
RepositoryNode node = getSelectedRepositoryNode();
Item item = node.getObject().getProperty().getItem();
return (RoutineItem) item;
}
use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.
the class DeployOnSpagicAction method init.
/*
* (non-Javadoc)
*
* @see org.talend.repository.ui.actions.ITreeContextualAction#init(org.eclipse.jface.viewers.TreeViewer,
* org.eclipse.jface.viewers.IStructuredSelection)
*/
public void init(TreeViewer viewer, IStructuredSelection selection) {
boolean canWork = true;
if (selection.isEmpty()) {
setEnabled(false);
return;
}
List<RepositoryNode> nodes = (List<RepositoryNode>) selection.toList();
for (RepositoryNode node : nodes) {
if (node.getType() != ENodeType.REPOSITORY_ELEMENT || node.getProperties(EProperties.CONTENT_TYPE) != ERepositoryObjectType.PROCESS) {
canWork = false;
break;
}
}
setEnabled(canWork);
}
use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.
the class DBStructureComposite method openNewQueryEditor.
/**
* qzhang Comment method "openNewQueryEditor".
*/
public void openNewQueryEditor() {
final ConnectionParameters connParameters = builderDialog.getConnParameters();
final RepositoryNode selectQuery = this.treeLabelProvider.getSelectedExtReposiotryNode();
expandNodes = new ArrayList<RepositoryNode>();
getNeedExpandedNodes(selectQuery);
if (expandNodes.size() > 0) {
treeViewer.setExpandedElements(expandNodes.toArray(new Object[0]));
}
if (treeViewer.getTree().getItemCount() > 0) {
treeViewer.getTree().setSelection(treeViewer.getTree().getItem(0));
}
Action tempOpenNewEditorAction = new OpenNewEditorAction(treeViewer, builderDialog, connParameters, true);
tempOpenNewEditorAction.run();
}
Aggregations