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


Java StructuredViewer.getControl方法代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.StructuredViewer.getControl方法的典型用法代码示例。如果您正苦于以下问题:Java StructuredViewer.getControl方法的具体用法?Java StructuredViewer.getControl怎么用?Java StructuredViewer.getControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.viewers.StructuredViewer的用法示例。


在下文中一共展示了StructuredViewer.getControl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SelectionProviderMediator

import org.eclipse.jface.viewers.StructuredViewer; //导入方法依赖的package包/类
/**
 * @param viewers All viewers that can provide a selection
 * @param viewerInFocus the viewer currently in focus or <code>null</code>
 */
public SelectionProviderMediator(StructuredViewer[] viewers, StructuredViewer viewerInFocus) {
	Assert.isNotNull(viewers);
	fViewers= viewers;
	InternalListener listener= new InternalListener();
	fSelectionChangedListeners= new ListenerList();
	fPostSelectionChangedListeners= new ListenerList();
	fViewerInFocus= viewerInFocus;

	for (int i= 0; i < fViewers.length; i++) {
		StructuredViewer viewer= fViewers[i];
		viewer.addSelectionChangedListener(listener);
		viewer.addPostSelectionChangedListener(new InternalPostSelectionListener());
		Control control= viewer.getControl();
		control.addFocusListener(listener);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:SelectionProviderMediator.java

示例2: addViewerControlDisposeListener

import org.eclipse.jface.viewers.StructuredViewer; //导入方法依赖的package包/类
private void addViewerControlDisposeListener() {
    StructuredViewer viewer = getViewer();
    if (viewer == null) {
        return;
    }
    Control control = viewer.getControl();
    if (control.isDisposed()) {
        return;
    }

    control.addDisposeListener(_ControlDisposeListener);
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:13,代码来源:ElementBinding.java

示例3: removeViewerControlDisposeListener

import org.eclipse.jface.viewers.StructuredViewer; //导入方法依赖的package包/类
private void removeViewerControlDisposeListener() {
    StructuredViewer viewer = getViewer();
    if (viewer == null) {
        return;
    }
    Control control = viewer.getControl();
    control.removeDisposeListener(_ControlDisposeListener);
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:9,代码来源:ElementBinding.java

示例4: notifyChanged

import org.eclipse.jface.viewers.StructuredViewer; //导入方法依赖的package包/类
/**
 * Called by the object being adapter (the notifier) when something has
 * changed.
 */
public void notifyChanged(INodeNotifier notifier, int eventType,
		Object changedFeature, Object oldValue, Object newValue, int pos) {
	// future_TODO: the 'uijobs' used in this method were added to solve
	// threading problems when the dom
	// is updated in the background while the editor is open. They may be
	// a bit overkill and not that useful.
	// (That is, may be be worthy of job manager management). If they are
	// found to be important enough to leave in,
	// there's probably some optimization that can be done.
	if (notifier instanceof IJSONNode) {
		Collection listeners = fAdapterFactory.getListeners();
		Iterator iterator = listeners.iterator();

		while (iterator.hasNext()) {
			Object listener = iterator.next();
			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90637
			// if (notifier instanceof Node && (listener instanceof
			// StructuredViewer) && (eventType ==
			// INodeNotifier.STRUCTURE_CHANGED || (eventType ==
			// INodeNotifier.CHANGE && changedFeature == null))) {
			if ((listener instanceof StructuredViewer)
					&& ((eventType == INodeNotifier.STRUCTURE_CHANGED)
							|| (eventType == INodeNotifier.CONTENT_CHANGED) || (eventType == INodeNotifier.CHANGE))) {
				if (DEBUG) {
					System.out
							.println("JFaceNodeAdapter notified on event type > " + eventType); //$NON-NLS-1$
				}

				// refresh on structural and "unknown" changes
				StructuredViewer structuredViewer = (StructuredViewer) listener;
				// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5230
				if (structuredViewer.getControl() != null) {
					getRefreshJob().refresh(structuredViewer,
							(IJSONNode) notifier);
				}
			}
		}
	}
}
 
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:44,代码来源:JFaceNodeAdapter.java

示例5: update

import org.eclipse.jface.viewers.StructuredViewer; //导入方法依赖的package包/类
/**
 * Performs the update on the viewer's control's display thread. Properly handles disposed controls.
 * 
 * @param structuredViewer
 * @param element
 * @param properties
 * 
 * @see StructuredViewer#update(Object element, String[] properties)
 */
public static void update(final StructuredViewer structuredViewer, final Object element, final String[] properties) {
	final Control control = structuredViewer.getControl();
	if ((control != null) && (!control.isDisposed())) {
		control.getDisplay().asyncExec(new Runnable() {
			@Override
			public void run() {
				if (!control.isDisposed()) {
					structuredViewer.update(element, properties);
				}
			}
		});
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:23,代码来源:StructuredViewerUtils.java


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