Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2006-11-22 20:05:22 +0000
committerDarin Wright2006-11-22 20:05:22 +0000
commitc3044935d11f7e967ebda57d7ba0fffbd395af67 (patch)
treec191c417ea7f917c7fca9fbf4bec65f22f819d26
parentf27ee76a13bd6c145401556eb9af1e28e144be54 (diff)
downloadeclipse.platform.debug-c3044935d11f7e967ebda57d7ba0fffbd395af67.tar.gz
eclipse.platform.debug-c3044935d11f7e967ebda57d7ba0fffbd395af67.tar.xz
eclipse.platform.debug-c3044935d11f7e967ebda57d7ba0fffbd395af67.zip
Bug 153500 Asynchronous model viewer [batch updates]
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ModelContentProvider.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenCountUpdate.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenUpdate.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementCompareRequest.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementLabelProvider.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoProvider.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoRequest.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IHasChildrenUpdate.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ILabelUpdate.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdate.java17
23 files changed, 195 insertions, 225 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java
index 8747709a7..c03dced55 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java
@@ -20,7 +20,6 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.jface.viewers.TreePath;
/**
* @since 3.3
@@ -83,15 +82,10 @@ public abstract class ElementContentProvider implements IElementContentProvider
IPresentationContext context = update.getPresentationContext();
if (supportsContext(context)) {
int offset = update.getOffset();
- Object parent = update.getElement(update.getElementPath());
- if (parent == null) {
- update.setCanceled(true);
- } else {
- Object[] children = getChildren(parent, offset, update.getLength(), context, update);
- if (!update.isCanceled() && children != null) {
- for (int i = 0; i < children.length; i++) {
- update.setChild(children[i], offset + i);
- }
+ Object[] children = getChildren(update.getElement(), offset, update.getLength(), context, update);
+ if (!update.isCanceled() && children != null) {
+ for (int i = 0; i < children.length; i++) {
+ update.setChild(children[i], offset + i);
}
}
}
@@ -114,17 +108,10 @@ public abstract class ElementContentProvider implements IElementContentProvider
IStatus status = Status.OK_STATUS;
try {
IPresentationContext context = update.getPresentationContext();
- TreePath elementPath = update.getElementPath();
if (supportsContext(context)) {
- Object element = update.getElement(elementPath);
- if (element == null) {
- // viewer input changed to null
- update.setCanceled(true);
- } else {
- int childCount = getChildCount(element, context, update);
- if (!update.isCanceled()) {
- update.setChildCount(childCount);
- }
+ int childCount = getChildCount( update.getElement(), context, update);
+ if (!update.isCanceled()) {
+ update.setChildCount(childCount);
}
} else {
update.setChildCount(0);
@@ -225,17 +212,10 @@ public abstract class ElementContentProvider implements IElementContentProvider
IStatus status = Status.OK_STATUS;
try {
IPresentationContext context = update.getPresentationContext();
- TreePath elementPath = update.getElementPath();
if (supportsContext(context)) {
- Object element = update.getElement(elementPath);
- if (element == null) {
- // viewer input changed to null
- update.setCanceled(true);
- } else {
- boolean hasChildren = hasChildren(element, context, update);
- if (!update.isCanceled()) {
- update.setHasChilren(hasChildren);
- }
+ boolean hasChildren = hasChildren(update.getElement(), context, update);
+ if (!update.isCanceled()) {
+ update.setHasChilren(hasChildren);
}
} else {
update.setHasChilren(false);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java
index d985dae7d..a89b99b06 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java
@@ -36,12 +36,12 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
interface ILabelJob {
/**
- * Returns whether the update was queued.
+ * Returns whether the updates were queued.
*
- * @param update update
- * @return whether the update was queued
+ * @param updates updates
+ * @return whether the updates were queued
*/
- public boolean queue(ILabelUpdate update);
+ public boolean queue(ILabelUpdate[] updates);
}
class LabelJob extends Job implements ILabelJob {
@@ -64,8 +64,8 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider.ILabelJob#queue(org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate)
*/
- public boolean queue(ILabelUpdate update) {
- return fUpdater.queue(update);
+ public boolean queue(ILabelUpdate[] updates) {
+ return fUpdater.queue(updates);
}
/* (non-Javadoc)
@@ -97,8 +97,8 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider.ILabelJob#queue(org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate)
*/
- public boolean queue(ILabelUpdate update) {
- return fUpdater.queue(update);
+ public boolean queue(ILabelUpdate[] updates) {
+ return fUpdater.queue(updates);
}
/* (non-Javadoc)
@@ -116,11 +116,13 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
LinkedList fQueue = new LinkedList();
- public synchronized boolean queue(ILabelUpdate update) {
+ public synchronized boolean queue(ILabelUpdate[] updates) {
if (fQueue == null) {
return false;
} else {
- fQueue.addLast(update);
+ for (int i = 0; i < updates.length; i++) {
+ fQueue.addLast(updates[i]);
+ }
return true;
}
}
@@ -234,22 +236,22 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
protected abstract String getLabel(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException;
/* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider#updateLabel(org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate)
+ * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate[])
*/
- public synchronized void update(ILabelUpdate update) {
+ public synchronized void update(ILabelUpdate[] updates) {
if (fLabelJob == null) {
- fLabelJob = newLabelJob(update);
+ fLabelJob = newLabelJob(updates);
}
- if (!((ILabelJob)fLabelJob).queue(update)) {
- fLabelJob = newLabelJob(update);
- ((ILabelJob)fLabelJob).queue(update);
+ if (!((ILabelJob)fLabelJob).queue(updates)) {
+ fLabelJob = newLabelJob(updates);
+ ((ILabelJob)fLabelJob).queue(updates);
}
// TODO: rule
fLabelJob.schedule();
}
- private Job newLabelJob(ILabelUpdate update) {
- if (requiresUIJob(update)) {
+ private Job newLabelJob(ILabelUpdate[] updates) {
+ if (requiresUIJob(updates)) {
return new UILabelJob();
} else {
return new LabelJob();
@@ -259,7 +261,7 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
/**
* Returns whether a UI job should be used for updates versus a non-UI job.
*/
- protected boolean requiresUIJob(ILabelUpdate update) {
+ protected boolean requiresUIJob(ILabelUpdate[] updates) {
return false;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java
index 7b73b489c..e72bd4dc7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java
@@ -26,18 +26,22 @@ import org.eclipse.ui.IMemento;
*/
public abstract class ElementMementoProvider implements IElementMementoProvider {
+
/* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider#compareElement(org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest)
+ * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider#compareElements(org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest[])
*/
- public void compareElement(final IElementCompareRequest request) {
+ public void compareElements(final IElementCompareRequest[] requests) {
Job job = new Job("compare element") { //$NON-NLS-1$
protected IStatus run(IProgressMonitor monitor) {
- try {
- request.setEqual(isEqual(request.getElement(), request.getMemento(), request.getPresentationContext()));
- } catch (CoreException e) {
- request.setStatus(e.getStatus());
+ for (int i = 0; i < requests.length; i++) {
+ IElementCompareRequest request = requests[i];
+ try {
+ request.setEqual(isEqual(request.getElement(), request.getMemento(), request.getPresentationContext()));
+ } catch (CoreException e) {
+ request.setStatus(e.getStatus());
+ }
+ request.done();
}
- request.done();
return Status.OK_STATUS;
}
};
@@ -57,19 +61,22 @@ public abstract class ElementMementoProvider implements IElementMementoProvider
protected abstract boolean isEqual(Object element, IMemento memento, IPresentationContext context) throws CoreException;
/* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider#encodeElement(org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest)
+ * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider#encodeElements(org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest[])
*/
- public void encodeElement(final IElementMementoRequest request) {
+ public void encodeElements(final IElementMementoRequest[] requests) {
Job job = new Job("encode element") { //$NON-NLS-1$
protected IStatus run(IProgressMonitor monitor) {
- try {
- if (!encodeElement(request.getElement(), request.getMemento(), request.getPresentationContext())) {
- request.setCanceled(true);
+ for (int i = 0; i < requests.length; i++) {
+ IElementMementoRequest request = requests[i];
+ try {
+ if (!encodeElement(request.getElement(), request.getMemento(), request.getPresentationContext())) {
+ request.setCanceled(true);
+ }
+ } catch (CoreException e) {
+ request.setStatus(e.getStatus());
}
- } catch (CoreException e) {
- request.setStatus(e.getStatus());
+ request.done();
}
- request.done();
return Status.OK_STATUS;
}
};
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java
index 4ca3c697d..5cdbf55d3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java
@@ -19,15 +19,13 @@ import org.eclipse.jface.viewers.TreeViewer;
*/
class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountUpdate {
- private TreePath fElementPath;
private int fCount = 0;
/**
* @param contentProvider
*/
- public ChildrenCountUpdate(ModelContentProvider contentProvider, TreePath elementPath) {
- super(contentProvider);
- fElementPath = elementPath;
+ public ChildrenCountUpdate(ModelContentProvider contentProvider, TreePath elementPath, Object element) {
+ super(contentProvider, elementPath, element);
}
/* (non-Javadoc)
@@ -35,30 +33,27 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
*/
protected void performUpdate() {
int viewCount = fCount;
+ TreePath elementPath = getElementPath();
if (viewCount == 0) {
- getContentProvider().clearFilters(fElementPath);
+ getContentProvider().clearFilters(elementPath);
} else {
- viewCount = getContentProvider().modelToViewChildCount(fElementPath, fCount);
+ viewCount = getContentProvider().modelToViewChildCount(elementPath, fCount);
}
if (ModelContentProvider.DEBUG_CONTENT_PROVIDER) {
- System.out.println("setChildCount(" + getElement(fElementPath) + ", modelCount: " + fCount + " viewCount: " + viewCount + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ System.out.println("setChildCount(" + getElement() + ", modelCount: " + fCount + " viewCount: " + viewCount + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
- ((TreeViewer)(getContentProvider().getViewer())).setChildCount(fElementPath, viewCount);
+ ((TreeViewer)(getContentProvider().getViewer())).setChildCount(elementPath, viewCount);
}
public void setChildCount(int numChildren) {
fCount = numChildren;
}
- public TreePath getElementPath() {
- return fElementPath;
- }
-
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#isContained(org.eclipse.jface.viewers.TreePath)
*/
boolean isContained(TreePath path) {
- return fElementPath.startsWith(path, null);
+ return getElementPath().startsWith(path, null);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java
index acec06f88..38a859f48 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java
@@ -19,7 +19,6 @@ import org.eclipse.jface.viewers.TreePath;
*/
class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpdate {
- private TreePath fParentPath;
private Object[] fElements;
private int fIndex;
private int fLength;
@@ -32,9 +31,8 @@ class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpdate {
* @param node node to update
* @param model model containing the node
*/
- public ChildrenUpdate(ModelContentProvider provider, TreePath parentPath, int index, IElementContentProvider presentation) {
- super(provider);
- fParentPath = parentPath;
+ public ChildrenUpdate(ModelContentProvider provider, TreePath elementPath, Object element, int index, IElementContentProvider presentation) {
+ super(provider, elementPath, element);
fIndex = index;
fLength = 1;
fContentProvider = presentation;
@@ -47,41 +45,42 @@ class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpdate {
*/
protected void performUpdate() {
TreeModelContentProvider provider = (TreeModelContentProvider) getContentProvider();
+ TreePath elementPath = getElementPath();
if (fElements != null) {
InternalTreeModelViewer viewer = (InternalTreeModelViewer) provider.getViewer();
for (int i = 0; i < fElements.length; i++) {
int modelIndex = fIndex + i;
Object element = fElements[i];
if (element != null) {
- int viewIndex = provider.modelToViewIndex(fParentPath, modelIndex);
- if (provider.shouldFilter(fParentPath, element)) {
- if (provider.addFilteredIndex(fParentPath, modelIndex)) {
+ int viewIndex = provider.modelToViewIndex(elementPath, modelIndex);
+ if (provider.shouldFilter(elementPath, element)) {
+ if (provider.addFilteredIndex(elementPath, modelIndex)) {
if (ModelContentProvider.DEBUG_CONTENT_PROVIDER) {
- System.out.println("REMOVE(" + getElement(fParentPath) + ", modelIndex: " + modelIndex + " viewIndex: " + viewIndex + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ System.out.println("REMOVE(" + getElement() + ", modelIndex: " + modelIndex + " viewIndex: " + viewIndex + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
- viewer.remove(fParentPath, viewIndex);
+ viewer.remove(elementPath, viewIndex);
}
} else {
- if (provider.isFiltered(fParentPath, modelIndex)) {
- provider.clearFilteredChild(fParentPath, modelIndex);
- int insertIndex = provider.modelToViewIndex(fParentPath, modelIndex);
+ if (provider.isFiltered(elementPath, modelIndex)) {
+ provider.clearFilteredChild(elementPath, modelIndex);
+ int insertIndex = provider.modelToViewIndex(elementPath, modelIndex);
if (ModelContentProvider.DEBUG_CONTENT_PROVIDER) {
- System.out.println("insert(" + fParentPath.getLastSegment() + ", modelIndex: " + modelIndex + " insertIndex: " + insertIndex + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ System.out.println("insert(" + getElement() + ", modelIndex: " + modelIndex + " insertIndex: " + insertIndex + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
- viewer.insert(fParentPath, element, insertIndex);
+ viewer.insert(elementPath, element, insertIndex);
} else {
if (ModelContentProvider.DEBUG_CONTENT_PROVIDER) {
- System.out.println("replace(" + getElement(fParentPath) + ", modelIndex: " + modelIndex + " viewIndex: " + viewIndex + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ System.out.println("replace(" + getElement() + ", modelIndex: " + modelIndex + " viewIndex: " + viewIndex + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
- viewer.replace(fParentPath, viewIndex, element);
+ viewer.replace(elementPath, viewIndex, element);
}
- TreePath childPath = fParentPath.createChildPath(element);
+ TreePath childPath = elementPath.createChildPath(element);
provider.updateHasChildren(childPath);
}
}
}
} else {
- provider.updateHasChildren(fParentPath);
+ provider.updateHasChildren(elementPath);
}
}
@@ -141,15 +140,11 @@ class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpdate {
return fIndex;
}
- public TreePath getElementPath() {
- return fParentPath;
- }
-
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#isContained(org.eclipse.jface.viewers.TreePath)
*/
boolean isContained(TreePath path) {
- return fParentPath.startsWith(path, null);
+ return getElementPath().startsWith(path, null);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java
index 1dee5ccc6..04a8d99c3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java
@@ -12,6 +12,7 @@ package org.eclipse.debug.internal.ui.viewers.model;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
+import org.eclipse.jface.viewers.TreePath;
import org.eclipse.ui.IMemento;
/**
@@ -26,8 +27,8 @@ class ElementCompareRequest extends MementoUpdate implements IElementCompareRequ
* @param element
* @param memento
*/
- public ElementCompareRequest(ModelContentProvider provider, Object element, IMemento memento, ModelDelta delta) {
- super(provider, provider.getPresentationContext(), element, memento);
+ public ElementCompareRequest(ModelContentProvider provider, Object element, TreePath elementPath, IMemento memento, ModelDelta delta) {
+ super(provider, provider.getPresentationContext(), element, elementPath, memento);
fProvider = provider;
fDelta = delta;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java
index b41260f14..238c3e3b4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java
@@ -13,6 +13,7 @@ package org.eclipse.debug.internal.ui.viewers.model;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
+import org.eclipse.jface.viewers.TreePath;
import org.eclipse.ui.IMemento;
/**
@@ -28,8 +29,8 @@ class ElementMementoRequest extends MementoUpdate implements IElementMementoRequ
* @param element
* @param memento
*/
- public ElementMementoRequest(ModelContentProvider provider, IMementoManager manager, IPresentationContext context, Object element, IMemento memento, ModelDelta delta) {
- super(provider, context, element, memento);
+ public ElementMementoRequest(ModelContentProvider provider, IMementoManager manager, IPresentationContext context, Object element, TreePath elementPath, IMemento memento, ModelDelta delta) {
+ super(provider, context, element, elementPath, memento);
fManager = manager;
fDelta = delta;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java
index a48fc21c4..223ecb4b4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java
@@ -19,15 +19,13 @@ import org.eclipse.jface.viewers.TreeViewer;
*/
class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdate {
- private TreePath fElementPath;
private boolean fHasChildren = false;
/**
* @param contentProvider
*/
- public HasChildrenUpdate(ModelContentProvider contentProvider, TreePath elementPath) {
- super(contentProvider);
- fElementPath = elementPath;
+ public HasChildrenUpdate(ModelContentProvider contentProvider, TreePath elementPath, Object element) {
+ super(contentProvider, elementPath, element);
}
/* (non-Javadoc)
@@ -35,22 +33,19 @@ class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdat
*/
protected void performUpdate() {
ModelContentProvider contentProvider = getContentProvider();
+ TreePath elementPath = getElementPath();
if (!fHasChildren) {
- contentProvider.clearFilters(fElementPath);
+ contentProvider.clearFilters(elementPath);
}
if (ModelContentProvider.DEBUG_CONTENT_PROVIDER) {
- System.out.println("setHasChildren(" + getElement(fElementPath) + " >> " + fHasChildren); //$NON-NLS-1$ //$NON-NLS-2$
+ System.out.println("setHasChildren(" + getElement() + " >> " + fHasChildren); //$NON-NLS-1$ //$NON-NLS-2$
}
- ((TreeViewer)(contentProvider.getViewer())).setHasChildren(fElementPath, fHasChildren);
- if (fElementPath.getSegmentCount() > 0) {
- contentProvider.doRestore(fElementPath);
+ ((TreeViewer)(contentProvider.getViewer())).setHasChildren(elementPath, fHasChildren);
+ if (elementPath.getSegmentCount() > 0) {
+ contentProvider.doRestore(elementPath);
}
}
- public TreePath getElementPath() {
- return fElementPath;
- }
-
public void setHasChilren(boolean hasChildren) {
fHasChildren = hasChildren;
}
@@ -59,7 +54,7 @@ class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdat
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#isContained(org.eclipse.jface.viewers.TreePath)
*/
boolean isContained(TreePath path) {
- return fElementPath.startsWith(path, null);
+ return getElementPath().startsWith(path, null);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java
index 8801ebc3c..6cb2fad99 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java
@@ -219,11 +219,10 @@ class LabelUpdate extends AbstractRequestMonitor implements ILabelUpdate {
}
/* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElement(org.eclipse.jface.viewers.TreePath)
+ * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElement()
*/
- public Object getElement(TreePath path) {
- // TODO Auto-generated method stub
- return null;
+ public Object getElement() {
+ return getElementPath().getLastSegment();
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java
index d9b29d8a9..d8689ca34 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java
@@ -23,6 +23,7 @@ abstract class MementoUpdate extends AbstractRequestMonitor implements IViewerUp
private IPresentationContext fContext;
private Object fElement;
+ private TreePath fElementPath;
private IMemento fMemento;
protected ModelContentProvider fProvider;
@@ -33,9 +34,10 @@ abstract class MementoUpdate extends AbstractRequestMonitor implements IViewerUp
* @param element element
* @param memento memento
*/
- public MementoUpdate(ModelContentProvider provider, IPresentationContext context, Object element, IMemento memento) {
+ public MementoUpdate(ModelContentProvider provider, IPresentationContext context, Object element, TreePath elementPath, IMemento memento) {
fContext = context;
fElement = element;
+ fElementPath = elementPath;
fMemento = memento;
fProvider = provider;
}
@@ -51,6 +53,10 @@ abstract class MementoUpdate extends AbstractRequestMonitor implements IViewerUp
return fElement;
}
+ public TreePath getElementPath() {
+ return fElementPath;
+ }
+
public IMemento getMemento() {
return fMemento;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ModelContentProvider.java
index b58510188..c1e0ded92 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ModelContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ModelContentProvider.java
@@ -32,6 +32,7 @@ import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest;
@@ -244,7 +245,7 @@ abstract class ModelContentProvider implements IContentProvider, IModelChangedLi
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IMementoManager#processReqeusts()
*/
public void processReqeusts() {
- defaultProvider.encodeElement(fRequest);
+ defaultProvider.encodeElements(new IElementMementoRequest[]{fRequest});
}
/* (non-Javadoc)
@@ -256,7 +257,7 @@ abstract class ModelContentProvider implements IContentProvider, IModelChangedLi
};
manager.addRequest(new ElementMementoRequest(ModelContentProvider.this, manager, getPresentationContext(),
- delta.getElement(), inputMemento, delta));
+ delta.getElement(), getViewerTreePath(delta), inputMemento, delta));
manager.processReqeusts();
}
}
@@ -294,9 +295,9 @@ abstract class ModelContentProvider implements IContentProvider, IModelChangedLi
provider = defaultProvider;
}
if (provider != null) {
- provider.compareElement(
+ provider.compareElements(new IElementCompareRequest[]{
new ElementCompareRequest(ModelContentProvider.this,
- potentialMatch, (IMemento) element, (ModelDelta)delta));
+ potentialMatch, path, (IMemento) element, (ModelDelta)delta)});
}
} else {
if (element.equals(potentialMatch)) {
@@ -339,7 +340,11 @@ abstract class ModelContentProvider implements IContentProvider, IModelChangedLi
final XMLMemento childrenMemento = XMLMemento.createWriteRoot("CHILDREN_MEMENTO"); //$NON-NLS-1$
final IMementoManager manager = new IMementoManager() {
- private Set requests = new HashSet();
+ /**
+ * Maps element memento provider to list of memento requests
+ */
+ private Map requestMap = new HashMap();
+ private Set allRequests = new HashSet();
private boolean abort = false;
/* (non-Javadoc)
@@ -348,8 +353,9 @@ abstract class ModelContentProvider implements IContentProvider, IModelChangedLi
public synchronized void requestComplete(IElementMementoRequest request) {
if (!abort) {
if (!request.isCanceled() && (request.getStatus() == null || request.getStatus().isOK())) {
- requests.remove(request);
- if (requests.isEmpty()) {
+ allRequests.remove(request);
+ if (allRequests.isEmpty()) {
+ requestMap.clear();
XMLMemento keyMemento = (XMLMemento) rootDelta.getElement();
StringWriter writer = new StringWriter();
try {
@@ -361,12 +367,13 @@ abstract class ModelContentProvider implements IContentProvider, IModelChangedLi
}
} else {
abort = true;
- Iterator iterator = requests.iterator();
+ Iterator iterator = allRequests.iterator();
while (iterator.hasNext()) {
IElementMementoRequest req = (IElementMementoRequest) iterator.next();
req.setCanceled(true);
}
- requests.clear();
+ requestMap.clear();
+ allRequests.clear();
}
}
}
@@ -375,13 +382,12 @@ abstract class ModelContentProvider implements IContentProvider, IModelChangedLi
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IMementoManager#processReqeusts()
*/
public void processReqeusts() {
- IElementMementoRequest[] req = (IElementMementoRequest[]) requests.toArray(new IElementMementoRequest[requests.size()]);
- for (int i = 0; i < req.length; i++) {
- IElementMementoProvider provider = getViewerStateAdapter(req[i].getElement());
- if (provider == null) {
- provider = defaultProvider;
- }
- provider.encodeElement(req[i]);
+ Iterator iterator = requestMap.entrySet().iterator();
+ while (iterator.hasNext()) {
+ Entry entry = (Entry) iterator.next();
+ IElementMementoProvider provider = (IElementMementoProvider) entry.getKey();
+ List list = (List) entry.getValue();
+ provider.encodeElements((IElementMementoRequest[]) list.toArray(new IElementMementoRequest[list.size()]));
}
}
@@ -389,7 +395,18 @@ abstract class ModelContentProvider implements IContentProvider, IModelChangedLi
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IMementoManager#addRequest(org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest)
*/
public synchronized void addRequest(IElementMementoRequest request) {
- requests.add(request);
+ if (allRequests.add(request)) {
+ IElementMementoProvider provider = getViewerStateAdapter(request.getElement());
+ if (provider == null) {
+ provider = defaultProvider;
+ }
+ List list = (List)requestMap.get(provider);
+ if (list == null) {
+ list = new ArrayList();
+ requestMap.put(provider, list);
+ }
+ list.add(request);
+ }
}
};
@@ -398,11 +415,11 @@ abstract class ModelContentProvider implements IContentProvider, IModelChangedLi
if (delta.getParentDelta() == null) {
manager.addRequest(
new ElementMementoRequest(ModelContentProvider.this, manager, getPresentationContext(),
- delta.getElement(), inputMemento, (ModelDelta)delta));
+ delta.getElement(), getViewerTreePath(delta), inputMemento, (ModelDelta)delta));
} else {
manager.addRequest(
new ElementMementoRequest(ModelContentProvider.this, manager, getPresentationContext(),
- delta.getElement(), childrenMemento.createChild("CHILD_ELEMENT"), (ModelDelta)delta)); //$NON-NLS-1$
+ delta.getElement(), getViewerTreePath(delta), childrenMemento.createChild("CHILD_ELEMENT"), (ModelDelta)delta)); //$NON-NLS-1$
}
return true;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
index 66284ece8..4f1f7c2d7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
@@ -85,7 +85,7 @@ class TreeModelContentProvider extends ModelContentProvider implements ILazyTree
Object element = getElement(path);
IElementContentProvider contentAdapter = getContentAdapter(element);
if (contentAdapter != null) {
- ChildrenCountUpdate request = new ChildrenCountUpdate(this, path);
+ ChildrenCountUpdate request = new ChildrenCountUpdate(this, path, element);
List requests = (List) fPendingCountRequests.get(contentAdapter);
if (requests != null) {
requests.add(request);
@@ -121,7 +121,7 @@ class TreeModelContentProvider extends ModelContentProvider implements ILazyTree
Object parent = getElement(parentPath);
IElementContentProvider contentAdapter = getContentAdapter(parent);
if (contentAdapter != null) {
- final ChildrenUpdate newRequest = new ChildrenUpdate(this, parentPath, modelIndex, contentAdapter);
+ final ChildrenUpdate newRequest = new ChildrenUpdate(this, parentPath, parent, modelIndex, contentAdapter);
fPendingChildRequests.put(parentPath, newRequest);
fTimer.schedule(new TimerTask() {
public void run() {
@@ -135,7 +135,7 @@ class TreeModelContentProvider extends ModelContentProvider implements ILazyTree
Object element = getElement(path);
IElementContentProvider contentAdapter = getContentAdapter(element);
if (contentAdapter != null) {
- HasChildrenUpdate request = new HasChildrenUpdate(this, path);
+ HasChildrenUpdate request = new HasChildrenUpdate(this, path, element);
List requests = (List) fPendingHasChildrenRequests.get(contentAdapter);
if (requests != null) {
requests.add(request);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java
index 53a8fb12f..b8b92507e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java
@@ -190,7 +190,7 @@ class TreeModelLabelProvider extends ColumnLabelProvider {
Object element = elementPath.getLastSegment();
IElementLabelProvider presentation = getLabelAdapter(element);
if (presentation != null) {
- presentation.update(new LabelUpdate(elementPath, (TreeItem) row.getItem(), this, visibleColumns));
+ presentation.update(new ILabelUpdate[]{new LabelUpdate(elementPath, (TreeItem) row.getItem(), this, visibleColumns)});
} else if (element instanceof String) {
// for example, expression error messages
row.setText(0, (String)element);
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 32827aa27..f157c5a2f 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
@@ -27,6 +27,16 @@ import org.eclipse.ui.progress.WorkbenchJob;
abstract class ViewerUpdateMonitor extends AbstractRequestMonitor implements IViewerUpdate {
private ModelContentProvider fContentProvider;
+
+ /**
+ * Element's tree path
+ */
+ private TreePath fElementPath;
+
+ /**
+ * Element
+ */
+ private Object fElement;
/**
* Whether this request's 'done' method has been called.
@@ -59,9 +69,13 @@ abstract class ViewerUpdateMonitor extends AbstractRequestMonitor implements IVi
* Constructs an update for the given content provider
*
* @param contentProvider content provider
+ * @param elementPath path to associated model element - empty for root element
+ * @param element associated model element
*/
- public ViewerUpdateMonitor(ModelContentProvider contentProvider) {
+ public ViewerUpdateMonitor(ModelContentProvider contentProvider, TreePath elementPath, Object element) {
fContentProvider = contentProvider;
+ fElement = element;
+ fElementPath = elementPath;
// serialize updates per viewer
fViewerUpdateJob.setRule(getUpdateSchedulingRule());
fViewerUpdateJob.setSystem(true);
@@ -133,8 +147,18 @@ abstract class ViewerUpdateMonitor extends AbstractRequestMonitor implements IVi
return fContentProvider.getPresentationContext();
}
- public Object getElement(TreePath path) {
- return fContentProvider.getElement(path);
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElement()
+ */
+ public Object getElement() {
+ return fElement;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElementPath()
+ */
+ public TreePath getElementPath() {
+ return fElementPath;
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenCountUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenCountUpdate.java
index 67c271ce2..c34073bba 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenCountUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenCountUpdate.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model.provisional;
-import org.eclipse.jface.viewers.TreePath;
/**
@@ -19,14 +18,6 @@ import org.eclipse.jface.viewers.TreePath;
* @since 3.3
*/
public interface IChildrenCountUpdate extends IViewerUpdate {
-
- /**
- * Returns the element that a child count has been requested for
- * as a tree path. An empty path identifies the root element.
- *
- * @return element as a tree path
- */
- public TreePath getElementPath();
/**
* Sets the number of children for this update.
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenUpdate.java
index 113c4b9ef..ee7843ea7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenUpdate.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model.provisional;
-import org.eclipse.jface.viewers.TreePath;
/**
* Context sensitive children update request for a parent and subrange of its
@@ -21,14 +20,6 @@ import org.eclipse.jface.viewers.TreePath;
public interface IChildrenUpdate extends IViewerUpdate {
/**
- * Returns the element that children are being requested for
- * as a tree path. An empty path identifies the root element.
- *
- * @return element as a tree path
- */
- public TreePath getElementPath();
-
- /**
* Returns the offset at which children have been requested for. This is
* the index of the first child being requested.
*
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementCompareRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementCompareRequest.java
index 0a0d8c6bc..131dea4cd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementCompareRequest.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementCompareRequest.java
@@ -10,28 +10,13 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model.provisional;
-import org.eclipse.ui.IMemento;
/**
* Request to compare an element to a previously created memento.
*
* @since 3.3
*/
-public interface IElementCompareRequest extends IViewerUpdate {
-
- /**
- * The element to compare against this request's memento.
- *
- * @return element
- */
- public Object getElement();
-
- /**
- * The memento to compare this request's element.
- *
- * @return memento
- */
- public IMemento getMemento();
+public interface IElementCompareRequest extends IElementMementoRequest {
/**
* Sets whether this request's memento represents this requests's element.
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementLabelProvider.java
index 56717e5a5..fb6ef792c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementLabelProvider.java
@@ -19,10 +19,10 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
public interface IElementLabelProvider {
/**
- * Updates the specified label.
+ * Updates the specified labels.
*
- * @param update specifies the element and context for which a label is requested and
- * stores updated label attributes
+ * @param updates each update specifies the element and context for which a label is requested and
+ * stores label attributes
*/
- public void update(ILabelUpdate update);
+ public void update(ILabelUpdate[] updates);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoProvider.java
index e6912e613..110e6b8f3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoProvider.java
@@ -25,19 +25,19 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
public interface IElementMementoProvider {
/**
- * Creates and stores a memento for the element specified in the request.
- * The request should be cancelled if a memento is not supported for the
+ * Creates and stores a mementos for the elements specified in the requests.
+ * A request should be cancelled if a memento is not supported for the
* specified element or context.
*
- * @param request specifies element and provides memento store
+ * @param requests specifies elements and provides memento stores
*/
- public void encodeElement(IElementMementoRequest request);
+ public void encodeElements(IElementMementoRequest[] requests);
/**
- * Determines if a memento represents the element specified in the request.
+ * Determines whether mementos represent associated elements specified in the requests.
*
- * @param request specifies element and previously created memento
+ * @param requests specifies each element and previously created memento
*/
- public void compareElement(IElementCompareRequest request);
+ public void compareElements(IElementCompareRequest[] requests);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoRequest.java
index 51719f021..45e3fd95d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoRequest.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoRequest.java
@@ -18,13 +18,6 @@ import org.eclipse.ui.IMemento;
* @since 3.3
*/
public interface IElementMementoRequest extends IViewerUpdate {
-
- /**
- * Returns the element for which the memento has been requested.
- *
- * @return element
- */
- public Object getElement();
/**
* Returns the memento used to persist the element.
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IHasChildrenUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IHasChildrenUpdate.java
index cd6db7d5b..afed7ba59 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IHasChildrenUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IHasChildrenUpdate.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model.provisional;
-import org.eclipse.jface.viewers.TreePath;
/**
* Context sensitive update request for whether an element has children.
@@ -20,14 +19,6 @@ import org.eclipse.jface.viewers.TreePath;
public interface IHasChildrenUpdate extends IViewerUpdate {
/**
- * The element this request is for specified as a tree path.
- * An empty path identifies the root element.
- *
- * @return element as a tree path
- */
- public TreePath getElementPath();
-
- /**
* Sets whether there are children for this update.
*
* @param hasChildren whether there are children
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ILabelUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ILabelUpdate.java
index 63e45e437..1d0c8deb8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ILabelUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ILabelUpdate.java
@@ -11,7 +11,6 @@
package org.eclipse.debug.internal.ui.viewers.model.provisional;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.TreePath;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.RGB;
@@ -21,14 +20,7 @@ import org.eclipse.swt.graphics.RGB;
* @since 3.3
*/
public interface ILabelUpdate extends IViewerUpdate {
-
- /**
- * Returns a tree path for the element the label update is for.
- *
- * @return associated element tree path
- */
- public TreePath getElementPath();
-
+
/**
* Returns the id's of the visible columns in presentation order,
* or <code>null</code> if none.
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdate.java
index 098dbc8b9..4dcfb6bc4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdate.java
@@ -28,12 +28,17 @@ public interface IViewerUpdate extends IStatusMonitor {
public IPresentationContext getPresentationContext();
/**
- * Returns the model element corresponding to the given tree path
- * or <code>null</code> if none. An empty path corresponds to the
- * root element.
+ * Returns the model element associated with this request.
*
- * @param path viewer tree path
- * @return corresponding model element or <code>null</code>
+ * @return associated model element
*/
- public Object getElement(TreePath path);
+ public Object getElement();
+
+ /**
+ * Returns the viewer tree path to the model element associated with this
+ * request. An empty path indicates a root element.
+ *
+ * @return tree path, possibly empty
+ */
+ public TreePath getElementPath();
}

Back to the top