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();
}
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);
}
}
}
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);
}
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);
}
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);
}
}
}
Aggregations