Search in sources :

Example 1 with TableViewFilterAction

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);
            }
        }
    }
}
Also used : TableViewFilterAction(org.talend.dataprofiler.core.ui.action.actions.TableViewFilterAction) TreeSelection(org.eclipse.jface.viewers.TreeSelection) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) MetadataCatalogRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) MetadataSchemaRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject) MetadataCatalogRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject) RepositoryNode(org.talend.repository.model.RepositoryNode) AnalysisSubFolderRepNode(org.talend.dq.nodes.AnalysisSubFolderRepNode) MetadataSchemaRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject)

Aggregations

TreeSelection (org.eclipse.jface.viewers.TreeSelection)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 MetadataCatalogRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject)1 MetadataSchemaRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject)1 TableViewFilterAction (org.talend.dataprofiler.core.ui.action.actions.TableViewFilterAction)1 AnalysisSubFolderRepNode (org.talend.dq.nodes.AnalysisSubFolderRepNode)1 RepositoryNode (org.talend.repository.model.RepositoryNode)1