Search in sources :

Example 41 with ExpansionEvent

use of org.eclipse.ui.forms.events.ExpansionEvent in project netxms by netxms.

the class AlarmDetails method createEventsSection.

/**
 * Create events section
 */
private void createEventsSection() {
    final Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR | Section.EXPANDED | Section.TWISTIE | Section.COMPACT);
    section.setText(Messages.get().AlarmDetails_RelatedEvents);
    final GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.verticalAlignment = SWT.FILL;
    gd.grabExcessVerticalSpace = true;
    section.setLayoutData(gd);
    section.addExpansionListener(new IExpansionListener() {

        @Override
        public void expansionStateChanging(ExpansionEvent e) {
            gd.grabExcessVerticalSpace = e.getState();
        }

        @Override
        public void expansionStateChanged(ExpansionEvent e) {
        }
    });
    final Composite content = toolkit.createComposite(section);
    GridLayout layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    content.setLayout(layout);
    section.setClient(content);
    final String[] names = { Messages.get().AlarmDetails_Column_Severity, Messages.get().AlarmDetails_Column_Source, Messages.get().AlarmDetails_Column_Name, Messages.get().AlarmDetails_Column_Message, Messages.get().AlarmDetails_Column_Timestamp };
    final int[] widths = { 130, 160, 160, 400, 150 };
    eventViewer = new SortableTreeViewer(content, names, widths, EV_COLUMN_TIMESTAMP, SWT.DOWN, SWT.BORDER | SWT.FULL_SELECTION);
    eventViewer.setContentProvider(new EventTreeContentProvider());
    eventViewer.setLabelProvider(new EventTreeLabelProvider());
    eventViewer.setComparator(new EventTreeComparator());
    eventViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    final IDialogSettings settings = Activator.getDefault().getDialogSettings();
    // $NON-NLS-1$
    WidgetHelper.restoreTreeViewerSettings(eventViewer, settings, "AlarmDetails.Events");
    eventViewer.getControl().addDisposeListener(new DisposeListener() {

        @Override
        public void widgetDisposed(DisposeEvent e) {
            // $NON-NLS-1$
            WidgetHelper.saveTreeViewerSettings(eventViewer, settings, "AlarmDetails.Events");
        }
    });
}
Also used : SortableTreeViewer(org.netxms.ui.eclipse.widgets.SortableTreeViewer) DisposeListener(org.eclipse.swt.events.DisposeListener) IExpansionListener(org.eclipse.ui.forms.events.IExpansionListener) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) EventTreeContentProvider(org.netxms.ui.eclipse.alarmviewer.views.helpers.EventTreeContentProvider) DisposeEvent(org.eclipse.swt.events.DisposeEvent) Section(org.eclipse.ui.forms.widgets.Section) GridLayout(org.eclipse.swt.layout.GridLayout) IDialogSettings(org.eclipse.jface.dialogs.IDialogSettings) GridData(org.eclipse.swt.layout.GridData) ExpansionEvent(org.eclipse.ui.forms.events.ExpansionEvent) EventTreeLabelProvider(org.netxms.ui.eclipse.alarmviewer.views.helpers.EventTreeLabelProvider) EventTreeComparator(org.netxms.ui.eclipse.alarmviewer.views.helpers.EventTreeComparator)

Example 42 with ExpansionEvent

use of org.eclipse.ui.forms.events.ExpansionEvent in project liferay-ide by liferay.

the class AbstractValidationSettingsPage method createTwistie.

protected ExpandableComposite createTwistie(Composite parent, String label, int nColumns) {
    ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
    excomposite.setText(label);
    excomposite.setExpanded(false);
    excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
    excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1));
    excomposite.addExpansionListener(new ExpansionAdapter() {

        @Override
        public void expansionStateChanged(ExpansionEvent e) {
            expandedStateChanged((ExpandableComposite) e.getSource());
        }
    });
    _fExpandables.add(excomposite);
    _makeScrollableCompositeAware(excomposite);
    return excomposite;
}
Also used : GridData(org.eclipse.swt.layout.GridData) ExpansionAdapter(org.eclipse.ui.forms.events.ExpansionAdapter) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ExpansionEvent(org.eclipse.ui.forms.events.ExpansionEvent)

Example 43 with ExpansionEvent

