Search in sources :

Example 1 with ConnectionWizard

use of org.talend.dataprofiler.core.ui.wizard.analysis.connection.ConnectionWizard in project tdq-studio-se by Talend.

the class CreateNewConnectionForMatchAnalysisAction method run.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[],
     * org.eclipse.ui.cheatsheets.ICheatSheetManager)
     */
public void run(String[] arg0, ICheatSheetManager arg1) {
    ConnectionWizard connectionWizard = new ConnectionWizard(PlatformUI.getWorkbench(), null);
    connectionWizard.setForcePreviousAndNextButtons(true);
    WizardDialog dialog = new WizardDialog(null, connectionWizard);
    dialog.setPageSize(500, 200);
    dialog.open();
    IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (editor instanceof MatchAnalysisEditor) {
        MatchAnalysisDetailsPage masterPage = (MatchAnalysisDetailsPage) ((MatchAnalysisEditor) editor).getMasterPage();
        if (masterPage.getAnalysisHandler() != null) {
            masterPage.openColumnsSelectionDialog(masterPage.getAnalysisHandler().getConnection());
        }
    }
}
Also used : ConnectionWizard(org.talend.dataprofiler.core.ui.wizard.analysis.connection.ConnectionWizard) IEditorPart(org.eclipse.ui.IEditorPart) WizardDialog(org.eclipse.jface.wizard.WizardDialog) MatchAnalysisDetailsPage(org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisDetailsPage) MatchAnalysisEditor(org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisEditor)

Example 2 with ConnectionWizard

use of org.talend.dataprofiler.core.ui.wizard.analysis.connection.ConnectionWizard in project tdq-studio-se by Talend.

the class MatchAnalysisDetailsPage method createDataSelectionButtonComp.

private void createDataSelectionButtonComp(Composite parent) {
    Composite dataSelectionComp = toolkit.createComposite(parent);
    GridLayout dataSelectionCompLayout = new GridLayout(3, Boolean.TRUE);
    dataSelectionComp.setLayout(dataSelectionCompLayout);
    Button createConnectionBtn = toolkit.createButton(dataSelectionComp, DefaultMessagesImpl.getString("MatchMasterDetailsPage.CreateConnectionButton"), // $NON-NLS-1$
    SWT.NONE);
    GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).applyTo(createConnectionBtn);
    Button selectDataBtn = toolkit.createButton(dataSelectionComp, DefaultMessagesImpl.getString("MatchMasterDetailsPage.SelectDataButton"), // $NON-NLS-1$
    SWT.NONE);
    GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).applyTo(selectDataBtn);
    // Button suggestBtn = toolkit.createButton(dataSelectionComp, "Suggest", SWT.NONE);//$NON-NLS-1$
    // GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).applyTo(suggestBtn);
    createConnectionBtn.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseDown(MouseEvent e) {
            ConnectionWizard connectionWizard = new ConnectionWizard(PlatformUI.getWorkbench(), dataSampleparentComposite);
            connectionWizard.setForcePreviousAndNextButtons(true);
            WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), connectionWizard);
            dialog.setPageSize(500, 200);
            dialog.open();
        }
    });
    selectDataBtn.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseDown(MouseEvent e) {
            // no need to give the current connection, the called method will find the current selected nodes auto
            openColumnsSelectionDialog(null);
        }
    });
    // suggestBtn.addMouseListener(new MouseListener() {
    // 
    // public void mouseDoubleClick(MouseEvent e) {
    // // no need to implement
    // }
    // 
    // public void mouseDown(MouseEvent e) {
    // // no need to give the current connection, the called method will find the current selected nodes auto
    // suggestConfiguration();
    // }
    // 
    // public void mouseUp(MouseEvent e) {
    // // no need to implement
    // }
    // });
    registerEvents(dataSampleparentComposite);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) MouseEvent(org.eclipse.swt.events.MouseEvent) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) Button(org.eclipse.swt.widgets.Button) ConnectionWizard(org.talend.dataprofiler.core.ui.wizard.analysis.connection.ConnectionWizard) MouseAdapter(org.eclipse.swt.events.MouseAdapter) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 3 with ConnectionWizard

use of org.talend.dataprofiler.core.ui.wizard.analysis.connection.ConnectionWizard in project tdq-studio-se by Talend.

the class AbstractAnalysisMetadataPage method createConnectionButton.

/**
 * DOC talend Comment method "createConnectionButton".
 *
 * @param dataPreviewTableCom
 */
protected void createConnectionButton(final Composite dataPreviewTableCom, final Section dataPreviewSection) {
    Button createConnectionButton = toolkit.createButton(dataPreviewTableCom, DefaultMessagesImpl.getString("ColumnMasterDetailsPage.createConnectionBtn"), // $NON-NLS-1$
    SWT.NONE);
    createConnectionButton.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseDown(MouseEvent e) {
            ConnectionWizard connectionWizard = new ConnectionWizard(PlatformUI.getWorkbench(), dataPreviewSection);
            connectionWizard.setForcePreviousAndNextButtons(true);
            WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), connectionWizard);
            dialog.setPageSize(500, 200);
            dialog.open();
        }
    });
}
Also used : MouseEvent(org.eclipse.swt.events.MouseEvent) Button(org.eclipse.swt.widgets.Button) ConnectionWizard(org.talend.dataprofiler.core.ui.wizard.analysis.connection.ConnectionWizard) MouseAdapter(org.eclipse.swt.events.MouseAdapter) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

WizardDialog (org.eclipse.jface.wizard.WizardDialog)3 ConnectionWizard (org.talend.dataprofiler.core.ui.wizard.analysis.connection.ConnectionWizard)3 MouseAdapter (org.eclipse.swt.events.MouseAdapter)2 MouseEvent (org.eclipse.swt.events.MouseEvent)2 Button (org.eclipse.swt.widgets.Button)2 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 IEditorPart (org.eclipse.ui.IEditorPart)1 MatchAnalysisDetailsPage (org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisDetailsPage)1 MatchAnalysisEditor (org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisEditor)1