Search in sources :

Example 1 with ImportRemotePatternAction

use of org.talend.dataprofiler.core.ui.action.actions.ImportRemotePatternAction in project tdq-studio-se by Talend.

the class ImportRemotePatternActionProvider method fillContextMenu.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
     */
@Override
public void fillContextMenu(IMenuManager menu) {
    // MOD mzhao user readonly role on svn repository mode.
    if (!isShowMenu()) {
        return;
    }
    TreeSelection currentSelection = ((TreeSelection) this.getContext().getSelection());
    List<IEcosComponent> selectedComponents = new ArrayList<IEcosComponent>();
    for (Object obj : currentSelection.toArray()) {
        if (obj instanceof ExchangeComponentRepNode) {
            ExchangeComponentRepNode node = (ExchangeComponentRepNode) obj;
            selectedComponents.add(node.getEcosComponent());
        }
    }
    if (selectedComponents.size() > 0) {
        ImportRemotePatternAction importAction = new ImportRemotePatternAction(selectedComponents.toArray(new IEcosComponent[selectedComponents.size()]));
        menu.add(importAction);
    }
}
Also used : TreeSelection(org.eclipse.jface.viewers.TreeSelection) ExchangeComponentRepNode(org.talend.dataprofiler.core.ui.exchange.ExchangeComponentRepNode) IEcosComponent(org.talend.dataprofiler.ecos.model.IEcosComponent) ArrayList(java.util.ArrayList) ImportRemotePatternAction(org.talend.dataprofiler.core.ui.action.actions.ImportRemotePatternAction)

Aggregations

ArrayList (java.util.ArrayList)1 TreeSelection (org.eclipse.jface.viewers.TreeSelection)1 ImportRemotePatternAction (org.talend.dataprofiler.core.ui.action.actions.ImportRemotePatternAction)1 ExchangeComponentRepNode (org.talend.dataprofiler.core.ui.exchange.ExchangeComponentRepNode)1 IEcosComponent (org.talend.dataprofiler.ecos.model.IEcosComponent)1