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