Search in sources :

Example 1 with PopComparisonUIAction

use of org.talend.cwm.compare.ui.actions.PopComparisonUIAction in project tdq-studio-se by Talend.

the class PopComparisonUIProvider method fillContextMenu.

@Override
public void fillContextMenu(IMenuManager menu) {
    // MOD mzhao user readonly role on svn repository mode.
    if (!isShowMenu()) {
        return;
    }
    // TDQ-9394 hide all "Reload" menu.
    if (isShowMenu()) {
        return;
    }
    Object obj = ((TreeSelection) this.getContext().getSelection()).getFirstElement();
    if (obj instanceof RepositoryNode) {
        RepositoryNode node = (RepositoryNode) obj;
        if (shouldShowReloadMenu(node)) {
            String menuText = COMPAREDATABASE_MENUTEXT;
            if (node instanceof DBTableFolderRepNode) {
                menuText = COMPARETABLES_MENUTEXT;
            } else if (node instanceof DBViewFolderRepNode) {
                menuText = COMPAREVIEWS_MENUTEXT;
            } else if (node instanceof DBColumnFolderRepNode) {
                menuText = COMPARECOLUMNS_MENUTEXT;
            }
            menu.add(new PopComparisonUIAction(node, menuText));
        }
    }
}
Also used : DBTableFolderRepNode(org.talend.dq.nodes.DBTableFolderRepNode) TreeSelection(org.eclipse.jface.viewers.TreeSelection) PopComparisonUIAction(org.talend.cwm.compare.ui.actions.PopComparisonUIAction) RepositoryNode(org.talend.repository.model.RepositoryNode) DBViewFolderRepNode(org.talend.dq.nodes.DBViewFolderRepNode) DBColumnFolderRepNode(org.talend.dq.nodes.DBColumnFolderRepNode)

Aggregations

TreeSelection (org.eclipse.jface.viewers.TreeSelection)1 PopComparisonUIAction (org.talend.cwm.compare.ui.actions.PopComparisonUIAction)1 DBColumnFolderRepNode (org.talend.dq.nodes.DBColumnFolderRepNode)1 DBTableFolderRepNode (org.talend.dq.nodes.DBTableFolderRepNode)1 DBViewFolderRepNode (org.talend.dq.nodes.DBViewFolderRepNode)1 RepositoryNode (org.talend.repository.model.RepositoryNode)1