use of org.talend.dq.nodes.ReportSubFolderRepNode in project tdq-studio-se by Talend.
the class DuplicateAction method selectAndReveal.
/**
* DOC bZhou Comment method "selectAndReveal".
*
* Selects and reveals the newly added resource in all parts of the active workbench window's active page.
*
* @param newLabel
*
* @param duplicateObject
* @throws BusinessException
*/
private void selectAndReveal(String newLabel, Item duplicateItem) throws BusinessException {
IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage page = workbenchWindow.getActivePage();
IWorkbenchPart activePart = page.getActivePart();
RepositoryNode recursiveFind = null;
recursiveFind = getSelctionNode(newLabel, duplicateItem.getProperty());
if (recursiveFind != null) {
if (recursiveFind instanceof AnalysisRepNode || recursiveFind instanceof AnalysisSubFolderRepNode || recursiveFind instanceof ReportRepNode || recursiveFind instanceof ReportSubFolderRepNode) {
CorePlugin.getDefault().refreshDQView(RepositoryNodeHelper.findNearestSystemFolderNode(recursiveFind));
} else {
CorePlugin.getDefault().refreshDQView(recursiveFind.getParent());
refreshHiveConnectionParent(recursiveFind);
}
// MOD qiongli TDQ-5391 Avoid 'recursiveFind' to casue NPE .
if (activePart instanceof ISetSelectionTarget) {
ISelection selection = new StructuredSelection(recursiveFind);
((ISetSelectionTarget) activePart).selectReveal(selection);
}
}
}
use of org.talend.dq.nodes.ReportSubFolderRepNode 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