use of org.talend.dataprofiler.core.ui.action.actions.OverviewAnalysisAction in project tdq-studio-se by Talend.
the class OverviewResultPage method createContextMenuFor.
protected void createContextMenuFor(final StructuredViewer viewer) {
// $NON-NLS-1$
final MenuManager contextMenu = new MenuManager("#PopUp");
// $NON-NLS-1$
contextMenu.add(new Separator("additions"));
contextMenu.setRemoveAllWhenShown(true);
contextMenu.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager mgr) {
Object overviewObject = ((StructuredSelection) viewer.getSelection()).getFirstElement();
if (overviewObject instanceof OverviewIndUIElement) {
OverviewIndUIElement overview = (OverviewIndUIElement) overviewObject;
IRepositoryNode node = overview.getNode();
List<IRepositoryNode> nodes = new ArrayList<IRepositoryNode>();
nodes.add(node);
contextMenu.add(new OverviewAnalysisAction(nodes));
}
// if (obj instanceof SchemaIndicator) {
// SchemaIndicator schemaIndicator = (SchemaIndicator) obj;
// contextMenu.add(new OverviewAnalysisAction(new Package[] { (Package)
// schemaIndicator.getAnalyzedElement() }));
// }
}
});
Menu menu = contextMenu.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
}
use of org.talend.dataprofiler.core.ui.action.actions.OverviewAnalysisAction in project tdq-studio-se by Talend.
the class OverViewAnalysisActionProvider method fillContextMenu.
@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 list = currentSelection.toList();
// DOC MOD klliu 2010-12-14 feature 15750 for overview catalog or schema analysis.
List<IRepositoryNode> packageList = new ArrayList<IRepositoryNode>();
for (Object obj : list) {
Connection conn = getConnection(obj);
if (!MetadataConnectionUtils.isTDQSupportDBTemplate(conn)) {
return;
}
IRepositoryNode node = (IRepositoryNode) obj;
packageList.add(node);
}
if (packageList.size() > 0) {
OverviewAnalysisAction overviewAnalysisAction = new OverviewAnalysisAction(packageList);
menu.add(overviewAnalysisAction);
}
}
Aggregations