use of org.talend.dataprofiler.core.ui.action.actions.TableViewFilterAction in project tdq-studio-se by Talend.
the class TableViewFilterActionProvider 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());
Object obj = currentSelection.getFirstElement();
if (obj instanceof RepositoryNode) {
RepositoryNode node = (RepositoryNode) obj;
if (ENodeType.TDQ_REPOSITORY_ELEMENT.equals(node.getType())) {
// MOD gdbu 2011-12-29 TDQ-4283 Remove the "Table/View filter" menu under AnalysisSubFolderRepNode.
if (node.getParent() instanceof AnalysisSubFolderRepNode) {
return;
}
// ~TDQ-4283
IRepositoryViewObject viewObject = node.getObject();
if (viewObject instanceof MetadataSchemaRepositoryObject) {
MetadataSchemaRepositoryObject schemaObject = (MetadataSchemaRepositoryObject) viewObject;
// MOD yyin TDQ-4959 20120503
TableViewFilterAction tvfAction = new TableViewFilterAction(schemaObject.getSchema(), node);
menu.add(tvfAction);
} else if (viewObject instanceof MetadataCatalogRepositoryObject) {
MetadataCatalogRepositoryObject catalogObject = (MetadataCatalogRepositoryObject) viewObject;
// MOD yyin TDQ-4959 20120503
TableViewFilterAction tvfAction = new TableViewFilterAction(catalogObject.getCatalog(), node);
menu.add(tvfAction);
}
}
}
}
Aggregations