use of org.talend.dataprofiler.core.ui.action.actions.RemoveAnalysisAction in project tdq-studio-se by Talend.
the class RemoveAnalysisActionProvider method fillContextMenu.
@Override
public void fillContextMenu(IMenuManager menu) {
// MOD mzhao user readonly role on svn repository mode.
if (!isShowMenu()) {
return;
}
TreeSelection treeSelection = ((TreeSelection) this.getContext().getSelection());
if (!treeSelection.isEmpty()) {
Iterator iterator = treeSelection.iterator();
while (iterator.hasNext()) {
Object obj = iterator.next();
if (obj instanceof ReportAnalysisRepNode) {
ReportAnalysisRepNode repAnaNode = (ReportAnalysisRepNode) obj;
TDQReportItem reportItem = repAnaNode.getReportItem();
if (CorePlugin.getDefault().itemIsOpening(reportItem, false)) {
// if the report's editor is opening, don't show the menu
return;
}
} else {
// if include other type node, don't show the menu
return;
}
}
}
// show the menu
menu.add(new RemoveAnalysisAction());
}
Aggregations