use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.
the class ColumnSetAnalysisResultPage method createSimpleTable2.
private void createSimpleTable2(final ScrolledForm form, final Composite composite, final SimpleStatIndicator simpleStatIndicator) {
List<IndicatorUnit> units = new ArrayList<IndicatorUnit>();
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.RowCountIndicatorEnum, masterPage.getSimpleStatIndicator().getRowCountIndicator()));
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.DistinctCountIndicatorEnum, masterPage.getSimpleStatIndicator().getDistinctCountIndicator()));
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.DuplicateCountIndicatorEnum, masterPage.getSimpleStatIndicator().getDuplicateCountIndicator()));
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.UniqueIndicatorEnum, masterPage.getSimpleStatIndicator().getUniqueCountIndicator()));
EIndicatorChartType simpleStatType = EIndicatorChartType.SIMPLE_STATISTICS;
// create table firstly
ITableTypeStates tableTypeState = TableTypeStatesFactory.getInstance().getTableState(simpleStatType, units);
TableWithData chartData = new TableWithData(simpleStatType, tableTypeState.getDataEntity());
TableViewer tableviewer = tableTypeState.getTableForm(composite);
tableviewer.setInput(chartData);
// MOD qiongli feature 19192.
DataExplorer dataExplorer = tableTypeState.getDataExplorer();
Analysis analysis = this.getAnalysisHandler().getAnalysis();
ChartTableFactory.addMenuAndTip(tableviewer, dataExplorer, analysis);
// create chart
if (canShowChartForResultPage()) {
IChartTypeStates chartTypeState = ChartTypeStatesFactory.getChartState(simpleStatType, units);
Object chart = chartTypeState.getChart();
TOPChartUtils.getInstance().decorateChart(chart, false);
if (chart != null) {
Object chartComposite2 = TOPChartUtils.getInstance().createChartComposite(composite, SWT.NONE, chart, true);
addMenuToChartComp(chartComposite2, dataExplorer, analysis, ((ICustomerDataset) chartTypeState.getDataset()).getDataEntities());
}
}
}
use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.
the class CorrelationAnalysisResultPage method createSimpleStatistics2.
private void createSimpleStatistics2(final Composite composite, final ColumnSetMultiValueIndicator columnSetMultiValueIndicator) {
List<IndicatorUnit> units = new ArrayList<IndicatorUnit>();
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.RowCountIndicatorEnum, columnSetMultiValueIndicator.getRowCountIndicator()));
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.DistinctCountIndicatorEnum, columnSetMultiValueIndicator.getDistinctCountIndicator()));
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.DuplicateCountIndicatorEnum, columnSetMultiValueIndicator.getDuplicateCountIndicator()));
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.UniqueIndicatorEnum, columnSetMultiValueIndicator.getUniqueCountIndicator()));
EIndicatorChartType simpleStatType = EIndicatorChartType.SIMPLE_STATISTICS;
// create table viewer firstly
ITableTypeStates tableTypeState = TableTypeStatesFactory.getInstance().getTableState(simpleStatType, units);
TableWithData chartData = new TableWithData(simpleStatType, tableTypeState.getDataEntity());
TableViewer tableviewer = tableTypeState.getTableForm(composite);
tableviewer.setInput(chartData);
TableUtils.addTooltipForTable(tableviewer.getTable());
// create chart
if (canShowChartForResultPage()) {
// then create chart
IChartTypeStates chartTypeState = ChartTypeStatesFactory.getChartState(simpleStatType, units);
Object chart = chartTypeState.getChart();
TOPChartUtils.getInstance().decorateChart(chart, false);
if (chart != null) {
TOPChartUtils.getInstance().createChartComposite(composite, SWT.NONE, chart, true);
}
}
}
use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.
the class MasterPaginationInfo method render.
@Override
protected void render() {
// refresh analysis tree
if (treeViewer != null) {
treeViewer.setElements(modelElementIndicators.toArray(new ModelElementIndicator[modelElementIndicators.size()]), false);
}
// chart composite don't display So need't consider it.
if (previewChartList == null || uiPagination.getChartComposite() == null) {
return;
}
previewChartList.clear();
clearDynamicList();
if (EditorPreferencePage.isHideGraphicsSectionForSettingsPage() || !TOPChartUtils.getInstance().isTOPChartInstalled()) {
return;
}
for (ModelElementIndicator modelElementIndicator : modelElementIndicators) {
final ExpandableComposite exComp = uiPagination.getToolkit().createExpandableComposite(uiPagination.getChartComposite(), ExpandableComposite.TREE_NODE | ExpandableComposite.CLIENT_INDENT);
needDispostWidgets.add(exComp);
exComp.setText(DefaultMessagesImpl.getString("ColumnMasterDetailsPage.column", // $NON-NLS-1$
modelElementIndicator.getElementName()));
exComp.setLayout(new GridLayout());
exComp.setData(modelElementIndicator);
previewChartList.add(exComp);
Composite comp = uiPagination.getToolkit().createComposite(exComp);
comp.setLayout(new GridLayout());
comp.setLayoutData(new GridData(GridData.FILL_BOTH));
Map<EIndicatorChartType, List<IndicatorUnit>> indicatorComposite = CompositeIndicator.getInstance().getIndicatorComposite(modelElementIndicator);
for (EIndicatorChartType chartType : indicatorComposite.keySet()) {
List<IndicatorUnit> units = indicatorComposite.get(chartType);
if (!units.isEmpty()) {
if (chartType == EIndicatorChartType.UDI_FREQUENCY) {
for (IndicatorUnit unit : units) {
List<IndicatorUnit> specialUnit = new ArrayList<IndicatorUnit>();
specialUnit.add(unit);
createChart(comp, chartType, specialUnit);
}
} else {
createChart(comp, chartType, units);
}
}
}
exComp.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(ExpansionEvent e) {
uiPagination.getChartComposite().layout();
form.reflow(true);
if (e.getState()) {
exComp.setExpanded(e.getState());
exComp.getParent().pack();
}
}
});
exComp.setExpanded(true);
exComp.setClient(comp);
uiPagination.getChartComposite().layout();
}
}
use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.
the class ColumnAnalysisDetailsPage method checkUDIInvalid.
/**
* Judge whether there are exist invalid udi
*
* @param modelElementIndicator
* @return
*/
private boolean checkUDIInvalid(ModelElementIndicator modelElementIndicator, boolean isExist) {
for (IndicatorUnit indicatorUnit : modelElementIndicator.getIndicatorUnits()) {
boolean isExistSqlExpr = false;
boolean sqlCaseNormal = false;
if (IndicatorEnum.UserDefinedIndicatorEnum == indicatorUnit.getType()) {
// mean that is there exist sql expression
if (!indicatorUnit.getIndicator().getIndicatorDefinition().getSqlGenericExpression().isEmpty()) {
isExistSqlExpr = true;
DbmsLanguage dbmsLanguage = DbmsLanguageFactory.createDbmsLanguage(this.getCurrentModelElement(), ExecutionLanguage.SQL);
if (dbmsLanguage.getSqlExpression(indicatorUnit.getIndicator().getIndicatorDefinition()) != null) {
sqlCaseNormal = true;
}
}
if (isExist && !(isExistSqlExpr && sqlCaseNormal)) {
// case1:find JUDI exist and isExist=true then return true
return true;
} else if (!isExist && !UDIHelper.isJavaUDI(indicatorUnit.getIndicator())) {
// case2:find JUDI is not exist and isExist=false then return true
return true;
}
}
}
// other case(both valid)
return false;
}
use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.
the class ModelElementIndicatorImpl method createTempSpecialIndicatorUnit.
private IndicatorUnit createTempSpecialIndicatorUnit(IndicatorEnum indicatorEnum, Indicator indicator) {
Indicator tempIndicator = indicator;
if (tempIndicator == null) {
EFactoryImpl factory = (EFactoryImpl) indicatorEnum.getIndicatorType().getEPackage().getEFactoryInstance();
tempIndicator = (Indicator) factory.create(indicatorEnum.getIndicatorType());
// MOD scorreia 2008-09-18: bug 5131 fixed: set indicator's definition when the indicator is created.
if (!DefinitionHandler.getInstance().setDefaultIndicatorDefinition(tempIndicator)) {
// $NON-NLS-1$
log.error(DefaultMessagesImpl.getString("ModelElementIndicatorImpl_COULDNOTSETDEF_GIVEN_IND0") + tempIndicator.getName());
}
}
// }
if (this.specialIndicatorUnitList == null) {
this.specialIndicatorUnitList = new ArrayList<IndicatorUnit>();
}
for (IndicatorUnit currentUnit : tempSpecialIndicatorUnitList) {
if (tempIndicator.getName().equalsIgnoreCase(currentUnit.getIndicator().getName())) {
return currentUnit;
}
}
IndicatorUnit indicatorUnit = new ColumnIndicatorUnit(indicatorEnum, tempIndicator, this);
tempSpecialIndicatorUnitList.add(indicatorUnit);
this.specialIndicatorUnitMap.put(tempIndicator.getName(), indicatorUnit);
return indicatorUnit;
}
Aggregations