Search in sources :

Example 26 with Section

use of org.eclipse.ui.forms.widgets.Section in project egit by eclipse.

the class NotesBlock method createMasterPart.

@Override
protected void createMasterPart(final IManagedForm managedForm, Composite parent) {
    form = managedForm;
    FormToolkit toolkit = managedForm.getToolkit();
    Composite masterArea = toolkit.createComposite(parent);
    GridLayoutFactory.swtDefaults().applyTo(masterArea);
    RepositoryCommitNote[] notes = commit.getNotes();
    Section refsSection = toolkit.createSection(masterArea, ExpandableComposite.TITLE_BAR);
    refsSection.setText(MessageFormat.format(UIText.NotesBlock_NotesSection, Integer.valueOf(notes.length)));
    GridDataFactory.fillDefaults().grab(true, true).applyTo(refsSection);
    Composite refsArea = toolkit.createComposite(refsSection);
    refsSection.setClient(refsArea);
    GridLayoutFactory.fillDefaults().extendedMargins(2, 2, 2, 2).applyTo(refsArea);
    toolkit.paintBordersFor(refsArea);
    Table refsTable = toolkit.createTable(refsArea, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE);
    refsViewer = new TableViewer(refsTable);
    refsViewer.setComparator(new ViewerComparator());
    refsTable.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(refsTable);
    refsViewer.setContentProvider(ArrayContentProvider.getInstance());
    refsViewer.setLabelProvider(new WorkbenchLabelProvider());
    refsViewer.setInput(notes);
    part = new SectionPart(refsSection);
    refsViewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            managedForm.fireSelectionChanged(part, event.getSelection());
        }
    });
}
Also used : WorkbenchLabelProvider(org.eclipse.ui.model.WorkbenchLabelProvider) Table(org.eclipse.swt.widgets.Table) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ViewerComparator(org.eclipse.jface.viewers.ViewerComparator) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) Section(org.eclipse.ui.forms.widgets.Section) SectionPart(org.eclipse.ui.forms.SectionPart) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 27 with Section

use of org.eclipse.ui.forms.widgets.Section in project tdq-studio-se by Talend.

the class ColumnSetAnalysisResultPage method createSimpleStatisticsPart.

private Section createSimpleStatisticsPart(Composite parentComp, String title, SimpleStatIndicator simpleStatIndicator) {
    // MOD sgandon 15/03/2010 bug 11769 : made descriotion null to remove empty space.
    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);
    createSimpleTable2(form, sectionClient, simpleStatIndicator);
    section.setClient(sectionClient);
    return section;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) AbstractPageControllerComposite(org.eclipse.nebula.widgets.pagination.AbstractPageControllerComposite) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) Section(org.eclipse.ui.forms.widgets.Section)

Example 28 with Section

use of org.eclipse.ui.forms.widgets.Section in project tdq-studio-se by Talend.

the class ColumnSetAnalysisResultPage method createTableSectionPart.

