Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2011-12-14 05:44:30 +0000
committerPawel Piech2011-12-14 05:44:30 +0000
commit875e97919cee69efa44b21b08bd318653e4b7d9a (patch)
tree4fc460a02ca98092bc6aff2d0354d86ee2d6e7bb
parentff153112a45c47312d0bea81ca5ef1359064cc22 (diff)
downloadeclipse.platform.debug-875e97919cee69efa44b21b08bd318653e4b7d9a.tar.gz
eclipse.platform.debug-875e97919cee69efa44b21b08bd318653e4b7d9a.tar.xz
eclipse.platform.debug-875e97919cee69efa44b21b08bd318653e4b7d9a.zip
(nobug) Added comments and toString() in flex hierarchy viewer.v20111219-0907
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewerFilter.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualItem.java23
3 files changed, 27 insertions, 2 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
index 0b7083b74..d227cba86 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
@@ -1582,5 +1582,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
// Not supported
}
-
+ public String toString() {
+ return getTree().toString();
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewerFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewerFilter.java
index 077938619..57cdc7fda 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewerFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewerFilter.java
@@ -31,6 +31,8 @@ abstract public class TreeModelViewerFilter extends ViewerFilter {
* Determines whether the filter applies to the given parent element.
* @return Returns true if the viewer should use the given filter on the
* given element.
+ * @param viewer The viewer that is using this filter to select elements.
+ * @param parentElement Parent element to check filter for.
*/
abstract public boolean isApplicable(ITreeModelViewer viewer, Object parentElement);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualItem.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualItem.java
index 0a190b278..c6a71d01a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualItem.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualItem.java
@@ -515,6 +515,27 @@ public class VirtualItem {
}
public String toString() {
+ StringBuffer buffer = new StringBuffer();
+ toStringItem(buffer, "");
+ return buffer.toString();
+ }
+
+ void toStringItem(StringBuffer buffer, String indent) {
+ buffer.append(indent);
+ buffer.append(toStringElement());
+ buffer.append("\n");
+ indent = indent + " ";
+ for (int i = 0; i < fItemCount; i++) {
+ VirtualItem item = (VirtualItem)fItems.get(new Integer(i));
+ if (item != null) {
+ toStringItem(buffer, indent);
+ } else {
+ buffer.append("<no item>\n");
+ }
+ }
+ }
+
+ private String toStringElement() {
String[] label = (String[])fData.get(LABEL_KEY);
if (label != null && label.length != 0) {
return label[0];
@@ -523,6 +544,6 @@ public class VirtualItem {
if (data != null) {
return data.toString();
}
- return super.toString();
+ return "<no data>";
}
}

Back to the top