Search in sources :

Example 1 with AnalysisSubFolderRepNode

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);
            }
        }
    }
}
Also used : TableViewFilterAction(org.talend.dataprofiler.core.ui.action.actions.TableViewFilterAction) TreeSelection(org.eclipse.jface.viewers.TreeSelection) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) MetadataCatalogRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) MetadataSchemaRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject) MetadataCatalogRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject) RepositoryNode(org.talend.repository.model.RepositoryNode) AnalysisSubFolderRepNode(org.talend.dq.nodes.AnalysisSubFolderRepNode) MetadataSchemaRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject)

Example 2 with AnalysisSubFolderRepNode

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;
}
Also used : PatternSqlSubFolderRepNode(org.talend.dq.nodes.PatternSqlSubFolderRepNode) UserDefIndicatorSubFolderRepNode(org.talend.dq.nodes.UserDefIndicatorSubFolderRepNode) PatternRegexSubFolderRepNode(org.talend.dq.nodes.PatternRegexSubFolderRepNode) RulesSQLSubFolderRepNode(org.talend.dq.nodes.RulesSQLSubFolderRepNode) DBConnectionSubFolderRepNode(org.talend.dq.nodes.DBConnectionSubFolderRepNode) DFConnectionSubFolderRepNode(org.talend.dq.nodes.DFConnectionSubFolderRepNode) ReportSubFolderRepNode(org.talend.dq.nodes.ReportSubFolderRepNode) RulesParserSubFolderRepNode(org.talend.dq.nodes.RulesParserSubFolderRepNode) AnalysisSubFolderRepNode(org.talend.dq.nodes.AnalysisSubFolderRepNode) JrxmlTempSubFolderNode(org.talend.dq.nodes.JrxmlTempSubFolderNode)

Example 3 with AnalysisSubFolderRepNode

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);
    }
}
Also used : DBSchemaRepNode(org.talend.dq.nodes.DBSchemaRepNode) ArrayList(java.util.ArrayList) RepositoryNode(org.talend.repository.model.RepositoryNode) AnalysisSubFolderRepNode(org.talend.dq.nodes.AnalysisSubFolderRepNode) ModelElement(orgomg.cwm.objectmodel.core.ModelElement) ExportConnectionToTOSAction(org.talend.dataprofiler.core.ui.action.actions.ExportConnectionToTOSAction) DBCatalogRepNode(org.talend.dq.nodes.DBCatalogRepNode) TreeSelection(org.eclipse.jface.viewers.TreeSelection) Package(orgomg.cwm.objectmodel.core.Package)

Example 4 with AnalysisSubFolderRepNode

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;
}
Also used : ReportFileRepNode(org.talend.dq.nodes.ReportFileRepNode) ReportAnalysisRepNode(org.talend.dq.nodes.ReportAnalysisRepNode) AnalysisRepNode(org.talend.dq.nodes.AnalysisRepNode) ReportRepNode(org.talend.dq.nodes.ReportRepNode) ENodeType(org.talend.repository.model.IRepositoryNode.ENodeType) DQRepositoryNode(org.talend.dq.nodes.DQRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) ReportAnalysisRepNode(org.talend.dq.nodes.ReportAnalysisRepNode) AnalysisSubFolderRepNode(org.talend.dq.nodes.AnalysisSubFolderRepNode)

Example 5 with AnalysisSubFolderRepNode

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);
        }
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) AnalysisRepNode(org.talend.dq.nodes.AnalysisRepNode) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) ReportRepNode(org.talend.dq.nodes.ReportRepNode) ISelection(org.eclipse.jface.viewers.ISelection) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) ISetSelectionTarget(org.eclipse.ui.part.ISetSelectionTarget) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) ReportSubFolderRepNode(org.talend.dq.nodes.ReportSubFolderRepNode) AnalysisSubFolderRepNode(org.talend.dq.nodes.AnalysisSubFolderRepNode)

Aggregations

AnalysisSubFolderRepNode (org.talend.dq.nodes.AnalysisSubFolderRepNode)6 RepositoryNode (org.talend.repository.model.RepositoryNode)5 TreeSelection (org.eclipse.jface.viewers.TreeSelection)3 AnalysisRepNode (org.talend.dq.nodes.AnalysisRepNode)2 ReportRepNode (org.talend.dq.nodes.ReportRepNode)2 ReportSubFolderRepNode (org.talend.dq.nodes.ReportSubFolderRepNode)2 IRepositoryNode (org.talend.repository.model.IRepositoryNode)2 ArrayList (java.util.ArrayList)1 ISelection (org.eclipse.jface.viewers.ISelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)1 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)1 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1 ISetSelectionTarget (org.eclipse.ui.part.ISetSelectionTarget)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 MetadataCatalogRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject)1 MetadataSchemaRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject)1 CreateNewAnalysisAction (org.talend.dataprofiler.core.ui.action.actions.CreateNewAnalysisAction)1 ExportConnectionToTOSAction (org.talend.dataprofiler.core.ui.action.actions.ExportConnectionToTOSAction)1 TableViewFilterAction (org.talend.dataprofiler.core.ui.action.actions.TableViewFilterAction)1