Search in sources :

Example 1 with DQCheckedTreeViewer

use of org.talend.dataprofiler.core.ui.utils.DQCheckedTreeViewer in project tdq-studio-se by Talend.

the class ExportUDIWizardPage method createControl.

public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    GridData gridData = new GridData(GridData.FILL_BOTH);
    container.setLayout(layout);
    container.setLayoutData(gridData);
    Composite fileComp = new Composite(container, SWT.NONE);
    layout = new GridLayout(3, false);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    fileComp.setLayout(layout);
    fileComp.setLayoutData(gridData);
    Label label = new Label(fileComp, SWT.NONE);
    if (isForExchange) {
        // $NON-NLS-1$
        label.setText(DefaultMessagesImpl.getString("ExportUDIWizardPage.SelectFolder"));
    } else {
        // $NON-NLS-1$
        label.setText(DefaultMessagesImpl.getString("ExportPatternsWizardPage.selectFile"));
    }
    fileText = new Text(fileComp, SWT.BORDER);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    fileText.setLayoutData(gridData);
    fileText.setEditable(false);
    Button button = new Button(fileComp, SWT.PUSH);
    // $NON-NLS-1$
    button.setText(DefaultMessagesImpl.getString("ExportUDIWizardPage.browse"));
    button.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            // $NON-NLS-1$
            String path = "";
            if (isForExchange) {
                DirectoryDialog dialog = new DirectoryDialog(Display.getDefault().getActiveShell());
                if (fileText.getText() != null) {
                    dialog.setFilterPath(fileText.getText());
                }
                path = dialog.open();
            } else {
                FileDialog dialog = new FileDialog(Display.getDefault().getActiveShell());
                // $NON-NLS-1$
                dialog.setFilterExtensions(new String[] { "*.csv" });
                if (fileText.getText() != null) {
                    dialog.setFileName(fileText.getText());
                }
                path = dialog.open();
                if (path != null && !path.endsWith(".csv")) {
                    // $NON-NLS-1$
                    // $NON-NLS-1$
                    path = path + ".csv";
                }
            }
            if (path != null) {
                fileText.setText(path);
            }
        }
    });
    Group group = new Group(container, SWT.NONE);
    // $NON-NLS-1$
    group.setText(DefaultMessagesImpl.getString("ExportUDIWizardPage.selectIndicators"));
    group.setLayout(new GridLayout());
    group.setLayoutData(new GridData(GridData.FILL_BOTH));
    selectedTree = new DQCheckedTreeViewer(group);
    selectedTree.setInput(RepositoryNodeHelper.getLibrariesFolderNode(EResourceConstant.USER_DEFINED_INDICATORS));
    selectedTree.setWizardPage(this);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(selectedTree.getTree());
    selectedTree.setCheckedElements(udiFolder.getChildren().toArray());
    // FIXME buttonComposite never used.
    Control buttonComposite = createSelectionButtons(container);
    Composite monitorComp = new Composite(container, SWT.NONE);
    monitorComp.setLayout(new GridLayout());
    monitorComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    ProgressBar bar = new ProgressBar(monitorComp, SWT.NONE);
    bar.setLayoutData(new GridData(GridData.FILL_BOTH));
    bar.setVisible(false);
    setControl(container);
}
Also used : Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) GridLayout(org.eclipse.swt.layout.GridLayout) Control(org.eclipse.swt.widgets.Control) DQCheckedTreeViewer(org.talend.dataprofiler.core.ui.utils.DQCheckedTreeViewer) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FileDialog(org.eclipse.swt.widgets.FileDialog) ProgressBar(org.eclipse.swt.widgets.ProgressBar) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog)

Example 2 with DQCheckedTreeViewer

use of org.talend.dataprofiler.core.ui.utils.DQCheckedTreeViewer in project tdq-studio-se by Talend.

the class ExportParserRuleWizardPage method createControl.

public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    GridData gridData = new GridData(GridData.FILL_BOTH);
    container.setLayout(layout);
    container.setLayoutData(gridData);
    Composite fileComp = new Composite(container, SWT.NONE);
    layout = new GridLayout(3, false);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    fileComp.setLayout(layout);
    fileComp.setLayoutData(gridData);
    Label label = new Label(fileComp, SWT.NONE);
    // $NON-NLS-1$
    label.setText(DefaultMessagesImpl.getString("ExportParserRuleWizardPage.SelectFolder"));
    fileText = new Text(fileComp, SWT.BORDER);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    fileText.setLayoutData(gridData);
    fileText.setEditable(false);
    Button button = new Button(fileComp, SWT.PUSH);
    // $NON-NLS-1$
    button.setText(DefaultMessagesImpl.getString("ExportParserRuleWizardPage.browse"));
    button.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            // $NON-NLS-1$
            String path = "";
            DirectoryDialog dialog = new DirectoryDialog(Display.getDefault().getActiveShell());
            if (fileText.getText() != null) {
                dialog.setFilterPath(fileText.getText());
            }
            path = dialog.open();
            if (path != null) {
                fileText.setText(path);
            }
        }
    });
    Group group = new Group(container, SWT.NONE);
    // $NON-NLS-1$
    group.setText(DefaultMessagesImpl.getString("ExportParserRuleWizardPage.selectParserRules"));
    group.setLayout(new GridLayout());
    group.setLayoutData(new GridData(GridData.FILL_BOTH));
    selectedTree = new DQCheckedTreeViewer(group);
    selectedTree.setInput(parserRuleFolder);
    selectedTree.setWizardPage(this);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(selectedTree.getTree());
    selectedTree.setCheckedElements(parserRuleFolder.getChildren().toArray());
    Composite monitorComp = new Composite(container, SWT.NONE);
    monitorComp.setLayout(new GridLayout());
    monitorComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    ProgressBar bar = new ProgressBar(monitorComp, SWT.NONE);
    bar.setLayoutData(new GridData(GridData.FILL_BOTH));
    bar.setVisible(false);
    setControl(container);
}
Also used : Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) GridLayout(org.eclipse.swt.layout.GridLayout) DQCheckedTreeViewer(org.talend.dataprofiler.core.ui.utils.DQCheckedTreeViewer) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ProgressBar(org.eclipse.swt.widgets.ProgressBar) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog)