use of org.eclipse.ui.forms.events.ExpansionEvent in project jbosstools-openshift by jbosstools.

the class BuildConfigWizardPage method doCreateControls.

@Override
protected void doCreateControls(Composite parent, DataBindingContext dbc) {
    GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(parent);
    GridLayoutFactory.fillDefaults().applyTo(parent);
    Group buildConfigsGroup = new Group(parent, SWT.NONE);
    buildConfigsGroup.setText("Existing Build Configs:");
    GridLayoutFactory.fillDefaults().numColumns(2).margins(10, 10).applyTo(buildConfigsGroup);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(buildConfigsGroup);
    // build configs tree
    TreeViewer buildConfigsViewer = createBuildConfigsViewer(new Tree(buildConfigsGroup, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL), model, dbc);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).hint(SWT.DEFAULT, 200).span(1, 2).applyTo(buildConfigsViewer.getControl());
    final IObservableValue selectedItem = BeanProperties.value(IBuildConfigPageModel.PROPERTY_SELECTED_ITEM).observe(model);
    Binding selectedBuildConfigBinding = ValueBindingBuilder.bind(ViewerProperties.singleSelection().observe(buildConfigsViewer)).converting(new ObservableTreeItem2ModelConverter()).to(selectedItem).converting(new Model2ObservableTreeItemConverter()).in(dbc);
    dbc.addValidationStatusProvider(new MultiValidator() {

        @Override
        protected IStatus validate() {
            if (!(selectedItem.getValue() instanceof IBuildConfig)) {
                return ValidationStatus.cancel("Please select the existing build config that you want to import");
            } else {
                return ValidationStatus.ok();
            }
        }
    });
    IObservableValue connectionObservable = BeanProperties.value(IBuildConfigPageModel.PROPERTY_CONNECTION).observe(model);
    DataBindingUtils.addDisposableValueChangeListener(onConnectionChanged(buildConfigsViewer, model), connectionObservable, buildConfigsViewer.getTree());
    ControlDecorationSupport.create(selectedBuildConfigBinding, SWT.LEFT | SWT.TOP, null, new RequiredControlDecorationUpdater(true));
    // refresh button
    Button refreshButton = new Button(buildConfigsGroup, SWT.PUSH);
    refreshButton.setText("&Refresh");
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).hint(100, SWT.DEFAULT).applyTo(refreshButton);
    refreshButton.addSelectionListener(onRefresh(buildConfigsViewer, model));
    // filler
    Label fillerLabel = new Label(buildConfigsGroup, SWT.NONE);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(false, true).applyTo(fillerLabel);
    // details
    ExpandableComposite expandable = new ExpandableComposite(buildConfigsGroup, SWT.None);
    GridDataFactory.fillDefaults().span(2, 1).align(SWT.FILL, SWT.FILL).grab(true, false).hint(SWT.DEFAULT, 150).applyTo(expandable);
    expandable.setText("Build config Details");
    expandable.setExpanded(true);
    GridLayoutFactory.fillDefaults().numColumns(2).margins(0, 0).spacing(0, 0).applyTo(expandable);
    GridDataFactory.fillDefaults().span(2, 1).align(SWT.FILL, SWT.FILL).grab(true, false).hint(SWT.DEFAULT, 150).applyTo(expandable);
    Composite detailsContainer = new Composite(expandable, SWT.NONE);
    GridDataFactory.fillDefaults().span(2, 1).align(SWT.FILL, SWT.FILL).grab(true, false).hint(SWT.DEFAULT, 150).applyTo(detailsContainer);
    IObservableValue selectedService = new WritableValue();
    ValueBindingBuilder.bind(selectedItem).to(selectedService).notUpdatingParticipant().in(dbc);
    new BuildConfigDetailViews(selectedService, detailsContainer, dbc).createControls();
    expandable.setClient(detailsContainer);
    expandable.addExpansionListener(new IExpansionListener() {

        @Override
        public void expansionStateChanging(ExpansionEvent e) {
        }

        @Override
        public void expansionStateChanged(ExpansionEvent e) {
            buildConfigsGroup.update();
            buildConfigsGroup.layout(true);
        }
    });
    loadBuildConfigs(model);
}
Also used : Binding(org.eclipse.core.databinding.Binding) Group(org.eclipse.swt.widgets.Group) IStatus(org.eclipse.core.runtime.IStatus) IExpansionListener(org.eclipse.ui.forms.events.IExpansionListener) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) TreeViewer(org.eclipse.jface.viewers.TreeViewer) Label(org.eclipse.swt.widgets.Label) ObservableTreeItem2ModelConverter(org.jboss.tools.openshift.internal.ui.treeitem.ObservableTreeItem2ModelConverter) BuildConfigDetailViews(org.jboss.tools.openshift.internal.ui.server.BuildConfigDetailViews) MultiValidator(org.eclipse.core.databinding.validation.MultiValidator) WritableValue(org.eclipse.core.databinding.observable.value.WritableValue) RequiredControlDecorationUpdater(org.jboss.tools.openshift.internal.common.ui.databinding.RequiredControlDecorationUpdater) Model2ObservableTreeItemConverter(org.jboss.tools.openshift.internal.ui.wizard.importapp.BuildConfigTreeItems.Model2ObservableTreeItemConverter) IBuildConfig(com.openshift.restclient.model.IBuildConfig) Button(org.eclipse.swt.widgets.Button) Tree(org.eclipse.swt.widgets.Tree) IObservableValue(org.eclipse.core.databinding.observable.value.IObservableValue) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ExpansionEvent(org.eclipse.ui.forms.events.ExpansionEvent)

