use of org.eclipse.jface.viewers.DoubleClickEvent in project tdi-studio-se by Talend.
the class TalendExportPage method createTreeViewer.
protected Composite createTreeViewer(Composite parent) {
IWizardCategory root = WorkbenchPlugin.getDefault().getExportWizardRegistry().getRootCategory();
// exportTree = new TalendCategorizedWizardSelectionTree(root,
// WorkbenchMessages.ExportWizard_selectDestination);
exportTree = new TalendCategorizedWizardSelectionTree(root, //$NON-NLS-1$
Messages.getString("WorkbenchMessages.ExportWizard_selectDestination"));
Composite exportComp = exportTree.createControl(parent);
exportTree.getViewer().addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
listSelectionChanged(event.getSelection());
}
});
exportTree.getViewer().addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
treeDoubleClicked(event);
}
});
setTreeViewer(exportTree.getViewer());
return exportComp;
}
use of org.eclipse.jface.viewers.DoubleClickEvent in project tdi-studio-se by Talend.
the class ExtendedNodeReviewDialog method createDialogArea.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
//$NON-NLS-1$
TimeMeasure.step(RepositoryReviewDialog.class.getSimpleName(), "before createDialogArea...");
GridData data = (GridData) container.getLayoutData();
data.minimumHeight = 400;
data.heightHint = 400;
data.minimumWidth = 500;
data.widthHint = 500;
container.setLayoutData(data);
textFilter = new ViewerTextFilter();
createFilterField(container);
treeViewer = provider.createViewer(container);
treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
getButton(IDialogConstants.OK_ID).setEnabled(isValidSelection(event));
}
});
treeViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
if (getButton(IDialogConstants.OK_ID).isEnabled()) {
okPressed();
}
}
});
treeViewer.addFilter(textFilter);
treeViewer.addFilter(new ViewerFilter() {
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
return filterByType(viewer, parentElement, element);
}
});
return container;
}
use of org.eclipse.jface.viewers.DoubleClickEvent in project bndtools by bndtools.
the class PackageListWizardPage method createControl.
@SuppressWarnings("unused")
public void createControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
setControl(composite);
composite.setLayout(new GridLayout(3, false));
Label lblAvailablePackages = new Label(composite, SWT.NONE);
lblAvailablePackages.setText("Available Packages:");
new Label(composite, SWT.NONE);
Label lblSelectedPackages = new Label(composite, SWT.NONE);
lblSelectedPackages.setText("Selected Packages:");
tblAvailable = new Table(composite, SWT.BORDER | SWT.FULL_SELECTION);
tblAvailable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
availableViewer = new TableViewer(tblAvailable);
availableViewer.setContentProvider(ArrayContentProvider.getInstance());
availableViewer.setLabelProvider(new PackageNameLabelProvider());
availableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
updateUI();
}
});
availableViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
doAddSelection();
}
});
Composite composite_1 = new Composite(composite, SWT.NONE);
GridLayout gl_composite_1 = new GridLayout(1, false);
gl_composite_1.marginWidth = 0;
gl_composite_1.marginHeight = 0;
composite_1.setLayout(gl_composite_1);
btnAdd = new Button(composite_1, SWT.NONE);
btnAdd.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
btnAdd.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
doAddSelection();
}
});
btnAdd.setText("Add ->");
btnAdd.setEnabled(false);
btnAddAll = new Button(composite_1, SWT.NONE);
btnAddAll.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
btnAddAll.setText("Add All ->");
btnAddAll.setEnabled(false);
btnAddAll.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
doAddAll();
}
});
btnRemove = new Button(composite_1, SWT.NONE);
btnRemove.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
btnRemove.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
doRemoveSelection();
}
});
btnRemove.setText("<- Remove");
btnRemove.setEnabled(false);
btnRemoveAll = new Button(composite_1, SWT.NONE);
btnRemoveAll.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
btnRemoveAll.setText("<- Remove All");
btnRemoveAll.setEnabled(false);
btnRemoveAll.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
doRemoveAll();
}
});
tblSelected = new Table(composite, SWT.BORDER | SWT.FULL_SELECTION);
tblSelected.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
selectedViewer = new TableViewer(tblSelected);
selectedViewer.setContentProvider(ArrayContentProvider.getInstance());
selectedViewer.setLabelProvider(new PackageNameLabelProvider());
selectedViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
updateUI();
}
});
selectedViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
doRemoveSelection();
}
});
Composite composite_2 = new Composite(composite, SWT.NONE);
composite_2.setLayout(new GridLayout(2, false));
composite_2.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
Label lblNewLabel = new Label(composite_2, SWT.NONE);
lblNewLabel.setText("Project Name:");
txtProjectName = new Text(composite_2, SWT.BORDER);
txtProjectName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
txtProjectName.setText(projectName != null ? projectName : "");
txtProjectName.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
if (!programmaticChange) {
try {
uiChange = true;
setProjectName(txtProjectName.getText());
} finally {
uiChange = false;
}
}
}
});
}
use of org.eclipse.jface.viewers.DoubleClickEvent in project bndtools by bndtools.
the class PluginClassSelectionPage method createControl.
public void createControl(Composite parent) {
setTitle("Plug-in Type");
setDescription("Select from one of the following known plug-in types.");
// Create controls
Composite composite = new Composite(parent, SWT.NONE);
table = new Table(composite, SWT.FULL_SELECTION | SWT.BORDER);
viewer = new TableViewer(table);
viewer.setContentProvider(ArrayContentProvider.getInstance());
viewer.setSorter(new PluginClassSorter());
viewer.setLabelProvider(new PluginDeclarationLabelProvider());
// txtDescription = new ScrolledFormText(composite, true);
// Load data
IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(Plugin.PLUGIN_ID, "bndPlugins");
viewer.setInput(elements);
// Listeners
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
if (!programmaticChange) {
try {
programmaticChange = true;
IStructuredSelection sel = (IStructuredSelection) viewer.getSelection();
setSelectedElement((IConfigurationElement) sel.getFirstElement());
} finally {
programmaticChange = false;
}
}
}
});
viewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
getContainer().showPage(getNextPage());
}
});
// Layout
GridLayout layout;
GridData gd;
layout = new GridLayout(1, false);
composite.setLayout(layout);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
table.setLayoutData(gd);
gd = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
gd.heightHint = 150;
// txtDescription.setLayoutData(gd);
setControl(composite);
}
Aggregations