本文整理汇总了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;
}