Example 44 with ExpansionEvent

use of org.eclipse.ui.forms.events.ExpansionEvent in project tdq-studio-se by Talend.

the class BusinessRuleAnalysisDetailsPage method createPreviewCharts.

@Override
public void createPreviewCharts(final ScrolledForm form1, final Composite composite) {
    previewChartList = new ArrayList<ExpandableComposite>();
    dynamicList.clear();
    for (final TableIndicator tableIndicator : this.treeViewer.getTableIndicator()) {
        final NamedColumnSet set = tableIndicator.getColumnSet();
        ExpandableComposite exComp = toolkit.createExpandableComposite(composite, ExpandableComposite.TREE_NODE | ExpandableComposite.CLIENT_INDENT);
        // bug 10541 modify by zshen,Change some character set to be proper to add view in the table anasys
        if (tableIndicator.isTable()) {
            // $NON-NLS-1$
            exComp.setText(DefaultMessagesImpl.getString("TableMasterDetailsPage.table") + set.getName());
        } else {
            // $NON-NLS-1$
            exComp.setText(DefaultMessagesImpl.getString("TableMasterDetailsPage.view") + set.getName());
        }
        exComp.setLayout(new GridLayout());
        exComp.setLayoutData(new GridData(GridData.FILL_BOTH));
        exComp.setData(tableIndicator);
        previewChartList.add(exComp);
        final Composite comp = toolkit.createComposite(exComp);
        comp.setLayout(new GridLayout());
        comp.setLayoutData(new GridData(GridData.FILL_BOTH));
        exComp.setExpanded(true);
        exComp.setClient(comp);
        if (tableIndicator.getIndicators().length != 0) {
            IRunnableWithProgress rwp = new IRunnableWithProgress() {

                public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                    monitor.beginTask(// $NON-NLS-1$
                    DefaultMessagesImpl.getString("TableMasterDetailsPage.createPreview") + set.getName(), IProgressMonitor.UNKNOWN);
                    Display.getDefault().syncExec(new Runnable() {

                        public void run() {
                            Map<EIndicatorChartType, List<TableIndicatorUnit>> indicatorComposite = CompositeIndicator.getInstance().getTableIndicatorComposite(tableIndicator);
                            for (EIndicatorChartType chartType : indicatorComposite.keySet()) {
                                List<TableIndicatorUnit> units = indicatorComposite.get(chartType);
                                if (!units.isEmpty()) {
                                    final IChartTypeStates chartTypeState = ChartTypeStatesFactory.getChartStateOfTableAna(chartType, units, tableIndicator);
                                    // get all indicator lists separated by chart, and only
                                    // WhereRuleStatisticsStateTable can get not-null charts
                                    List<List<Indicator>> pagedIndicators = ((WhereRuleStatisticsStateTable) chartTypeState).getPagedIndicators();
                                    // Added TDQ-9241: for each list(for each chart), check if the current
                                    // list has been registered dynamic event
                                    List<Object> datasets = new ArrayList<Object>();
                                    for (List<Indicator> oneChart : pagedIndicators) {
                                        IEventReceiver event = EventManager.getInstance().findRegisteredEvent(oneChart.get(0), EventEnum.DQ_DYMANIC_CHART, 0);
                                        if (event != null) {
                                            // get the dataset from the event
                                            Object dataset = ((TableDynamicChartEventReceiver) event).getDataset();
                                            // one running)
                                            if (dataset != null) {
                                                datasets.add(dataset);
                                            }
                                        }
                                    // ~
                                    }
                                    // create chart
                                    List<Object> charts = null;
                                    if (datasets.size() > 0) {
                                        charts = chartTypeState.getChartList(datasets);
                                    } else {
                                        charts = chartTypeState.getChartList();
                                    }
                                    int index = 0;
                                    if (charts != null) {
                                        for (Object chart : charts) {
                                            Object chartComp = TOPChartUtils.getInstance().createChartComposite(comp, SWT.NONE, chart, true);
                                            // Added TDQ-8787 20140707 yyin: create and store the dynamic model
                                            DynamicIndicatorModel dyModel = AnalysisUtils.createDynamicModel(chartType, pagedIndicators.get(index++), chart);
                                            dynamicList.add(dyModel);
                                            // ~
                                            TOPChartUtils.getInstance().addListenerToChartComp(chartComp, chartTypeState.getReferenceLink(), // $NON-NLS-1$
                                            DefaultMessagesImpl.getString("TableMasterDetailsPage.what"));
                                        }
                                    }
                                }
                            }
                        }
                    });
                    monitor.done();
                }
            };
            try {
                new ProgressMonitorDialog(getSite().getShell()).run(true, false, rwp);
            } catch (Exception ex) {
                log.error(ex, ex);
            }
        }
        exComp.addExpansionListener(new ExpansionAdapter() {

            @Override
            public void expansionStateChanged(ExpansionEvent e) {
                getChartComposite().layout();
                form1.reflow(true);
                composite.pack();
            }
        });
        getChartComposite().layout();
        form1.reflow(true);
        composite.pack();
    }
    if (!previewChartList.isEmpty()) {
        this.previewChartCompsites = previewChartList.toArray(new Composite[previewChartList.size()]);
    }
}
Also used : IEventReceiver(org.talend.dataprofiler.core.ui.events.IEventReceiver) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress) GridLayout(org.eclipse.swt.layout.GridLayout) TableIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit) List(java.util.List) ArrayList(java.util.ArrayList) EList(org.eclipse.emf.common.util.EList) DynamicIndicatorModel(org.talend.dataprofiler.core.model.dynamic.DynamicIndicatorModel) NamedColumnSet(orgomg.cwm.resource.relational.NamedColumnSet) TableIndicator(org.talend.dataprofiler.core.model.TableIndicator) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ProgressMonitorDialog(org.eclipse.jface.dialogs.ProgressMonitorDialog) ExpansionAdapter(org.eclipse.ui.forms.events.ExpansionAdapter) CompositeIndicator(org.talend.dataprofiler.core.ui.editor.preview.CompositeIndicator) Indicator(org.talend.dataquality.indicators.Indicator) TableIndicator(org.talend.dataprofiler.core.model.TableIndicator) DataprofilerCoreException(org.talend.dataquality.exception.DataprofilerCoreException) InvocationTargetException(java.lang.reflect.InvocationTargetException) IChartTypeStates(org.talend.dataprofiler.core.ui.editor.preview.model.states.IChartTypeStates) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) GridData(org.eclipse.swt.layout.GridData) EIndicatorChartType(org.talend.dq.indicators.preview.EIndicatorChartType) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) Map(java.util.Map) ExpansionEvent(org.eclipse.ui.forms.events.ExpansionEvent)

