Search in sources :

Example 1 with HDFSOfHCFolderRepNode

use of org.talend.dq.nodes.hadoopcluster.HDFSOfHCFolderRepNode in project tdq-studio-se by Talend.

the class CreateHDFSActionProvider method fillContextMenu.

@Override
public void fillContextMenu(IMenuManager menu) {
    // MOD mzhao user readonly role on svn repository mode.
    if (!isShowMenu()) {
        return;
    }
    // MOD mzhao user readonly role on svn repository mode.
    AbstractSvnRepositoryService svnReposService = GlobalServiceRegister.getDefault().getSvnRepositoryService(AbstractSvnRepositoryService.class);
    if (svnReposService != null && svnReposService.isReadonly()) {
        return;
    }
    // MOD gdbu 2011-4-1 bug 20051
    RepositoryNode node = (RepositoryNode) getFirstRepositoryNode();
    if (node != null) {
        // ~20051
        IAction action = null;
        if (node instanceof HadoopClusterConnectionRepNode || node instanceof HDFSOfHCFolderRepNode) {
            action = new CreateHDFSAction(node);
            menu.add(action);
        }
    }
}
Also used : HDFSOfHCFolderRepNode(org.talend.dq.nodes.hadoopcluster.HDFSOfHCFolderRepNode) AbstractSvnRepositoryService(org.talend.dataprofiler.core.service.AbstractSvnRepositoryService) IAction(org.eclipse.jface.action.IAction) CreateHDFSAction(org.talend.dataprofiler.core.ui.action.actions.CreateHDFSAction) RepositoryNode(org.talend.repository.model.RepositoryNode) HadoopClusterConnectionRepNode(org.talend.dq.nodes.hadoopcluster.HadoopClusterConnectionRepNode)

Example 2 with HDFSOfHCFolderRepNode

use of org.talend.dq.nodes.hadoopcluster.HDFSOfHCFolderRepNode in project tdq-studio-se by Talend.

the class CreateNewRepositoryNodeFolder method fillContextMenu.

/**
 * Adds a submenu to the given menu with the name "New Component".
 */
@Override
public void fillContextMenu(IMenuManager menu) {
    if (!isShowMenu()) {
        return;
    }
    // ADD msjian TDQ-10444: fix get error when click on the exchange node
    if (isExchangeNode()) {
        return;
    }
    // TDQ-10444~
    Object obj = ((TreeSelection) this.getContext().getSelection()).getFirstElement();
    RepositoryNode node = (RepositoryNode) obj;
    RepositoryNode parent = node.getParent();
    if (!(parent instanceof ReportSubFolderRepNode)) {
        if (parent != null || node instanceof ContextFolderRepNode) {
            IFolder folder = WorkbenchUtils.getFolder(node);
            if (!(node instanceof ExchangeFolderRepNode) && !ResourceManager.getRulesFolder().equals(folder) && !ResourceManager.getPatternFolder().equals(folder) && !ResourceManager.getIndicatorFolder().equals(folder) && !ResourceService.isSubFolder(ResourceManager.getSystemIndicatorFolder(), folder) && (ENodeType.SYSTEM_FOLDER.equals(node.getType()) || ENodeType.SIMPLE_FOLDER.equals(node.getType())) && !(node instanceof HDFSOfHCFolderRepNode || node instanceof HiveOfHCFolderRepNode)) {
                // MOD qiongli 2011-1-20 don't add it for recycle bin elements
                if (node.getObject() != null && !node.getObject().getProperty().getItem().getState().isDeleted()) {
                    currentSelection = WorkbenchUtils.getFolder(node);
                    CreateRepositoryNodeAction createSubFolderAction = new CreateRepositoryNodeAction(currentSelection);
                    menu.add(createSubFolderAction);
                }
            }
        }
    }
}
Also used : HDFSOfHCFolderRepNode(org.talend.dq.nodes.hadoopcluster.HDFSOfHCFolderRepNode) HiveOfHCFolderRepNode(org.talend.dq.nodes.hadoopcluster.HiveOfHCFolderRepNode) CreateRepositoryNodeAction(org.talend.dataprofiler.core.ui.action.actions.CreateRepositoryNodeAction) TreeSelection(org.eclipse.jface.viewers.TreeSelection) ExchangeFolderRepNode(org.talend.dataprofiler.core.ui.exchange.ExchangeFolderRepNode) RepositoryNode(org.talend.repository.model.RepositoryNode) ReportSubFolderRepNode(org.talend.dq.nodes.ReportSubFolderRepNode) ContextFolderRepNode(org.talend.dq.nodes.ContextFolderRepNode) IFolder(org.eclipse.core.resources.IFolder)

Aggregations

HDFSOfHCFolderRepNode (org.talend.dq.nodes.hadoopcluster.HDFSOfHCFolderRepNode)2 RepositoryNode (org.talend.repository.model.RepositoryNode)2 IFolder (org.eclipse.core.resources.IFolder)1 IAction (org.eclipse.jface.action.IAction)1 TreeSelection (org.eclipse.jface.viewers.TreeSelection)1 AbstractSvnRepositoryService (org.talend.dataprofiler.core.service.AbstractSvnRepositoryService)1 CreateHDFSAction (org.talend.dataprofiler.core.ui.action.actions.CreateHDFSAction)1 CreateRepositoryNodeAction (org.talend.dataprofiler.core.ui.action.actions.CreateRepositoryNodeAction)1 ExchangeFolderRepNode (org.talend.dataprofiler.core.ui.exchange.ExchangeFolderRepNode)1 ContextFolderRepNode (org.talend.dq.nodes.ContextFolderRepNode)1 ReportSubFolderRepNode (org.talend.dq.nodes.ReportSubFolderRepNode)1 HadoopClusterConnectionRepNode (org.talend.dq.nodes.hadoopcluster.HadoopClusterConnectionRepNode)1 HiveOfHCFolderRepNode (org.talend.dq.nodes.hadoopcluster.HiveOfHCFolderRepNode)1