Label label = new Label(parent, SWT.LEFT);
label.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
label.setText("Area of Interest: ");
// get the current strategy
IAOIService aOIService = PlatformGIS.getAOIService();
listenService(true);
// eclipse combo viewer
comboViewer = new ComboViewer(parent, SWT.READ_ONLY);
comboViewer.setContentProvider(new ArrayContentProvider());
comboViewer.setLabelProvider(new LabelProvider(){
@Override
public String getText( Object element ) {
if (element instanceof IAOIStrategy) {
IAOIStrategy comboStrategy = (IAOIStrategy) element;
return comboStrategy.getName();
}
return super.getText(element);
}
});
comboViewer.setInput(aOIService.getProxyList());
// set the current strategy
AOIProxy proxy = aOIService.getProxy();
if (proxy == null) {
proxy = aOIService.getDefault();
}
comboViewer.setSelection(new StructuredSelection(proxy));
// now that we are configured we can start to listen!
listenCombo(true);