use of org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit in project tdq-studio-se by Talend.
the class WhereRuleStatisticsStateTable method getOptimizeShowDataset.
/**
* DOC xqliu Comment method "getOptimizeShowDataset". ADD xqliu 2010-03-10 feature 10834
*
* @return
*/
private List<Object> getOptimizeShowDataset() {
List<Object> result = new ArrayList<Object>();
// get the page size
int size = getSizeOfDQRulePerChart();
// Add RowCountIndicator dataset
CustomerDefaultCategoryDataset customerDatasetRownCount = new CustomerDefaultCategoryDataset();
// MOD msjian TDQ-5119: fix a NPE
if (units != null && units.size() > 0) {
addRownCountDataEntity2CustomerDataset(customerDatasetRownCount, getRownCountUnit(units));
result.add(customerDatasetRownCount);
// MOD xqliu 2012-04-23 TDQ-5057: don't include RowCountUnit
List<TableIndicatorUnit> whereRuleUnits = removeRowCountUnit(units);
int totalNum = whereRuleUnits.size();
int pageNum = totalNum % size == 0 ? totalNum / size : totalNum / size + 1;
for (int i = 0; i < pageNum; i++) {
CustomerDefaultCategoryDataset customerDataset = new CustomerDefaultCategoryDataset();
for (int j = 0; j < size; ++j) {
int index = i * size + j;
if (index < totalNum) {
addDataEntity2CustomerDataset(customerDataset, whereRuleUnits.get(index));
} else {
break;
}
}
result.add(customerDataset);
}
}
return result;
}
use of org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit in project tdq-studio-se by Talend.
the class TableIndicator method createSpecialIndicatorUnit.
private TableIndicatorUnit createSpecialIndicatorUnit(IndicatorDefinition whereRule, IndicatorEnum indicatorEnum, Indicator indicator) {
Indicator indicatorNew = indicator;
if (indicatorNew == null) {
IndicatorSqlFactory factory = IndicatorSqlFactory.eINSTANCE;
indicatorNew = (Indicator) factory.create(indicatorEnum.getIndicatorType());
if (whereRule != null && indicatorNew instanceof WhereRuleIndicator) {
indicatorNew.setAnalyzedElement(getColumnSet());
indicatorNew.setIndicatorDefinition(whereRule);
}
}
if (!indicatorEnumList.contains(indicatorEnum)) {
this.indicatorEnumList.add(indicatorEnum);
}
if (this.specialIndicatorUnitList == null) {
this.specialIndicatorUnitList = new ArrayList<TableIndicatorUnit>();
}
TableIndicatorUnit indicatorUnit = new TableIndicatorUnit(indicatorEnum, indicatorNew, this);
specialIndicatorUnitList.add(indicatorUnit);
return indicatorUnit;
}
use of org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit in project tdq-studio-se by Talend.
the class TableIndicator method removeSpecialIndicatorUnit.
/**
* Remove the specialIndicatorUnit from specialIndicatorList, if there exist more than one special Indicator which
* has same IndicatorEnumn type, the type of IndicatorUnit will be not removed from flatIndicatorEnumList.
*
* @param indicatorUnit
*/
private void removeSpecialIndicatorUnit(TableIndicatorUnit indicatorUnit) {
IndicatorEnum indicatorEnumn = indicatorUnit.getType();
this.specialIndicatorUnitList.remove(indicatorUnit);
for (TableIndicatorUnit unit : specialIndicatorUnitList) {
if (unit.getType() == indicatorEnumn) {
return;
} else {
continue;
}
}
this.indicatorEnumList.remove(indicatorEnumn);
}
use of org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit in project tdq-studio-se by Talend.
the class TableIndicator method createIndicatorUnit.
private TableIndicatorUnit createIndicatorUnit(IFile fe, IndicatorEnum indicatorEnum, Indicator indicator) {
Indicator indicatorNew = indicator;
if (indicator == null) {
IndicatorsFactory factory = IndicatorsFactory.eINSTANCE;
indicatorNew = (Indicator) factory.create(indicatorEnum.getIndicatorType());
indicatorNew.setAnalyzedElement(getColumnSet());
}
if (!DefinitionHandler.getInstance().setDefaultIndicatorDefinition(indicator)) {
// $NON-NLS-1$
log.error(DefaultMessagesImpl.getString("TableIndicator.couldnotSetDef") + indicatorNew.getName());
}
TableIndicatorUnit indicatorUnit = new TableIndicatorUnit(indicatorEnum, indicatorNew, this);
this.indicatorUnitMap.put(indicatorEnum, indicatorUnit);
return indicatorUnit;
}
Aggregations