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