Search in sources :

Example 1 with FunctionalDependencyAnalysisDetailsPage

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

the class AnalysisColumnCompareTreeViewer method createAnalyzedColumnSetsSection.

private void createAnalyzedColumnSetsSection(String mainTitle, String description) {
    columnsComparisonSection = masterPage.createSection(form, parentComp, mainTitle, description);
    Composite sectionClient = toolkit.createComposite(columnsComparisonSection);
    sectionClient.setLayout(new GridLayout());
    if (showCheckButton) {
        checkComputeButton = new Button(sectionClient, SWT.CHECK);
        GridData layoutData = new GridData(GridData.FILL_BOTH);
        layoutData.horizontalAlignment = SWT.CENTER;
        checkComputeButton.setLayoutData(layoutData);
        // $NON-NLS-1$
        checkComputeButton.setText(DefaultMessagesImpl.getString("ColumnsComparisonMasterDetailsPage.Compute"));
        // $NON-NLS-1$
        checkComputeButton.setToolTipText(DefaultMessagesImpl.getString("ColumnsComparisonMasterDetailsPage.WhenUnchecked"));
        checkComputeButton.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                masterPage.setDirty(true);
            }
        });
        checkComputeButton.setSelection(checkComputButton);
    }
    Composite columnComp = toolkit.createComposite(sectionClient);
    columnComp.setLayoutData(new GridData(GridData.FILL_BOTH));
    columnComp.setLayout(new GridLayout());
    Composite compareToplevelComp = toolkit.createComposite(columnComp);
    GridLayout compareToplevelLayout = new GridLayout();
    compareToplevelLayout.numColumns = 2;
    compareToplevelComp.setLayout(compareToplevelLayout);
    // ColumnSet comparison analysis.s
    if (masterPage instanceof FunctionalDependencyAnalysisDetailsPage) {
        // $NON-NLS-1$
        columnReverseButtion = toolkit.createButton(compareToplevelComp, "Reverse columns", SWT.NONE);
        columnReverseButtion.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseDown(MouseEvent e) {
                handleColumnReverseAction();
            }
        });
        columnReverseButtion.addKeyListener(new KeyAdapter() {

            @Override
            public void keyPressed(KeyEvent e) {
                if (e.keyCode == 13) {
                    handleColumnReverseAction();
                }
            }
        });
        masterPage.createRunButton(compareToplevelComp);
    } else {
        masterPage.createConnBindWidget(compareToplevelComp);
    }
    // ~
    SashForm sashForm = new SashForm(sectionClient, SWT.NULL);
    sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
    // $NON-NLS-1$
    String leftSelectButtonText = DefaultMessagesImpl.getString("ColumnsComparisonMasterDetailsPage.selectColumnsForASet");
    // $NON-NLS-1$
    String rightSelectButtonText = DefaultMessagesImpl.getString("ColumnsComparisonMasterDetailsPage.selectColumnsForBSet");
    String leftSelectButtonTooltip;
    String rightSelectButtonTooltip;
    if (masterPage instanceof FunctionalDependencyAnalysisDetailsPage) {
        // $NON-NLS-1$
        leftSelectButtonTooltip = DefaultMessagesImpl.getString("AnalysisColumnCompareTreeViewer.DeterminantCol");
        // $NON-NLS-1$
        rightSelectButtonTooltip = DefaultMessagesImpl.getString("AnalysisColumnCompareTreeViewer.DependentCol");
    } else {
        leftSelectButtonTooltip = DefaultMessagesImpl.getString(// $NON-NLS-1$
        "AnalysisColumnCompareTreeViewer.selectColumnsForASetTooltip");
        rightSelectButtonTooltip = DefaultMessagesImpl.getString(// $NON-NLS-1$
        "AnalysisColumnCompareTreeViewer.selectColumnsForBSetTooltip");
    }
    Composite leftComp = toolkit.createComposite(sashForm);
    leftComp.setLayoutData(new GridData(GridData.FILL_BOTH));
    leftComp.setLayout(new GridLayout());
    // $NON-NLS-1$
    String leftSectionTitle = DefaultMessagesImpl.getString("ColumnsComparisonMasterDetailsPage.leftColumns");
    leftTableViewer = this.createSectionPart(leftComp, columnListA, leftSectionTitle, leftSelectButtonText, leftSelectButtonTooltip, true);
    Composite rightComp = toolkit.createComposite(sashForm);
    rightComp.setLayoutData(new GridData(GridData.FILL_BOTH));
    rightComp.setLayout(new GridLayout());
    // $NON-NLS-1$
    String rightSectionTitle = DefaultMessagesImpl.getString("ColumnsComparisonMasterDetailsPage.rightColumns");
    rightTableViewer = this.createSectionPart(rightComp, columnListB, rightSectionTitle, rightSelectButtonText, rightSelectButtonTooltip, false);
    // MOD mzhao 2009-05-05 bug:6587.
    updateBindConnection(masterPage, tableViewerPosStack);
    columnsComparisonSection.setClient(sectionClient);
}
Also used : MouseEvent(org.eclipse.swt.events.MouseEvent) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) KeyAdapter(org.eclipse.swt.events.KeyAdapter) MouseAdapter(org.eclipse.swt.events.MouseAdapter) KeyEvent(org.eclipse.swt.events.KeyEvent) SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) FunctionalDependencyAnalysisDetailsPage(org.talend.dataprofiler.core.ui.editor.analysis.FunctionalDependencyAnalysisDetailsPage) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent)

Example 2 with FunctionalDependencyAnalysisDetailsPage

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

