Search in sources :

Example 1 with ColumnSetIndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit 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());
        }
    }
}
Also used : ITableTypeStates(org.talend.dataprofiler.core.ui.editor.preview.model.states.table.ITableTypeStates) Analysis(org.talend.dataquality.analysis.Analysis) DataExplorer(org.talend.dq.analysis.explore.DataExplorer) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) ArrayList(java.util.ArrayList) EIndicatorChartType(org.talend.dq.indicators.preview.EIndicatorChartType) TableWithData(org.talend.dataprofiler.core.ui.editor.preview.model.TableWithData) TableViewer(org.eclipse.jface.viewers.TableViewer) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) IChartTypeStates(org.talend.dataprofiler.core.ui.editor.preview.model.states.IChartTypeStates)

Example 2 with ColumnSetIndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit 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);
        }
    }
}
Also used : ITableTypeStates(org.talend.dataprofiler.core.ui.editor.preview.model.states.table.ITableTypeStates) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) ArrayList(java.util.ArrayList) EIndicatorChartType(org.talend.dq.indicators.preview.EIndicatorChartType) TableWithData(org.talend.dataprofiler.core.ui.editor.preview.model.TableWithData) TableViewer(org.eclipse.jface.viewers.TableViewer) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) IChartTypeStates(org.talend.dataprofiler.core.ui.editor.preview.model.states.IChartTypeStates)

Example 3 with ColumnSetIndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit in project tdq-studio-se by Talend.

the class IndicatorsComp method setInput.

// input composite indicator
public void setInput(Object... obj) {
    List<ColumnSetIndicatorUnit> indicatortList = new ArrayList<ColumnSetIndicatorUnit>();
    for (Object indicatorObj : obj) {
        // for SimpleStatIndicator, CountAvgNullIndicator, MinMaxDateIndicator, WeakCorrelationIndicator
        if (indicatorObj instanceof SimpleStatIndicator || indicatorObj instanceof CountAvgNullIndicator || indicatorObj instanceof MinMaxDateIndicator || indicatorObj instanceof WeakCorrelationIndicator) {
            columnSetIndicator = (ColumnSetMultiValueIndicator) indicatorObj;
            for (Indicator indicator : IndicatorHelper.getIndicatorLeavesBySingleNode(columnSetIndicator)) {
                IndicatorEnum indicatorEnum = IndicatorEnum.findIndicatorEnum(indicator.eClass());
                indicatortList.add(new ColumnSetIndicatorUnit(indicatorEnum, indicator));
            }
        // MOD msjian TDQ-8860: we always show the allMatchIndicator in the Indicators section
        } else if (indicatorObj instanceof AllMatchIndicator) {
            // for AllMatchIndicator
            AllMatchIndicator allMatchIndicator = (AllMatchIndicator) indicatorObj;
            indicatortList.add(new ColumnSetIndicatorUnit(IndicatorEnum.AllMatchIndicatorEnum, allMatchIndicator));
        // TDQ-8860~
        }
    // ~
    }
    setElements(indicatortList.toArray(new ColumnSetIndicatorUnit[indicatortList.size()]));
}
Also used : WeakCorrelationIndicator(org.talend.dataquality.indicators.columnset.WeakCorrelationIndicator) IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) AllMatchIndicator(org.talend.dataquality.indicators.columnset.AllMatchIndicator) ArrayList(java.util.ArrayList) MinMaxDateIndicator(org.talend.dataquality.indicators.columnset.MinMaxDateIndicator) SimpleStatIndicator(org.talend.dataquality.indicators.columnset.SimpleStatIndicator) CountAvgNullIndicator(org.talend.dataquality.indicators.columnset.CountAvgNullIndicator) ColumnSetMultiValueIndicator(org.talend.dataquality.indicators.columnset.ColumnSetMultiValueIndicator) MinMaxDateIndicator(org.talend.dataquality.indicators.columnset.MinMaxDateIndicator) CountAvgNullIndicator(org.talend.dataquality.indicators.columnset.CountAvgNullIndicator) Indicator(org.talend.dataquality.indicators.Indicator) WeakCorrelationIndicator(org.talend.dataquality.indicators.columnset.WeakCorrelationIndicator) AllMatchIndicator(org.talend.dataquality.indicators.columnset.AllMatchIndicator) SimpleStatIndicator(org.talend.dataquality.indicators.columnset.SimpleStatIndicator) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit)