private Section createTableSectionPart(Composite parentComp, String title, SimpleStatIndicator ssIndicator) {
    Section columnSetElementSection = this.createSection(form, parentComp, title, null);
    Composite sectionTableComp = toolkit.createComposite(columnSetElementSection);
    // MOD yyi 2010-12-07 17282:create parameter section for storing data control
    if (ssIndicator.isStoreData()) {
        columnSetElementSection.setExpanded(true);
        columnSetElementSection.setEnabled(true);
        sectionTableComp.setLayoutData(new GridData(GridData.FILL_BOTH));
        sectionTableComp.setLayout(new GridLayout());
        // MOD zshen for feature 14000
        Button filterDataBt = new Button(sectionTableComp, SWT.NONE);
        // $NON-NLS-1$
        filterDataBt.setText(DefaultMessagesImpl.getString("ColumnSetResultPage.filterData"));
        filterDataBt.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
        filterDataBt.setEnabled(containAllMatchIndicator());
        filterDataBt.addMouseListener(new MouseListener() {

            public void mouseDoubleClick(MouseEvent e) {
            // TODO Auto-generated method stub
            }

            public void mouseDown(MouseEvent e) {
                List<Indicator> indicatorsList = masterPage.getCurrentModelElement().getResults().getIndicators();
                SelectPatternsWizard wizard = new SelectPatternsWizard(indicatorsList);
                wizard.setFilterType(filterType);
                wizard.setOldTableInputList(ColumnSetAnalysisResultPage.this.tableFilterResult.getTableFilterResult());
                WizardDialog dialog = new WizardDialog(null, wizard);
                dialog.setPageSize(300, 400);
                wizard.setContainer(dialog);
                // $NON-NLS-1$
                wizard.setWindowTitle(DefaultMessagesImpl.getString("SelectPatternsWizard.title"));
                if (WizardDialog.OK == dialog.open()) {
                    ColumnSetAnalysisResultPage.this.tableFilterResult = new TableFilterResult(wizard.getPatternSelectPage().getTableInputList());
                    filterType = wizard.getPatternSelectPage().getFilterType();
                    columnsElementViewer.refresh();
                }
            }

            public void mouseUp(MouseEvent e) {
            // TODO Auto-generated method stub
            }
        });
        columnsElementViewer = new TableViewer(sectionTableComp, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
        Table table = columnsElementViewer.getTable();
        table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
        List<String> tableColumnNames = ssIndicator.getColumnHeaders();
        for (String tableColumnName : tableColumnNames) {
            final TableColumn columnHeader = new TableColumn(table, SWT.NONE);
            columnHeader.setText(tableColumnName);
        }
        table.setLinesVisible(true);
        table.setHeaderVisible(true);
        TableSectionViewerProvider provider = new TableSectionViewerProvider();
        List<Object[]> tableRows = ssIndicator.getListRows();
        columnsElementViewer.setContentProvider(provider);
        columnsElementViewer.setLabelProvider(provider);
        columnsElementViewer.setInput(tableRows);
        for (int i = 0; i < tableColumnNames.size(); i++) {
            table.getColumn(i).pack();
        }
        columnSetElementSection.setClient(sectionTableComp);
        columnSetElementSection.setExpanded(false);
        // ADDED sgandon 15/03/2010 bug 11769 : setup the size of the table to avoid crash and add consistency.
        setupTableGridDataLimitedSize(table, tableRows.size());
        addColumnSorters(columnsElementViewer, table.getColumns(), this.buildSorter(tableRows));
    } else {
        columnSetElementSection.setExpanded(false);
        columnSetElementSection.setEnabled(false);
    }
    return columnSetElementSection;
}
Also used : MouseEvent(org.eclipse.swt.events.MouseEvent) Table(org.eclipse.swt.widgets.Table) AbstractPageControllerComposite(org.eclipse.nebula.widgets.pagination.AbstractPageControllerComposite) Composite(org.eclipse.swt.widgets.Composite) SelectPatternsWizard(org.talend.dataprofiler.core.ui.wizard.patterns.SelectPatternsWizard) Section(org.eclipse.ui.forms.widgets.Section) TableColumn(org.eclipse.swt.widgets.TableColumn) GridLayout(org.eclipse.swt.layout.GridLayout) MouseListener(org.eclipse.swt.events.MouseListener) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) List(java.util.List) ArrayList(java.util.ArrayList) WizardDialog(org.eclipse.jface.wizard.WizardDialog) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 29 with Section

use of org.eclipse.ui.forms.widgets.Section in project tdq-studio-se by Talend.

the class ColumnSetAnalysisResultPage method createTableSectionPartForMapDB.

