本文整理匯總了Java中org.eclipse.jface.databinding.viewers.IViewerObservable類的典型用法代碼示例。如果您正苦於以下問題:Java IViewerObservable類的具體用法?Java IViewerObservable怎麽用?Java IViewerObservable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IViewerObservable類屬於org.eclipse.jface.databinding.viewers包,在下文中一共展示了IViewerObservable類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: findControl
import org.eclipse.jface.databinding.viewers.IViewerObservable; //導入依賴的package包/類
/**
* Find control.
*
* @param target the target
* @return the control
*/
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;
}
示例2: SWTValueUpdater
import org.eclipse.jface.databinding.viewers.IViewerObservable; //導入依賴的package包/類
private SWTValueUpdater(final org.eclipse.core.databinding.Binding binding) {
this.binding = binding;
target = binding.getTarget();
if (target instanceof ISWTObservable
&& ((ISWTObservable) binding.getTarget()).getWidget() instanceof Control) {
control = (Control) ((ISWTObservable) binding.getTarget()).getWidget();
} else if (target instanceof IViewerObservable) {
control = ((IViewerObservable) target).getViewer().getControl();
} else {
throw new IllegalArgumentException(
"target of binding must be an ISWTObservable whose widget is a Control.");
}
addListeners();
}
示例3: findControl
import org.eclipse.jface.databinding.viewers.IViewerObservable; //導入依賴的package包/類
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;
}