use of org.talend.dataprofiler.core.ui.action.actions.ExportConnectionToTOSAction in project tdq-studio-se by Talend.
the class ExportConnecitonActionProvider 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;
}
List<Object> selectionList = ((TreeSelection) this.getContext().getSelection()).toList();
List<Package> packList = new ArrayList<Package>();
boolean showMenu = false;
for (Object obj : selectionList) {
if (obj instanceof DBCatalogRepNode || obj instanceof DBSchemaRepNode) {
// MOD gdbu 2011-12-29 TDQ-4281 Remove the "create a new connection" menu under
// AnalysisSubFolderRepNode.
RepositoryNode node = (RepositoryNode) obj;
if (node.getParent() instanceof AnalysisSubFolderRepNode) {
return;
}
// ~TDQ-4281
ModelElement me = RepositoryNodeHelper.getModelElementFromRepositoryNode(node);
if (me != null && me instanceof Package) {
Package pack = (Package) me;
packList.add(pack);
showMenu = true;
}
}
}
if (showMenu) {
ExportConnectionToTOSAction action = new ExportConnectionToTOSAction(packList);
menu.add(action);
}
}
Aggregations