Search in sources :

Example 1 with FolderSelectionDialog

use of org.talend.dataprofiler.core.ui.dialog.FolderSelectionDialog 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 2 with FolderSelectionDialog

use of org.talend.dataprofiler.core.ui.dialog.FolderSelectionDialog 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

IFolder (org.eclipse.core.resources.IFolder)2 IResource (org.eclipse.core.resources.IResource)2 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)2 FolderSelectionDialog (org.talend.dataprofiler.core.ui.dialog.FolderSelectionDialog)2 DQFolderFilter (org.talend.dataprofiler.core.ui.filters.DQFolderFilter)2 ResourceComparator (org.eclipse.ui.views.navigator.ResourceComparator)1