Example 45 with ExpansionEvent

use of org.eclipse.ui.forms.events.ExpansionEvent in project tdq-studio-se by Talend.

the class BusinessRuleAnalysisResultPage method createResultDataComposite.

private void createResultDataComposite(final Composite comp, final TableIndicator tableIndicator) {
    if (tableIndicator.getIndicators().length != 0) {
        final NamedColumnSet set = tableIndicator.getColumnSet();
        IRunnableWithProgress rwp = new IRunnableWithProgress() {

            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                monitor.beginTask(DefaultMessagesImpl.getString("TableAnalysisResultPage.createPreview", set.getName()), // $NON-NLS-1$
                IProgressMonitor.UNKNOWN);
                Display.getDefault().asyncExec(new Runnable() {

                    public void run() {
                        Map<EIndicatorChartType, List<TableIndicatorUnit>> indicatorComposite = CompositeIndicator.getInstance().getTableIndicatorComposite(tableIndicator);
                        for (EIndicatorChartType chartType : indicatorComposite.keySet()) {
                            List<TableIndicatorUnit> units = indicatorComposite.get(chartType);
                            if (!units.isEmpty()) {
                                // create UI
                                ExpandableComposite subComp = createSubWholeComposite(comp, chartType);
                                final Composite composite = createCompositeForTableAndChart(subComp);
                                Composite tableTopComp = createTableComposite(composite);
                                Analysis analysis = masterPage.getAnalysisHandler().getAnalysis();
                                ITableTypeStates tableTypeState = TableTypeStatesFactory.getInstance().getTableStateForRule(chartType, units, tableIndicator);
                                // create table for RownCountIndicator
                                createTableViewerForRowCount(chartType, units, tableTopComp, analysis, tableTypeState);
                                // create table for WhereRuleIndicator
                                createTableForWhereRule(chartType, tableTopComp, analysis, tableTypeState, units);
                                Composite chartTopComp = createTableComposite(composite);
                                if (canShowChartForResultPage()) {
                                    createChartsForRules(tableIndicator, chartType, units, analysis, chartTopComp);
                                }
                                subComp.setClient(composite);
                                subComp.addExpansionListener(new ExpansionAdapter() {

                                    @Override
                                    public void expansionStateChanged(ExpansionEvent e) {
                                        form.reflow(true);
                                    }
                                });
                            }
                        }
                    }

                    /**
                     * DOC yyin Comment method "createChartsForRules".
                     *
                     * @param tableIndicator
                     * @param chartType
                     * @param units
                     * @param analysis
                     * @param chartTopComp
                     */
                    private void createChartsForRules(final TableIndicator tableIndicator, EIndicatorChartType chartType, List<TableIndicatorUnit> units, Analysis analysis, Composite chartTopComp) {
                        IChartTypeStates chartTypeState = ChartTypeStatesFactory.getChartStateOfTableAna(chartType, units, tableIndicator);
                        // get all indicator lists separated by chart, and only
                        // WhereRuleStatisticsStateTable can get not-null charts
                        List<List<Indicator>> pagedIndicators = ((WhereRuleStatisticsStateTable) chartTypeState).getPagedIndicators();
                        // Added TDQ-9241: for each list(for each chart), check if the current
                        // list has been registered dynamic event
                        List<Object> datasets = new ArrayList<Object>();
                        for (List<Indicator> oneChart : pagedIndicators) {
                            IEventReceiver event = EventManager.getInstance().findRegisteredEvent(oneChart.get(0), EventEnum.DQ_DYMANIC_CHART, 0);
                            if (event != null) {
                                // get the dataset from the event
                                Object dataset = ((TableDynamicChartEventReceiver) event).getDataset();
                                // one running)
                                if (dataset != null) {
                                    datasets.add(dataset);
                                }
                            }
                        // ~
                        }
                        // create chart
                        List<Object> charts = null;
                        if (datasets.size() > 0) {
                            charts = chartTypeState.getChartList(datasets);
                        } else {
                            charts = chartTypeState.getChartList();
                            datasets = ((WhereRuleStatisticsStateTable) chartTypeState).getTempDatasetList();
                        }
                        if (charts != null) {
                            int index = 0;
                            for (int i = 0; i < charts.size(); i++) {
                                Object chart2 = charts.get(i);
                                Object chartComp = TOPChartUtils.getInstance().createChartCompositeWithSpecialSize(chartTopComp, SWT.NONE, chart2, true, 250, 550);
                                // Added TDQ-8787 20140707 yyin: create and store the dynamic model for
                                // each chart
                                DynamicIndicatorModel dyModel = AnalysisUtils.createDynamicModel(chartType, pagedIndicators.get(index++), chart2);
                                dynamicList.add(dyModel);
                                // ~
                                // one dataset <--> one chart
                                addMenuToChartComp(chartComp, chartTypeState.getDataExplorer(), analysis, ((ICustomerDataset) datasets.get(i)).getDataEntities());
                            }
                        }
                    }

                    /**
                     * DOC yyin Comment method "createTableForWhereRule".
                     *
                     * @param chartType
                     * @param tableTopComp
                     * @param analysis
                     * @param tableTypeState
                     * @param units
                     * @return
                     */
                    private void createTableForWhereRule(EIndicatorChartType chartType, Composite tableTopComp, Analysis analysis, ITableTypeStates tableTypeState, List<TableIndicatorUnit> units) {
                        TableWithData chartData = new TableWithData(chartType, tableTypeState.getDataEntity());
                        TableViewer tableviewer = tableTypeState.getTableForm(tableTopComp);
                        tableviewer.setInput(chartData);
                        ChartTableFactory.addMenuAndTip(tableviewer, tableTypeState.getDataExplorer(), analysis);
                        // Added TDQ-8787 20140707 yyin: create and store the dynamic model
                        List<Indicator> allRules = new ArrayList<Indicator>();
                        List<TableIndicatorUnit> removeRowCountUnit = ((WhereRuleStatisticsTableState) tableTypeState).removeRowCountUnit(units);
                        for (TableIndicatorUnit indUnit : removeRowCountUnit) {
                            allRules.add(indUnit.getIndicator());
                        }
                        DynamicIndicatorModel dyModel = AnalysisUtils.createDynamicModel(chartType, allRules, null);
                        dyModel.setTableViewer(tableviewer);
                        dynamicList.add(dyModel);
                    }

                    /**
                     * DOC yyin Comment method "createTableViewerForRowCount".
                     *
                     * @param chartType
                     * @param units
                     * @param tableTopComp
                     * @param analysis
                     * @param tableTypeState
                     */
                    private void createTableViewerForRowCount(EIndicatorChartType chartType, List<TableIndicatorUnit> units, Composite tableTopComp, Analysis analysis, ITableTypeStates tableTypeState) {
                        WhereRuleStatisticsTableState tableWhereRule = (WhereRuleStatisticsTableState) tableTypeState;
                        TableWithData chartDataRowCount = new TableWithData(chartType, tableWhereRule.getDataEntityOfRowCount());
                        TableViewer tableviewerRowCount = tableWhereRule.getTableFormRowCount(tableTopComp);
                        tableviewerRowCount.setInput(chartDataRowCount);
                        ChartTableFactory.addMenuAndTip(tableviewerRowCount, tableTypeState.getDataExplorer(), analysis);
                        // Added TDQ-8787 20140707 yyin: create and store the dynamic model for row
                        // count's table
                        List<Indicator> rowCount = new ArrayList<Indicator>();
                        rowCount.add(tableWhereRule.getRownCountUnit(units).getIndicator());
                        DynamicIndicatorModel dyModel = AnalysisUtils.createDynamicModel(chartType, rowCount, null);
                        dyModel.setTableViewer(tableviewerRowCount);
                        dynamicList.add(dyModel);
                    }

                    /**
                     * DOC yyin Comment method "createTableComposite".
                     *
                     * @param composite
                     * @return
                     */
                    private Composite createTableComposite(final Composite composite) {
                        Composite tableTopComp = toolkit.createComposite(composite, SWT.NULL);
                        tableTopComp.setLayout(new GridLayout(1, false));
                        tableTopComp.setLayoutData(new GridData(GridData.FILL_BOTH));
                        return tableTopComp;
                    }

                    /**
                     * DOC yyin Comment method "createCompositeForTableAndChart".
                     *
                     * @param subComp
                     * @return
                     */
                    private Composite createCompositeForTableAndChart(ExpandableComposite subComp) {
                        final Composite composite = toolkit.createComposite(subComp, SWT.NULL);
                        composite.setLayout(new GridLayout(2, false));
                        composite.setLayoutData(new GridData(GridData.FILL_BOTH));
                        return composite;
                    }

                    /**
                     * DOC yyin Comment method "createSubWholeComposite".
                     *
                     * @param comp
                     * @param chartType
                     * @return
                     */
                    private ExpandableComposite createSubWholeComposite(final Composite comp, EIndicatorChartType chartType) {
                        ExpandableComposite subComp = toolkit.createExpandableComposite(comp, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT | ExpandableComposite.EXPANDED);
                        subComp.setText(chartType.getLiteral());
                        subComp.setLayoutData(new GridData(GridData.FILL_BOTH));
                        subComp.setExpanded(EditorPreferencePage.isUnfoldingIndicatorsResultPage());
                        return subComp;
                    }
                });
                monitor.done();
            }
        };
        try {
            new ProgressMonitorDialog(this.getEditorSite().getShell()).run(true, false, rwp);
        } catch (Exception ex) {
            log.error(ex, ex);
        }
    }
}
Also used : IEventReceiver(org.talend.dataprofiler.core.ui.events.IEventReceiver) TableWithData(org.talend.dataprofiler.core.ui.editor.preview.model.TableWithData) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress) GridLayout(org.eclipse.swt.layout.GridLayout) TableIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit) List(java.util.List) ArrayList(java.util.ArrayList) DynamicIndicatorModel(org.talend.dataprofiler.core.model.dynamic.DynamicIndicatorModel) NamedColumnSet(orgomg.cwm.resource.relational.NamedColumnSet) ICustomerDataset(org.talend.dataprofiler.common.ui.editor.preview.ICustomerDataset) TableIndicator(org.talend.dataprofiler.core.model.TableIndicator) WhereRuleStatisticsTableState(org.talend.dataprofiler.core.ui.editor.preview.model.states.table.WhereRuleStatisticsTableState) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ProgressMonitorDialog(org.eclipse.jface.dialogs.ProgressMonitorDialog) WhereRuleStatisticsStateTable(org.talend.dataprofiler.core.ui.editor.preview.model.states.WhereRuleStatisticsStateTable) ExpansionAdapter(org.eclipse.ui.forms.events.ExpansionAdapter) CompositeIndicator(org.talend.dataprofiler.core.ui.editor.preview.CompositeIndicator) Indicator(org.talend.dataquality.indicators.Indicator) TableIndicator(org.talend.dataprofiler.core.model.TableIndicator) InvocationTargetException(java.lang.reflect.InvocationTargetException) IChartTypeStates(org.talend.dataprofiler.core.ui.editor.preview.model.states.IChartTypeStates) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) ITableTypeStates(org.talend.dataprofiler.core.ui.editor.preview.model.states.table.ITableTypeStates) Analysis(org.talend.dataquality.analysis.Analysis) EIndicatorChartType(org.talend.dq.indicators.preview.EIndicatorChartType) GridData(org.eclipse.swt.layout.GridData) Map(java.util.Map) IdentityHashMap(java.util.IdentityHashMap) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ExpansionEvent(org.eclipse.ui.forms.events.ExpansionEvent) TableViewer(org.eclipse.jface.viewers.TableViewer)

