use of org.talend.dq.nodes.PatternSqlSubFolderRepNode in project tdq-studio-se by Talend.
the class RepositoryNodeHelper method getModelElementRepNodes.
/**
* get RepositoryNode which contains a ModelElment(include: Analysis, Report, IndicatorDefinition, Pattern, DqRule)
* under the parentNode.
*
* @param parentNode
* @param recursive
* @return
*/
public static List<RepositoryNode> getModelElementRepNodes(RepositoryNode parentNode, boolean recursive) {
List<RepositoryNode> result = new ArrayList<RepositoryNode>();
List<IRepositoryNode> children = parentNode.getChildren();
for (IRepositoryNode node : children) {
ModelElement modelElementFromRepositoryNode = RepositoryNodeHelper.getModelElementFromRepositoryNode(node);
if (modelElementFromRepositoryNode != null) {
result.add((RepositoryNode) node);
} else {
boolean isFolder = false;
if (node instanceof AnalysisFolderRepNode) {
AnalysisFolderRepNode anaFolderRepNode = (AnalysisFolderRepNode) node;
isFolder = !anaFolderRepNode.isVirtualFolder();
} else if (node instanceof ReportFolderRepNode) {
ReportFolderRepNode repFolderRepNode = (ReportFolderRepNode) node;
isFolder = !repFolderRepNode.isVirtualFolder();
} else if (node instanceof UserDefIndicatorFolderRepNode || node instanceof PatternRegexFolderRepNode || node instanceof PatternRegexSubFolderRepNode || node instanceof PatternSqlFolderRepNode || node instanceof PatternSqlSubFolderRepNode || node instanceof RulesSQLFolderRepNode) {
isFolder = true;
}
if (isFolder && recursive) {
result.addAll(getModelElementRepNodes((RepositoryNode) node, recursive));
}
}
}
return result;
}
use of org.talend.dq.nodes.PatternSqlSubFolderRepNode 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;
}
Aggregations