Example 4 with ColumnSetIndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit in project tdq-studio-se by Talend.

the class ColumnSetAnalysisDetailsPage method createAllMatch.

private void createAllMatch(final Composite composite) {
    List<IndicatorUnit> units = new ArrayList<IndicatorUnit>();
    units.add(new ColumnSetIndicatorUnit(IndicatorEnum.AllMatchIndicatorEnum, allMatchIndicator));
    EIndicatorChartType matchingType = EIndicatorChartType.PATTERN_MATCHING;
    IChartTypeStates chartTypeState = ChartTypeStatesFactory.getChartState(matchingType, units);
    Object chart = chartTypeState.getChart();
    TOPChartUtils.getInstance().decorateChart(chart, false);
    if (chart != null) {
        TOPChartUtils.getInstance().createChartComposite(composite, SWT.NONE, chart, true);
    }
}
Also used : IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) ArrayList(java.util.ArrayList) EIndicatorChartType(org.talend.dq.indicators.preview.EIndicatorChartType) MetadataColumnRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject) EObject(org.eclipse.emf.ecore.EObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) IChartTypeStates(org.talend.dataprofiler.core.ui.editor.preview.model.states.IChartTypeStates)

Example 5 with ColumnSetIndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit in project tdq-studio-se by Talend.

the class ColumnSetAnalysisDetailsPage method createSimpleStatistics.

private void createSimpleStatistics(final Composite composite) {
    List<IndicatorUnit> units = new ArrayList<IndicatorUnit>();
    units.add(new ColumnSetIndicatorUnit(IndicatorEnum.RowCountIndicatorEnum, simpleStatIndicator.getRowCountIndicator()));
    units.add(new ColumnSetIndicatorUnit(IndicatorEnum.DistinctCountIndicatorEnum, simpleStatIndicator.getDistinctCountIndicator()));
    units.add(new ColumnSetIndicatorUnit(IndicatorEnum.DuplicateCountIndicatorEnum, simpleStatIndicator.getDuplicateCountIndicator()));
    units.add(new ColumnSetIndicatorUnit(IndicatorEnum.UniqueIndicatorEnum, simpleStatIndicator.getUniqueCountIndicator()));
    IChartTypeStates chartTypeState = ChartTypeStatesFactory.getChartState(EIndicatorChartType.SIMPLE_STATISTICS, units);
    // create chart
    Object chart = chartTypeState.getChart();
    TOPChartUtils.getInstance().decorateChart(chart, false);
    if (chart != null) {
        TOPChartUtils.getInstance().createChartComposite(composite, SWT.NONE, chart, true);
    }
}
Also used : IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) ArrayList(java.util.ArrayList) MetadataColumnRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject) EObject(org.eclipse.emf.ecore.EObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) IChartTypeStates(org.talend.dataprofiler.core.ui.editor.preview.model.states.IChartTypeStates)

Aggregations

ColumnSetIndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit)8 ArrayList (java.util.ArrayList)7 IndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit)6 IChartTypeStates (org.talend.dataprofiler.core.ui.editor.preview.model.states.IChartTypeStates)5 EIndicatorChartType (org.talend.dq.indicators.preview.EIndicatorChartType)4 TableViewer (org.eclipse.jface.viewers.TableViewer)3 TableWithData (org.talend.dataprofiler.core.ui.editor.preview.model.TableWithData)3 ITableTypeStates (org.talend.dataprofiler.core.ui.editor.preview.model.states.table.ITableTypeStates)3 EObject (org.eclipse.emf.ecore.EObject)2 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)2 MetadataColumnRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject)2 AbstractPageControllerComposite (org.eclipse.nebula.widgets.pagination.AbstractPageControllerComposite)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 Section (org.eclipse.ui.forms.widgets.Section)1 Before (org.junit.Before)1 OpeningHelpWizardDialog (org.talend.dataprofiler.core.ui.utils.OpeningHelpWizardDialog)1 IndicatorOptionsWizard (org.talend.dataprofiler.core.ui.wizard.indicator.IndicatorOptionsWizard)1 Analysis (org.talend.dataquality.analysis.Analysis)1