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);
}
}
}
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);
}
}
}
}
}
Aggregations