use of org.talend.dq.nodes.AnalysisSubFolderRepNode 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);
}
}
}
}
use of org.talend.dq.nodes.AnalysisSubFolderRepNode in project tdq-studio-se by Talend.
the class DeleteResourceProvider method shouldShowRenameFolderMenu.
private boolean shouldShowRenameFolderMenu(RepositoryNode node) {
boolean show = false;
if (node instanceof AnalysisSubFolderRepNode) {
AnalysisSubFolderRepNode anaSubFolderNode = (AnalysisSubFolderRepNode) node;
show = !anaSubFolderNode.isVirtualFolder();
} else if (node instanceof ReportSubFolderRepNode) {
ReportSubFolderRepNode repSubFolderNode = (ReportSubFolderRepNode) node;
show = !repSubFolderNode.isVirtualFolder();
} else if (node instanceof UserDefIndicatorSubFolderRepNode || node instanceof PatternRegexSubFolderRepNode || node instanceof PatternSqlSubFolderRepNode || node instanceof RulesSQLSubFolderRepNode || node instanceof RulesParserSubFolderRepNode || node instanceof DBConnectionSubFolderRepNode || node instanceof DFConnectionSubFolderRepNode || node instanceof JrxmlTempSubFolderNode) {
show = true;
}
return show;
}
use of org.talend.dq.nodes.AnalysisSubFolderRepNode in project tdq-studio-se by Talend.
the class ExportConnecitonActionProvider method fillContextMenu.
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
*/
@Override
public void fillContextMenu(IMenuManager menu) {
// MOD mzhao user readonly role on svn repository mode.
if (!isShowMenu()) {
return;
}
List<Object> selectionList = ((TreeSelection) this.getContext().getSelection()).toList();
List<Package> packList = new ArrayList<Package>();
boolean showMenu = false;
for (Object obj : selectionList) {
if (obj instanceof DBCatalogRepNode || obj instanceof DBSchemaRepNode) {
// MOD gdbu 2011-12-29 TDQ-4281 Remove the "create a new connection" menu under
// AnalysisSubFolderRepNode.
RepositoryNode node = (RepositoryNode) obj;
if (node.getParent() instanceof AnalysisSubFolderRepNode) {
return;
}
// ~TDQ-4281
ModelElement me = RepositoryNodeHelper.getModelElementFromRepositoryNode(node);
if (me != null && me instanceof Package) {
Package pack = (Package) me;
packList.add(pack);
showMenu = true;
}
}
}
if (showMenu) {
ExportConnectionToTOSAction action = new ExportConnectionToTOSAction(packList);
menu.add(action);
}
}
use of org.talend.dq.nodes.AnalysisSubFolderRepNode in project tdq-studio-se by Talend.
the class LocalRepositoryObjectCRUD method isForbidNode.
/**
* check whether the node is forbidden to drag.
*
* @param sourceNode
* @return
*/
private boolean isForbidNode(IRepositoryNode sourceNode) {
ENodeType type = sourceNode.getType();
// MOD xqliu 2012-05-22 TDQ-4831 allow user to drag Jrxml file
boolean flag = (type != null && type == ENodeType.SYSTEM_FOLDER) || sourceNode instanceof ReportFileRepNode || sourceNode instanceof ReportAnalysisRepNode;
// ~ TDQ-4831
if (!flag) {
RepositoryNode parent = sourceNode.getParent();
if (parent != null) {
flag = parent instanceof AnalysisRepNode || parent instanceof ReportRepNode || (parent instanceof AnalysisSubFolderRepNode && ((AnalysisSubFolderRepNode) parent).getObject() == null);
}
}
return flag;
}
use of org.talend.dq.nodes.AnalysisSubFolderRepNode 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);
}
}
}
Aggregations