Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Barnes2005-01-25 23:42:38 +0000
committerKevin Barnes2005-01-25 23:42:38 +0000
commitafd5d41ef31757a7d56c4075e2fa528b1d11d467 (patch)
tree90850f8f692f6e743e807aeccf2a314386f0dd3b
parent8918427812743bca3774b403e9a9036f4f5b2a18 (diff)
downloadeclipse.platform.debug-afd5d41ef31757a7d56c4075e2fa528b1d11d467.tar.gz
eclipse.platform.debug-afd5d41ef31757a7d56c4075e2fa528b1d11d467.tar.xz
eclipse.platform.debug-afd5d41ef31757a7d56c4075e2fa528b1d11d467.zip
Bugzilla Bug 83453 - Infinite "restore viewer state"
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/AbstractViewerState.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ViewerState.java11
2 files changed, 14 insertions, 8 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/AbstractViewerState.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/AbstractViewerState.java
index 21512dfb2..0bdef211f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/AbstractViewerState.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/AbstractViewerState.java
@@ -26,10 +26,7 @@ public abstract class AbstractViewerState {
// paths to expanded elements
private List fSavedExpansion = null;
- // paths currently expanded
- private List fCurrentExpansion = new ArrayList();
- // paths to selected elements
- private IPath[] fSelection = null;
+ private IPath[] fSelection;
/**
* Constructs a memento for the given viewer.
@@ -45,7 +42,6 @@ public abstract class AbstractViewerState {
* @param viewer viewer of which to save the state
*/
public void saveState(TreeViewer viewer) {
- fCurrentExpansion.clear();
List expanded = new ArrayList();
fSavedExpansion = null;
TreeItem[] items = viewer.getTree().getItems();
@@ -99,6 +95,7 @@ public abstract class AbstractViewerState {
* @param viewer viewer to which state is restored
*/
public void restoreState(TreeViewer viewer) {
+ List newExpansion = new ArrayList();
boolean expansionComplete = true;
if (fSavedExpansion != null && fSavedExpansion.size() > 0) {
for (int i = 0; i < fSavedExpansion.size(); i++) {
@@ -108,7 +105,7 @@ public abstract class AbstractViewerState {
try {
obj = decodePath(path, viewer);
if (obj != null) {
- fCurrentExpansion.add(obj);
+ newExpansion.add(obj);
} else {
expansionComplete = false;
}
@@ -116,7 +113,7 @@ public abstract class AbstractViewerState {
}
}
}
- viewer.setExpandedElements(fCurrentExpansion.toArray());
+ viewer.setExpandedElements(newExpansion.toArray());
if (expansionComplete) {
fSavedExpansion = null;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ViewerState.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ViewerState.java
index 0888a7436..1575e902b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ViewerState.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ViewerState.java
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IVariable;
import org.eclipse.debug.internal.ui.views.AbstractViewerState;
+import org.eclipse.debug.internal.ui.views.RemoteTreeViewer;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.widgets.TreeItem;
@@ -59,7 +60,15 @@ public class ViewerState extends AbstractViewerState {
IVariable variable = null;
for (int i = 0; i < names.length; i++) {
variable = null;
- Object[] children = contentProvider.getChildren(parent);
+ Object[] children = null;
+ if (viewer instanceof RemoteTreeViewer) {
+ children = ((RemoteTreeViewer)viewer).getCurrentChildren(parent);
+ } else {
+ children = contentProvider.getChildren(parent);
+ }
+ if (children == null) {
+ return null;
+ }
String name = names[i];
for (int j = 0; j < children.length; j++) {
if (!(children[j] instanceof IVariable)) {

Back to the top