private Section createTableSectionPartForMapDB(Composite parentComp, String title, SimpleStatIndicator ssIndicator) {
    Section columnSetElementSection = this.createSection(form, parentComp, title, null);
    Composite sectionTableComp = toolkit.createComposite(columnSetElementSection);
    // MOD yyi 2010-12-07 17282:create parameter section for storing data control
    if (ssIndicator.isStoreData()) {
        columnSetElementSection.setExpanded(true);
        columnSetElementSection.setEnabled(true);
        sectionTableComp.setLayoutData(new GridData(GridData.FILL_BOTH));
        sectionTableComp.setLayout(new GridLayout());
        try {
            mapDB = MapDBUtils.getMapDB(StandardDBName.dataSection.name(), ssIndicator);
        } catch (IOError error) {
            log.warn(error.getMessage(), error);
        }
        Button filterDataBt = new Button(sectionTableComp, SWT.NONE);
        // $NON-NLS-1$
        filterDataBt.setText(DefaultMessagesImpl.getString("ColumnSetResultPage.filterData"));
        filterDataBt.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
        filterDataBt.setEnabled(containAllMatchIndicator() && mapDB != null);
        filterDataBt.addMouseListener(new MouseListener() {

            public void mouseDoubleClick(MouseEvent e) {
            // do nothing until now
            }

            public void mouseDown(MouseEvent e) {
                List<Indicator> indicatorsList = masterPage.getCurrentModelElement().getResults().getIndicators();
                SelectPatternsWizard wizard = new SelectPatternsWizard(indicatorsList);
                wizard.setFilterType(filterType);
                wizard.setOldTableInputList(ColumnSetAnalysisResultPage.this.tableFilterResult.getTableFilterResult());
                WizardDialog dialog = new WizardDialog(null, wizard);
                dialog.setPageSize(300, 400);
                wizard.setContainer(dialog);
                // $NON-NLS-1$
                wizard.setWindowTitle(DefaultMessagesImpl.getString("SelectPatternsWizard.title"));
                if (WizardDialog.OK == dialog.open()) {
                    ColumnSetAnalysisResultPage.this.tableFilterResult = new TableFilterResult(wizard.getPatternSelectPage().getTableInputList());
                    filterType = wizard.getPatternSelectPage().getFilterType();
                    columnsElementViewer.refresh();
                    redrawController();
                }
            }

            public void mouseUp(MouseEvent e) {
            // do nothing until now
            }
        });
        columnsElementViewer = new TableViewer(sectionTableComp, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
        Table table = columnsElementViewer.getTable();
        table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
        table.setLinesVisible(true);
        table.setHeaderVisible(true);
        TableSectionViewerProvider provider = new TableSectionViewerProvider();
        columnsElementViewer.setContentProvider(provider);
        columnSetElementSection.setClient(sectionTableComp);
        columnSetElementSection.setExpanded(false);
        int pageSize = 100;
        // // ADDED sgandon 15/03/2010 bug 11769 : setup the size of the table to avoid crash and add consistency.
        setupTableGridDataLimitedSize(table, pageSize);
        // add pagation control
        controller = new PageableController(MapDBPageConstant.NUMBER_PER_PAGE);
        if (mapDB != null) {
            redrawPagationComposite(sectionTableComp, null, true);
        }
        createColumns(controller, ssIndicator);
        // Set current page to 0 to refresh the table
        controller.reset();
        for (TableColumn column : table.getColumns()) {
            column.pack();
        }
    } else {
        columnSetElementSection.setExpanded(false);
        columnSetElementSection.setEnabled(false);
    }
    return columnSetElementSection;
}
Also used : MouseEvent(org.eclipse.swt.events.MouseEvent) Table(org.eclipse.swt.widgets.Table) AbstractPageControllerComposite(org.eclipse.nebula.widgets.pagination.AbstractPageControllerComposite) Composite(org.eclipse.swt.widgets.Composite) PageableController(org.eclipse.nebula.widgets.pagination.PageableController) SelectPatternsWizard(org.talend.dataprofiler.core.ui.wizard.patterns.SelectPatternsWizard) Section(org.eclipse.ui.forms.widgets.Section) TableColumn(org.eclipse.swt.widgets.TableColumn) GridLayout(org.eclipse.swt.layout.GridLayout) MouseListener(org.eclipse.swt.events.MouseListener) IOError(java.io.IOError) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) List(java.util.List) ArrayList(java.util.ArrayList) WizardDialog(org.eclipse.jface.wizard.WizardDialog) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 30 with Section

use of org.eclipse.ui.forms.widgets.Section in project tdq-studio-se by Talend.

the class CorrelationAnalysisResultPage method createSimpleStatisticsPart.

private Section createSimpleStatisticsPart(Composite parentComp, String title, ColumnSetMultiValueIndicator columnSetMultiValueIndicator) {
    // $NON-NLS-1$
    Section section = createSection(form, parentComp, title, DefaultMessagesImpl.getString("ColumnMasterDetailsPage.space"));
    section.setLayoutData(new GridData(GridData.FILL_BOTH));
    Composite sectionClient = toolkit.createComposite(section);
    sectionClient.setLayout(new GridLayout());
    sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).applyTo(sectionClient);
    Composite simpleComposite = toolkit.createComposite(sectionClient);
    simpleComposite.setLayout(new GridLayout(2, true));
    simpleComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    createSimpleStatistics2(simpleComposite, columnSetMultiValueIndicator);
    section.setClient(sectionClient);
    return section;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) HideSeriesChartComposite(org.talend.dataprofiler.core.ui.editor.preview.HideSeriesChartComposite) GridData(org.eclipse.swt.layout.GridData) Section(org.eclipse.ui.forms.widgets.Section)

Aggregations

Section (org.eclipse.ui.forms.widgets.Section)260 Composite (org.eclipse.swt.widgets.Composite)229 GridLayout (org.eclipse.swt.layout.GridLayout)216 GridData (org.eclipse.swt.layout.GridData)215 ISection (org.eclipse.ui.views.properties.tabbed.ISection)103 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)70 TableViewer (org.eclipse.jface.viewers.TableViewer)33 FormToolkit (org.eclipse.ui.forms.widgets.FormToolkit)32 ExpansionEvent (org.eclipse.ui.forms.events.ExpansionEvent)30 TableWrapData (org.eclipse.ui.forms.widgets.TableWrapData)29 ExpansionAdapter (org.eclipse.ui.forms.events.ExpansionAdapter)28 SelectionEvent (org.eclipse.swt.events.SelectionEvent)25 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)19 Group (org.eclipse.swt.widgets.Group)19 EJFrameworkExtensionProperties (org.entirej.framework.core.properties.definitions.interfaces.EJFrameworkExtensionProperties)19 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)17 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)17 HyperlinkEvent (org.eclipse.ui.forms.events.HyperlinkEvent)17 FillLayout (org.eclipse.swt.layout.FillLayout)16 HyperlinkAdapter (org.eclipse.ui.forms.events.HyperlinkAdapter)16