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