use of org.talend.dataprofiler.core.ui.action.actions.OpenIndicatorDefinitionAction in project tdq-studio-se by Talend.
the class IndicatorDefinitionActionProvider 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<IndicatorDefinition> list = new ArrayList<IndicatorDefinition>();
Object[] objs = currentSelection.toArray();
for (Object obj : objs) {
if (obj instanceof RepositoryNode) {
RepositoryNode node = (RepositoryNode) obj;
if (ERepositoryObjectType.TDQ_INDICATOR_ELEMENT.equals(node.getContentType())) {
TDQIndicatorDefinitionItem item = (TDQIndicatorDefinitionItem) node.getObject().getProperty().getItem();
list.add(item.getIndicatorDefinition());
}
}
}
if (!list.isEmpty()) {
menu.add(new OpenIndicatorDefinitionAction(list.toArray(new IndicatorDefinition[list.size()])));
}
}
Aggregations