当前位置: 首页>>代码示例>>Java>>正文


Java IViewerObservable类代码示例

本文整理汇总了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;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:36,代码来源:BackgroundControlDecorationSupport.java

示例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();
}
 
开发者ID:fabric8io,项目名称:data-mapper,代码行数:15,代码来源:SWTValueUpdater.java

示例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;
}
 
开发者ID:gulliverrr,项目名称:hestia-engine-dev,代码行数:28,代码来源:ControlDecorationSupport.java


注:本文中的org.eclipse.jface.databinding.viewers.IViewerObservable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。