Example 3 with DQCheckedTreeViewer

use of org.talend.dataprofiler.core.ui.utils.DQCheckedTreeViewer in project tdq-studio-se by Talend.

the class ExportPatternsWizardPage method createControl.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
     */
public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    GridData gridData = new GridData(GridData.FILL_BOTH);
    container.setLayout(layout);
    container.setLayoutData(gridData);
    Composite fileComp = new Composite(container, SWT.NONE);
    layout = new GridLayout(3, false);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    fileComp.setLayout(layout);
    fileComp.setLayoutData(gridData);
    Label label = new Label(fileComp, SWT.NONE);
    if (isForExchange) {
        // $NON-NLS-1$
        label.setText(DefaultMessagesImpl.getString("ExportPatternsWizardPage.SelectFolder"));
    } else {
        // $NON-NLS-1$
        label.setText(DefaultMessagesImpl.getString("ExportPatternsWizardPage.selectFile"));
    }
    fileText = new Text(fileComp, SWT.BORDER);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    fileText.setLayoutData(gridData);
    fileText.setEditable(false);
    Button button = new Button(fileComp, SWT.PUSH);
    // $NON-NLS-1$
    button.setText(DefaultMessagesImpl.getString("ExportPatternsWizardPage.browse"));
    button.addSelectionListener(new SelectionAdapter() {

        /*
             * (non-Javadoc)
             * 
             * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
             */
        @Override
        public void widgetSelected(SelectionEvent e) {
            // $NON-NLS-1$
            String path = "";
            if (isForExchange) {
                DirectoryDialog dialog = new DirectoryDialog(Display.getDefault().getActiveShell());
                if (fileText.getText() != null) {
                    dialog.setFilterPath(fileText.getText());
                }
                path = dialog.open();
            } else {
                FileDialog dialog = new FileDialog(Display.getDefault().getActiveShell());
                // $NON-NLS-1$
                dialog.setFilterExtensions(new String[] { "*.csv" });
                if (fileText.getText() != null) {
                    dialog.setFileName(fileText.getText());
                }
                path = dialog.open();
                if (path != null && !path.endsWith(".csv")) {
                    // $NON-NLS-1$
                    // $NON-NLS-1$
                    path = path + ".csv";
                }
            }
            if (path != null) {
                fileText.setText(path);
            }
        }
    });
    Group group = new Group(container, SWT.NONE);
    // $NON-NLS-1$
    group.setText(DefaultMessagesImpl.getString("ExportPatternsWizardPage.selectPatternss"));
    group.setLayout(new GridLayout());
    group.setLayoutData(new GridData(GridData.FILL_BOTH));
    selectedPatternsTree = new DQCheckedTreeViewer(group);
    selectedPatternsTree.addFilter(new DQFolderFilter(true));
    selectedPatternsTree.setInput(this.node);
    selectedPatternsTree.setWizardPage(this);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(selectedPatternsTree.getTree());
    try {
        selectedPatternsTree.setCheckedElements(folder.members());
    } catch (CoreException e1) {
        log.error(e1, e1);
    }
    createSelectionButtons(container);
    Composite monitorComp = new Composite(container, SWT.NONE);
    monitorComp.setLayout(new GridLayout());
    monitorComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    ProgressBar bar = new ProgressBar(monitorComp, SWT.NONE);
    bar.setLayoutData(new GridData(GridData.FILL_BOTH));
    bar.setVisible(false);
    setControl(container);
}
Also used : Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) DQFolderFilter(org.talend.dataprofiler.core.ui.filters.DQFolderFilter) GridLayout(org.eclipse.swt.layout.GridLayout) DQCheckedTreeViewer(org.talend.dataprofiler.core.ui.utils.DQCheckedTreeViewer) CoreException(org.eclipse.core.runtime.CoreException) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FileDialog(org.eclipse.swt.widgets.FileDialog) ProgressBar(org.eclipse.swt.widgets.ProgressBar) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog)

Aggregations

SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)3 SelectionEvent (org.eclipse.swt.events.SelectionEvent)3 GridData (org.eclipse.swt.layout.GridData)3 GridLayout (org.eclipse.swt.layout.GridLayout)3 Button (org.eclipse.swt.widgets.Button)3 Composite (org.eclipse.swt.widgets.Composite)3 DirectoryDialog (org.eclipse.swt.widgets.DirectoryDialog)3 Group (org.eclipse.swt.widgets.Group)3 Label (org.eclipse.swt.widgets.Label)3 ProgressBar (org.eclipse.swt.widgets.ProgressBar)3 Text (org.eclipse.swt.widgets.Text)3 DQCheckedTreeViewer (org.talend.dataprofiler.core.ui.utils.DQCheckedTreeViewer)3 FileDialog (org.eclipse.swt.widgets.FileDialog)2 CoreException (org.eclipse.core.runtime.CoreException)1 Control (org.eclipse.swt.widgets.Control)1 DQFolderFilter (org.talend.dataprofiler.core.ui.filters.DQFolderFilter)1