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