use of org.talend.dataquality.indicators.CountsIndicator in project tdq-studio-se by Talend.
the class IndicatorThresholdsForm method isContainRowCountIndicator.
private boolean isContainRowCountIndicator() {
IEditorPart editor = CorePlugin.getDefault().getCurrentActiveEditor();
if (editor == null) {
return false;
}
AbstractAnalysisMetadataPage masterPage = ((AnalysisEditor) editor).getMasterPage();
if (masterPage == null) {
return false;
}
// if the analysis type is TABLE Analysis, just return true
if (AnalysisType.TABLE.equals(masterPage.getAnalysisHandler().getAnalysis().getParameters().getAnalysisType())) {
return true;
}
ModelElementIndicator[] currentModelElementIndicators = masterPage.getCurrentModelElementIndicators();
if (currentModelElementIndicators == null) {
return false;
}
for (ModelElementIndicator meIndicator : currentModelElementIndicators) {
if (meIndicator != null && meIndicator.getIndicators() != null) {
for (Indicator indicator : meIndicator.getIndicators()) {
if (IndicatorsPackage.eINSTANCE.getRowCountIndicator().equals(indicator.eClass())) {
return true;
}
if (IndicatorsPackage.eINSTANCE.getCountsIndicator().equals(indicator.eClass())) {
CountsIndicator cInd = (CountsIndicator) indicator;
if (cInd.getRowCountIndicator() != null) {
return true;
}
}
if (ColumnsetPackage.eINSTANCE.getSimpleStatIndicator().equals(indicator.eClass())) {
return true;
}
}
}
}
return false;
}
Aggregations