Search in sources :

Example 16 with TDQReportItem

use of org.talend.dataquality.properties.TDQReportItem in project tdq-studio-se by Talend.

the class DQDeleteAction method excuteSuperRun.

/**
 * DOC qiongli :excute super method run().
 *
 * @param currentNode:null for logical delete a selected element by UI.none-null for physical delete or logical
 * delete dependecy.
 */
private void excuteSuperRun(IRepositoryNode repoNode, IRepositoryNode parent) {
    this.currentNode = repoNode;
    Item item = null;
    if (repoNode != null) {
        Property property = repoNode.getObject().getProperty();
        if (property != null) {
            item = property.getItem();
        }
    }
    // MOD qiongli 2011-5-9 bug 21035,avoid to unload resource.
    super.setAvoidUnloadResources(true);
    super.doRun();
    // delete dependency.
    if (repoNode != null) {
        // MOD qiongli 2012-4-1 TDQ-4926,after physical delete this node,should remove it from that
        // selection List.avoid to delete twice.
        this.selectedNodes.remove(repoNode);
        if (parent != null && (parent.getType() == ENodeType.SIMPLE_FOLDER || parent.getLabel().equalsIgnoreCase(ERepositoryObjectType.RECYCLE_BIN.name().replaceAll("_", PluginConstant.SPACE_STRING)))) {
            // $NON-NLS-1$
            parent.getChildren(true).remove(repoNode);
        }
        // is TDQReportItem or not
        if (item != null && item instanceof TDQReportItem) {
            deleteRelatedFolder(repoNode, item);
        }
    }
    // refresh parent node
    refreshParentNode(parent);
}
Also used : Item(org.talend.core.model.properties.Item) TDQReportItem(org.talend.dataquality.properties.TDQReportItem) Property(org.talend.core.model.properties.Property) TDQReportItem(org.talend.dataquality.properties.TDQReportItem)

Example 17 with TDQReportItem

use of org.talend.dataquality.properties.TDQReportItem in project tdq-studio-se by Talend.

the class RemoveAnalysisActionProvider method fillContextMenu.

@Override
public void fillContextMenu(IMenuManager menu) {
    // MOD mzhao user readonly role on svn repository mode.
    if (!isShowMenu()) {
        return;
    }
    TreeSelection treeSelection = ((TreeSelection) this.getContext().getSelection());
    if (!treeSelection.isEmpty()) {
        Iterator iterator = treeSelection.iterator();
        while (iterator.hasNext()) {
            Object obj = iterator.next();
            if (obj instanceof ReportAnalysisRepNode) {
                ReportAnalysisRepNode repAnaNode = (ReportAnalysisRepNode) obj;
                TDQReportItem reportItem = repAnaNode.getReportItem();
                if (CorePlugin.getDefault().itemIsOpening(reportItem, false)) {
                    // if the report's editor is opening, don't show the menu
                    return;
                }
            } else {
                // if include other type node, don't show the menu
                return;
            }
        }
    }
    // show the menu
    menu.add(new RemoveAnalysisAction());
}
Also used : TreeSelection(org.eclipse.jface.viewers.TreeSelection) Iterator(java.util.Iterator) ReportAnalysisRepNode(org.talend.dq.nodes.ReportAnalysisRepNode) TDQReportItem(org.talend.dataquality.properties.TDQReportItem) RemoveAnalysisAction(org.talend.dataprofiler.core.ui.action.actions.RemoveAnalysisAction)

Aggregations

TDQReportItem (org.talend.dataquality.properties.TDQReportItem)17 Report (orgomg.cwmx.analysis.informationreporting.Report)9 TDQAnalysisItem (org.talend.dataquality.properties.TDQAnalysisItem)8 Item (org.talend.core.model.properties.Item)7 TDQPatternItem (org.talend.dataquality.properties.TDQPatternItem)7 TdReport (org.talend.dataquality.reports.TdReport)7 Analysis (org.talend.dataquality.analysis.Analysis)6 PersistenceException (org.talend.commons.exception.PersistenceException)5 Property (org.talend.core.model.properties.Property)5 TDQIndicatorDefinitionItem (org.talend.dataquality.properties.TDQIndicatorDefinitionItem)5 ConnectionItem (org.talend.core.model.properties.ConnectionItem)4 ItemState (org.talend.core.model.properties.ItemState)4 Pattern (org.talend.dataquality.domain.pattern.Pattern)4 TDQBusinessRuleItem (org.talend.dataquality.properties.TDQBusinessRuleItem)4 IPath (org.eclipse.core.runtime.IPath)3 Connection (org.talend.core.model.metadata.builder.connection.Connection)3 DatabaseConnection (org.talend.core.model.metadata.builder.connection.DatabaseConnection)3 TDQItem (org.talend.core.model.properties.TDQItem)3 IFolder (org.eclipse.core.resources.IFolder)2 CoreException (org.eclipse.core.runtime.CoreException)2