Search in sources :

Example 86 with RepositoryNode

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;
}
Also used : IAdaptable(org.eclipse.core.runtime.IAdaptable) RepositoryNode(org.talend.repository.model.RepositoryNode)

Example 87 with RepositoryNode

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);
    }
}
Also used : RepositoryNode(org.talend.repository.model.RepositoryNode)

Example 88 with RepositoryNode

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;
}
Also used : RoutineItem(org.talend.core.model.properties.RoutineItem) Item(org.talend.core.model.properties.Item) RoutineItem(org.talend.core.model.properties.RoutineItem) RepositoryNode(org.talend.repository.model.RepositoryNode)

Example 89 with RepositoryNode

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);
}
Also used : List(java.util.List) RepositoryNode(org.talend.repository.model.RepositoryNode)

Example 90 with RepositoryNode

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();
}
Also used : OpenQueryAction(org.talend.sqlbuilder.actions.OpenQueryAction) SelectionProviderAction(org.eclipse.ui.actions.SelectionProviderAction) MetadataRefreshAction(org.talend.sqlbuilder.actions.MetadataRefreshAction) GenerateSelectSQLAction(org.talend.sqlbuilder.actions.GenerateSelectSQLAction) DeleteQueryAction(org.talend.sqlbuilder.actions.DeleteQueryAction) OpenNewEditorAction(org.talend.sqlbuilder.actions.OpenNewEditorAction) Action(org.eclipse.jface.action.Action) ShowQueryPropertyAction(org.talend.sqlbuilder.actions.ShowQueryPropertyAction) ConnectionParameters(org.talend.core.sqlbuilder.util.ConnectionParameters) SqlBuilderRepositoryObject(org.talend.sqlbuilder.dbstructure.SqlBuilderRepositoryObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) OpenNewEditorAction(org.talend.sqlbuilder.actions.OpenNewEditorAction) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode)

Aggregations

RepositoryNode (org.talend.repository.model.RepositoryNode)250 IRepositoryNode (org.talend.repository.model.IRepositoryNode)94 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)74 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)44 ERepositoryObjectType (org.talend.core.model.repository.ERepositoryObjectType)44 ProjectRepositoryNode (org.talend.core.repository.model.ProjectRepositoryNode)42 Item (org.talend.core.model.properties.Item)38 ArrayList (java.util.ArrayList)33 PersistenceException (org.talend.commons.exception.PersistenceException)27 IProxyRepositoryFactory (org.talend.repository.model.IProxyRepositoryFactory)27 ProcessItem (org.talend.core.model.properties.ProcessItem)23 RepositoryObject (org.talend.core.model.repository.RepositoryObject)22 ISelection (org.eclipse.jface.viewers.ISelection)20 ConnectionItem (org.talend.core.model.properties.ConnectionItem)20 IProjectRepositoryNode (org.talend.repository.model.nodes.IProjectRepositoryNode)20 List (java.util.List)18 Property (org.talend.core.model.properties.Property)18 DatabaseConnectionItem (org.talend.core.model.properties.DatabaseConnectionItem)17 MetadataColumnRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject)16 WizardDialog (org.eclipse.jface.wizard.WizardDialog)13