Search in sources :

Example 1 with DQFolderFilter

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

the class AnalysisDPSelectionPage method createControl.

public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    container.setLayout(layout);
    Label nameLabel = new Label(container, SWT.NONE);
    nameLabel.setText(nameLabTxt);
    createMetaDataTree(container);
    setControl(container);
    addFilters(new EMFObjFilter(), new DQFolderFilter(true), new TDQEEConnectionFolderFilter(), new RecycleBinFilter(), new HadoopCLusterFolderNodeFilter());
    addListeners();
}
Also used : TDQEEConnectionFolderFilter(org.talend.dataprofiler.core.ui.filters.TDQEEConnectionFolderFilter) GridLayout(org.eclipse.swt.layout.GridLayout) EMFObjFilter(org.talend.dataprofiler.core.ui.filters.EMFObjFilter) Composite(org.eclipse.swt.widgets.Composite) HadoopCLusterFolderNodeFilter(org.talend.dataprofiler.core.ui.filters.HadoopCLusterFolderNodeFilter) Label(org.eclipse.swt.widgets.Label) RecycleBinFilter(org.talend.dataprofiler.core.ui.filters.RecycleBinFilter) DQFolderFilter(org.talend.dataprofiler.core.ui.filters.DQFolderFilter)

Example 2 with DQFolderFilter

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

the class CreateSqlFileWizardPage method openFolderSelectionDialog.

protected void openFolderSelectionDialog(IFolder inputFolder) {
    assert inputFolder != null;
    FolderSelectionDialog dialog = new FolderSelectionDialog(getShell());
    // $NON-NLS-1$
    dialog.setTitle(DefaultMessagesImpl.getString("MetadataWizardPage.selectFolder"));
    // $NON-NLS-1$
    dialog.setMessage(DefaultMessagesImpl.getString("MetadataWizardPage.selectFolderItem"));
    dialog.setInput(inputFolder);
    dialog.addFilter(new DQFolderFilter());
    dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
    if (dialog.open() == Window.OK) {
        if (dialog.getResult() == null || dialog.getResult().length == 0) {
            return;
        }
        Object elements = dialog.getResult()[0];
        IResource elem = (IResource) elements;
        if (elem instanceof IFolder) {
            pathText.setText(elem.getFullPath().toString());
            parameter.getFolderProvider().setFolderResource((IFolder) elem);
        }
    }
}
Also used : ResourceComparator(org.eclipse.ui.views.navigator.ResourceComparator) FolderSelectionDialog(org.talend.dataprofiler.core.ui.dialog.FolderSelectionDialog) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) DQFolderFilter(org.talend.dataprofiler.core.ui.filters.DQFolderFilter) IResource(org.eclipse.core.resources.IResource) IFolder(org.eclipse.core.resources.IFolder)

Example 3 with DQFolderFilter

use of org.talend.dataprofiler.core.ui.filters.DQFolderFilter 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)

Example 4 with DQFolderFilter

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

the class DQRuleSelectPage method createControl.

public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    FillLayout layout = new FillLayout();
    container.setLayout(layout);
    cViewer = new ContainerCheckedTreeViewer(container, SWT.NONE);
    cViewer.setLabelProvider(new DQRuleLabelProvider());
    cViewer.setContentProvider(new WorkbenchContentProvider());
    cViewer.setInput(ResourceManager.getLibrariesFolder());
    // ADD mzhao bug TDQ-4188 hide the .svn folders.
    cViewer.addFilter(new DQFolderFilter(true));
    cViewer.addFilter(new RuleFolderFliter(true));
    cViewer.addFilter(AnalysisUtils.createRuleFilter());
    setControl(container);
}
Also used : RuleFolderFliter(org.talend.dataprofiler.core.ui.filters.RuleFolderFliter) Composite(org.eclipse.swt.widgets.Composite) ContainerCheckedTreeViewer(org.eclipse.ui.dialogs.ContainerCheckedTreeViewer) FillLayout(org.eclipse.swt.layout.FillLayout) WorkbenchContentProvider(org.eclipse.ui.model.WorkbenchContentProvider) DQFolderFilter(org.talend.dataprofiler.core.ui.filters.DQFolderFilter)

Example 5 with DQFolderFilter

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

the class MetadataWizardPage method openFolderSelectionDialog.

/**
 * DOC bZhou Comment method "openFolderSelectionDialog".
 *
 * @param inputFolder
 */
protected void openFolderSelectionDialog(IFolder inputFolder) {
    FolderSelectionDialog dialog = new FolderSelectionDialog(getShell());
    // $NON-NLS-1$
    dialog.setTitle(DefaultMessagesImpl.getString("MetadataWizardPage.selectFolder"));
    // $NON-NLS-1$
    dialog.setMessage(DefaultMessagesImpl.getString("MetadataWizardPage.selectFolderItem"));
    dialog.setInput(inputFolder);
    dialog.addFilter(new DQFolderFilter());
    if (dialog.open() == Window.OK) {
        if (dialog.getResult() == null || dialog.getResult().length == 0) {
            return;
        }
        Object elements = dialog.getResult()[0];
        IResource elem = (IResource) elements;
        if (elem instanceof IFolder) {
            pathText.setText(elem.getFullPath().toString());
            getParameter().getFolderProvider().setFolderResource((IFolder) elem);
        }
    }
}
Also used : FolderSelectionDialog(org.talend.dataprofiler.core.ui.dialog.FolderSelectionDialog) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) DQFolderFilter(org.talend.dataprofiler.core.ui.filters.DQFolderFilter) IResource(org.eclipse.core.resources.IResource) IFolder(org.eclipse.core.resources.IFolder)

Aggregations

DQFolderFilter (org.talend.dataprofiler.core.ui.filters.DQFolderFilter)6 Composite (org.eclipse.swt.widgets.Composite)3 IFolder (org.eclipse.core.resources.IFolder)2 IResource (org.eclipse.core.resources.IResource)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Label (org.eclipse.swt.widgets.Label)2 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)2 FolderSelectionDialog (org.talend.dataprofiler.core.ui.dialog.FolderSelectionDialog)2 EMFObjFilter (org.talend.dataprofiler.core.ui.filters.EMFObjFilter)2 HadoopCLusterFolderNodeFilter (org.talend.dataprofiler.core.ui.filters.HadoopCLusterFolderNodeFilter)2 TDQEEConnectionFolderFilter (org.talend.dataprofiler.core.ui.filters.TDQEEConnectionFolderFilter)2 MultiValueMap (org.apache.commons.collections.map.MultiValueMap)1 CoreException (org.eclipse.core.runtime.CoreException)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 FillLayout (org.eclipse.swt.layout.FillLayout)1 GridData (org.eclipse.swt.layout.GridData)1 Button (org.eclipse.swt.widgets.Button)1 DirectoryDialog (org.eclipse.swt.widgets.DirectoryDialog)1 FileDialog (org.eclipse.swt.widgets.FileDialog)1