Search in sources :

Example 1 with AnalysisTableTreeViewer

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

the class BusinessRuleAnalysisResultPage method createResultSection.

@Override
protected void createResultSection(Composite parent) {
    // ADD gdbu 2011-3-4 bug 19242
    AbstractPagePart treeViewer = masterPage.getTreeViewer();
    if (treeViewer != null && treeViewer instanceof AnalysisTableTreeViewer) {
        tableTreeViewer = (AnalysisTableTreeViewer) treeViewer;
    }
    // ~
    // $NON-NLS-1$
    resultSection = createSection(form, parent, DefaultMessagesImpl.getString("TableAnalysisResultPage.analysisResult"), null);
    sectionClient = toolkit.createComposite(resultSection);
    sectionClient.setLayout(new GridLayout());
    sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
    dynamicList.clear();
    for (final TableIndicator tableIndicator : tableTreeViewer.getTableIndicator()) {
        ExpandableComposite exComp = toolkit.createExpandableComposite(sectionClient, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT | ExpandableComposite.EXPANDED);
        // bug 10541 fix by zshen,Change some character set to be proper to add view in the table anasys
        if (tableIndicator.isTable()) {
            exComp.setText(DefaultMessagesImpl.getString("TableAnalysisResultPage.table", // $NON-NLS-1$
            tableIndicator.getColumnSet().getName()));
        } else {
            exComp.setText(DefaultMessagesImpl.getString("TableAnalysisResultPage.view", // $NON-NLS-1$
            tableIndicator.getColumnSet().getName()));
        }
        exComp.setLayout(new GridLayout());
        exComp.setLayoutData(new GridData(GridData.FILL_BOTH));
        // MOD xqliu 2009-06-23 bug 7481
        exComp.setExpanded(EditorPreferencePage.isUnfoldingAnalyzedEelementsResultPage());
        // ~
        final Composite comp = toolkit.createComposite(exComp);
        comp.setLayout(new GridLayout());
        comp.setLayoutData(new GridData(GridData.FILL_BOTH));
        exComp.setClient(comp);
        createResultDataComposite(comp, tableIndicator);
        exComp.addExpansionListener(new ExpansionAdapter() {

            @Override
            public void expansionStateChanged(ExpansionEvent e) {
                form.reflow(true);
            }
        });
    }
    resultSection.setClient(sectionClient);
}
Also used : AnalysisTableTreeViewer(org.talend.dataprofiler.core.ui.editor.composite.AnalysisTableTreeViewer) GridLayout(org.eclipse.swt.layout.GridLayout) TableIndicator(org.talend.dataprofiler.core.model.TableIndicator) AbstractPagePart(org.talend.dataprofiler.core.ui.editor.composite.AbstractPagePart) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) 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 2 with AnalysisTableTreeViewer

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

the class BusinessRuleAnalysisDetailsPage method createAnalysisTablesSection.

void createAnalysisTablesSection(final ScrolledForm form1, Composite anasisDataComp) {
    analysisTableSection = createSection(form1, anasisDataComp, DefaultMessagesImpl.getString("TableMasterDetailsPage.analyzeTable"), // $NON-NLS-1$
    null);
    Composite topComp1 = toolkit.createComposite(analysisTableSection);
    topComp1.setLayout(new GridLayout());
    // ~ MOD mzhao 2009-05-05,Bug 6587.
    createConnBindWidget(topComp1);
    // ~
    Composite actionBarComp = toolkit.createComposite(topComp1);
    GridLayout gdLayout = new GridLayout();
    gdLayout.numColumns = 3;
    actionBarComp.setLayout(gdLayout);
    ImageHyperlink collapseAllImageLink = toolkit.createImageHyperlink(actionBarComp, SWT.NONE);
    // $NON-NLS-1$
    collapseAllImageLink.setToolTipText(DefaultMessagesImpl.getString("TableMasterDetailsPage.collapseAllTables"));
    WorkbenchUtils.setHyperlinkImage(collapseAllImageLink, ImageLib.getImage(ImageLib.COLLAPSE_ALL));
    collapseAllImageLink.addHyperlinkListener(new HyperlinkAdapter() {

        @Override
        public void linkActivated(HyperlinkEvent e) {
            TreeItem[] items = treeViewer.getTree().getItems();
            expandTreeItems(items, false);
            packOtherColumns();
        }
    });
    ImageHyperlink expandAllImageLink = toolkit.createImageHyperlink(actionBarComp, SWT.NONE);
    // $NON-NLS-1$
    expandAllImageLink.setToolTipText(DefaultMessagesImpl.getString("TableMasterDetailsPage.expandAllTables"));
    WorkbenchUtils.setHyperlinkImage(expandAllImageLink, ImageLib.getImage(ImageLib.EXPAND_ALL));
    expandAllImageLink.addHyperlinkListener(new HyperlinkAdapter() {

        @Override
        public void linkActivated(HyperlinkEvent e) {
            TreeItem[] items = treeViewer.getTree().getItems();
            expandTreeItems(items, true);
            packOtherColumns();
        }
    });
    Button clmnBtn = // $NON-NLS-1$
    toolkit.createButton(// $NON-NLS-1$
    actionBarComp, // $NON-NLS-1$
    DefaultMessagesImpl.getString("TableMasterDetailsPage.selectTable"), SWT.NONE);
    clmnBtn.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseDown(MouseEvent e) {
            openTableSelectionDialog();
        }
    });
    Composite treeComp = toolkit.createComposite(topComp1, SWT.NONE);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(treeComp);
    treeComp.setLayout(new GridLayout());
    ((GridData) treeComp.getLayoutData()).heightHint = TREE_MAX_LENGTH;
    treeComp.setBackgroundMode(SWT.INHERIT_DEFAULT);
    treeViewer = new AnalysisTableTreeViewer(treeComp, this);
    treeViewer.setDirty(false);
    treeViewer.addPropertyChangeListener(this);
    analysisTableSection.setClient(topComp1);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) AnalysisTableTreeViewer(org.talend.dataprofiler.core.ui.editor.composite.AnalysisTableTreeViewer) HyperlinkEvent(org.eclipse.ui.forms.events.HyperlinkEvent) MouseEvent(org.eclipse.swt.events.MouseEvent) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ImageHyperlink(org.eclipse.ui.forms.widgets.ImageHyperlink) Button(org.eclipse.swt.widgets.Button) MouseAdapter(org.eclipse.swt.events.MouseAdapter) HyperlinkAdapter(org.eclipse.ui.forms.events.HyperlinkAdapter)

Aggregations

GridLayout (org.eclipse.swt.layout.GridLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)2 AnalysisTableTreeViewer (org.talend.dataprofiler.core.ui.editor.composite.AnalysisTableTreeViewer)2 MouseAdapter (org.eclipse.swt.events.MouseAdapter)1 MouseEvent (org.eclipse.swt.events.MouseEvent)1 GridData (org.eclipse.swt.layout.GridData)1 Button (org.eclipse.swt.widgets.Button)1 ExpansionAdapter (org.eclipse.ui.forms.events.ExpansionAdapter)1 ExpansionEvent (org.eclipse.ui.forms.events.ExpansionEvent)1 HyperlinkAdapter (org.eclipse.ui.forms.events.HyperlinkAdapter)1 HyperlinkEvent (org.eclipse.ui.forms.events.HyperlinkEvent)1 ImageHyperlink (org.eclipse.ui.forms.widgets.ImageHyperlink)1 TableIndicator (org.talend.dataprofiler.core.model.TableIndicator)1 AbstractPagePart (org.talend.dataprofiler.core.ui.editor.composite.AbstractPagePart)1