Aggregations

ExpansionEvent (org.eclipse.ui.forms.events.ExpansionEvent)58 ExpansionAdapter (org.eclipse.ui.forms.events.ExpansionAdapter)53 GridData (org.eclipse.swt.layout.GridData)46 Composite (org.eclipse.swt.widgets.Composite)46 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)46 GridLayout (org.eclipse.swt.layout.GridLayout)38 Section (org.eclipse.ui.forms.widgets.Section)30 SelectionEvent (org.eclipse.swt.events.SelectionEvent)12 TableViewer (org.eclipse.jface.viewers.TableViewer)11 ArrayList (java.util.ArrayList)7 ICellModifier (org.eclipse.jface.viewers.ICellModifier)7 TextCellEditor (org.eclipse.jface.viewers.TextCellEditor)7 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)7 SelectionListener (org.eclipse.swt.events.SelectionListener)7 Point (org.eclipse.swt.graphics.Point)7 Label (org.eclipse.swt.widgets.Label)7 TableColumn (org.eclipse.swt.widgets.TableColumn)7 TableItem (org.eclipse.swt.widgets.TableItem)7 ParseTree (org.antlr.v4.runtime.tree.ParseTree)6 AddedParseTree (org.eclipse.titan.common.parsers.AddedParseTree)6