diff options
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java')
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java index 5058d4a48..26674906b 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java @@ -28,43 +28,43 @@ import org.eclipse.swt.widgets.Display; public abstract class ViewerUpdateMonitor extends Request implements IViewerUpdate { private TreeModelContentProvider fContentProvider; - + /** * Element's tree path */ private TreePath fElementPath; - + /** * Element */ private Object fElement; - + /** * Element content provider */ private IElementContentProvider fElementContentProvider; - + /** * Whether this request's 'done' method has been called. */ private boolean fDone = false; - + /** * Whether this request has been started */ private boolean fStarted = false; - + /** * Viewer input at the time the request was made */ private Object fViewerInput = null; - + /** * Whether this update has been delegated to another content provider * @since 3.4 */ private boolean fIsDelegated = false; - + /** * Presentation context */ @@ -72,7 +72,7 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda /** * Constructs an update for the given content provider - * + * * @param contentProvider content provider * @param viewerInput Viewer input for update * @param elementPath path to associated model element - empty for root element @@ -82,7 +82,7 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda */ public ViewerUpdateMonitor(TreeModelContentProvider contentProvider, Object viewerInput, TreePath elementPath, Object element, IElementContentProvider elementContentProvider, IPresentationContext context) { fContext = context; - // Bug 380288: Catch and log a race condition where the viewer input is null. + // Bug 380288: Catch and log a race condition where the viewer input is null. if (viewerInput == null) { DebugUIPlugin.log(new NullPointerException("Input to viewer update should not be null")); //$NON-NLS-1$ } @@ -92,34 +92,34 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda fElement = element; fElementPath = elementPath; } - + /** * Returns the scheduling rule for viewer update job. - * + * * @return rule or <code>null</code> */ protected ISchedulingRule getUpdateSchedulingRule() { return AsynchronousSchedulingRuleFactory.getDefault().newSerialPerObjectRule(getContentProvider()); } - + /** * Returns the model content provider this update is being performed for. - * + * * @return the model content provider this update is being performed for */ protected TreeModelContentProvider getContentProvider() { return fContentProvider; - } - + } + /** * Returns the element content provider to use for this request - * + * * @return element content provider */ protected IElementContentProvider getElementContentProvider() { return fElementContentProvider; } - + /* (non-Javadoc) * @see org.eclipse.core.runtime.IProgressMonitor#done() */ @@ -133,10 +133,10 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda } scheduleViewerUpdate(); } - + /** * Returns whether this request is done yet. - * + * * @return True if this update is done. */ protected synchronized boolean isDone() { @@ -146,13 +146,13 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda protected void scheduleViewerUpdate() { getContentProvider().scheduleViewerUpdate(this); } - + /** * Notification this update has been completed and should now be applied to * this update's viewer. This method is called in the UI thread. */ protected abstract void performUpdate(); - + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getPresentationContext() */ @@ -168,7 +168,7 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda public Object getElement() { return fElement; } - + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElementPath() */ @@ -176,26 +176,26 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda public TreePath getElementPath() { return fElementPath; } - + /** * Returns whether this request can coalesce the given request, and performs the * coalesce if it can. - * + * * @param update request to coalesce with this request * @return whether it worked */ abstract boolean coalesce(ViewerUpdateMonitor update); /** - * Returns whether this update or any coalesced updates is for an + * Returns whether this update or any coalesced updates is for an * element at the given path. * @param path Element path to check. * @return True if this update contains the given update path. - * + * * @since 3.6 */ abstract boolean containsUpdate(TreePath path); - + /** * Starts this request. Subclasses must override startRequest(). */ @@ -212,8 +212,8 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda } else { done(); } - } - + } + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getViewerInput() */ @@ -226,21 +226,21 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda * Subclasses must override to initiate specific request types. */ abstract void startRequest(); - + /** * Returns the priority of this request. Subclasses must override. The * highest priority is 1. Priorities indicate the order that waiting - * requests should be started in (for example, 'hasChildren' before 'update child count'). - * + * requests should be started in (for example, 'hasChildren' before 'update child count'). + * * @return priority */ abstract int getPriority(); - + /** * Returns a path used to schedule this request - i.e. based on this path, this * request will be scheduled to run when no requests are running against the * same element or a parent of the element denoted by the path. - * + * * @return path used to schedule request */ abstract TreePath getSchedulingPath(); @@ -261,7 +261,7 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda public boolean isDelegated() { return fIsDelegated; } - + @Override public boolean equals(Object obj) { if (obj instanceof ViewerUpdateMonitor) { @@ -274,27 +274,27 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda public int hashCode() { return doHashCode(); } - + /** - * Checks whether the given update is equal as this. The update is equal if it's + * Checks whether the given update is equal as this. The update is equal if it's * the same type of update and its updating the same elements. * @param update Update to compare to. * @return True if the given update is equals * @since 3.8 */ abstract protected boolean doEquals(ViewerUpdateMonitor update); - + /** * Calculates the hash code of the given update using the same parameters as doEquals(). * @return Update's hash code. * @since 3.8 */ abstract protected int doHashCode(); - + /** - * Executes the given runnable in the UI thread. If method is called in + * Executes the given runnable in the UI thread. If method is called in * UI thread, then runnable is executed immediately, otherwise it's executed - * using <code>Display.asyncExec()</code>. Runnable is not executed if update is + * using <code>Display.asyncExec()</code>. Runnable is not executed if update is * canceled or content provider is disposed. * @since 3.8 */ |