當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。