the class OpenColumnSelectorAction method run.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[],
     * org.eclipse.ui.cheatsheets.ICheatSheetManager)
     */
public void run(String[] params, ICheatSheetManager manager) {
    // ADD xqliu TDQ-4285 2011-12-27
    if (!CheatSheetActionHelper.canRun()) {
        return;
    }
    if (params == null || params.length == 0) {
        return;
    }
    Integer analysisCatigory = null;
    if (NumberUtils.isNumber(params[0])) {
        analysisCatigory = NumberUtils.toInt(params[0]);
    }
    if (analysisCatigory != null) {
        AnalysisEditor editor = (AnalysisEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
        if (editor == null) {
            return;
        }
        switch(analysisCatigory) {
            case AnalysisType.BUSINESS_RULE_VALUE:
                BusinessRuleAnalysisDetailsPage page4 = (BusinessRuleAnalysisDetailsPage) editor.getMasterPage();
                page4.openTableSelectionDialog();
                page4.doSave(null);
                break;
            case AnalysisType.TABLE_FUNCTIONAL_DEPENDENCY_VALUE:
                FunctionalDependencyAnalysisDetailsPage page3 = (FunctionalDependencyAnalysisDetailsPage) editor.getMasterPage();
                if (params[1] != null) {
                    if ("A".equalsIgnoreCase(params[1])) {
                        // $NON-NLS-1$
                        page3.openColumnsSetASelectionDialog();
                    } else {
                        page3.openColumnsSetBSelectionDialog();
                    }
                }
                // page3.doSave(null);
                break;
            case AnalysisType.COLUMN_SET_VALUE:
                ColumnSetAnalysisDetailsPage page0 = (ColumnSetAnalysisDetailsPage) editor.getMasterPage();
                page0.openColumnsSelectionDialog();
                page0.doSave(null);
                break;
            case AnalysisType.MULTIPLE_COLUMN_VALUE:
                ColumnAnalysisDetailsPage page = (ColumnAnalysisDetailsPage) editor.getMasterPage();
                page.openColumnsSelectionDialog();
                page.doSave(null);
                break;
            case AnalysisType.COLUMNS_COMPARISON_VALUE:
                RedundancyAnalysisDetailsPage page1 = (RedundancyAnalysisDetailsPage) editor.getMasterPage();
                if (params[1] != null) {
                    if (NumberUtils.isNumber(params[1])) {
                        int pos = NumberUtils.toInt(params[1]);
                        if (pos == 0) {
                            page1.openColumnsSetASelectionDialog();
                        } else {
                            page1.openColumnsSetBSelectionDialog();
                        }
                    }
                }
                // page1.doSave(null);
                break;
            case AnalysisType.COLUMN_CORRELATION_VALUE:
                CorrelationAnalysisDetailsPage page2 = (CorrelationAnalysisDetailsPage) editor.getMasterPage();
                page2.openColumnsSelectionDialog();
                page2.doSave(null);
                break;
            default:
                break;
        }
    }
}
Also used : RedundancyAnalysisDetailsPage(org.talend.dataprofiler.core.ui.editor.analysis.RedundancyAnalysisDetailsPage) ColumnSetAnalysisDetailsPage(org.talend.dataprofiler.core.ui.editor.analysis.ColumnSetAnalysisDetailsPage) FunctionalDependencyAnalysisDetailsPage(org.talend.dataprofiler.core.ui.editor.analysis.FunctionalDependencyAnalysisDetailsPage) CorrelationAnalysisDetailsPage(org.talend.dataprofiler.core.ui.editor.analysis.CorrelationAnalysisDetailsPage) AnalysisEditor(org.talend.dataprofiler.core.ui.editor.analysis.AnalysisEditor) BusinessRuleAnalysisDetailsPage(org.talend.dataprofiler.core.ui.editor.analysis.BusinessRuleAnalysisDetailsPage) ColumnAnalysisDetailsPage(org.talend.dataprofiler.core.ui.editor.analysis.ColumnAnalysisDetailsPage)

Aggregations

FunctionalDependencyAnalysisDetailsPage (org.talend.dataprofiler.core.ui.editor.analysis.FunctionalDependencyAnalysisDetailsPage)2 SashForm (org.eclipse.swt.custom.SashForm)1 KeyAdapter (org.eclipse.swt.events.KeyAdapter)1 KeyEvent (org.eclipse.swt.events.KeyEvent)1 MouseAdapter (org.eclipse.swt.events.MouseAdapter)1 MouseEvent (org.eclipse.swt.events.MouseEvent)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Button (org.eclipse.swt.widgets.Button)1 Composite (org.eclipse.swt.widgets.Composite)1 AnalysisEditor (org.talend.dataprofiler.core.ui.editor.analysis.AnalysisEditor)1 BusinessRuleAnalysisDetailsPage (org.talend.dataprofiler.core.ui.editor.analysis.BusinessRuleAnalysisDetailsPage)1 ColumnAnalysisDetailsPage (org.talend.dataprofiler.core.ui.editor.analysis.ColumnAnalysisDetailsPage)1 ColumnSetAnalysisDetailsPage (org.talend.dataprofiler.core.ui.editor.analysis.ColumnSetAnalysisDetailsPage)1 CorrelationAnalysisDetailsPage (org.talend.dataprofiler.core.ui.editor.analysis.CorrelationAnalysisDetailsPage)1 RedundancyAnalysisDetailsPage (org.talend.dataprofiler.core.ui.editor.analysis.RedundancyAnalysisDetailsPage)1