*/
public void createControl(Composite parent) {
Composite comp = new Composite(parent, SWT.NONE);
comp.setLayout(new FillLayout());
DataSourceSelectionState state = (DataSourceSelectionState) getState();
List<UDIGConnectionFactoryDescriptor> descriptorList;
if (state.getShortlist() != null) {
descriptorList = state.getShortlist();
}
else {
descriptorList = getDescriptors();
}
viewer = new WizardViewer(comp, SWT.SINGLE | SWT.BORDER);
viewer.setInput(descriptorList.toArray());
viewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
IWizardContainer container = getContainer();
if (container instanceof Dialog) {
Dialog d = (Dialog) container;
Button button = findButton(d.buttonBar,
IDialogConstants.NEXT_ID);
if (button != null)
button.notifyListeners(SWT.Selection, new Event());
}
}
});
viewer.addSelectionChangedListener(this);
// check the state for an initial selection
if (state.getDescriptor() != null){
viewer.setSelection(new StructuredSelection(state.getDescriptor()));
}
setControl(comp);
}