use of org.eclipse.jface.wizard.IWizardNode in project bndtools by bndtools.
the class RunExportSelectionPage method createControl.
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NONE);
setControl(container);
container.setLayout(new GridLayout(1, false));
table = new Table(container, SWT.BORDER | SWT.FULL_SELECTION | SWT.SINGLE);
table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
viewer = new TableViewer(table);
viewer.setContentProvider(ArrayContentProvider.getInstance());
viewer.setLabelProvider(new ConfigElementLabelProvider(table.getDisplay(), null));
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
ISelection sel = viewer.getSelection();
if (sel.isEmpty())
setSelectedNode(null);
else {
IConfigurationElement elem = (IConfigurationElement) ((IStructuredSelection) sel).getFirstElement();
IWizardNode node = nodeCache.get(elem);
if (node == null) {
node = new RunExportWizardNode(getShell(), elem, model, bndProject);
nodeCache.put(elem, node);
}
setSelectedNode(node);
}
}
});
viewer.addOpenListener(new IOpenListener() {
public void open(OpenEvent event) {
IWizardPage nextPage = getNextPage();
if (nextPage != null)
getContainer().showPage(nextPage);
}
});
viewer.setInput(elements);
}
Aggregations