ObservableMap binding to a Combo [message #902939] |
Tue, 21 August 2012 06:32  |
Eclipse User |
|
|
|
Hi,
I would like to bind an ObservableMap to a Combo. I currently have code which binds an ObservableSet:
WritableSet selectedSet = new WritableSet(SWTObservables.getRealm(RedMobileControl.getDisplay()));
ComboViewer selectedViewer = new ComboViewer(this, SWT.READ_ONLY | SWT.DROP_DOWN);
selectedViewer.setContentProvider(new ObservableSetContentProvider());
selectedViewer.setInput(selectedSet);
selectedViewer.setLabelProvider(new LabelProvider(){
@Override public String getText(Object element) {
//Some irrelevant code here.
}
});
The problem is that I would like the set to have a nice fast lookup key for use elsewhere in the application (I don't care whether I have access to the key in the LabelProvider for example) and there is no ObservableMapContentProvider. Any ideas how I can achieve this binding?
Many thanks,
Dan.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05894 seconds