use of org.talend.dataprofiler.core.ui.action.actions.predefined.PreviewAction in project tdq-studio-se by Talend.
the class PreviewProvider 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 treeSelection = ((TreeSelection) this.getContext().getSelection());
Object firstElement = treeSelection.getFirstElement();
NamedColumnSet set = null;
if (firstElement instanceof DBTableRepNode) {
set = ((DBTableRepNode) firstElement).getTdTable();
} else if (firstElement instanceof DBViewRepNode) {
set = ((DBViewRepNode) firstElement).getTdView();
}
if (set != null) {
PreviewAction action = new PreviewAction(set);
menu.add(action);
}
}
Aggregations