use of org.eclipse.jface.databinding.swt.ISWTObservable in project eclipse.platform.ui by eclipse-platform.
the class ControlDecorationSupport method findControl.
private Control findControl(IObservable target) {
if (target instanceof ISWTObservable) {
Widget widget = ((ISWTObservable) target).getWidget();
if (widget instanceof Control)
return (Control) widget;
}
if (target instanceof IViewerObservable) {
Viewer viewer = ((IViewerObservable) target).getViewer();
return viewer.getControl();
}
if (target instanceof IDecoratingObservable) {
IObservable decorated = ((IDecoratingObservable) target).getDecorated();
Control control = findControl(decorated);
if (control != null)
return control;
}
if (target instanceof IObserving) {
Object observed = ((IObserving) target).getObserved();
if (observed instanceof IObservable)
return findControl((IObservable) observed);
}
return null;
}
Aggregations