Search in sources :

Example 6 with ColumnSetIndicatorUnit

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

the class ColumnSetAnalysisResultPage method createAllMatchPart.

private Section createAllMatchPart(Composite parentComp, String title, AllMatchIndicator matchIndicator) {
    Section section = createSection(form, parentComp, title, null);
    section.setLayoutData(new GridData(GridData.FILL_BOTH));
    Composite sectionClient = toolkit.createComposite(section);
    sectionClient.setLayout(new GridLayout(2, false));
    sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).applyTo(sectionClient);
    List<IndicatorUnit> units = new ArrayList<IndicatorUnit>();
    units.add(new ColumnSetIndicatorUnit(IndicatorEnum.AllMatchIndicatorEnum, allMatchIndicator));
    EIndicatorChartType matchingType = EIndicatorChartType.PATTERN_MATCHING;
    ITableTypeStates tableTypeState = TableTypeStatesFactory.getInstance().getTableState(matchingType, units);
    TableWithData chartData = new TableWithData(matchingType, tableTypeState.getDataEntity());
    TableViewer tableviewer = tableTypeState.getTableForm(sectionClient);
    tableviewer.setInput(chartData);
    // MOD qiongli feature 19192.
    if (masterPage.getCurrentModelElement().getParameters().isStoreData()) {
        ChartTableFactory.addMenuAndTip(tableviewer, tableTypeState.getDataExplorer(), masterPage.getCurrentModelElement());
    } else {
        TableUtils.addTooltipForTable(tableviewer.getTable());
        TableUtils.addActionTooltip(tableviewer.getTable());
    }
    if (canShowChartForResultPage()) {
        IChartTypeStates chartTypeState = ChartTypeStatesFactory.getChartState(matchingType, units);
        Object chart = chartTypeState.getChart();
        TOPChartUtils.getInstance().decorateChart(chart, false);
        if (chart != null) {
            TOPChartUtils.getInstance().createChartComposite(sectionClient, SWT.NONE, chart, true);
        }
    }
    section.setClient(sectionClient);
    return section;
}
Also used : AbstractPageControllerComposite(org.eclipse.nebula.widgets.pagination.AbstractPageControllerComposite) Composite(org.eclipse.swt.widgets.Composite) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) ArrayList(java.util.ArrayList) TableWithData(org.talend.dataprofiler.core.ui.editor.preview.model.TableWithData) Section(org.eclipse.ui.forms.widgets.Section) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) IChartTypeStates(org.talend.dataprofiler.core.ui.editor.preview.model.states.IChartTypeStates) GridLayout(org.eclipse.swt.layout.GridLayout) ITableTypeStates(org.talend.dataprofiler.core.ui.editor.preview.model.states.table.ITableTypeStates) GridData(org.eclipse.swt.layout.GridData) EIndicatorChartType(org.talend.dq.indicators.preview.EIndicatorChartType) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 7 with ColumnSetIndicatorUnit

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

the class PatternStatisticsStateTest method setUp.

/**
 * init the state.
 *
 * @throws java.lang.Exception
 */
@Before
public void setUp() throws Exception {
    List<IndicatorUnit> units = new ArrayList<IndicatorUnit>();
    RegexpMatchingIndicator indicator = IndicatorsFactory.eINSTANCE.createRegexpMatchingIndicator();
    // $NON-NLS-1$
    indicator.setName("Blank text");
    indicator.setComputed(true);
    units.add(new ColumnSetIndicatorUnit(IndicatorEnum.AllMatchIndicatorEnum, indicator));
    patternStatisticsState = new PatternStatisticsState(units);
}
Also used : IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) ArrayList(java.util.ArrayList) RegexpMatchingIndicator(org.talend.dataquality.indicators.RegexpMatchingIndicator) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) Before(org.junit.Before)

Example 8 with ColumnSetIndicatorUnit

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

the class IndicatorsComp method openIndicatorOptionDialog.

public boolean openIndicatorOptionDialog(Shell shell, TreeItem indicatorItem) {
    if (isDirty()) {
        masterPage.doSave(null);
    }
    ColumnSetIndicatorUnit indicatorUnit = (ColumnSetIndicatorUnit) indicatorItem.getData(INDICATOR_KEY);
    if (indicatorUnit.isExsitingForm()) {
        IndicatorOptionsWizard wizard = new IndicatorOptionsWizard(indicatorUnit);
        String href = FormEnum.getFirstFormHelpHref(indicatorUnit);
        OpeningHelpWizardDialog optionDialog = new OpeningHelpWizardDialog(shell, wizard, href);
        if (Window.OK == optionDialog.open()) {
            masterPage.setDirty(wizard.isDirty());
            return hasIndicatorParameters(indicatorUnit.getIndicator());
        }
    } else {
        // $NON-NLS-1$
        MessageDialogWithToggle.openInformation(// $NON-NLS-1$
        shell, // $NON-NLS-1$
        DefaultMessagesImpl.getString("AnalysisColumnTreeViewer.information"), // $NON-NLS-1$
        DefaultMessagesImpl.getString("AnalysisColumnTreeViewer.nooption"));
    }
    return false;
}
Also used : OpeningHelpWizardDialog(org.talend.dataprofiler.core.ui.utils.OpeningHelpWizardDialog) IndicatorOptionsWizard(org.talend.dataprofiler.core.ui.wizard.indicator.IndicatorOptionsWizard) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit)

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