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