Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java50
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/FilterTransform.java102
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/IInternalTreeModelViewer.java118
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ILabelUpdateListener.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProvider.java112
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelLabelProvider.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelViewer.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java384
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java272
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java114
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java272
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java122
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java64
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java330
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java84
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java78
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java78
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckUpdate.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckboxModelProxy.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenCountUpdate.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenUpdate.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation2.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentationFactory.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementCompareRequest.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementContentProvider.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementEditor.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementLabelProvider.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoProvider.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoRequest.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IHasChildrenUpdate.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ILabelUpdate.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelChangedListener.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDelta.java72
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDeltaVisitor.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy2.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory2.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicy.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicyFactory.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java56
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStateUpdateListener.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStatusMonitor.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ITreeModelViewer.java114
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewActionProvider.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputProvider.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputRequestor.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputUpdate.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdate.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdateListener.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IVirtualItemListener.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IVirtualItemValidator.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java68
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewer.java84
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewerFilter.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualItem.java152
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTree.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTreeModelViewer.java96
69 files changed, 1834 insertions, 1834 deletions
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 4b1cf136e..84f75aff8 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
@@ -7,7 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Wind River Systems - Fix for viewer state save/restore [188704]
+ * Wind River Systems - Fix for viewer state save/restore [188704]
* Pawel Piech (Wind River) - added support for a virtual tree model viewer (Bug 242489)
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model;
@@ -29,31 +29,31 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
* Child count result.
*/
private int fCount = 0;
-
+
/**
* Other child count updates for the same content provider. Coalesced requests are
* batched together into an array.
*/
private List<ViewerUpdateMonitor> fBatchedRequests = null;
-
+
/**
- * Flag whether filtering is enabled in viewer. If filtering is enabled, then a
+ * Flag whether filtering is enabled in viewer. If filtering is enabled, then a
* children update is performed on child elements to filter them as part of the
* child count calculation.
*/
private boolean fShouldFilter = false;
-
+
/**
- * Children indexes which are currently filtered. When updating child count, also need
+ * Children indexes which are currently filtered. When updating child count, also need
* to verify that currently filtered children are still filtered.
*/
private int[] fFilteredChildren = null;
-
+
/**
* Children update used to filter children.
*/
private ChildrenUpdate fChildrenUpdate;
-
+
/**
* Constructor
* @param provider the content provider to use for the update
@@ -92,14 +92,14 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
int endIdx = fFilteredChildren[fFilteredChildren.length - 1];
count = endIdx - startIdx + 1;
}
-
+
fChildrenUpdate = new ChildrenUpdate(getContentProvider(), getViewerInput(), getElementPath(), getElement(), startIdx, count, getElementContentProvider()) {
@Override
protected void performUpdate() {
performUpdate(true);
ChildrenCountUpdate.super.scheduleViewerUpdate();
}
-
+
@Override
protected void scheduleViewerUpdate() {
execInDisplayThread(new Runnable() {
@@ -124,8 +124,8 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
super.scheduleViewerUpdate();
}
}
-
-
+
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ViewerUpdateMonitor#performUpdate()
*/
@@ -142,8 +142,8 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) {
DebugUIPlugin.trace("setChildCount(" + getElement() + ", modelCount: " + fCount + " viewCount: " + viewCount + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
- // Special case for element 0 in a set of filtered elements:
- // Child 0 is automatically updated by the tree at the same time that the child count is requested. Therefore,
+ // Special case for element 0 in a set of filtered elements:
+ // Child 0 is automatically updated by the tree at the same time that the child count is requested. Therefore,
// If this child count update filtered out this element, it needs to be updated again.
if (fShouldFilter && getContentProvider().isFiltered(elementPath, 0)) {
getContentProvider().updateElement(elementPath, 0);
@@ -156,14 +156,14 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
public void setChildCount(int numChildren) {
fCount = numChildren;
}
-
+
@Override
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append("IChildrenCountUpdate: "); //$NON-NLS-1$
buf.append(getElement());
return buf.toString();
- }
+ }
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#coalesce(org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor)
@@ -185,7 +185,7 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
}
return false;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#startRequest()
*/
@@ -204,7 +204,7 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
getElementContentProvider().update(updates);
}
}
-
+
@Override
boolean containsUpdate(TreePath path) {
if (getElementPath().equals(path)) {
@@ -237,20 +237,20 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
return path.getParentPath();
}
return path;
- }
-
+ }
+
int getCount() {
return fCount;
}
-
+
@Override
protected boolean doEquals(ViewerUpdateMonitor update) {
- return
- update instanceof ChildrenCountUpdate &&
- getViewerInput().equals(update.getViewerInput()) &&
+ return
+ update instanceof ChildrenCountUpdate &&
+ getViewerInput().equals(update.getViewerInput()) &&
getElementPath().equals(update.getElementPath());
}
-
+
@Override
protected int doHashCode() {
return getClass().hashCode() + getViewerInput().hashCode() + getElementPath().hashCode();
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 db71f4c80..25ebff492 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
@@ -7,7 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Wind River Systems - Fix for viewer state save/restore [188704]
+ * Wind River Systems - Fix for viewer state save/restore [188704]
* Pawel Piech (Wind River) - added support for a virtual tree model viewer (Bug 242489)
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model;
@@ -19,19 +19,19 @@ import org.eclipse.jface.viewers.TreePath;
/**
* This class is public so the test suite has access - it should be default protection.
- *
- * @since 3.3
+ *
+ * @since 3.3
*/
public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpdate {
-
+
private Object[] fElements;
private int fIndex;
private int fLength;
/**
* Constructs a request to update an element
- *
- * @param provider the content provider
+ *
+ * @param provider the content provider
* @param viewerInput the current input
* @param elementPath the path to the element being update
* @param element the element
@@ -43,14 +43,14 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
fIndex = index;
fLength = 1;
}
-
+
public ChildrenUpdate(TreeModelContentProvider provider, Object viewerInput, TreePath elementPath, Object element, int index, int length, IElementContentProvider elementContentProvider) {
super(provider, viewerInput, elementPath, element, elementContentProvider, provider.getPresentationContext());
fIndex = index;
fLength = length;
}
-
-
+
+
protected void performUpdate(boolean updateFilterOnly) {
TreeModelContentProvider provider = getContentProvider();
TreePath elementPath = getElementPath();
@@ -94,7 +94,7 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
}
}
}
-
+
if (!updateFilterOnly) {
provider.getStateTracker().restorePendingStateOnUpdate(elementPath, -1, true, true, true);
}
@@ -106,14 +106,14 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor#performUpdate()
*/
@Override
protected void performUpdate() {
performUpdate(false);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#setChild(java.lang.Object, int)
*/
@@ -126,16 +126,16 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
}
/* (non-Javadoc)
- *
+ *
* This method is public so the test suite has access - it should be default protection.
- *
+ *
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#coalesce(org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor)
*/
@Override
public synchronized boolean coalesce(ViewerUpdateMonitor request) {
if (request instanceof ChildrenUpdate) {
ChildrenUpdate cu = (ChildrenUpdate) request;
- if (getElement().equals(cu.getElement()) && getElementPath().equals(cu.getElementPath())) {
+ if (getElement().equals(cu.getElement()) && getElementPath().equals(cu.getElementPath())) {
int end = fIndex + fLength;
int otherStart = cu.getOffset();
int otherEnd = otherStart + cu.getLength();
@@ -153,14 +153,14 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
}
return false;
}
-
+
@Override
boolean containsUpdate(TreePath path) {
return getElementPath().equals(path);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#getLength()
*/
@@ -176,7 +176,7 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
public int getOffset() {
return fIndex;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#startRequest()
*/
@@ -204,37 +204,37 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
@Override
int getPriority() {
return 3;
- }
-
+ }
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#getSchedulingPath()
*/
@Override
TreePath getSchedulingPath() {
return getElementPath();
- }
-
+ }
+
/**
* Sets this request's offset. Used when modifying a waiting request when
* the offset changes due to a removed element.
- *
+ *
* @param offset new offset
*/
void setOffset(int offset) {
fIndex = offset;
}
-
+
Object[] getElements() {
return fElements;
}
-
+
@Override
protected boolean doEquals(ViewerUpdateMonitor update) {
- return
+ return
update instanceof ChildrenUpdate &&
((ChildrenUpdate)update).getOffset() == getOffset() &&
((ChildrenUpdate)update).getLength() == getLength() &&
- getViewerInput().equals(update.getViewerInput()) &&
+ getViewerInput().equals(update.getViewerInput()) &&
getElementPath().equals(update.getElementPath());
}
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 592b73664..433b8d38f 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
@@ -7,7 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Wind River Systems - Fix for viewer state save/restore [188704]
+ * Wind River Systems - Fix for viewer state save/restore [188704]
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model;
@@ -28,8 +28,8 @@ public class ElementCompareRequest extends MementoUpdate implements IElementComp
private boolean fKnowsHasChildren;
private boolean fKnowsChildCount;
private boolean fCheckChildrenRealized;
-
-
+
+
/**
* @param provider the content provider to use for the update
* @param viewerInput the current input
@@ -38,15 +38,15 @@ public class ElementCompareRequest extends MementoUpdate implements IElementComp
* @param memento Memento to encode result into
* @param delta Delta to write the result comparison into.
* @param modelIndex Index of element to compare.
- * @param knowsHasChildren Flag indicating whether provider knows the has
- * children state of element.
- * @param knowsChildCount Flag indicating whether provider knows the
+ * @param knowsHasChildren Flag indicating whether provider knows the has
+ * children state of element.
+ * @param knowsChildCount Flag indicating whether provider knows the
* child count state of element.
* @param checkChildrenRealized Flag indicating if any realized children should be checked
*/
- public ElementCompareRequest(TreeModelContentProvider provider, Object viewerInput, Object element,
- TreePath elementPath, IMemento memento, ModelDelta delta, int modelIndex,
- boolean knowsHasChildren, boolean knowsChildCount, boolean checkChildrenRealized)
+ public ElementCompareRequest(TreeModelContentProvider provider, Object viewerInput, Object element,
+ TreePath elementPath, IMemento memento, ModelDelta delta, int modelIndex,
+ boolean knowsHasChildren, boolean knowsChildCount, boolean checkChildrenRealized)
{
super(provider, viewerInput, provider.getPresentationContext(), element, elementPath, memento);
fProvider = provider;
@@ -83,25 +83,25 @@ public class ElementCompareRequest extends MementoUpdate implements IElementComp
}
});
}
- }
-
+ }
+
public boolean isEqual() {
return fEqual;
}
-
+
ModelDelta getDelta() {
return fDelta;
}
-
+
int getModelIndex() {
return fModelIndex;
}
-
+
void setKnowsHasChildren(boolean hasChildren) {
fKnowsHasChildren = hasChildren;
}
-
+
boolean knowsHasChildren() {
return fKnowsHasChildren;
}
@@ -109,19 +109,19 @@ public class ElementCompareRequest extends MementoUpdate implements IElementComp
void setKnowsChildCount(boolean childCount) {
fKnowsChildCount = childCount;
}
-
+
boolean knowChildCount() {
return fKnowsChildCount;
}
void setCheckChildrenRealized(boolean checkChildrenRealized) {
- fCheckChildrenRealized = checkChildrenRealized;
+ fCheckChildrenRealized = checkChildrenRealized;
}
-
+
boolean checkChildrenRealized() {
return fCheckChildrenRealized;
}
-
+
@Override
public String toString() {
StringBuffer buf = new StringBuffer();
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 6351fc3a4..6e53cf171 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
@@ -19,11 +19,11 @@ import org.eclipse.ui.IMemento;
/**
* Request for element memento.
- *
+ *
* @since 3.3
*/
class ElementMementoRequest extends MementoUpdate implements IElementMementoRequest {
-
+
private IElementMementoCollector fManager;
private ModelDelta fDelta;
@@ -47,7 +47,7 @@ class ElementMementoRequest extends MementoUpdate implements IElementMementoRequ
*/
@Override
public void done() {
-
+
ITreeModelViewer viewer = getContentProvider().getViewer();
if (viewer == null) return; // disposed
if (viewer.getDisplay().getThread() == Thread.currentThread()) {
@@ -60,12 +60,12 @@ class ElementMementoRequest extends MementoUpdate implements IElementMementoRequ
}
});
}
-
+
}
-
+
private void doComplete() {
if (getContentProvider().isDisposed()) return;
-
+
if (!isCanceled() && (getStatus() == null || getStatus().isOK())) {
// replace the element with a memento
fDelta.setElement(getMemento());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/FilterTransform.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/FilterTransform.java
index af91ff4ea..5e207da8b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/FilterTransform.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/FilterTransform.java
@@ -34,16 +34,16 @@ import org.eclipse.jface.viewers.TreePath;
public class FilterTransform {
private Node root = new Node();
-
+
class Node {
private int[] filteredIndexes = null;
private Object[] filteredElements = null;
private Map<Object, Node> children = null; // only set for parent nodes,
// indexed by child
-
+
Node() {
}
-
+
boolean addFilter(TreePath path, int childIndex, int pathIndex, Object filtered) {
if (pathIndex == path.getSegmentCount()) {
if (filteredIndexes == null) {
@@ -80,7 +80,7 @@ public class FilterTransform {
filteredElements = filt;
return true;
}
-
+
if (children == null) {
children = new HashMap<Object, Node>();
}
@@ -92,7 +92,7 @@ public class FilterTransform {
}
return node.addFilter(path, childIndex, pathIndex + 1, filtered);
}
-
+
boolean clear(TreePath path, int pathIndex) {
if (pathIndex == path.getSegmentCount()) {
return true;
@@ -109,7 +109,7 @@ public class FilterTransform {
}
return children.isEmpty() && (filteredIndexes == null || filteredIndexes.length == 0);
}
-
+
boolean clear(TreePath path, int childIndex, int pathIndex) {
if (pathIndex == path.getSegmentCount()) {
if (filteredIndexes != null) {
@@ -158,8 +158,8 @@ public class FilterTransform {
} else {
return false;
}
- }
-
+ }
+
Node find(TreePath path, int pathIndex) {
if (pathIndex == path.getSegmentCount()) {
return this;
@@ -174,7 +174,7 @@ public class FilterTransform {
}
return null;
}
-
+
int viewToModel(int childIndex) {
if (filteredIndexes == null) {
return childIndex;
@@ -185,11 +185,11 @@ public class FilterTransform {
// has asked for the model index corresponding to the 4th viewer
// index, then we want to find the 5th missing number in the
// filtered index sequence.
-
+
int count = -1; // count from 0, 1, 2...
int missingNumbers = 0; // how many numbers missing from the filtered index
int offset = 0; // offset into the filtered index
-
+
while (missingNumbers < (childIndex + 1)) {
count++;
if (offset < filteredIndexes.length) {
@@ -206,7 +206,7 @@ public class FilterTransform {
}
return count;
}
-
+
int modelToView(int childIndex) {
if (filteredIndexes == null) {
return childIndex;
@@ -222,15 +222,15 @@ public class FilterTransform {
}
}
return childIndex - offset;
- }
-
+ }
+
int modelToViewCount(int childCount) {
if (filteredIndexes == null) {
return childCount;
}
return childCount - filteredIndexes.length;
}
-
+
boolean isFiltered(int index) {
if (filteredIndexes != null) {
int location = Arrays.binarySearch(filteredIndexes, index);
@@ -238,7 +238,7 @@ public class FilterTransform {
}
return false;
}
-
+
int indexOfFilteredElement(Object element) {
if (filteredElements != null) {
for (int i = 0; i < filteredElements.length; i++) {
@@ -249,11 +249,11 @@ public class FilterTransform {
}
return -1;
}
-
+
/**
* Sets the child count for this element, trimming any filtered elements
* that were above this count.
- *
+ *
* @param childCount new child count
*/
void setModelChildCount(int childCount) {
@@ -263,7 +263,7 @@ public class FilterTransform {
// trim
if (i == 0) {
filteredIndexes = null;
- // bug 200325 - filteredElements should have the same length
+ // bug 200325 - filteredElements should have the same length
// as filteredIndexes
filteredElements = null;
return;
@@ -271,7 +271,7 @@ public class FilterTransform {
int[] temp = new int[i + 1];
System.arraycopy(filteredIndexes, 0, temp, 0, temp.length);
filteredIndexes = temp;
- // bug 200325 - filteredElements should have the same length
+ // bug 200325 - filteredElements should have the same length
// as filteredIndexes
Object[] temp2 = new Object[i + 1];
System.arraycopy(filteredElements, 0, temp2, 0, temp2.length);
@@ -281,10 +281,10 @@ public class FilterTransform {
}
}
}
-
+
/**
* Updates filter index for a removed element at the given index
- *
+ *
* @param index index at which an element was removed
*/
void removeElementFromFilters(int index) {
@@ -333,7 +333,7 @@ public class FilterTransform {
/**
* Filters the specified child of the given parent and returns
* whether the filter was added.
- *
+ *
* @param parentPath path to parent element
* @param childIndex index of filtered child relative to parent (in model coordinates)
* @param element the filtered element
@@ -343,46 +343,46 @@ public class FilterTransform {
public boolean addFilteredIndex(TreePath parentPath, int childIndex, Object element) {
return root.addFilter(parentPath, childIndex, 0, element);
}
-
+
/**
* Clears all filtered elements.
*/
public void clear() {
root = new Node();
}
-
+
/**
* Clears all filters in the subtree of the given element.
- *
+ *
* @param path element path
*/
public void clear(TreePath path) {
root.clear(path, 0);
}
-
+
/**
* Clears the given filtered index of the specified parent. I.e.
* the child still exists, but is no longer filtered.
- *
+ *
* @param parentPath parent path
* @param index index to clear
*/
public void clear(TreePath parentPath, int index) {
root.clear(parentPath, index, 0);
- }
-
+ }
+
public int indexOfFilteredElement(TreePath parentPath, Object element) {
Node parentNode = root.find(parentPath, 0);
if (parentNode == null) {
return -1;
}
- return parentNode.indexOfFilteredElement(element);
+ return parentNode.indexOfFilteredElement(element);
}
-
+
/**
* Translates and returns the given model index (raw index) into
* a view index (filtered index), or -1 if filtered.
- *
+ *
* @param parentPath path to parent element
* @param childIndex index of child element in model space
* @return the given index in view coordinates, or -1 if filtered.
@@ -394,11 +394,11 @@ public class FilterTransform {
}
return parentNode.modelToView(childIndex);
}
-
+
/**
* Translates and returns the given view index (filtered) into
* a model index (raw index).
- *
+ *
* @param parentPath path to parent element
* @param childIndex index of child element in view space
* @return the given index in model coordinates
@@ -410,10 +410,10 @@ public class FilterTransform {
}
return parentNode.viewToModel(childIndex);
}
-
+
/**
* Returns the number of children for the given parent, in the model.
- *
+ *
* @param parentPath path to parent element
* @param viewCount number of children in the view
* @return number of children in the model
@@ -427,11 +427,11 @@ public class FilterTransform {
}
return viewCount;
}
-
+
/**
* Translates and returns the given model child count (raw) into
* a view count (filtered).
- *
+ *
* @param parentPath path to parent element
* @param count child count in model space
* @return the given count in view coordinates
@@ -442,11 +442,11 @@ public class FilterTransform {
return count;
}
return parentNode.modelToViewCount(count);
- }
-
+ }
+
/**
* Returns whether the given index of the specified parent is currently filtered.
- *
+ *
* @param parentPath path to parent element
* @param index index of child element
* @return whether the child is currently filtered
@@ -458,10 +458,10 @@ public class FilterTransform {
}
return parentNode.isFiltered(index);
}
-
+
/**
* Returns filtered children of the given parent, or <code>null</code> if none.
- *
+ *
* @param parentPath Path of parent element
* @return filtered children or <code>null</code>
*/
@@ -472,10 +472,10 @@ public class FilterTransform {
}
return parentNode.filteredIndexes;
}
-
+
/**
* Clears any filters for the given parent above the given count.
- *
+ *
* @param parentPath path to parent element
* @param childCount child count
*/
@@ -485,11 +485,11 @@ public class FilterTransform {
parentNode.setModelChildCount(childCount);
}
}
-
+
/**
* The element at the given index has been removed from the parent. Update
* indexes.
- *
+ *
* @param parentPath path to parent element
* @param index index of child element in model coordinates
*/
@@ -499,11 +499,11 @@ public class FilterTransform {
parentNode.removeElementFromFilters(index);
}
}
-
+
/**
* The element has been removed from the parent. Update
* filtered indexes, in case it was a filtered object.
- *
+ *
* @param parentPath path to parent element
* @param element removed element
* @return true if element was removed
@@ -518,5 +518,5 @@ public class FilterTransform {
}
}
return false;
- }
+ }
}
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 d16ba7b2c..059f4570a 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
@@ -7,7 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Wind River Systems - Fix for viewer state save/restore [188704]
+ * Wind River Systems - Fix for viewer state save/restore [188704]
* Pawel Piech (Wind River) - added support for a virtual tree model viewer (Bug 242489)
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model;
@@ -26,13 +26,13 @@ import org.eclipse.jface.viewers.TreePath;
class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdate {
private boolean fHasChildren = false;
-
+
private List<ViewerUpdateMonitor> fBatchedRequests = null;
-
+
/**
* Constructs a request to update an element
- *
- * @param provider the content provider
+ *
+ * @param provider the content provider
* @param viewerInput the current input
* @param elementPath the path to the element being update
* @param element the element
@@ -75,7 +75,7 @@ class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdat
buf.append(getElement());
return buf.toString();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#coalesce(org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor)
*/
@@ -137,8 +137,8 @@ class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdat
@Override
int getPriority() {
return 1;
- }
-
+ }
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#getSchedulingPath()
*/
@@ -149,17 +149,17 @@ class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdat
return path.getParentPath();
}
return path;
- }
-
+ }
+
boolean hasChildren() {
return fHasChildren;
}
-
+
@Override
protected boolean doEquals(ViewerUpdateMonitor update) {
- return
- update instanceof HasChildrenUpdate &&
- getViewerInput().equals(update.getViewerInput()) &&
+ return
+ update instanceof HasChildrenUpdate &&
+ getViewerInput().equals(update.getViewerInput()) &&
getElementPath().equals(update.getElementPath());
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/IInternalTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/IInternalTreeModelViewer.java
index 9aa4c1f62..0b66433e4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/IInternalTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/IInternalTreeModelViewer.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* IBM Corporation - ongoing bug fixes and enhancements
@@ -22,19 +22,19 @@ import org.eclipse.swt.graphics.RGB;
/**
* This interface must be implemented by the viewer which uses the
* {@link TreeModelContentProvider} content provider. It allows the content
- * provider to update the viewer with information retrieved from the
+ * provider to update the viewer with information retrieved from the
* content, proxy, memento, and other element-based providers.
- *
+ *
* @since 3.8
*/
public interface IInternalTreeModelViewer extends ITreeModelViewer {
/**
* Returns this viewer's filters.
- *
+ *
* @return an array of viewer filters
* @see org.eclipse.jface.viewers.StructuredViewer#setFilters(ViewerFilter[])
- */
+ */
@Override
public ViewerFilter[] getFilters();
@@ -44,11 +44,11 @@ public interface IInternalTreeModelViewer extends ITreeModelViewer {
* @param index Index of the element to be revealed.
*/
public void reveal(TreePath path, int index);
-
+
/**
- * Triggers an update of the given element's state. If multiple instances
+ * Triggers an update of the given element's state. If multiple instances
* of the given element are found in the tree, they will all be updated.
- *
+ *
* @param element Element to update.
*/
public void update(Object element);
@@ -58,36 +58,36 @@ public interface IInternalTreeModelViewer extends ITreeModelViewer {
* <p>
* This method should only be called by the viewer framework.
* </p>
- *
+ *
* @param parentOrTreePath Parent object, or a tree path of the parent element.
* @param index Index at which to set the new element.
* @param element Element object.
* @noreference This method is not intended to be referenced by clients.
*/
public void replace(Object parentOrTreePath, final int index, Object element);
-
+
/**
- * Set the number of children of the given element or tree path. To set the
- * number of children of the invisible root of the tree, you can pass the
+ * Set the number of children of the given element or tree path. To set the
+ * number of children of the invisible root of the tree, you can pass the
* input object or an empty tree path.
* <p>
* This method should only be called by the viewer framework.
* </p>
- *
+ *
* @param elementOrTreePath The element, or tree path.
* @param count new value
* @noreference This method is not intended to be referenced by clients.
*/
public void setChildCount(final Object elementOrTreePath, final int count);
-
+
/**
- * Inform the viewer about whether the given element or tree path has
- * children. Avoid calling this method if the number of children has
+ * Inform the viewer about whether the given element or tree path has
+ * children. Avoid calling this method if the number of children has
* already been set.
* <p>
* This method should only be called by the viewer framework.
* </p>
- *
+ *
* @param elementOrTreePath the element, or tree path
* @param hasChildren new value.
* @noreference This method is not intended to be referenced by clients.
@@ -100,7 +100,7 @@ public interface IInternalTreeModelViewer extends ITreeModelViewer {
* <p>
* This method should only be called by the viewer framework.
* </p>
- *
+ *
* @param elementPath tree path to element to consider for expansion
* @noreference This method is not intended to be referenced by clients.
*/
@@ -118,7 +118,7 @@ public interface IInternalTreeModelViewer extends ITreeModelViewer {
* @param expanded
* <code>true</code> if the node is expanded, and
* <code>false</code> if collapsed
- *
+ *
* @noreference This method is not intended to be referenced by clients.
*/
public void setExpandedState(Object elementOrTreePath, boolean expanded);
@@ -136,7 +136,7 @@ public interface IInternalTreeModelViewer extends ITreeModelViewer {
* @param level
* non-negative level, or <code>ALL_LEVELS</code> to expand all
* levels of the tree
- *
+ *
* @noreference This method is not intended to be referenced by clients.
*/
public void expandToLevel(Object elementOrTreePath, int level);
@@ -149,7 +149,7 @@ public interface IInternalTreeModelViewer extends ITreeModelViewer {
* </p>
* @param elementOrTreePath the element, or the tree path to the element
* @noreference This method is not intended to be referenced by clients.
- */
+ */
public void remove(Object elementOrTreePath);
/**
@@ -161,7 +161,7 @@ public interface IInternalTreeModelViewer extends ITreeModelViewer {
* @param parentOrTreePath the parent element, the input element, or a tree path to the parent element
* @param index child index
* @noreference This method is not intended to be referenced by clients.
- */
+ */
public void remove(Object parentOrTreePath, final int index);
/**
@@ -172,19 +172,19 @@ public interface IInternalTreeModelViewer extends ITreeModelViewer {
* <p>
* This method should only be called by the viewer framework.
* </p>
- * @param parentOrTreePath the parent element, or the tree path to the parent
+ * @param parentOrTreePath the parent element, or the tree path to the parent
*
* @param element the element
* @param position a 0-based position relative to the model, or -1 to indicate
* the last position
* @noreference This method is not intended to be referenced by clients.
- */
+ */
public void insert(Object parentOrTreePath, Object element, int position);
/**
* Returns whether the candidate selection should override the current
* selection.
- * @param current Current selection in viewer.
+ * @param current Current selection in viewer.
* @param candidate Proposed new selection.
* @return whether new selection should override the current
*/
@@ -200,22 +200,22 @@ public interface IInternalTreeModelViewer extends ITreeModelViewer {
* <code>false</code> if collapsed
*/
public boolean getExpandedState(Object elementOrTreePath);
-
+
/**
* Returns whether the node corresponding to the given element or tree path
* has any child elements.
- *
+ *
* @param elementOrTreePath Path to element
* @return Returns whether the given element has children.
*/
public boolean getHasChildren(Object elementOrTreePath);
-
+
/**
* Returns the child count of the element at the given path. <br>
* Note: The child count may be incorrect if the element is not
* expanded in the tree.
- *
- * @param path Path to get count for.
+ *
+ * @param path Path to get count for.
* @return The child count.
*/
public int getChildCount(TreePath path);
@@ -223,98 +223,98 @@ public interface IInternalTreeModelViewer extends ITreeModelViewer {
/**
* Returns the element which is a child of the element at the
* given path, with the given index.
- *
+ *
* @param path Path to parent element.
* @param index Index of child element.
* @return Child element.
*/
public Object getChildElement(TreePath path, int index);
-
+
/**
- * Returns the tree path of the element that is at the top of the
+ * Returns the tree path of the element that is at the top of the
* viewer.
- *
- * @return the tree path of the element at the top of the
+ *
+ * @return the tree path of the element at the top of the
* viewer.
*/
public TreePath getTopElementPath();
-
- /**
+
+ /**
* Finds the index of the given element with a parent of given path.
- *
- * @param parentPath Path of parent element.
+ *
+ * @param parentPath Path of parent element.
* @param element Element to find.
- *
+ *
* @return The element's index, or -1 if not found.
*/
public int findElementIndex(TreePath parentPath, Object element);
/**
- * Returns a boolean indicating whether all the child elements of the
+ * Returns a boolean indicating whether all the child elements of the
* given parent have been realized already.
- *
+ *
* @param parentPath Path of parent element.
* @return true if all children realized
*/
public boolean getElementChildrenRealized(TreePath parentPath);
-
+
/**
* Clears the selection in the viewer, if any, without firing
* selection change notification. This is only to be used by
* the platform.
*/
public void clearSelectionQuiet();
-
+
/**
* Sets the element's display information.
* <p>
* This method should only be called by the viewer framework.
* </p>
- *
- * @param path Element path.
+ *
+ * @param path Element path.
* @param numColumns Number of columns in the data.
- * @param labels Array of labels. The array cannot to be
+ * @param labels Array of labels. The array cannot to be
* <code>null</code>, but values within the array may be.
* @param images Array of image descriptors, may be <code>null</code>.
* @param fontDatas Array of fond data objects, may be <code>null</code>.
- * @param foregrounds Array of RGB values for foreground colors, may be
+ * @param foregrounds Array of RGB values for foreground colors, may be
* <code>null</code>.
- * @param backgrounds Array of RGB values for background colors, may be
+ * @param backgrounds Array of RGB values for background colors, may be
* <code>null</code>.
* @noreference This method is not intended to be referenced by clients.
*/
- public void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] images, FontData[] fontDatas, RGB[] foregrounds, RGB[] backgrounds);
+ public void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] images, FontData[] fontDatas, RGB[] foregrounds, RGB[] backgrounds);
/**
* Returns identifiers of the visible columns in this viewer, or <code>null</code>
* if there is currently no column presentation.
- *
+ *
* @return visible columns or <code>null</code>
*/
- public String[] getVisibleColumns();
-
+ public String[] getVisibleColumns();
+
/**
* Sets the element check state data.
- *
+ *
* @param path Path of element to check.
* @param checked if true, item will be checked
* @param grayed if true item will be grayed
*/
- public void setElementChecked(TreePath path, boolean checked, boolean grayed);
+ public void setElementChecked(TreePath path, boolean checked, boolean grayed);
/**
* Retrieves the element check state.
- *
+ *
* @param path Path of element to return check state for.
* @return the element checked state
*/
- public boolean getElementChecked(TreePath path);
+ public boolean getElementChecked(TreePath path);
/**
* Retrieves the element's check box grayed state.
- *
+ *
* @param path Path of element to return grayed state for.
* @return the element grayed state
*/
- public boolean getElementGrayed(TreePath path);
+ public boolean getElementGrayed(TreePath path);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ILabelUpdateListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ILabelUpdateListener.java
index a53be350f..b296064a0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ILabelUpdateListener.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ILabelUpdateListener.java
@@ -14,7 +14,7 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate;
/**
* Notified of label updates.
- *
+ *
* @since 3.3
*/
public interface ILabelUpdateListener {
@@ -23,25 +23,25 @@ public interface ILabelUpdateListener {
* Notification that a sequence of viewer updates are starting.
*/
public void labelUpdatesBegin();
-
+
/**
* Notification that viewer updates are complete. Corresponds to
* a <code>viewerUpdatesBegin()</code> notification.
*/
public void labelUpdatesComplete();
-
+
/**
* Notification that a specific update has started within
* a sequence of updates.
- *
+ *
* @param update update
*/
public void labelUpdateStarted(ILabelUpdate update);
-
+
/**
* Notification that a specific update has completed within a
* sequence of updates.
- *
+ *
* @param update update
*/
public void labelUpdateComplete(ILabelUpdate update);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProvider.java
index 4c995ec2a..cf2d9bcf2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProvider.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -21,65 +21,65 @@ import org.eclipse.jface.viewers.ILazyTreePathContentProvider;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.Viewer;
-/**
+/**
* {@link TreeModelViewer} content provider interface.
- *
+ *
* @since 3.5
*/
public interface ITreeModelContentProvider extends ILazyTreePathContentProvider {
/**
* Bit-mask which allows all possible model delta flags.
- *
+ *
* @since 3.6
* @see #setModelDeltaMask(int)
*/
- public static final int ALL_MODEL_DELTA_FLAGS = ~0;
+ public static final int ALL_MODEL_DELTA_FLAGS = ~0;
/**
- * Bit-mask which allows only flags which control selection and expansion.
- *
+ * Bit-mask which allows only flags which control selection and expansion.
+ *
* @since 3.6
* @see #setModelDeltaMask(int)
*/
- public static final int CONTROL_MODEL_DELTA_FLAGS =
+ public static final int CONTROL_MODEL_DELTA_FLAGS =
IModelDelta.EXPAND | IModelDelta.COLLAPSE | IModelDelta.SELECT | IModelDelta.REVEAL | IModelDelta.FORCE;
/**
* Bit-mask which allows only flags which update viewer's information
* about the model.
- *
+ *
* @since 3.6
* @see #setModelDeltaMask(int)
*/
- public static final int UPDATE_MODEL_DELTA_FLAGS =
+ public static final int UPDATE_MODEL_DELTA_FLAGS =
IModelDelta.ADDED | IModelDelta.CONTENT | IModelDelta.INSERTED | IModelDelta.INSTALL | IModelDelta.REMOVED |
IModelDelta.REPLACED | IModelDelta.STATE | IModelDelta.UNINSTALL;
/**
* Translates and returns the given child index from the viewer coordinate
* space to the model coordinate space.
- *
+ *
* @param parentPath path to parent element
* @param index index of child element in viewer (filtered) space
* @return index of child element in model (raw) space
*/
public int viewToModelIndex(TreePath parentPath, int index);
-
+
/**
* Translates and returns the given child count from the viewer coordinate
* space to the model coordinate space.
- *
+ *
* @param parentPath path to parent element
* @param count number of child elements in viewer (filtered) space
* @return number of child elements in model (raw) space
*/
public int viewToModelCount(TreePath parentPath, int count);
-
+
/**
* Translates and returns the given child index from the model coordinate
* space to the viewer coordinate space.
- *
+ *
* @param parentPath path to parent element
* @param index index of child element in model (raw) space
* @return index of child element in viewer (filtered) space or -1 if filtered
@@ -89,31 +89,31 @@ public interface ITreeModelContentProvider extends ILazyTreePathContentProvider
/**
* Returns whether the children of given element should be filtered.
* <p>This method is used to determine whether any of the registered filters
- * that extend {@link TreeModelViewerFilter} are applicable to the given
- * element. If so, then children of given element should be filtered
- * prior to populating them in the viewer.
- *
+ * that extend {@link TreeModelViewerFilter} are applicable to the given
+ * element. If so, then children of given element should be filtered
+ * prior to populating them in the viewer.
+ *
* @param parentElement
- * the parent element
- * @return whether there are any {@link TreeModelViewerFilter} filters
+ * the parent element
+ * @return whether there are any {@link TreeModelViewerFilter} filters
* applicable to given parent
*/
- public boolean areTreeModelViewerFiltersApplicable(Object parentElement);
-
+ public boolean areTreeModelViewerFiltersApplicable(Object parentElement);
+
/**
* Returns whether the given element is filtered.
- *
+ *
* @param parentElementOrTreePath
* the parent element or path
* @param element
* the child element
* @return whether to filter the element
*/
- public boolean shouldFilter(Object parentElementOrTreePath, Object element);
+ public boolean shouldFilter(Object parentElementOrTreePath, Object element);
/**
* Notification the given element is being unmapped.
- *
+ *
* @param path Path to unmap
*/
public void unmapPath(TreePath path);
@@ -122,27 +122,27 @@ public interface ITreeModelContentProvider extends ILazyTreePathContentProvider
* Sets the bit mask which will be used to filter the {@link IModelDelta}
* coming from the model. Any delta flags which are hidden by the mask
* will be ignored.
- *
+ *
* @param mask for <code>IModelDelta</code> flags
- *
+ *
* @since 3.6
*/
public void setModelDeltaMask(int mask);
-
+
/**
* Returns the current model delta mask.
- *
+ *
* @return bit mask used to filter model delta events.
- *
+ *
* @see #setModelDeltaMask(int)
* @since 3.6
*/
public int getModelDeltaMask();
-
+
/**
* Translates and returns the given child count from the model coordinate
* space to the viewer coordinate space.
- *
+ *
* @param parentPath path to parent element
* @param count child count element in model (raw) space
* @return child count in viewer (filtered) space
@@ -154,27 +154,27 @@ public interface ITreeModelContentProvider extends ILazyTreePathContentProvider
* @param listener Listener to add
*/
public void addViewerUpdateListener(IViewerUpdateListener listener);
-
+
/**
* Removes the specified listener from update notifications.
* @param listener Listener to remove
*/
public void removeViewerUpdateListener(IViewerUpdateListener listener);
-
+
/**
* Registers the given listener for model delta notification.
* This listener is called immediately after the viewer processes
- * the delta.
+ * the delta.
* @param listener Listener to add
*/
public void addModelChangedListener(IModelChangedListener listener);
-
+
/**
* Removes the given listener from model delta notification.
* @param listener Listener to remove
*/
public void removeModelChangedListener(IModelChangedListener listener);
-
+
/**
* Causes the content provider to save the expansion and selection state
* of given element. The state is then restored as the tree is lazily
@@ -200,46 +200,46 @@ public interface ITreeModelContentProvider extends ILazyTreePathContentProvider
/**
* Instructs the content provider to process the given model delta. This
* mechanism can be used to control the view's layout (expanding, selecting
- * , etc.)
- *
+ * , etc.)
+ *
* @param delta The model delta to process.
- * @param mask Mask that can be used to suppress processing of some of the
+ * @param mask Mask that can be used to suppress processing of some of the
* delta flags
- *
+ *
* @since 3.6
*/
public void updateModel(IModelDelta delta, int mask);
/**
- * Instructs the content provider to cancel any pending state changes
+ * Instructs the content provider to cancel any pending state changes
* (i.e. SELECT, REVEAL, EXPAND, COLLAPSE) for the given path. Pending
- * state changes are changes the the viewer plans to re-apply to the
+ * state changes are changes the the viewer plans to re-apply to the
* viewer following a refresh. If the user changes viewer state while
- * the viewer is being refreshed, user's change should override the
- * previous state.
- *
+ * the viewer is being refreshed, user's change should override the
+ * previous state.
+ *
* @param path Path of the element for which to cancel pending changes.
* @param flags Flags indicating the changes to cancel.
*/
public void cancelRestore(TreePath path, int flags);
-
+
/**
- * Notifies the content provider that a client called {@link Viewer#setInput(Object)},
- * and the viewer input is changed.
- * This method is guaranteed to be called after {@link IContentProvider#inputChanged(Viewer, Object, Object)}
- *
+ * Notifies the content provider that a client called {@link Viewer#setInput(Object)},
+ * and the viewer input is changed.
+ * This method is guaranteed to be called after {@link IContentProvider#inputChanged(Viewer, Object, Object)}
+ *
* @param viewer The viewer that uses this content provider.
* @param oldInput Old input object.
* @param newInput New input object.
- *
+ *
* @since 3.8
*/
public void postInputChanged(IInternalTreeModelViewer viewer, Object oldInput, Object newInput);
-
+
/**
- * Notifies the receiver that the given element has had its
+ * Notifies the receiver that the given element has had its
* checked state modified in the viewer.
- *
+ *
* @param path Path of the element that had its checked state changed
* @param checked The new checked state of the element
* @return false if the check state should not change
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelLabelProvider.java
index fe57a3bd1..190a0a8f7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelLabelProvider.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -20,10 +20,10 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.RGB;
/**
- * {@link InternalTreeModelViewer} label provider interface. In addition to
+ * {@link InternalTreeModelViewer} label provider interface. In addition to
* implementing this interface, the label provider for the TreeModelViewer
- * must also extend CellLabelProvider.
- *
+ * must also extend CellLabelProvider.
+ *
* @since 3.5
*/
public interface ITreeModelLabelProvider extends IBaseLabelProvider {
@@ -31,17 +31,17 @@ public interface ITreeModelLabelProvider extends IBaseLabelProvider {
/**
* Requests an label update label of the given element.
* @param elementPath Element to update.
- * @return true if element label provider is found and update will
+ * @return true if element label provider is found and update will
* be requested.
*/
public boolean update(TreePath elementPath);
-
+
/**
* Registers the specified listener for view label update notifications.
* @param listener Listener to add
*/
public void addLabelUpdateListener(ILabelUpdateListener listener);
-
+
/**
* Removes the specified listener from view label update notifications.
* @param listener Listener to remove
@@ -51,25 +51,25 @@ public interface ITreeModelLabelProvider extends IBaseLabelProvider {
/**
* Returns an image for the given image descriptor or <code>null</code>. Adds the image
* to a cache of images if it does not already exist.
- *
+ *
* @param descriptor image descriptor or <code>null</code>
* @return image or <code>null</code>
*/
public Image getImage(ImageDescriptor descriptor);
-
+
/**
- * Returns a font for the given font data or <code>null</code>. Adds the font to the font
+ * Returns a font for the given font data or <code>null</code>. Adds the font to the font
* cache if not yet created.
- *
+ *
* @param fontData font data or <code>null</code>
* @return font font or <code>null</code>
*/
public Font getFont(FontData fontData);
/**
- * Returns a color for the given RGB or <code>null</code>. Adds the color to the color
+ * Returns a color for the given RGB or <code>null</code>. Adds the color to the color
* cache if not yet created.
- *
+ *
* @param rgb RGB or <code>null</code>
* @return color or <code>null</code>
*/
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelViewer.java
index 8d064cb27..aa37b49c6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelViewer.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* IBM Corporation - bug fixing
@@ -12,10 +12,10 @@
package org.eclipse.debug.internal.ui.viewers.model;
/**
- * This interface was moved to the {@link org.eclipse.debug.internal.ui.viewers.model.provisional}
- * package. This stub was left for backward compatibility for packages that
+ * This interface was moved to the {@link org.eclipse.debug.internal.ui.viewers.model.provisional}
+ * package. This stub was left for backward compatibility for packages that
* referenced this internal interface.
- *
+ *
* @deprecated This internal interface was replaced by {@link org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer}.
*/
@Deprecated
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
index 38f00cd75..0aa7c1160 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
@@ -72,58 +72,58 @@ import org.eclipse.ui.IMemento;
/**
* A tree viewer that displays a model.
- *
+ *
* @since 3.3
*/
@SuppressWarnings("deprecation")
public class InternalTreeModelViewer extends TreeViewer implements IInternalTreeModelViewer, org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer
{
-
+
private final IPresentationContext fContext;
-
+
/**
* Current column presentation or <code>null</code>
*/
- private IColumnPresentation fColumnPresentation = null;
-
+ private IColumnPresentation fColumnPresentation = null;
+
/**
* Map of columns presentation id to its visible columns id's (String[])
* When a columns presentation is not in the map, default settings are used.
*/
private final Map<String, String[]> fVisibleColumns = new HashMap<String, String[]>();
-
+
/**
* Map of column id's to persisted sizes
*/
private final Map<Object, Integer> fColumnSizes = new HashMap<Object, Integer>();
-
+
/**
* Map of column presentation id's to an array of integers representing the column order
* for that presentation, or <code>null</code> if default.
*/
private final Map<String, int[]> fColumnOrder = new HashMap<String, int[]>();
-
+
/**
* Map of column presentation id to whether columns should be displayed
- * for that presentation (the user can toggle columns on/off when a
+ * for that presentation (the user can toggle columns on/off when a
* presentation is optional.
*/
private final Map<String, Boolean> fShowColumns = new HashMap<String, Boolean>();
-
+
/**
- * Item's tree path cache
+ * Item's tree path cache
*/
private static final String TREE_PATH_KEY = "TREE_PATH_KEY"; //$NON-NLS-1$
-
+
/**
- * Memento type for column sizes. Sizes are keyed by column presentation id
+ * Memento type for column sizes. Sizes are keyed by column presentation id
*/
private static final String COLUMN_SIZES = "COLUMN_SIZES"; //$NON-NLS-1$
/**
* Memento type for the column order for a presentation context.
* A memento is created for each column presentation
*/
- private static final String COLUMN_ORDER = "COLUMN_ORDER"; //$NON-NLS-1$
+ private static final String COLUMN_ORDER = "COLUMN_ORDER"; //$NON-NLS-1$
/**
* Memento type for the visible columns for a presentation context.
* A memento is created for each column presentation keyed by column number
@@ -133,7 +133,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
* Memento type for whether columns are visible for a presentation context.
* Booleans are keyed by column presentation id
*/
- private static final String SHOW_COLUMNS = "SHOW_COLUMNS"; //$NON-NLS-1$
+ private static final String SHOW_COLUMNS = "SHOW_COLUMNS"; //$NON-NLS-1$
/**
* Memento key for the number of visible columns in a VISIBLE_COLUMNS memento
* or for the width of a column
@@ -142,21 +142,21 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
/**
* Memento key prefix a visible column
*/
- private static final String COLUMN = "COLUMN"; //$NON-NLS-1$
-
+ private static final String COLUMN = "COLUMN"; //$NON-NLS-1$
+
/**
* True while performing an insert... we allow insert with filters
*/
private boolean fInserting = false;
-
+
/**
* Whether to notify the content provider when an element is unmapped
*/
private boolean fNotifyUnmap = true;
-
+
/**
* Persist column sizes when they change.
- *
+ *
* @since 3.2
*/
class ColumnListener implements ControlListener {
@@ -176,14 +176,14 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
persistColumnSizes();
}
}
-
- private final ColumnListener fListener = new ColumnListener();
+
+ private final ColumnListener fListener = new ColumnListener();
/**
* Proxy to cell modifier/editor support
*/
class CellModifierProxy implements ICellModifier {
-
+
private ICellModifier fModifier;
/* (non-Javadoc)
@@ -236,7 +236,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
fModifier.modify(element, property, value);
}
}
-
+
/**
* Clears client's column editor and cell editors
*/
@@ -260,12 +260,12 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
}
-
+
}
-
+
private final CellModifierProxy fCellModifier;
-
-
+
+
/**
* @param parent the parent composite
* @param style the widget style bits
@@ -281,9 +281,9 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
fContext = context;
setContentProvider(createContentProvider());
setLabelProvider(createLabelProvider());
-
+
// A pop-up viewer is transient and does not automatically expand
- // and select elements up when requested by the model
+ // and select elements up when requested by the model
if ((style & SWT.POP_UP) != 0) {
((ITreeModelContentProvider)getContentProvider()).setModelDeltaMask(
~ITreeModelContentProvider.CONTROL_MODEL_DELTA_FLAGS);
@@ -292,7 +292,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
context.setProperty(ICheckUpdate.PROP_CHECK, Boolean.TRUE);
}
}
-
+
/**
* @return content provider for this tree viewer
*/
@@ -300,7 +300,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
{
return new TreeModelContentProvider();
}
-
+
/**
* @return label provider for this tree viewer
*/
@@ -308,12 +308,12 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
{
return new TreeModelLabelProvider(this);
}
-
+
/* (non-Javadoc)
- *
+ *
* Workaround for bug 159461: when an item is cleared it's label is cleared. To avoid
* flashing, restore its label to its previous value.
- *
+ *
* @see org.eclipse.jface.viewers.TreeViewer#hookControl(org.eclipse.swt.widgets.Control)
*/
@Override
@@ -329,9 +329,9 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
});
super.hookControl(control);
}
-
+
/**
- * @param item the item
+ * @param item the item
*/
private void preserveItem(TreeItem item) {
Object[] labels = (Object[]) item.getData(PREV_LABEL_KEY);
@@ -378,8 +378,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.StructuredViewer#handleInvalidSelection
- *
- * Override the default handler for invalid selection to allow model
+ *
+ * Override the default handler for invalid selection to allow model
* selection policy to select the new selection.
*/
@Override
@@ -402,7 +402,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
super.handleInvalidSelection(selection, newSelection);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ContentViewer#handleDispose(org.eclipse.swt.events.DisposeEvent)
@@ -413,20 +413,20 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
fColumnPresentation.dispose();
}
fCellModifier.clear();
-
+
super.handleDispose(event);
}
-
+
/**
* Returns this viewer's presentation context.
- *
+ *
* @return presentation context
*/
@Override
public IPresentationContext getPresentationContext() {
return fContext;
}
-
+
@Override
protected void unmapElement(Object element, Widget widget) {
if (fNotifyUnmap) {
@@ -435,7 +435,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
super.unmapElement(element, widget);
}
-
+
@Override
protected void associate(Object element, Item item) {
// see AbstractTreeViewer.associate(...)
@@ -455,9 +455,9 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
/* (non-Javadoc)
- *
+ *
* We need tree paths when disposed/unmapped in any order so cache the tree path.
- *
+ *
* @see org.eclipse.jface.viewers.TreeViewer#mapElement(java.lang.Object, org.eclipse.swt.widgets.Widget)
*/
@Override
@@ -469,11 +469,11 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
widget.setData(TREE_PATH_KEY, TreeModelContentProvider.EMPTY_TREE_PATH);
}
}
-
+
/* (non-Javadoc)
- *
+ *
* Override because we allow inserting with filters present.
- *
+ *
* @see org.eclipse.jface.viewers.AbstractTreeViewer#insert(java.lang.Object, java.lang.Object, int)
*/
@Override
@@ -485,11 +485,11 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
fInserting = false;
}
}
-
+
/* (non-Javadoc)
- *
+ *
* Override because we allow inserting with filters present.
- *
+ *
* @see org.eclipse.jface.viewers.StructuredViewer#hasFilters()
*/
@Override
@@ -499,17 +499,17 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
return super.hasFilters();
}
-
+
@Override
protected void unmapAllElements() {
- // Do nothing when called from StructuredViewer.setInput(), to avoid
+ // Do nothing when called from StructuredViewer.setInput(), to avoid
// clearing elements before viewer state is saved.
// Bug 326917
if (getControl().isDisposed()) {
unmapAllElements();
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.AbstractTreeViewer#inputChanged(java.lang.Object, java.lang.Object)
*/
@@ -521,13 +521,13 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
super.unmapAllElements();
((ITreeModelContentProvider)getContentProvider()).postInputChanged(this, oldInput, input);
super.inputChanged(input, oldInput);
-
- resetColumns(input);
+
+ resetColumns(input);
}
/**
* Configures the columns for the given viewer input.
- *
+ *
* @param input the viewer input
*/
protected void resetColumns(Object input) {
@@ -562,8 +562,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
}
- }
-
+ }
+
/**
* Configures the columns based on the current settings.
*/
@@ -573,16 +573,16 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
if (isShowColumns(fColumnPresentation.getId())) {
build = fColumnPresentation;
}
- buildColumns(build);
+ buildColumns(build);
} else {
// get rid of columns
buildColumns(null);
}
}
-
+
/**
* Toggles columns on/off for the current column presentation, if any.
- *
+ *
* @param show whether to show columns if the current input supports
* columns
*/
@@ -598,7 +598,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
refreshColumns();
}
-
+
/**
* Resets any persisted column size for the given columns
* @param columnIds the identifiers of the columns to reset
@@ -608,11 +608,11 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
fColumnSizes.remove(columnIds[i]);
}
}
-
+
/**
* Sets the id's of visible columns, or <code>null</code> to set default columns.
* Only affects the current column presentation.
- *
+ *
* @param ids visible columns
*/
public void setVisibleColumns(String[] ids) {
@@ -641,12 +641,12 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
presentationContext.setColumns(getVisibleColumns());
refreshColumns();
}
- }
+ }
@Override
protected void internalRefresh(Object element, boolean updateLabels) {
- ITreeModelContentProvider contentProvider = (ITreeModelContentProvider)getContentProvider();
-
+ ITreeModelContentProvider contentProvider = (ITreeModelContentProvider)getContentProvider();
+
if (element == null) {
internalRefresh(getControl(), getRoot(), true, updateLabels);
contentProvider.preserveState(TreePath.EMPTY);
@@ -664,7 +664,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
super.internalRefresh(element, updateLabels);
}
-
+
/**
* Refreshes the columns in the view, based on the viewer input.
*/
@@ -672,11 +672,11 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
configureColumns();
refresh();
}
-
+
/**
* Returns whether columns are being displayed currently.
- *
- * @return if columns are being shown
+ *
+ * @return if columns are being shown
*/
public boolean isShowColumns() {
if (fColumnPresentation != null) {
@@ -684,29 +684,29 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
return false;
}
-
+
/**
* Returns whether columns can be toggled on/off for the current input.
- *
+ *
* @return whether columns can be toggled on/off for the current input
*/
public boolean canToggleColumns() {
return fColumnPresentation != null && fColumnPresentation.isOptional();
}
-
+
protected boolean isShowColumns(String columnPresentationId) {
Boolean bool = fShowColumns.get(columnPresentationId);
if (bool == null) {
return true;
}
return bool.booleanValue();
- }
-
+ }
+
/**
* Creates new columns for the given presentation.
- *
+ *
* TODO: does this need to be asynchronous?
- *
+ *
* @param presentation the column presentation to build from
*/
protected void buildColumns(IColumnPresentation presentation) {
@@ -722,7 +722,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
columns[i].dispose();
}
PresentationContext presentationContext = (PresentationContext) getPresentationContext();
- if (presentation != null) {
+ if (presentation != null) {
for (int i = 0; i < visibleColumnIds.length; i++) {
String id = visibleColumnIds[i];
String header = presentation.getHeader(id);
@@ -753,13 +753,13 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
setCellModifier(null);
setColumnProperties(null);
}
-
+
int treeWidgetWidth = tree.getSize().x;
int avg = treeWidgetWidth;
if (visibleColumnIds != null) {
avg /= visibleColumnIds.length;
}
-
+
if (avg == 0) {
tree.addPaintListener(new PaintListener() {
@Override
@@ -784,7 +784,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
for (int i = 0; i < columns.length; i++) {
TreeColumn treeColumn = columns[i];
Object colData = treeColumn.getData();
- String columnId = colData instanceof String ? (String) colData : null;
+ String columnId = colData instanceof String ? (String) colData : null;
Integer width = fColumnSizes.get(colData);
if (width == null) {
int ans = getInitialColumnWidth(columnId, treeWidgetWidth, visibleColumnIds);
@@ -798,22 +798,22 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
treeColumn.addControlListener(fListener);
}
- }
-
+ }
+
/**
* Returns the current column presentation for this viewer, or <code>null</code>
* if none.
- *
+ *
* @return column presentation or <code>null</code>
*/
public IColumnPresentation getColumnPresentation() {
return fColumnPresentation;
}
-
+
/**
* Returns identifiers of the visible columns in this viewer, or <code>null</code>
* if there is currently no column presentation.
- *
+ *
* @return visible columns or <code>null</code>
*/
@Override
@@ -833,7 +833,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
columnAvailable = true;
}
}
-
+
if (!columnAvailable || presentation.getHeader(columns[i]) == null) {
// We found a column ID which is not in current list of available column IDs.
// Or the presentation cannot return a header title for the given column.
@@ -849,14 +849,14 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
return null;
- }
-
+ }
+
/**
* Returns initial column width of a given column, or -1
* @param columnId column Id
* @param treeWidgetWidth tree widget width
* @param visibleColumnIds visible columns
- *
+ *
* @return column width
*/
public int getInitialColumnWidth(String columnId, int treeWidgetWidth, String[] visibleColumnIds) {
@@ -873,7 +873,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
/**
* Persists column sizes in cache
*/
- protected void persistColumnSizes() {
+ protected void persistColumnSizes() {
Tree tree = getTree();
TreeColumn[] columns = tree.getColumns();
for (int i = 0; i < columns.length; i++) {
@@ -882,7 +882,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
fColumnSizes.put(id, Integer.valueOf(treeColumn.getWidth()));
}
}
-
+
/**
* Persists column ordering
*/
@@ -904,10 +904,10 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
fColumnOrder.remove(presentation.getId());
}
}
-
+
/**
* Save viewer state into the given memento.
- *
+ *
* @param memento the {@link IMemento} to save to
*/
public void saveState(IMemento memento) {
@@ -921,7 +921,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
for (Entry<String, Boolean> entry : fShowColumns.entrySet()) {
IMemento sizes = memento.createChild(SHOW_COLUMNS, entry.getKey());
sizes.putString(SHOW_COLUMNS, entry.getValue().toString());
- }
+ }
}
if (!fVisibleColumns.isEmpty()) {
for (Entry<String, String[]> entry : fVisibleColumns.entrySet()) {
@@ -950,13 +950,13 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
if (context instanceof PresentationContext) {
PresentationContext pc = (PresentationContext) context;
pc.saveProperites(memento);
-
+
}
- }
-
+ }
+
/**
* Initializes viewer state from the memento
- *
+ *
* @param memento the {@link IMemento} to read from
*/
public void initState(IMemento memento) {
@@ -1014,7 +1014,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
pc.initProperties(memento);
}
}
-
+
/**
* Returns whether the candidate selection should override the current
* selection.
@@ -1035,9 +1035,9 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
/* (non-Javadoc)
- *
+ *
* Consider selection policy
- *
+ *
* @see org.eclipse.jface.viewers.StructuredViewer#setSelection(org.eclipse.jface.viewers.ISelection, boolean)
*/
@Override
@@ -1047,7 +1047,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
super.setSelection(selection, reveal);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer#setSelection(org.eclipse.jface.viewers.ISelection, boolean, boolean)
@@ -1056,7 +1056,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
public void setSelection(ISelection selection, boolean reveal, boolean force) {
trySelection(selection, reveal, force);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer#trySelection(org.eclipse.jface.viewers.ISelection, boolean, boolean)
*/
@@ -1070,17 +1070,17 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
/**
* Registers the specified listener for view update notifications.
- *
+ *
* @param listener listener
*/
@Override
public void addViewerUpdateListener(IViewerUpdateListener listener) {
((ITreeModelContentProvider)getContentProvider()).addViewerUpdateListener(listener);
}
-
+
/**
* Removes the specified listener from update notifications.
- *
+ *
* @param listener listener
*/
@Override
@@ -1090,20 +1090,20 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
cp.removeViewerUpdateListener(listener);
}
}
-
+
/**
* Registers the given listener for model delta notification.
- *
+ *
* @param listener model delta listener
*/
@Override
public void addModelChangedListener(IModelChangedListener listener) {
- ((ITreeModelContentProvider)getContentProvider()).addModelChangedListener(listener);
+ ((ITreeModelContentProvider)getContentProvider()).addModelChangedListener(listener);
}
-
+
/**
* Unregisters the given listener from model delta notification.
- *
+ *
* @param listener model delta listener
*/
@Override
@@ -1118,7 +1118,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
public void addStateUpdateListener(IStateUpdateListener listener) {
((ITreeModelContentProvider)getContentProvider()).addStateUpdateListener(listener);
}
-
+
@Override
public void removeStateUpdateListener(IStateUpdateListener listener) {
ITreeModelContentProvider cp = (ITreeModelContentProvider)getContentProvider();
@@ -1126,7 +1126,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
cp.removeStateUpdateListener(listener);
}
}
-
+
/*
* (non-Javadoc) Method declared in AbstractTreeViewer.
*/
@@ -1140,13 +1140,13 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
unmapElement(element, treeItem);
return;
}
-
+
if ( !((ITreeModelLabelProvider)getLabelProvider()).update(getTreePathFromItem(item)) ) {
if (element instanceof String) {
item.setData(PREV_LABEL_KEY, new String[] { (String)element } );
- }
+ }
}
-
+
// As it is possible for user code to run the event
// loop check here.
@@ -1154,23 +1154,23 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
unmapElement(element, item);
}
}
-
+
@Override
public void addLabelUpdateListener(ILabelUpdateListener listener) {
((ITreeModelLabelProvider)getLabelProvider()).addLabelUpdateListener(listener);
}
-
+
@Override
public void removeLabelUpdateListener(ILabelUpdateListener listener) {
if (!getControl().isDisposed()) {
((ITreeModelLabelProvider)getLabelProvider()).removeLabelUpdateListener(listener);
}
}
-
+
/**
* Returns the item for the element at the given tree path or <code>null</code>
* if none.
- *
+ *
* @param path tree path
* @return item or <code>null</code>
*/
@@ -1189,12 +1189,12 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
return null;
}
-
+
@Override
public Item[] getChildren(Widget widget) {
return super.getChildren(widget);
}
-
+
/**
* Returns the tree path for the given item.
* @param item the item to compute the {@link TreePath} for
@@ -1203,17 +1203,17 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
@Override
protected TreePath getTreePathFromItem(Item item) {
return super.getTreePathFromItem(item);
- }
+ }
-//**************************************************************************
+//**************************************************************************
// These methods were copied from TreeViewer as a workaround for bug 183463:
// Expanded nodes in tree viewer flash on refresh
-
+
/*
* (non-Javadoc)
- *
+ *
* workaround for bug 183463
- *
+ *
* @see org.eclipse.jface.viewers.AbstractTreeViewer#internalRefreshStruct(org.eclipse.swt.widgets.Widget,
* java.lang.Object, boolean)
*/
@@ -1241,8 +1241,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
virtualRefreshExpandedItems(parent, widget, element, index);
- }
-
+ }
+
/**
* Traverses the visible (expanded) part of the tree and updates child
* counts.
@@ -1276,10 +1276,10 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
virtualRefreshExpandedItems(widget, item, data, i);
}
}
-
+
/**
* workaround for bug 183463
- *
+ *
* Update the child count
* @param widget the widget
* @param currentChildCount the current child count
@@ -1294,7 +1294,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
((ILazyTreePathContentProvider) getContentProvider())
.updateChildCount(treePath, currentChildCount);
}
-
+
/**
* Update the widget at index.
* <p>
@@ -1321,11 +1321,11 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
((ILazyTreePathContentProvider) getContentProvider())
.updateElement(treePath, index);
- }
-
-//**************************************************************************
+ }
+
+//**************************************************************************
// Another couple of methods copied from TreeViewer to workaround the UI bug 266189.
-//
+//
@Override
protected void createChildren(Widget widget) {
Object element = widget.getData();
@@ -1375,7 +1375,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
/**
* Performs auto expand on an element at the specified path if the auto expand
* level dictates the element should be expanded.
- *
+ *
* @param elementPath tree path to element to consider for expansion
*/
@Override
@@ -1417,7 +1417,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
return true;
}
-
+
@Override
public Display getDisplay() {
Control control = getControl();
@@ -1428,12 +1428,12 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
protected static final String[] STATE_PROPERTIES = new String[]{ IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE };
-
+
@Override
public void update(Object element) {
update(element, STATE_PROPERTIES);
}
-
+
/**
* Label data cache keys
* TODO: workaround for bug 159461
@@ -1448,11 +1448,11 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
@Override
public void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] imageDescriptors,
- FontData[] fontDatas, RGB[] _foregrounds, RGB[] _backgrounds)
+ FontData[] fontDatas, RGB[] _foregrounds, RGB[] _backgrounds)
{
Widget widget = findItem(path);
String[] columnIds = getVisibleColumns();
-
+
if (widget != null && widget instanceof TreeItem && !widget.isDisposed()) {
TreeItem item = (TreeItem)widget;
/*Object data = item.getData();
@@ -1460,13 +1460,13 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
item.clearAll(false);
item.setData(data);
item.setItemCount(itemCount);*/
-
+
for (int i=0; i<numColumns; i++){
// text might be null if the launch has been terminated
item.setText(i,(labels[i] == null ? IInternalDebugCoreConstants.EMPTY_STRING : labels[i]));
}
item.setData(PREV_LABEL_KEY, labels);
-
+
if (imageDescriptors == null) {
for (int i=0; i<numColumns; i++){
item.setImage(i,null);
@@ -1484,8 +1484,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
item.setData(PREV_IMAGE_KEY, images);
}
-
- if (_foregrounds == null) {
+
+ if (_foregrounds == null) {
for (int i=0; i<numColumns; i++){
item.setForeground(i,null);
}
@@ -1504,7 +1504,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
item.setData(PREV_FOREGROUND_KEY, foregrounds);
}
-
+
if (_backgrounds == null) {
for (int i=0; i<numColumns; i++){
item.setBackground(i,null);
@@ -1524,7 +1524,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
item.setData(PREV_BACKGROUND_KEY, backgrounds);
}
-
+
if (fontDatas == null) {
for (int i=0; i<numColumns; i++){
item.setFont(i,null);
@@ -1546,13 +1546,13 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
}
-
+
@Override
public ViewerLabel getElementLabel(TreePath path, String columnId) {
if (path.getSegmentCount() == 0) {
return null;
}
-
+
int columnIdx = -1;
String[] visibleColumns = getVisibleColumns();
if (columnId != null && visibleColumns != null) {
@@ -1570,7 +1570,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
columnIdx = 0;
}
TreeItem item = (TreeItem)findItem(path);
-
+
if (item != null) {
ViewerLabel label = new ViewerLabel(item.getText(columnIdx), item.getImage(columnIdx));
label.setFont(item.getFont(columnIdx));
@@ -1594,7 +1594,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
getTree().setTopItem(children[index]);
}
}
-
+
@Override
public int getChildCount(TreePath path) {
if (path.getSegmentCount() == 0) {
@@ -1605,11 +1605,11 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
if (items[0] instanceof TreeItem) {
return ((TreeItem)items[0]).getItemCount();
}
- }
+ }
}
return -1;
}
-
+
@Override
public Object getChildElement(TreePath path, int index) {
TreeItem childItem = null;
@@ -1630,7 +1630,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
if (childItem != null) {
return childItem.getData();
- }
+ }
return null;
}
@@ -1642,7 +1642,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
return null;
}
-
+
@Override
public boolean saveElementState(TreePath path, ModelDelta delta, int flagsToSave) {
Tree tree = (Tree) getControl();
@@ -1651,7 +1651,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
for (int i = 0; i < selection.length; i++) {
set.add(selection[i]);
}
-
+
TreeItem[] items = null;
Widget w = internalGetWidgetToSelect(path);
if (w instanceof Tree) {
@@ -1660,7 +1660,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
if ((flagsToSave & IModelDelta.EXPAND) != 0) {
delta.setFlags(delta.getFlags() | IModelDelta.EXPAND);
}
- items = tree.getItems();
+ items = tree.getItems();
} else if (w instanceof TreeItem) {
TreeItem item = (TreeItem)w;
if (item.getExpanded()) {
@@ -1672,7 +1672,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
} else if ((flagsToSave & IModelDelta.COLLAPSE) != 0){
delta.setFlags(delta.getFlags() | IModelDelta.COLLAPSE);
}
-
+
if (set.contains(item) && (flagsToSave & IModelDelta.SELECT) != 0) {
delta.setFlags(delta.getFlags() | IModelDelta.SELECT);
}
@@ -1687,7 +1687,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
return false;
}
}
-
+
private void doSaveElementState(TreePath parentPath, ModelDelta delta, TreeItem item, Collection<TreeItem> set, int index, int flagsToSave) {
Object element = item.getData();
if (element != null) {
@@ -1696,7 +1696,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
int flags = IModelDelta.NO_CHANGE;
if (expanded && (flagsToSave & IModelDelta.EXPAND) != 0) {
flags = flags | IModelDelta.EXPAND;
- }
+ }
if (!expanded && (flagsToSave & IModelDelta.COLLAPSE) != 0) {
flags = flags | IModelDelta.COLLAPSE;
}
@@ -1710,7 +1710,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
if (expanded) {
// Only get the item count if the item is expanded. Getting
// item count triggers an update of the element (bug 335734).
- int itemCount = item.getItemCount();
+ int itemCount = item.getItemCount();
int numChildren = ((ITreeModelContentProvider)getContentProvider()).viewToModelCount(elementPath, itemCount);
childDelta.setChildCount(numChildren);
TreeItem[] items = item.getItems();
@@ -1721,7 +1721,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
}
-
+
@Override
public void updateViewer(IModelDelta delta) {
((ITreeModelContentProvider)getContentProvider()).updateModel(delta, ITreeModelContentProvider.ALL_MODEL_DELTA_FLAGS);
@@ -1734,56 +1734,56 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
@Override
public void setElementChecked(TreePath path, boolean checked, boolean grayed) {
Widget widget = findItem(path);
-
+
if (widget != null && widget instanceof TreeItem && !widget.isDisposed()) {
TreeItem item = (TreeItem)widget;
-
+
item.setChecked(checked);
item.setGrayed(grayed);
-
+
item.setData(PREV_CHECKED_KEY, checked ? Boolean.TRUE : Boolean.FALSE);
item.setData(PREV_GRAYED_KEY, grayed ? Boolean.TRUE : Boolean.FALSE);
}
}
-
+
@Override
public boolean getElementChecked(TreePath path) {
Widget widget = findItem(path);
-
+
if (widget != null && widget instanceof TreeItem && !widget.isDisposed()) {
TreeItem item = (TreeItem)widget;
-
+
return item.getChecked();
- }
+ }
return false;
}
/**
* Retrieves the element's check box grayed state.
- *
+ *
* @param path the path of the element to set grayed
* @return grayed
*/
@Override
public boolean getElementGrayed(TreePath path) {
Widget widget = findItem(path);
-
+
if (widget != null && widget instanceof TreeItem && !widget.isDisposed()) {
TreeItem item = (TreeItem)widget;
-
+
return item.getGrayed();
- }
+ }
return false;
}
@Override
public boolean getHasChildren(Object elementOrTreePath) {
- if (elementOrTreePath instanceof TreePath &&
- ((TreePath)elementOrTreePath).getSegmentCount() == 0)
+ if (elementOrTreePath instanceof TreePath &&
+ ((TreePath)elementOrTreePath).getSegmentCount() == 0)
{
return getTree().getItemCount() > 0;
}
-
+
Widget[] items = internalFindItems(elementOrTreePath);
if (items != null && items.length > 0) {
if (items[0] instanceof TreeItem) {
@@ -1792,10 +1792,10 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
return ((Tree)items[0]).getItemCount() > 0;
}
}
-
+
return false;
}
-
+
@Override
public TreePath[] getElementPaths(Object element) {
Widget[] items = internalFindItems(element);
@@ -1809,7 +1809,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
return paths;
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.jface.viewers.StructuredViewer#handleSelect(org.eclipse.swt.events.SelectionEvent)
@@ -1819,16 +1819,16 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
super.handleSelect(event);
TreeItem item = (TreeItem) event.item;
- if (item != null) { // item can be null when de-selected (bug 296703)
+ if (item != null) { // item can be null when de-selected (bug 296703)
Object element = item.getData();
IContentProvider contentProvider = getContentProvider();
if (element != null && contentProvider instanceof TreeModelContentProvider) {
TreePath path = getTreePathFromItem(item);
-
+
if (event.detail == SWT.CHECK) {
- boolean checked = item.getChecked();
+ boolean checked = item.getChecked();
boolean accepted = ((ITreeModelContentProvider) contentProvider).setChecked(path, checked);
-
+
// if the listen rejects the change or there is not ICheckboxModelProxy, than revert the check state
if (!accepted) {
item.setChecked(!checked);
@@ -1841,7 +1841,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
}
-
+
@Override
protected void handleTreeExpand(TreeEvent event) {
super.handleTreeExpand(event);
@@ -1851,7 +1851,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
((TreeModelContentProvider) contentProvider).cancelRestore(path, IModelDelta.COLLAPSE);
}
}
-
+
@Override
protected void handleTreeCollapse(TreeEvent event) {
super.handleTreeCollapse(event);
@@ -1861,7 +1861,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
((TreeModelContentProvider) contentProvider).cancelRestore(path, IModelDelta.EXPAND);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget#clearSelectionQuiet()
*/
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 e9f573aa9..fafeebd65 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* IBM Corporation - ongoing bug fixing
@@ -64,23 +64,23 @@ import org.eclipse.ui.IMemento;
* @since 3.5
*/
@SuppressWarnings("deprecation")
-public class InternalVirtualTreeModelViewer extends Viewer
- implements IVirtualItemListener,
- org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer,
+public class InternalVirtualTreeModelViewer extends Viewer
+ implements IVirtualItemListener,
+ org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer,
IInternalTreeModelViewer
{
/**
* Memento type for the visible columns for a presentation context.
* A memento is created for each column presentation keyed by column number
- */
+ */
private static final String VISIBLE_COLUMNS = "VISIBLE_COLUMNS"; //$NON-NLS-1$
-
+
/**
* Memento type for whether columns are visible for a presentation context.
* Booleans are keyed by column presentation id
*/
- private static final String SHOW_COLUMNS = "SHOW_COLUMNS"; //$NON-NLS-1$
+ private static final String SHOW_COLUMNS = "SHOW_COLUMNS"; //$NON-NLS-1$
/**
* Memento key for the number of visible columns in a VISIBLE_COLUMNS memento
* or for the width of a column
@@ -89,10 +89,10 @@ public class InternalVirtualTreeModelViewer extends Viewer
/**
* Memento key prefix a visible column
*/
- private static final String COLUMN = "COLUMN"; //$NON-NLS-1$
-
+ private static final String COLUMN = "COLUMN"; //$NON-NLS-1$
+
/**
- * Item's tree path cache
+ * Item's tree path cache
*/
private static final String TREE_PATH_KEY = "TREE_PATH_KEY"; //$NON-NLS-1$
@@ -100,7 +100,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
* Viewer filters currently configured for viewer.
*/
private ViewerFilter[] fFilters = new ViewerFilter[0];
-
+
/**
* The display that this virtual tree viewer is associated with. It is used
* for access to the UI thread.
@@ -124,12 +124,12 @@ public class InternalVirtualTreeModelViewer extends Viewer
private VirtualTree fTree;
/**
- * Mapping of data elements in the tree to the items that hold them. The
+ * Mapping of data elements in the tree to the items that hold them. The
* tree may contain the same element in several places, so the map values
- * are lists.
+ * are lists.
*/
private Map<Object, List<VirtualItem>> fItemsMap = new HashMap<Object, List<VirtualItem>>();
-
+
/**
* Whether to notify the content provider when an element is unmapped.
* Used to suppress the notification during an associate operation.
@@ -159,44 +159,44 @@ public class InternalVirtualTreeModelViewer extends Viewer
private boolean fRestoreSelection;
/**
- * Level to which the tree should automatically expand elements.
+ * Level to which the tree should automatically expand elements.
* <code>-1<code> indicates that all levels shoudl be expanded.
*/
private int fAutoExpandToLevel = 0;
-
+
/**
* Current column presentation or <code>null</code>
*/
- private IColumnPresentation fColumnPresentation = null;
-
+ private IColumnPresentation fColumnPresentation = null;
+
/**
* Map of columns presentation id to its visible columns id's (String[])
* When a columns presentation is not in the map, default settings are used.
*/
private Map<String, String[]> fVisibleColumns = new HashMap<String, String[]>();
-
+
/**
* Map of column presentation id to whether columns should be displayed
- * for that presentation (the user can toggle columns on/off when a
+ * for that presentation (the user can toggle columns on/off when a
* presentation is optional.
*/
private Map<String, Boolean> fShowColumns = new HashMap<String, Boolean>();
/**
- * Runnable for validating the virtual tree. It is scheduled to run in the
+ * Runnable for validating the virtual tree. It is scheduled to run in the
* UI thread whenever a tree validation is requested.
*/
private Runnable fValidateRunnable;
-
- public InternalVirtualTreeModelViewer(Display display, int style, IPresentationContext context, IVirtualItemValidator itemValidator) {
+
+ public InternalVirtualTreeModelViewer(Display display, int style, IPresentationContext context, IVirtualItemValidator itemValidator) {
fDisplay = display;
- fContext = context;
+ fContext = context;
fTree = new VirtualTree(style, itemValidator);
fTree.addItemListener(this);
-
+
fContentProvider = new TreeModelContentProvider();
fLabelProvider = new TreeModelLabelProvider(this);
-
+
if ((style & SWT.POP_UP) != 0) {
getContentProvider().setModelDeltaMask(~ITreeModelContentProvider.CONTROL_MODEL_DELTA_FLAGS);
}
@@ -286,7 +286,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
public VirtualTree getTree() {
return fTree;
}
-
+
@Override
public void insert(Object parentOrTreePath, Object element, int position) {
if (parentOrTreePath instanceof TreePath) {
@@ -316,18 +316,18 @@ public class InternalVirtualTreeModelViewer extends Viewer
if (parentItem.isDisposed()) {
continue;
}
-
- // Parent item is not expanded so just update its contents so that
+
+ // Parent item is not expanded so just update its contents so that
// the plus sign gets refreshed.
if (!parentItem.getExpanded()) {
parentItem.setNeedsCountUpdate();
parentItem.setItemCount(-1);
virtualLazyUpdateHasChildren(parentItem);
}
-
+
if (index < parentItem.getItemCount()) {
VirtualItem item =parentItem.getItem(new VirtualItem.Index(index));
-
+
if (item.getData() != null) {
removedPath = getTreePathFromItem(item);
disassociate(item);
@@ -347,7 +347,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
if (removed) {
setSelection(
- new TreeSelection(oldSelection.toArray(new TreePath[oldSelection.size()])),
+ new TreeSelection(oldSelection.toArray(new TreePath[oldSelection.size()])),
false);
}
}
@@ -361,18 +361,18 @@ public class InternalVirtualTreeModelViewer extends Viewer
setInput(null);
return;
}
-
+
VirtualItem[] items = findItems(elementOrPath);
if (items.length > 0) {
for (int j = 0; j < items.length; j++) {
disassociate(items[j]);
items[j].getParent().remove(items[j].getIndex());
}
- }
+ }
}
- private TreeSelection adjustSelectionForReplace(VirtualItem[] selectedItems, TreeSelection selection,
- VirtualItem item, Object element, Object parentElement)
+ private TreeSelection adjustSelectionForReplace(VirtualItem[] selectedItems, TreeSelection selection,
+ VirtualItem item, Object element, Object parentElement)
{
if (item.getData() != null || selectedItems.length == selection.size() || parentElement == null) {
// Don't do anything - we are not seeing an instance of bug 185673
@@ -398,8 +398,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
return selection;
}
-// private VirtualTreeSelection adjustSelectionForReplace(VirtualTreeSelection selection, VirtualItem item,
-// Object element, Object parentElement)
+// private VirtualTreeSelection adjustSelectionForReplace(VirtualTreeSelection selection, VirtualItem item,
+// Object element, Object parentElement)
// {
// if (selection.getItems().containsKey(item)) {
// if (item.getData() == null) {
@@ -424,7 +424,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
// }
// return new VirtualTreeSelection(map, paths);
// } else if (!item.getData().equals(element)) {
-// // The current item was selected by the new element is
+// // The current item was selected by the new element is
// // different than the previous element in the item.
// // Remove this item from selection.
// Map map = new LinkedHashMap(selection.getItems());
@@ -437,7 +437,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
// paths[i++] = nextPath;
// }
// }
-// return new VirtualTreeSelection(map, paths);
+// return new VirtualTreeSelection(map, paths);
// }
// }
// if (item.getData() != null || selection.getItems().size() == selection.size() || parentElement == null) {
@@ -450,7 +450,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
// return selection;
// }
-
+
@Override
public void reveal(TreePath path, final int index) {
VirtualItem parentItem = findItem(path);
@@ -473,7 +473,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
return -1;
}
-
+
@Override
public boolean getElementChildrenRealized(TreePath parentPath) {
VirtualItem parentItem = findItem(parentPath);
@@ -511,18 +511,18 @@ public class InternalVirtualTreeModelViewer extends Viewer
private void refresh(VirtualItem item) {
getContentProvider().preserveState(getTreePathFromItem(item));
-
+
if (!item.needsDataUpdate()) {
if (item.getParent() != null) {
item.setNeedsLabelUpdate();
virtualLazyUpdateHasChildren(item);
}
-
+
VirtualItem[] items = item.getItems();
for (int i = 0; i < items.length; i++) {
items[i].setNeedsDataUpdate();
}
- }
+ }
refreshStruct(item);
}
@@ -536,8 +536,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
if (item.getExpanded()) {
virtualLazyUpdateData(item);
expanded = true;
- }
- }
+ }
+ }
VirtualItem[] items = item.getItems();
for (int i = 0; i < items.length; i++) {
@@ -548,7 +548,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
}
-
+
private void validate() {
if (fValidateRunnable == null) {
fValidateRunnable = new Runnable() {
@@ -563,7 +563,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
getDisplay().asyncExec(fValidateRunnable);
}
}
-
+
@Override
protected void inputChanged(Object input, Object oldInput) {
resetColumns(input);
@@ -578,7 +578,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
public void setAutoExpandLevel(int level) {
fAutoExpandToLevel = level;
}
-
+
public VirtualItem findItem(TreePath path) {
if (path.getSegmentCount() == 0) {
return fTree;
@@ -592,7 +592,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
}
-
+
return null;
}
@@ -627,7 +627,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
item.setData(VirtualItem.FONT_KEY, fontDatas);
}
}
-
+
@Override
public void setChildCount(final Object elementOrTreePath, final int count) {
preservingSelection(new Runnable() {
@@ -641,7 +641,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
disassociate(children[j]);
}
}
-
+
items[i].setItemCount(count);
}
}
@@ -657,7 +657,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
VirtualItem[] items = findItems(elementOrTreePath);
for (int i = 0; i < items.length; i++) {
VirtualItem item = items[i];
-
+
if (!hasChildren) {
VirtualItem[] children = item.getItems();
for (int j = 0; j < children.length; j++) {
@@ -666,7 +666,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
}
-
+
item.setHasItems(hasChildren);
if (hasChildren) {
if (!item.getExpanded()) {
@@ -679,7 +679,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
});
}
-
+
@Override
public boolean getHasChildren(Object elementOrTreePath) {
VirtualItem[] items = findItems(elementOrTreePath);
@@ -712,7 +712,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
if (item.getData() instanceof String) {
item.setData(VirtualItem.LABEL_KEY, new String[] { (String)item.getData() } );
}
- }
+ }
}
private TreePath getTreePathFromItem(VirtualItem item) {
@@ -759,7 +759,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
// Insert the set back into the map.
fItemsMap.put(element, itemsList);
-
+
item.setData(TREE_PATH_KEY, getTreePathFromItem(item));
}
@@ -770,11 +770,11 @@ public class InternalVirtualTreeModelViewer extends Viewer
} else if (item.getData() != null) {
if (item.needsLabelUpdate()) {
virtualLazyUpdateLabel(item);
- }
+ }
if (item.needsCountUpdate() && item.getExpanded()) {
virtualLazyUpdateChildCount(item);
}
- }
+ }
}
@Override
@@ -803,7 +803,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
-
+
private void doAssociate(Object element, VirtualItem item) {
Object data = item.getData();
if (data != null && data != element && data.equals(element)) {
@@ -831,10 +831,10 @@ public class InternalVirtualTreeModelViewer extends Viewer
private void disassociate(VirtualItem item) {
unmapElement(item.getData(), item);
-
+
// Clear the map before we clear the data
item.setData(null);
-
+
// Disassociate the children
VirtualItem[] items = item.getItems();
for (int i = 0; i < items.length; i++) {
@@ -848,7 +848,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
public void setSelection(ISelection selection, boolean reveal) {
setSelection(selection, reveal, false);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer#setSelection(org.eclipse.jface.viewers.ISelection, boolean, boolean)
*/
@@ -856,7 +856,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
public void setSelection(ISelection selection, boolean reveal, boolean force) {
trySelection(selection, reveal, force);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer#trySelection(org.eclipse.jface.viewers.ISelection, boolean, boolean)
*/
@@ -904,7 +904,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
} else {
fTree.setSelection(EMPTY_ITEMS_ARRAY);
}
-
+
// Make sure that the new selection is properly revealed.
validate();
}
@@ -916,7 +916,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
doUpdate(items[i]);
}
}
-
+
public void doUpdate(VirtualItem item) {
item.setNeedsLabelUpdate();
validate();
@@ -940,7 +940,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
return new TreeSelection(list.toArray(new TreePath[list.size()]));
}
-
+
private void preservingSelection(Runnable updateCode) {
ISelection oldSelection = null;
@@ -1000,15 +1000,15 @@ public class InternalVirtualTreeModelViewer extends Viewer
if (!item.hasItems()) {
return;
}
-
+
item.setExpanded(true);
if (item.getData() == null) {
virtualLazyUpdateData(item);
// Cannot expand children if data is null.
- return;
+ return;
}
-
+
if (level == ALL_LEVELS || level > 1) {
VirtualItem[] children = item.getItems();
int newLevel = (level == ALL_LEVELS ? ALL_LEVELS
@@ -1040,11 +1040,11 @@ public class InternalVirtualTreeModelViewer extends Viewer
fireSelectionChanged(new SelectionChangedEvent(this, newSelection));
}
-
+
/**
* Returns whether the candidate selection should override the current
* selection.
- *
+ *
* @param current Current selection in viewer
* @param candidate New potential selection requested by model.
* @return true if candidate selection should be set to viewer.
@@ -1065,7 +1065,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
public ViewerFilter[] getFilters() {
return fFilters;
}
-
+
@Override
public void addFilter(ViewerFilter filter) {
ViewerFilter[] newFilters = new ViewerFilter[fFilters.length + 1];
@@ -1073,17 +1073,17 @@ public class InternalVirtualTreeModelViewer extends Viewer
newFilters[fFilters.length] = filter;
fFilters = newFilters;
}
-
+
@Override
public void setFilters(ViewerFilter... filters) {
fFilters = filters;
}
-
+
public void dispose() {
if (fColumnPresentation != null) {
fColumnPresentation.dispose();
}
-
+
if (fContentProvider != null) {
fContentProvider.dispose();
fContentProvider = null;
@@ -1092,14 +1092,14 @@ public class InternalVirtualTreeModelViewer extends Viewer
fLabelProvider.dispose();
fLabelProvider = null;
}
-
+
fTree.removeItemListener(this);
fTree.dispose();
}
/**
* Returns this viewer's presentation context.
- *
+ *
* @return presentation context
*/
@Override
@@ -1109,7 +1109,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
/**
* Configures the columns for the given viewer input.
- *
+ *
* @param input new viewer input
*/
private void resetColumns(Object input) {
@@ -1144,8 +1144,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
}
- }
-
+ }
+
/**
* Configures the columns based on the current settings.
*/
@@ -1155,7 +1155,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
if (isShowColumns(fColumnPresentation.getId())) {
build = fColumnPresentation;
}
- buildColumns(build);
+ buildColumns(build);
} else {
// get rid of columns
buildColumns(null);
@@ -1164,7 +1164,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
/**
* Toggles columns on/off for the current column presentation, if any.
- *
+ *
* @param show whether to show columns if the current input supports
* columns
*/
@@ -1188,9 +1188,9 @@ public class InternalVirtualTreeModelViewer extends Viewer
configureColumns();
refresh();
}
-
+
/**
- * @return Returns true if columns are being displayed currently.
+ * @return Returns true if columns are being displayed currently.
*/
public boolean isShowColumns() {
if (fColumnPresentation != null) {
@@ -1198,32 +1198,32 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
return false;
}
-
+
/**
* Returns whether columns can be toggled on/off for the current input.
- *
+ *
* @return whether columns can be toggled on/off for the current input
*/
public boolean canToggleColumns() {
return fColumnPresentation != null && fColumnPresentation.isOptional();
}
-
+
protected boolean isShowColumns(String columnPresentationId) {
Boolean bool = fShowColumns.get(columnPresentationId);
if (bool == null) {
return true;
}
return bool.booleanValue();
- }
-
+ }
+
/**
* Creates new columns for the given presentation.
- *
+ *
* @param presentation presentation context to build columns for.
*/
protected void buildColumns(IColumnPresentation presentation) {
PresentationContext presentationContext = (PresentationContext) getPresentationContext();
- if (presentation != null) {
+ if (presentation != null) {
presentationContext.setColumns(getVisibleColumns());
} else {
presentationContext.setColumns(null);
@@ -1233,7 +1233,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
/**
* Returns identifiers of the visible columns in this viewer, or <code>null</code>
* if there is currently no column presentation.
- *
+ *
* @return visible columns or <code>null</code>
*/
@Override
@@ -1249,12 +1249,12 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
return null;
- }
-
+ }
+
/**
* Sets the id's of visible columns, or <code>null</code> to set default columns.
* Only affects the current column presentation.
- *
+ *
* @param ids visible columns
*/
public void setVisibleColumns(String[] ids) {
@@ -1282,12 +1282,12 @@ public class InternalVirtualTreeModelViewer extends Viewer
presentationContext.setColumns(getVisibleColumns());
refreshColumns();
}
- }
-
+ }
+
/**
* Returns the current column presentation for this viewer, or <code>null</code>
* if none.
- *
+ *
* @return column presentation or <code>null</code>
*/
public IColumnPresentation getColumnPresentation() {
@@ -1296,7 +1296,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
/**
* Save viewer state into the given memento.
- *
+ *
* @param memento Memento to write state to.
*/
public void saveState(IMemento memento) {
@@ -1304,7 +1304,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
for (Entry<String, Boolean> entry : fShowColumns.entrySet()) {
IMemento sizes = memento.createChild(SHOW_COLUMNS, entry.getKey());
sizes.putString(SHOW_COLUMNS, entry.getValue().toString());
- }
+ }
}
if (!fVisibleColumns.isEmpty()) {
for (Entry<String, String[]> entry : fVisibleColumns.entrySet()) {
@@ -1321,13 +1321,13 @@ public class InternalVirtualTreeModelViewer extends Viewer
if (context instanceof PresentationContext) {
PresentationContext pc = (PresentationContext) context;
pc.saveProperites(memento);
-
+
}
- }
-
+ }
+
/**
* Initializes viewer state from the memento
- *
+ *
* @param memento Memento to read state from.
*/
public void initState(IMemento memento) {
@@ -1367,7 +1367,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
public void addViewerUpdateListener(IViewerUpdateListener listener) {
getContentProvider().addViewerUpdateListener(listener);
}
-
+
@Override
public void removeViewerUpdateListener(IViewerUpdateListener listener) {
ITreeModelContentProvider cp = getContentProvider();
@@ -1375,12 +1375,12 @@ public class InternalVirtualTreeModelViewer extends Viewer
cp.removeViewerUpdateListener(listener);
}
}
-
+
@Override
public void addModelChangedListener(IModelChangedListener listener) {
- getContentProvider().addModelChangedListener(listener);
+ getContentProvider().addModelChangedListener(listener);
}
-
+
@Override
public void removeModelChangedListener(IModelChangedListener listener) {
ITreeModelContentProvider cp = getContentProvider();
@@ -1388,12 +1388,12 @@ public class InternalVirtualTreeModelViewer extends Viewer
cp.removeModelChangedListener(listener);
}
}
-
+
@Override
public void addStateUpdateListener(IStateUpdateListener listener) {
getContentProvider().addStateUpdateListener(listener);
}
-
+
@Override
public void removeStateUpdateListener(IStateUpdateListener listener) {
ITreeModelContentProvider cp = getContentProvider();
@@ -1401,21 +1401,21 @@ public class InternalVirtualTreeModelViewer extends Viewer
cp.removeStateUpdateListener(listener);
}
}
-
+
@Override
public void addLabelUpdateListener(ILabelUpdateListener listener) {
getLabelProvider().addLabelUpdateListener(listener);
}
-
+
@Override
public void removeLabelUpdateListener(ILabelUpdateListener listener) {
getLabelProvider().removeLabelUpdateListener(listener);
}
-
+
/**
* Performs auto expand on an element at the specified path if the auto expand
* level dictates the element should be expanded.
- *
+ *
* @param elementPath tree path to element to consider for expansion
*/
@Override
@@ -1427,7 +1427,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
}
-
+
@Override
public int getChildCount(TreePath path) {
int childCount = -1;
@@ -1439,11 +1439,11 @@ public class InternalVirtualTreeModelViewer extends Viewer
// Return 0, if we do not know if the item has children.
if (childCount == -1) {
childCount = items[0].hasItems() ? 1 : 0;
- }
- }
+ }
+ }
return childCount;
}
-
+
@Override
public Object getChildElement(TreePath path, int index) {
VirtualItem[] items = findItems(path);
@@ -1451,7 +1451,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
if (index < items[0].getItemCount()) {
return items[0].getItem(new VirtualItem.Index(index)).getData();
}
- }
+ }
return null;
}
@@ -1468,10 +1468,10 @@ public class InternalVirtualTreeModelViewer extends Viewer
for (int i = 0; i < selection.length; i++) {
set.add(selection[i]);
}
-
+
VirtualItem[] items = null;
VirtualItem parent = findItem(path);
-
+
if (parent != null) {
delta.setChildCount(((TreeModelContentProvider)getContentProvider()).viewToModelCount(path, parent.getItemCount()));
if (parent.getExpanded()) {
@@ -1481,11 +1481,11 @@ public class InternalVirtualTreeModelViewer extends Viewer
} else if ((flagsToSave & IModelDelta.COLLAPSE) != 0 && parent.hasItems()){
delta.setFlags(delta.getFlags() | IModelDelta.COLLAPSE);
}
-
+
if (set.contains(parent) && (flagsToSave & IModelDelta.SELECT) != 0) {
delta.setFlags(delta.getFlags() | IModelDelta.SELECT);
}
-
+
items = parent.getItems();
for (int i = 0; i < items.length; i++) {
doSaveElementState(path, delta, items[i], set, flagsToSave);
@@ -1495,7 +1495,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
return false;
}
}
-
+
private void doSaveElementState(TreePath parentPath, ModelDelta delta, VirtualItem item, Collection<VirtualItem> set, int flagsToSave) {
Object element = item.getData();
if (element != null) {
@@ -1504,7 +1504,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
int flags = IModelDelta.NO_CHANGE;
if (expanded && (flagsToSave & IModelDelta.EXPAND) != 0) {
flags = flags | IModelDelta.EXPAND;
- }
+ }
if (!expanded && (flagsToSave & IModelDelta.COLLAPSE) != 0 && item.hasItems()){
flags = flags | IModelDelta.COLLAPSE;
}
@@ -1530,13 +1530,13 @@ public class InternalVirtualTreeModelViewer extends Viewer
public void updateViewer(IModelDelta delta) {
getContentProvider().updateModel(delta, ITreeModelContentProvider.ALL_MODEL_DELTA_FLAGS);
}
-
+
@Override
public ViewerLabel getElementLabel(TreePath path, String columnId) {
if (path.getSegmentCount() == 0) {
return null;
}
-
+
int columnIdx = -1;
String[] visibleColumns = getVisibleColumns();
if (columnId != null && visibleColumns != null) {
@@ -1554,7 +1554,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
columnIdx = 0;
}
VirtualItem item = findItem(path);
-
+
if (item != null) {
ViewerLabel label = new ViewerLabel(getText(item, columnIdx), getImage(item, columnIdx));
label.setFont(getFont(item, columnIdx));
@@ -1574,7 +1574,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
return paths;
}
-
+
public String getText(VirtualItem item, int columnIdx) {
String[] texts = (String[])item.getData(VirtualItem.LABEL_KEY);
@@ -1607,7 +1607,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
return null;
}
-
+
public Color getBackground(VirtualItem item, int columnIdx) {
RGB[] rgbs = (RGB[]) item.getData(VirtualItem.BACKGROUND_KEY);
if (rgbs != null) {
@@ -1623,24 +1623,24 @@ public class InternalVirtualTreeModelViewer extends Viewer
public void clearSelectionQuiet() {
getTree().setSelection(EMPTY_ITEMS_ARRAY);
}
-
+
@Override
public boolean getElementChecked(TreePath path) {
// Not supported
return false;
}
-
+
@Override
public boolean getElementGrayed(TreePath path) {
// Not supported
return false;
}
-
+
@Override
public void setElementChecked(TreePath path, boolean checked, boolean grayed) {
// Not supported
}
-
+
@Override
public String toString() {
return getTree().toString();
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 5bbffb307..916f66951 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
@@ -26,7 +26,7 @@ import org.eclipse.swt.graphics.RGB;
* @since 3.3
*/
class LabelUpdate extends Request implements ILabelUpdate, ICheckUpdate {
-
+
private TreePath fElementPath;
private String[] fColumnIds;
private RGB[] fBackgrounds;
@@ -35,16 +35,16 @@ class LabelUpdate extends Request implements ILabelUpdate, ICheckUpdate {
private String[] fLabels;
private FontData[] fFontDatas;
private TreeModelLabelProvider fProvider;
- private int fNumColumns;
+ private int fNumColumns;
private IPresentationContext fContext;
private Object fViewerInput;
private boolean fChecked;
private boolean fGrayed;
-
+
/**
* @param viewerInput input at the time the request was made
* @param elementPath element the label is for
- * @param provider label provider to callback to
+ * @param provider label provider to callback to
* @param columnIds column identifiers or <code>null</code>
* @param context presentation context
*/
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 081058bd1..e3b591c63 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
@@ -20,14 +20,14 @@ import org.eclipse.ui.IMemento;
* @since 3.3
*/
abstract class MementoUpdate extends Request implements IViewerUpdate {
-
+
private IPresentationContext fContext;
private Object fElement;
private TreePath fElementPath;
private IMemento fMemento;
protected TreeModelContentProvider fProvider;
protected Object fViewerInput;
-
+
/**
* Constructs a viewer state request.
* @param provider the content provider to use for the update
@@ -36,7 +36,7 @@ abstract class MementoUpdate extends Request implements IViewerUpdate {
* @param element the element to update
* @param memento Memento to update
* @param context the presentation context
- *
+ *
*/
public MementoUpdate(TreeModelContentProvider provider, Object viewerInput, IPresentationContext context, Object element, TreePath elementPath, IMemento memento) {
fContext = context;
@@ -54,7 +54,7 @@ abstract class MementoUpdate extends Request implements IViewerUpdate {
public IPresentationContext getPresentationContext() {
return fContext;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElement()
*/
@@ -62,7 +62,7 @@ abstract class MementoUpdate extends Request implements IViewerUpdate {
public Object getElement() {
return fElement;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElementPath()
*/
@@ -70,11 +70,11 @@ abstract class MementoUpdate extends Request implements IViewerUpdate {
public TreePath getElementPath() {
return fElementPath;
}
-
+
public IMemento getMemento() {
return fMemento;
}
-
+
public TreeModelContentProvider getContentProvider() {
return fProvider;
}
@@ -90,7 +90,7 @@ abstract class MementoUpdate extends Request implements IViewerUpdate {
public Object getViewerInput() {
return fViewerInput;
}
-
-
-
+
+
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java
index ce7b203cc..4bc296835 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* IBM Corporation - ongoing bug fixes and enhancements
@@ -36,8 +36,8 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
/**
- * Specialized tree viewer which displays only sub-tree of a full model.
- *
+ * Specialized tree viewer which displays only sub-tree of a full model.
+ *
* @since 3.5
*/
public class SubTreeModelViewer extends TreeModelViewer {
@@ -51,9 +51,9 @@ public class SubTreeModelViewer extends TreeModelViewer {
* Viewer delegate that content and label providers refer to for viewer data.
*/
private DelegatingTreeModelViewer fDelegatingViewer;
-
+
/**
- * @return Returns the root element's model tree path.
+ * @return Returns the root element's model tree path.
*/
public TreePath getRootPath() {
return fRootPath;
@@ -65,7 +65,7 @@ public class SubTreeModelViewer extends TreeModelViewer {
/**
* Sets the viewer's input and root element's path
- *
+ *
* @param input New viewer input.
* @param rootPath New root element path.
*/
@@ -73,14 +73,14 @@ public class SubTreeModelViewer extends TreeModelViewer {
fRootPath = rootPath;
super.setInput(input);
}
-
+
/**
- * A proxy for the sub tree viewer which is given to the content and
- * label providers. It translates the sub-tree paths in the viewer to the
+ * A proxy for the sub tree viewer which is given to the content and
+ * label providers. It translates the sub-tree paths in the viewer to the
* full model paths that the providers expect.
*/
- public class DelegatingTreeModelViewer extends Viewer
- implements IInternalTreeModelViewer
+ public class DelegatingTreeModelViewer extends Viewer
+ implements IInternalTreeModelViewer
{
@Override
public void reveal(TreePath path, int index) {
@@ -88,7 +88,7 @@ public class SubTreeModelViewer extends TreeModelViewer {
SubTreeModelViewer.this.reveal(createSubPath(path), index);
}
}
-
+
@Override
public void replace(Object parentOrTreePath, int index, Object element) {
if (parentOrTreePath instanceof TreePath) {
@@ -100,7 +100,7 @@ public class SubTreeModelViewer extends TreeModelViewer {
SubTreeModelViewer.this.replace(parentOrTreePath, index, element);
}
}
-
+
@Override
public void setChildCount(Object elementOrTreePath, int count) {
if (elementOrTreePath instanceof TreePath) {
@@ -112,7 +112,7 @@ public class SubTreeModelViewer extends TreeModelViewer {
SubTreeModelViewer.this.setChildCount(elementOrTreePath, count);
}
}
-
+
@Override
public void setHasChildren(Object elementOrTreePath, boolean hasChildren) {
if (elementOrTreePath instanceof TreePath) {
@@ -141,7 +141,7 @@ public class SubTreeModelViewer extends TreeModelViewer {
SubTreeModelViewer.this.setExpandedState(elementOrTreePath, expanded);
}
}
-
+
@Override
public void expandToLevel(Object elementOrTreePath, int level) {
if (elementOrTreePath instanceof TreePath) {
@@ -202,12 +202,12 @@ public class SubTreeModelViewer extends TreeModelViewer {
}
return false;
}
-
+
@Override
public int getChildCount(TreePath path) {
if (path.startsWith(fRootPath, null)) {
return SubTreeModelViewer.this.getChildCount(createSubPath(path));
- }
+ }
return -1;
}
@@ -228,20 +228,20 @@ public class SubTreeModelViewer extends TreeModelViewer {
public Object getChildElement(TreePath path, int index) {
if (path.startsWith(fRootPath, null)) {
return SubTreeModelViewer.this.getChildElement(createSubPath(path), index);
- }
+ }
return null;
}
-
+
@Override
public TreePath getTopElementPath() {
return createFullPath(SubTreeModelViewer.this.getTopElementPath());
}
-
+
@Override
public int findElementIndex(TreePath parentPath, Object element) {
if (parentPath.startsWith(fRootPath, null)) {
return SubTreeModelViewer.this.findElementIndex(createSubPath(parentPath), element);
- }
+ }
return -1;
}
@@ -249,15 +249,15 @@ public class SubTreeModelViewer extends TreeModelViewer {
public boolean getElementChildrenRealized(TreePath parentPath) {
if (parentPath.startsWith(fRootPath, null)) {
return SubTreeModelViewer.this.getElementChildrenRealized(createSubPath(parentPath));
- }
+ }
return true;
}
-
+
@Override
public void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] images, FontData[] fontDatas, RGB[] foregrounds, RGB[] backgrounds) {
if (path.startsWith(fRootPath, null)) {
SubTreeModelViewer.this.setElementData(createSubPath(path), numColumns, labels, images, fontDatas, foregrounds, backgrounds);
- }
+ }
}
@Override
@@ -369,7 +369,7 @@ public class SubTreeModelViewer extends TreeModelViewer {
public void setSelection(ISelection selection, boolean reveal, boolean force) {
SubTreeModelViewer.this.setSelection(selection, reveal, force);
}
-
+
@Override
public boolean trySelection(ISelection selection, boolean reveal, boolean force) {
return SubTreeModelViewer.this.trySelection(selection, reveal, force);
@@ -380,7 +380,7 @@ public class SubTreeModelViewer extends TreeModelViewer {
SubTreeModelViewer.this.updateViewer(delta);
}
-
+
@Override
public ViewerFilter[] getFilters() {
return SubTreeModelViewer.this.getFilters();
@@ -390,12 +390,12 @@ public class SubTreeModelViewer extends TreeModelViewer {
public void addFilter(ViewerFilter filter) {
SubTreeModelViewer.this.addFilter(filter);
}
-
+
@Override
public void setFilters(ViewerFilter... filters) {
SubTreeModelViewer.this.setFilters(filters);
}
-
+
@Override
public boolean overrideSelection(ISelection current, ISelection candidate) {
return SubTreeModelViewer.this.overrideSelection(current, candidate);
@@ -410,12 +410,12 @@ public class SubTreeModelViewer extends TreeModelViewer {
public void update(Object element) {
SubTreeModelViewer.this.update(element);
}
-
+
@Override
public void clearSelectionQuiet() {
SubTreeModelViewer.this.clearSelectionQuiet();
}
-
+
@Override
public TreePath[] getElementPaths(Object element) {
TreePath[] subViewerPaths = SubTreeModelViewer.this.getElementPaths(element);
@@ -425,41 +425,41 @@ public class SubTreeModelViewer extends TreeModelViewer {
}
return retVal;
}
-
+
@Override
public boolean getElementChecked(TreePath path) {
return SubTreeModelViewer.this.getElementChecked(createSubPath(path));
}
-
+
@Override
public boolean getElementGrayed(TreePath path) {
return SubTreeModelViewer.this.getElementGrayed(createSubPath(path));
}
-
+
@Override
public void setElementChecked(TreePath path, boolean checked, boolean grayed) {
SubTreeModelViewer.this.setElementChecked(createSubPath(path), checked, grayed);
}
}
-
+
/**
- * Delegating content provider. It translates all the calls to the
+ * Delegating content provider. It translates all the calls to the
* underlying content provider to use full model tree paths.
*/
private class SubTreeModelContentProvider implements ITreeModelContentProvider {
-
+
private TreeModelContentProvider fBaseProvider;
-
+
public SubTreeModelContentProvider() {
fBaseProvider = new TreeModelContentProvider();
}
-
+
@Override
public void updateHasChildren(TreePath path) {
fBaseProvider.updateHasChildren(createFullPath(path));
}
-
+
@Override
public void updateChildCount(TreePath path, int currentChildCount) {
fBaseProvider.updateChildCount(createFullPath(path), currentChildCount);
@@ -469,12 +469,12 @@ public class SubTreeModelViewer extends TreeModelViewer {
public void updateElement(TreePath parentPath, int viewIndex) {
fBaseProvider.updateElement(createFullPath(parentPath), viewIndex);
}
-
+
@Override
public int viewToModelCount(TreePath parentPath, int count) {
return fBaseProvider.viewToModelCount(createFullPath(parentPath), count);
}
-
+
@Override
public int viewToModelIndex(TreePath parentPath, int index) {
return fBaseProvider.viewToModelIndex(createFullPath(parentPath), index);
@@ -539,7 +539,7 @@ public class SubTreeModelViewer extends TreeModelViewer {
public boolean areTreeModelViewerFiltersApplicable(Object parentElement) {
return fBaseProvider.areTreeModelViewerFiltersApplicable(parentElement);
}
-
+
@Override
public boolean shouldFilter(Object parentElementOrTreePath, Object element) {
if (parentElementOrTreePath instanceof TreePath) {
@@ -548,7 +548,7 @@ public class SubTreeModelViewer extends TreeModelViewer {
} else {
return fBaseProvider.shouldFilter(parentElementOrTreePath, element);
}
-
+
}
@Override
@@ -571,7 +571,7 @@ public class SubTreeModelViewer extends TreeModelViewer {
public void cancelRestore(TreePath path, int flags) {
fBaseProvider.cancelRestore(createFullPath(path), flags);
}
-
+
@Override
public void dispose() {
fBaseProvider.dispose();
@@ -581,13 +581,13 @@ public class SubTreeModelViewer extends TreeModelViewer {
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
fBaseProvider.inputChanged(fDelegatingViewer, oldInput, newInput);
}
-
+
@Override
public void postInputChanged(IInternalTreeModelViewer viewer,
Object oldInput, Object newInput) {
fBaseProvider.postInputChanged(viewer, oldInput, newInput);
}
-
+
@Override
public boolean setChecked(TreePath path, boolean checked) {
return fBaseProvider.setChecked(createFullPath(path), checked);
@@ -596,19 +596,19 @@ public class SubTreeModelViewer extends TreeModelViewer {
}
/**
- * Delegating label provider. It translates all the calls to the
+ * Delegating label provider. It translates all the calls to the
* underlying label provider to use full model tree paths.
*/
private class SubTreeModelLabelProvider extends ColumnLabelProvider
- implements ITreeModelLabelProvider
+ implements ITreeModelLabelProvider
{
private TreeModelLabelProvider fBaseProvider;
-
+
public SubTreeModelLabelProvider(IInternalTreeModelViewer viewer) {
fBaseProvider = new TreeModelLabelProvider(viewer);
}
-
+
@Override
public boolean update(TreePath elementPath) {
return fBaseProvider.update( createFullPath(elementPath) );
@@ -660,12 +660,12 @@ public class SubTreeModelViewer extends TreeModelViewer {
fBaseProvider.removeListener(listener);
}
}
-
+
private TreePath createFullPath(TreePath subPath) {
if (fRootPath == null) {
return TreePath.EMPTY;
}
-
+
Object[] segments = new Object[fRootPath.getSegmentCount() + subPath.getSegmentCount()];
for (int i = 0; i < fRootPath.getSegmentCount(); i++) {
segments[i] = fRootPath.getSegment(i);
@@ -675,7 +675,7 @@ public class SubTreeModelViewer extends TreeModelViewer {
}
return new TreePath(segments);
}
-
+
private TreePath createSubPath(TreePath fullPath) {
if (fRootPath == null) {
return TreePath.EMPTY;
@@ -690,23 +690,23 @@ public class SubTreeModelViewer extends TreeModelViewer {
}
return new TreePath(segments);
}
-
+
private DelegatingTreeModelViewer getDelegatingViewer() {
if (fDelegatingViewer == null) {
fDelegatingViewer = new DelegatingTreeModelViewer();
}
return fDelegatingViewer;
}
-
+
@Override
protected ITreeModelContentProvider createContentProvider() {
return new SubTreeModelContentProvider();
}
-
+
@Override
protected ITreeModelLabelProvider createLabelProvider() {
return new SubTreeModelLabelProvider(getDelegatingViewer());
}
-
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java
index da68d82c1..128101422 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java
@@ -24,7 +24,7 @@ import org.eclipse.ui.PlatformUI;
/**
* The TimeTriggeredProgressMonitorDialog is a progress monitor dialog that only
* opens if the runnable provided exceeds the specified long operation time.
- *
+ *
* @since 3.6 - Copied from org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog
*/
public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
@@ -43,7 +43,7 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
* Whether or not we've already opened a dialog.
*/
private boolean dialogOpened = false;
-
+
/**
* Wrappered monitor so we can check ticks and open the dialog when
* appropriate
@@ -52,7 +52,7 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
/**
* Create a new instance of the receiver.
- *
+ *
* @param parent
* the parent of the dialog
* @param longOperationTime
@@ -68,7 +68,7 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
/**
* Create a monitor for the receiver that wrappers the superclasses monitor.
- *
+ *
*/
public void createWrapperedMonitor() {
wrapperedMonitor = new IProgressMonitor() {
@@ -78,7 +78,7 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.runtime.IProgressMonitor#beginTask(java.lang.String,
* int)
*/
@@ -105,7 +105,7 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.runtime.IProgressMonitor#done()
*/
@Override
@@ -116,7 +116,7 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.runtime.IProgressMonitor#internalWorked(double)
*/
@Override
@@ -127,7 +127,7 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.runtime.IProgressMonitor#isCanceled()
*/
@Override
@@ -137,7 +137,7 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.runtime.IProgressMonitor#setCanceled(boolean)
*/
@Override
@@ -148,7 +148,7 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.runtime.IProgressMonitor#setTaskName(java.lang.String)
*/
@Override
@@ -160,7 +160,7 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.runtime.IProgressMonitor#subTask(java.lang.String)
*/
@Override
@@ -171,7 +171,7 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.runtime.IProgressMonitor#worked(int)
*/
@Override
@@ -185,7 +185,7 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.dialogs.ProgressMonitorDialog#getProgressMonitor()
*/
@Override
@@ -195,10 +195,10 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
}
return wrapperedMonitor;
}
-
+
/*
- * (non-Javadoc)
- *
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.operations.IRunnableContext#run(boolean, boolean, IRunnableWithProgress)
*/
@Override
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 0522d316b..24e0b712d 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
@@ -7,7 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Wind River Systems - Fix for viewer state save/restore [188704]
+ * Wind River Systems - Fix for viewer state save/restore [188704]
* Pawel Piech (Wind River) - added support for a virtual tree model viewer (Bug 242489)
* Dorin Ciuca - Top index fix (Bug 324100)
* Anton Leherbauer (Wind River) - REVEAL delta does not always work reliably (Bug 438724)
@@ -56,7 +56,7 @@ import org.eclipse.swt.widgets.Display;
/**
* Content provider for a virtual tree.
- *
+ *
* @since 3.3
*/
public class TreeModelContentProvider implements ITreeModelContentProvider, IContentProvider, IModelChangedListener {
@@ -73,7 +73,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
/**
* Map tree paths to model proxy responsible for element
- *
+ *
* Used to install different model proxy instances for one element depending
* on the tree path.
*/
@@ -85,7 +85,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
/**
* Map element to model proxy responsible for it.
- *
+ *
* Used to install a single model proxy which is responsible for all
* instances of an element in the model tree.
*/
@@ -114,7 +114,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
* @see IViewerUpdateListener
*/
private boolean fModelSequenceRunning = false;
-
+
/**
* Map of updates in progress: element path -> list of requests
*/
@@ -127,7 +127,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
private Map<TreePath, List<ViewerUpdateMonitor>> fWaitingRequests = new HashMap<TreePath, List<ViewerUpdateMonitor>>();
private List<ViewerUpdateMonitor> fCompletedUpdates = new ArrayList<ViewerUpdateMonitor>();
-
+
private Runnable fCompletedUpdatesRunnable;
private ViewerStateTracker fStateTracker = new ViewerStateTracker(this);
@@ -158,9 +158,9 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
if (fViewer == null) {
return;
}
-
+
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+
// cancel pending updates
for (List<ViewerUpdateMonitor> requests : fRequestsInProgress.values()) {
for (ViewerUpdateMonitor vu : requests) {
@@ -173,7 +173,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
fModelListeners.clear();
fUpdateListeners.clear();
disposeAllModelProxies();
-
+
synchronized(this) {
fViewer = null;
}
@@ -193,18 +193,18 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
synchronized(this) {
fViewer = (IInternalTreeModelViewer) viewer;
}
-
+
Assert.isTrue( fViewer.getDisplay().getThread() == Thread.currentThread() );
if (oldInput != null) {
fStateTracker.saveViewerState(oldInput);
}
}
-
+
@Override
public void postInputChanged(IInternalTreeModelViewer viewer, Object oldInput, Object newInput) {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+
cancelSubtreeUpdates(TreePath.EMPTY);
disposeAllModelProxies();
cancelSubtreeUpdates(TreePath.EMPTY);
@@ -212,7 +212,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
if (newInput != null) {
installModelProxy(newInput, TreePath.EMPTY);
fStateTracker.restoreViewerState(newInput);
- }
+ }
}
@Override
@@ -232,9 +232,9 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
@Override
public void preserveState(TreePath path) {
- fStateTracker.appendToPendingStateDelta(path);
+ fStateTracker.appendToPendingStateDelta(path);
}
-
+
@Override
public void removeStateUpdateListener(IStateUpdateListener listener) {
fStateTracker.removeStateUpdateListener(listener);
@@ -249,7 +249,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
public void removeModelChangedListener(IModelChangedListener listener) {
fModelListeners.remove(listener);
}
-
+
@Override
public void cancelRestore(final TreePath path, final int flags) {
fStateTracker.cancelRestore(path, flags);
@@ -260,10 +260,10 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
IModelProxy elementProxy = getElementProxy(path);
if (elementProxy instanceof ICheckboxModelProxy) {
return ((ICheckboxModelProxy) elementProxy).setChecked(getPresentationContext(), getViewer().getInput(), path, checked);
- }
+ }
return false;
}
-
+
/**
* Installs the model proxy for the given element into this content provider
* if not already installed.
@@ -271,7 +271,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
* @param path the {@link TreePath} to install the proxy for
*/
private void installModelProxy(Object input, TreePath path) {
-
+
if (!fTreeModelProxies.containsKey(path) && !fModelProxies.containsKey(path.getLastSegment())) {
Object element = path.getSegmentCount() != 0 ? path.getLastSegment() : input;
IModelProxy proxy = null;
@@ -366,7 +366,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
fTreeModelProxies.clear();
}
-
+
/**
* Removes the model proxy installed for the given element, if any.
* @param path the {@link TreePath} to dispose the model proxy for
@@ -380,8 +380,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
if (proxy != null) {
proxy.dispose();
}
- }
-
+ }
+
@Override
public void modelChanged(final IModelDelta delta, final IModelProxy proxy) {
Display display = null;
@@ -394,7 +394,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
}
if (display != null) {
- // If we're in display thread, process the delta immediately to
+ // If we're in display thread, process the delta immediately to
// avoid "skid" in processing events.
if (Thread.currentThread().equals(display.getThread())) {
doModelChanged(delta, proxy);
@@ -423,16 +423,16 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
updateModel(delta, getModelDeltaMask());
- // Initiate model update sequence before notifying of the model changed.
+ // Initiate model update sequence before notifying of the model changed.
trigger(null);
-
+
// Call model listeners after updating the viewer model.
for (IModelChangedListener iModelChangedListener : fModelListeners) {
iModelChangedListener.modelChanged(delta, proxy);
}
}
}
-
+
@Override
public void setModelDeltaMask(int mask) {
fModelDeltaMask = mask;
@@ -450,20 +450,20 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
if (getViewer() == null || getViewer().getInput() == null) {
return;
}
-
+
fRevealPath = null;
IModelDelta[] deltaArray = new IModelDelta[] { delta };
updateNodes(deltaArray, mask & (IModelDelta.REMOVED | IModelDelta.UNINSTALL));
updateNodes(deltaArray, mask & ITreeModelContentProvider.UPDATE_MODEL_DELTA_FLAGS
& ~(IModelDelta.REMOVED | IModelDelta.UNINSTALL));
updateNodes(deltaArray, mask & ITreeModelContentProvider.CONTROL_MODEL_DELTA_FLAGS);
-
+
fStateTracker.checkIfRestoreComplete();
}
/**
* Returns a tree path for the node including the root element.
- *
+ *
* @param node
* model delta
* @return corresponding tree path
@@ -479,7 +479,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
/**
* Returns a tree path for the node, *not* including the root element.
- *
+ *
* @param node
* model delta
* @return corresponding tree path
@@ -497,7 +497,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
/**
* Returns the viewer this content provider is working for.
- *
+ *
* @return viewer
*/
protected IInternalTreeModelViewer getViewer() {
@@ -532,7 +532,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
if (filters.length > 0) {
for (int j = 0; j < filters.length; j++) {
if (filters[j] instanceof TreeModelViewerFilter &&
- ((TreeModelViewerFilter)filters[j]).isApplicable(fViewer, parentElement))
+ ((TreeModelViewerFilter)filters[j]).isApplicable(fViewer, parentElement))
{
return true;
}
@@ -548,7 +548,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
for (int j = 0; j < filters.length; j++) {
if (filters[j] instanceof TreeModelViewerFilter) {
// Skip the filter if not applicable to parent element
- Object parentElement = parentElementOrTreePath instanceof TreePath
+ Object parentElement = parentElementOrTreePath instanceof TreePath
? ((TreePath)parentElementOrTreePath).getLastSegment() : parentElementOrTreePath;
if (parentElement == null) {
parentElement = fViewer.getInput();
@@ -557,7 +557,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
continue;
}
}
-
+
if (!(filters[j].select((Viewer) fViewer, parentElementOrTreePath, element))) {
return true;
}
@@ -573,7 +573,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
cancelSubtreeUpdates(path);
}
-
+
boolean addFilteredIndex(TreePath parentPath, int index, Object element) {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
return fTransform.addFilteredIndex(parentPath, index, element);
@@ -616,12 +616,12 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
/**
* Notification an update request has started
- *
+ *
* @param update the update to notify about
*/
void updateStarted(ViewerUpdateMonitor update) {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+
List<ViewerUpdateMonitor> requests = fRequestsInProgress.get(update.getSchedulingPath());
if (requests == null) {
requests = new ArrayList<ViewerUpdateMonitor>();
@@ -643,7 +643,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
/**
* Notification an update request has completed
- *
+ *
* @param updates the updates to notify
*/
void updatesComplete(final List<ViewerUpdateMonitor> updates) {
@@ -654,7 +654,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
DebugUIPlugin.trace("\tEND - " + update); //$NON-NLS-1$
}
}
-
+
// Wait a single cycle to allow viewer to queue requests triggered by completed updates.
getViewer().getDisplay().asyncExec(new Runnable() {
@Override
@@ -665,7 +665,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
for (int i = 0; i < updates.size(); i++) {
ViewerUpdateMonitor update = updates.get(i);
-
+
// Search for update in list using identity test. Otherwise a completed canceled
// update may trigger removal of up-to-date running update on the same element.
List<ViewerUpdateMonitor> requests = fRequestsInProgress.get(update.getSchedulingPath());
@@ -679,10 +679,10 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
}
}
-
+
if (found) {
- // Trigger may initiate new updates, so wait to remove requests array from
- // fRequestsInProgress map. This way updateStarted() will not send a
+ // Trigger may initiate new updates, so wait to remove requests array from
+ // fRequestsInProgress map. This way updateStarted() will not send a
// redundant "UPDATE SEQUENCE STARTED" notification.
trigger(update.getSchedulingPath());
} else {
@@ -703,12 +703,12 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
DebugUIPlugin.trace("MODEL SEQUENCE ENDS"); //$NON-NLS-1$
}
notifyUpdate(UPDATE_SEQUENCE_COMPLETE, null);
- }
+ }
}
});
-
+
}
-
+
/**
* @return Returns true if there are outstanding updates in the viewer.
*/
@@ -722,7 +722,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
ViewerStateTracker getStateTracker() {
return fStateTracker;
}
-
+
/**
* Notifies listeners about given update.
* @param type Type of update to call listeners with.
@@ -763,20 +763,20 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
/**
- * Cancels outstanding updates for the element at given path and its
+ * Cancels outstanding updates for the element at given path and its
* children.
* @param path Path of element.
*/
private void cancelSubtreeUpdates(TreePath path) {
- Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
+ Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
for (Entry<TreePath, List<ViewerUpdateMonitor>> entry : fRequestsInProgress.entrySet()) {
TreePath entryPath = entry.getKey();
if (entryPath.startsWith(path, null)) {
List<ViewerUpdateMonitor> requests = entry.getValue();
Iterator<ViewerUpdateMonitor> reqIter = requests.iterator();
while (reqIter.hasNext()) {
- // Cancel update and remove from requests list. Removing from
- // fRequestsInProgress ensures that isRequestBlocked() won't be triggered
+ // Cancel update and remove from requests list. Removing from
+ // fRequestsInProgress ensures that isRequestBlocked() won't be triggered
// by a canceled update.
reqIter.next().cancel();
reqIter.remove();
@@ -792,19 +792,19 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
for (TreePath tp : purge) {
fWaitingRequests.remove(tp);
}
-
+
fStateTracker.cancelStateSubtreeUpdates(path);
}
/**
* Returns whether this given request should be run, or should wait for
* parent update to complete.
- *
+ *
* @param update the update the schedule
*/
private void schedule(final ViewerUpdateMonitor update) {
Assert.isTrue(getViewer().getDisplay().getThread() == Thread.currentThread());
-
+
TreePath schedulingPath = update.getSchedulingPath();
List<ViewerUpdateMonitor> requests = fWaitingRequests.get(schedulingPath);
if (requests == null) {
@@ -816,15 +816,15 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
if (inProgressList != null) {
int staleUpdateIndex = inProgressList.indexOf(update);
if (staleUpdateIndex >= 0) {
- // Cancel update and remove from requests list. Removing from
- // fRequestsInProgress ensures that isRequestBlocked() won't be triggered
+ // Cancel update and remove from requests list. Removing from
+ // fRequestsInProgress ensures that isRequestBlocked() won't be triggered
// by a canceled update.
ViewerUpdateMonitor staleUpdate = inProgressList.remove(staleUpdateIndex);
staleUpdate.cancel();
- // Note: Do not reset the inProgressList to null. This would cause the
- // updateStarted() method to think that a new update sequence is
- // being started. Since there are waiting requests for this scheduling
- // path, the list will be cleaned up later.
+ // Note: Do not reset the inProgressList to null. This would cause the
+ // updateStarted() method to think that a new update sequence is
+ // being started. Since there are waiting requests for this scheduling
+ // path, the list will be cleaned up later.
}
}
if (inProgressList == null || inProgressList.isEmpty()) {
@@ -835,7 +835,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
return;
}
trigger(update.getSchedulingPath());
- }
+ }
});
}
} else {
@@ -843,15 +843,15 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
requests.add(coalesce(requests, update));
}
}
-
+
/**
- * Tries to coalesce the given request with any request in the list. If a match is found,
+ * Tries to coalesce the given request with any request in the list. If a match is found,
* the resulting request is then coalesced again with candidates in list.
- * @param requests List of waiting requests to coalesce with
+ * @param requests List of waiting requests to coalesce with
* @param toCoalesce request to coalesce
- * @return Returns either the coalesced request. If no match was found it returns the
- * toCoalesce parameter request. Either way the returned request needs to be added to the
- * waiting requests list.
+ * @return Returns either the coalesced request. If no match was found it returns the
+ * toCoalesce parameter request. Either way the returned request needs to be added to the
+ * waiting requests list.
*/
private ViewerUpdateMonitor coalesce(List<ViewerUpdateMonitor> requests, ViewerUpdateMonitor toCoalesce) {
for (ViewerUpdateMonitor waiting : requests) {
@@ -867,13 +867,13 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
/**
* Returns whether there are outstanding ChildrenUpdate updates for the given path.
- * This method is expected to be called during processing of a ChildrenRequest,
+ * This method is expected to be called during processing of a ChildrenRequest,
* therefore one running children request is ignored.
* @param path Path of element to check.
* @return True if there are outstanding children updates for given element.
*/
boolean areChildrenUpdatesPending(TreePath path) {
- Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
+ Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
List<ViewerUpdateMonitor> requests = fWaitingRequests.get(path);
if (requests != null) {
for (int i = 0; i < requests.size(); i++) {
@@ -897,20 +897,20 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
/**
- * Triggers waiting requests based on the given request that just
- * completed.
+ * Triggers waiting requests based on the given request that just
+ * completed.
* <p>
- * Requests are processed in order such that updates to
+ * Requests are processed in order such that updates to
* children are delayed until updates for parent elements are completed.
- * This allows the expansion/selection state of the elements to be
- * properly restored as new elements are retrieved from model.
+ * This allows the expansion/selection state of the elements to be
+ * properly restored as new elements are retrieved from model.
* </p>
- * @param schedulingPath schedulingPath path or requests to start processing. May
+ * @param schedulingPath schedulingPath path or requests to start processing. May
* be <code>null</code> to start the shortest path request.
*/
private void trigger(TreePath schedulingPath) {
Assert.isTrue(getViewer().getDisplay().getThread() == Thread.currentThread());
-
+
if (fWaitingRequests.isEmpty()) {
return;
}
@@ -936,8 +936,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
/**
- * Returns true if there are running requests for any parent element of
- * the given tree path.
+ * Returns true if there are running requests for any parent element of
+ * the given tree path.
* @param requestPath Path of element to check.
* @return Returns true if requests are running.
*/
@@ -954,7 +954,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
return true;
}
-
+
/**
* @param key the {@link TreePath}
* @param waiting the list of waiting requests
@@ -979,7 +979,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
/**
* Returns the element corresponding to the given tree path.
- *
+ *
* @param path
* tree path
* @return model element
@@ -995,15 +995,15 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
* Reschedule any children updates in progress for the given parent that
* have a start index greater than the given index. An element has been
* removed at this index, invalidating updates in progress.
- *
+ *
* @param parentPath
* view tree path to parent element
* @param modelIndex
* index at which an element was removed
*/
private void rescheduleUpdates(TreePath parentPath, int modelIndex) {
- Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+ Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
+
List<ViewerUpdateMonitor> requests = fRequestsInProgress.get(parentPath);
List<IChildrenUpdate> reCreate = null;
if (requests != null) {
@@ -1013,8 +1013,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
if (update instanceof IChildrenUpdate) {
IChildrenUpdate childrenUpdate = (IChildrenUpdate) update;
if (childrenUpdate.getOffset() > modelIndex) {
- // Cancel update and remove from requests list. Removing from
- // fRequestsInProgress ensures that isRequestBlocked() won't be triggered
+ // Cancel update and remove from requests list. Removing from
+ // fRequestsInProgress ensures that isRequestBlocked() won't be triggered
// by a canceled update.
childrenUpdate.cancel();
iterator.remove();
@@ -1056,49 +1056,49 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
}
}
-
+
private void doUpdateChildCount(TreePath path) {
- Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+ Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
+
Object element = getElement(path);
IElementContentProvider contentAdapter = ViewerAdapterService.getContentProvider(element);
if (contentAdapter != null) {
ChildrenCountUpdate request = new ChildrenCountUpdate(this, getViewer().getInput(), path, element, contentAdapter);
schedule(request);
}
- }
-
+ }
+
void doUpdateElement(TreePath parentPath, int modelIndex) {
- Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+ Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
+
Object parent = getElement(parentPath);
IElementContentProvider contentAdapter = ViewerAdapterService.getContentProvider(parent);
if (contentAdapter != null) {
ChildrenUpdate request = new ChildrenUpdate(this, getViewer().getInput(), parentPath, parent, modelIndex, contentAdapter);
schedule(request);
- }
- }
-
+ }
+ }
+
private void doUpdateHasChildren(TreePath path) {
- Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+ Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
+
Object element = getElement(path);
IElementContentProvider contentAdapter = ViewerAdapterService.getContentProvider(element);
if (contentAdapter != null) {
HasChildrenUpdate request = new HasChildrenUpdate(this, getViewer().getInput(), path, element, contentAdapter);
schedule(request);
}
- }
-
+ }
+
/**
- * Checks if there are outstanding updates that may replace the element
- * at given path.
+ * Checks if there are outstanding updates that may replace the element
+ * at given path.
* @param path Path of element to check.
* @return Returns true if there are outstanding updates.
*/
boolean areElementUpdatesPending(TreePath path) {
- Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+ Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
+
TreePath parentPath = path.getParentPath();
List<ViewerUpdateMonitor> requests = fWaitingRequests.get(path);
if (requests != null) {
@@ -1138,23 +1138,23 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
return false;
}
-
+
/**
* Returns the presentation context for this content provider.
- *
+ *
* @return presentation context
*/
protected IPresentationContext getPresentationContext() {
ITreeModelViewer viewer = getViewer();
if (viewer != null) {
return viewer.getPresentationContext();
- }
+ }
return null;
}
-
+
/**
* Updates the viewer with the following deltas.
- *
+ *
* @param nodes Model deltas to be processed.
* @param mask the model delta mask
* @see IModelDelta for a list of masks
@@ -1210,8 +1210,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
protected void handleUninstall(IModelDelta delta) {
disposeModelProxy(getFullTreePath(delta));
- }
-
+ }
+
protected void handleAdd(IModelDelta delta) {
IModelDelta parentDelta = delta.getParentDelta();
if (parentDelta == null) {
@@ -1250,7 +1250,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
TreePath childPath = parentPath.createChildPath(element);
updateHasChildren(childPath);
fStateTracker.restorePendingStateOnUpdate(childPath, modelIndex, false, false, false);
- }
+ }
} else {
if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) {
DebugUIPlugin.trace("handleAdd(" + delta.getElement() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1273,7 +1273,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
cancelSubtreeUpdates(treePath);
getViewer().refresh(getElement(treePath));
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ModelContentProvider#handleCollapse(org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta)
*/
@@ -1302,11 +1302,11 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) {
DebugUIPlugin.trace("[expand] setChildCount(" + delta.getElement() + ", (model) " + childCount + " (view) " + viewCount); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- getViewer().setChildCount(elementPath, viewCount);
+ getViewer().setChildCount(elementPath, viewCount);
}
}
}
-
+
/**
* Expands the element pointed to by given delta.
* @param delta Delta that points to the element to expand.
@@ -1348,12 +1348,12 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
}
}
-
+
/**
* Inserts the given child element of the specified parent into the tree if the element
* should *no* longer be filtered. Returns the view index of the newly inserted element
* or -1 if not inserted.
- *
+ *
* @param parentPath viewer tree path to parent element
* @param element element to insert
* @param modelIndex index of the element in the model
@@ -1394,7 +1394,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
TreePath parentPath = getViewerTreePath(delta.getParentDelta());
Object element = delta.getElement();
int modelIndex = delta.getIndex();
- int viewIndex = modelIndex >= 0 ? modelToViewIndex(parentPath, modelIndex) : -1;
+ int viewIndex = modelIndex >= 0 ? modelToViewIndex(parentPath, modelIndex) : -1;
int viewCount = getViewer().getChildCount(parentPath);
if (viewIndex >= 0 && viewIndex <= viewCount) {
// Index in range, insert.
@@ -1503,7 +1503,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
if (index >= 0) {
boolean filtered = isFiltered(parentPath, index);
boolean shouldFilter = shouldFilter(parentPath, delta.getReplacementElement());
-
+
// Update the filter transform
if (filtered) {
clearFilteredChild(parentPath, index);
@@ -1511,12 +1511,12 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
if (shouldFilter) {
addFilteredIndex(parentPath, index, delta.getElement());
}
-
+
// Update the viewer
if (filtered) {
if (!shouldFilter) {
getViewer().insert(parentPath, delta.getReplacementElement(), modelToViewIndex(parentPath, index));
- }
+ }
//else do nothing
} else {
if (shouldFilter) {
@@ -1533,8 +1533,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
IInternalTreeModelViewer treeViewer = getViewer();
// check if selection is allowed
IStructuredSelection candidate = new TreeSelection(getViewerTreePath(delta));
- if ((delta.getFlags() & IModelDelta.FORCE) == 0 &&
- !treeViewer.overrideSelection(treeViewer.getSelection(), candidate))
+ if ((delta.getFlags() & IModelDelta.FORCE) == 0 &&
+ !treeViewer.overrideSelection(treeViewer.getSelection(), candidate))
{
return;
}
@@ -1584,7 +1584,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
reveal(delta);
cancelRestore(getViewerTreePath(delta), IModelDelta.REVEAL);
}
-
+
/**
* Reveals the element pointed to by given delta.
* @param delta Delta pointing to the element to reveal.
@@ -1615,7 +1615,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
// only move tree based on force flag and selection policy
if ((delta.getFlags() & IModelDelta.FORCE) != 0 ||
- treeViewer.overrideSelection(treeViewer.getSelection(), new TreeSelection(elementPath)))
+ treeViewer.overrideSelection(treeViewer.getSelection(), new TreeSelection(elementPath)))
{
/*
* Bug 438724 - Save reveal parameters and redo reveal on
@@ -1627,8 +1627,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
treeViewer.reveal(parentPath, viewIndex);
}
}
- }
-
+ }
+
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILazyTreePathContentProvider#getParents(java.lang.Object)
@@ -1643,8 +1643,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
*/
@Override
public void updateChildCount(TreePath treePath, int currentChildCount) {
- Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+ Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
+
if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) {
DebugUIPlugin.trace("updateChildCount(" + getElement(treePath) + ", " + currentChildCount + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@@ -1657,12 +1657,12 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
@Override
public void updateElement(TreePath parentPath, int viewIndex) {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+
int modelIndex = viewToModelIndex(parentPath, viewIndex);
if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) {
DebugUIPlugin.trace("updateElement("+ getElement(parentPath) + ", " + viewIndex + ") > modelIndex = " + modelIndex); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- doUpdateElement(parentPath, modelIndex);
+ doUpdateElement(parentPath, modelIndex);
}
/* (non-Javadoc)
@@ -1671,7 +1671,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
@Override
public void updateHasChildren(TreePath path) {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+
if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) {
DebugUIPlugin.trace("updateHasChildren(" + getElement(path)); //$NON-NLS-1$
}
@@ -1680,7 +1680,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
/**
* Schedules given update to be performed on the viewer.
- * Updates are queued up if they are completed in the same
+ * Updates are queued up if they are completed in the same
* UI cycle.
* @param update Update to perform.
*/
@@ -1705,7 +1705,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
updateJob = fCompletedUpdatesRunnable;
}
}
-
+
if (updateJob != null) {
if (Thread.currentThread() == display.getThread()) {
performUpdates();
@@ -1720,7 +1720,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
*/
private void performUpdates() {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+
List<ViewerUpdateMonitor> jobCompletedUpdates;
synchronized(this) {
if (isDisposed()) {
@@ -1739,10 +1739,10 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
if (status == null || status.isOK()) {
completedUpdate.performUpdate();
}
- }
+ }
}
} finally {
updatesComplete(jobCompletedUpdates);
- }
+ }
}
}
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 cce0f4947..705b10734 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
@@ -45,17 +45,17 @@ import org.eclipse.swt.widgets.Display;
/**
* @since 3.3
*/
-public class TreeModelLabelProvider extends ColumnLabelProvider
- implements ITreeModelLabelProvider, IModelChangedListener
+public class TreeModelLabelProvider extends ColumnLabelProvider
+ implements ITreeModelLabelProvider, IModelChangedListener
{
-
+
private IInternalTreeModelViewer fViewer;
/**
* Note: access this variable should be synchronized with <code>this</code>.
*/
private List<ILabelUpdate> fComplete;
-
+
/**
* Cache of images used for elements in this label provider. Label updates
* use the method <code>getImage(...)</code> to cache images for
@@ -76,32 +76,32 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
* RGB values. The colors are disposed with this label provider.
*/
private Map<RGB, Color> fColorCache = new HashMap<RGB, Color>();
-
+
/**
* Label listeners
*/
private ListenerList<ILabelUpdateListener> fLabelListeners = new ListenerList<>();
-
+
/**
* Updates waiting to be sent to the label provider. The map contains
- * lists of updates, keyed using the provider.
+ * lists of updates, keyed using the provider.
*/
private Map<IElementLabelProvider, List<ILabelUpdate>> fPendingUpdates = new HashMap<IElementLabelProvider, List<ILabelUpdate>>();
-
+
/**
* A runnable that will send the label update requests.
- * This variable allows the job to be canceled and re-scheduled if
- * new updates are requested.
+ * This variable allows the job to be canceled and re-scheduled if
+ * new updates are requested.
*/
private Runnable fPendingUpdatesRunnable;
-
+
/**
* List of updates in progress
*/
private List<ILabelUpdate> fUpdatesInProgress = new ArrayList<ILabelUpdate>();
-
+
/**
- * Delta visitor actively cancels the outstanding label updates for
+ * Delta visitor actively cancels the outstanding label updates for
* elements that are changed and are about to be updated.
*/
class CancelPendingUpdatesVisitor implements IModelDeltaVisitor {
@@ -116,7 +116,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
} else if ((delta.getFlags() & IModelDelta.STATE) > 0) {
cancelElementUpdates(delta.getElement(), false);
return true;
- }
+ }
return true;
}
}
@@ -125,7 +125,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
* Delta visitor
*/
private CancelPendingUpdatesVisitor fCancelPendingUpdatesVisitor = new CancelPendingUpdatesVisitor();
-
+
/**
* Constructs a new label provider on the given display
* @param viewer Viewer that this label provider is used with.
@@ -134,11 +134,11 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
fViewer = viewer;
fViewer.addModelChangedListener(this);
}
-
+
/**
* Returns an image for the given image descriptor or <code>null</code>. Adds the image
* to a cache of images if it does not already exist.
- *
+ *
* @param descriptor image descriptor or <code>null</code>
* @return image or <code>null</code>
*/
@@ -157,17 +157,17 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
/**
* Returns the display to use for resource allocation.
- *
+ *
* @return display
*/
private Display getDisplay() {
return fViewer.getDisplay();
}
-
+
/**
- * Returns a font for the given font data or <code>null</code>. Adds the font to the font
+ * Returns a font for the given font data or <code>null</code>. Adds the font to the font
* cache if not yet created.
- *
+ *
* @param fontData font data or <code>null</code>
* @return font font or <code>null</code>
*/
@@ -182,12 +182,12 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
fFontCache.put(fontData, font);
}
return font;
- }
-
+ }
+
/**
- * Returns a color for the given RGB or <code>null</code>. Adds the color to the color
+ * Returns a color for the given RGB or <code>null</code>. Adds the color to the color
* cache if not yet created.
- *
+ *
* @param rgb RGB or <code>null</code>
* @return color or <code>null</code>
*/
@@ -210,10 +210,10 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
@Override
public void dispose() {
Assert.isTrue(fViewer.getDisplay().getThread() == Thread.currentThread());
-
+
fViewer.removeModelChangedListener(this);
fViewer = null;
-
+
List<ILabelUpdate> complete = null;
synchronized(this) {
complete = fComplete;
@@ -225,7 +225,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
}
}
for (ILabelUpdate currentUpdate : fUpdatesInProgress) {
- currentUpdate.cancel();
+ currentUpdate.cancel();
}
if (fPendingUpdatesRunnable != null) {
@@ -255,18 +255,18 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
private boolean isDisposed() {
return fViewer == null;
}
-
+
@Override
public void update(ViewerCell cell) {
- // NOT USED - the viewer updates each row instead
- }
-
+ // NOT USED - the viewer updates each row instead
+ }
+
@Override
public boolean update(TreePath elementPath) {
Assert.isTrue(fViewer.getDisplay().getThread() == Thread.currentThread());
-
+
cancelPathUpdates(elementPath);
-
+
String[] visibleColumns = fViewer.getVisibleColumns();
Object element = elementPath.getLastSegment();
IElementLabelProvider presentation = ViewerAdapterService.getLabelProvider(element);
@@ -292,9 +292,9 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
return false;
}
}
-
+
/**
- * Cancel any outstanding updates that are running for this element.
+ * Cancel any outstanding updates that are running for this element.
* @param elementPath Element to cancel updates for.
*/
private void cancelPathUpdates(TreePath elementPath) {
@@ -308,28 +308,28 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
/**
* Sets the element's display information in the viewer.
- *
- * @param path Element path.
+ *
+ * @param path Element path.
* @param numColumns Number of columns in the data.
- * @param labels Array of labels. The array cannot to be
+ * @param labels Array of labels. The array cannot to be
* <code>null</code>, but values within the array may be.
* @param images Array of image descriptors, may be <code>null</code>.
* @param fontDatas Array of fond data objects, may be <code>null</code>.
- * @param foregrounds Array of RGB values for foreground colors, may be
+ * @param foregrounds Array of RGB values for foreground colors, may be
* <code>null</code>.
- * @param backgrounds Array of RGB values for background colors, may be
+ * @param backgrounds Array of RGB values for background colors, may be
* <code>null</code>.
* @param checked Whether given item should be checked.
* @param grayed Whether given item's checkbox should be grayed.
*/
void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] images,
- FontData[] fontDatas, RGB[] foregrounds, RGB[] backgrounds, boolean checked, boolean grayed)
+ FontData[] fontDatas, RGB[] foregrounds, RGB[] backgrounds, boolean checked, boolean grayed)
{
fViewer.setElementData(path, numColumns, labels, images, fontDatas, foregrounds, backgrounds);
fViewer.setElementChecked(path, checked, grayed);
}
-
+
private void startRequests(Runnable runnable) {
if (runnable != fPendingUpdatesRunnable) {
return;
@@ -347,11 +347,11 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
fPendingUpdates.clear();
fPendingUpdatesRunnable = null;
}
-
+
/**
* Cancels all running updates for the given element. If seachFullPath is true,
- * all updates will be canceled which have the given element anywhere in their
- * patch.
+ * all updates will be canceled which have the given element anywhere in their
+ * patch.
* @param element element to search for.
* @param searchFullPath flag whether to look for the element in the full path
* of the update
@@ -367,7 +367,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
if (element.equals(updatePath.getSegment(i))) {
currentUpdate.cancel();
break; // Exit the for loop, stay in the while loop
- }
+ }
}
}
} else {
@@ -380,7 +380,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
/**
* Returns the presentation context for this label provider.
- *
+ *
* @return presentation context
*/
private IPresentationContext getPresentationContext() {
@@ -389,14 +389,14 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
/**
* A label update is complete.
- *
+ *
* @param update Update that is to be completed.
*/
synchronized void complete(ILabelUpdate update) {
if (fViewer == null) {
return;
}
-
+
if (fComplete == null) {
fComplete = new LinkedList<ILabelUpdate>();
fViewer.getDisplay().asyncExec(new Runnable() {
@@ -422,28 +422,28 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
}
fComplete.add(update);
}
-
+
@Override
public void addLabelUpdateListener(ILabelUpdateListener listener) {
fLabelListeners.add(listener);
}
-
+
@Override
public void removeLabelUpdateListener(ILabelUpdateListener listener) {
fLabelListeners.remove(listener);
}
-
+
/**
* Notification an update request has started
- *
+ *
* @param update Update that was started
*/
void updateStarted(ILabelUpdate update) {
Assert.isTrue(fViewer.getDisplay().getThread() == Thread.currentThread());
-
+
boolean begin = fUpdatesInProgress.isEmpty();
fUpdatesInProgress.add(update);
-
+
if (begin) {
if (DebugUIPlugin.DEBUG_UPDATE_SEQUENCE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) {
DebugUIPlugin.trace("LABEL SEQUENCE BEGINS"); //$NON-NLS-1$
@@ -455,15 +455,15 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
}
notifyUpdate(TreeModelContentProvider.UPDATE_BEGINS, update);
}
-
+
/**
* Notification an update request has completed
- *
+ *
* @param update Update that completed.
*/
void updateComplete(ILabelUpdate update) {
fUpdatesInProgress.remove(update);
-
+
if (DebugUIPlugin.DEBUG_UPDATE_SEQUENCE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) {
DebugUIPlugin.trace("\tEND - " + update); //$NON-NLS-1$
}
@@ -475,7 +475,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
notifyUpdate(TreeModelContentProvider.UPDATE_SEQUENCE_COMPLETE, null);
}
}
-
+
private void notifyUpdate(final int type, final ILabelUpdate update) {
if (!fLabelListeners.isEmpty()) {
for (ILabelUpdateListener iLabelUpdateListener : fLabelListeners) {
@@ -513,5 +513,5 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
public void modelChanged(IModelDelta delta, IModelProxy proxy) {
delta.accept(fCancelPendingUpdatesVisitor);
}
-
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java
index 9ec884a25..175aa6df6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java
@@ -29,96 +29,96 @@ import org.eclipse.jface.viewers.IStructuredSelection;
/**
* Helper class to retrieve adapters associated with viewers.
- *
+ *
* @since 3.4
*/
public class ViewerAdapterService {
-
+
/**
* Returns the content provider for the given element or
* <code>null</code> if none.
- *
+ *
* @param element element to retrieve adapter for
* @return content provider or <code>null</code>
*/
- public static IElementContentProvider getContentProvider(Object element) {
+ public static IElementContentProvider getContentProvider(Object element) {
return (IElementContentProvider)getAdapter(element, IElementContentProvider.class);
}
-
+
/**
* Returns the label provider for the given element or
* <code>null</code> if none.
- *
+ *
* @param element element to retrieve adapter for
* @return label provider or <code>null</code>
*/
- public static IElementLabelProvider getLabelProvider(Object element) {
+ public static IElementLabelProvider getLabelProvider(Object element) {
IElementLabelProvider lp = (IElementLabelProvider)getAdapter(element, IElementLabelProvider.class);
if (lp == null && element instanceof String) {
// there are no adapters registered for Strings
return new DebugElementAdapterFactory().getAdapter(element, IElementLabelProvider.class);
}
return lp;
- }
-
+ }
+
/**
* Returns the column presentation factory for the given element or <code>null</code>.
- *
+ *
* @param element element to retrieve adapter for
* @return column presentation factory of <code>null</code>
*/
public static IColumnPresentationFactory getColumnPresentationFactory(Object element) {
return (IColumnPresentationFactory)getAdapter(element, IColumnPresentationFactory.class);
- }
-
+ }
+
/**
* Returns the model proxy factory for the given element or
* <code>null</code> if none.
- *
+ *
* @param element element to retrieve adapter for
* @return model proxy factory or <code>null</code>
*/
public static IModelProxyFactory getModelProxyFactory(Object element) {
return (IModelProxyFactory)getAdapter(element, IModelProxyFactory.class);
- }
+ }
/**
* Returns the model proxy factory v.2 for the given element or
* <code>null</code> if none.
- *
+ *
* @param element element to retrieve adapter for
* @return model proxy factory or <code>null</code>
*/
public static IModelProxyFactory2 getModelProxyFactory2(Object element) {
return (IModelProxyFactory2)getAdapter(element, IModelProxyFactory2.class);
- }
-
+ }
+
/**
* Returns the memento provider for the given element or
* <code>null</code> if none.
- *
+ *
* @param element element to retrieve adapter for
* @return memento provider or <code>null</code>
*/
public static IElementMementoProvider getMementoProvider(Object element) {
return (IElementMementoProvider)getAdapter(element, IElementMementoProvider.class);
- }
-
+ }
+
/**
* Returns the element editor for the given element or <code>null</code>.
- *
+ *
* @param element element to retrieve adapter for
* @return element editor or <code>null</code>
*/
public static IElementEditor getElementEditor(Object element) {
return (IElementEditor)getAdapter(element, IElementEditor.class);
- }
-
+ }
+
/**
* Creates and returns the selection policy associated with the given selection
* or <code>null</code> if none.
- *
+ *
* @param selection or <code>null</code>
* @param context presentation context
* @return selection policy or <code>null</code>
@@ -133,28 +133,28 @@ public class ViewerAdapterService {
}
}
return null;
- }
-
+ }
+
/**
* Returns the viewer input provider for the given element or
* <code>null</code> if none.
- *
+ *
* @param element element to retrieve adapter for
* @return viewer input provider or <code>null</code>
*/
- public static IViewerInputProvider getInputProvider(Object element) {
+ public static IViewerInputProvider getInputProvider(Object element) {
return (IViewerInputProvider)getAdapter(element, IViewerInputProvider.class);
- }
-
+ }
+
/**
* Returns an adapter of the specified type for the given object or <code>null</code>
* if none.
- *
+ *
* @param element element to retrieve adapter for
* @param type adapter type
* @return adapter or <code>null</code>
*/
private static Object getAdapter(Object element, Class<?> type) {
- return DebugPlugin.getAdapter(element, type);
+ return DebugPlugin.getAdapter(element, type);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java
index 3c46cf1b9..4953b6e68 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java
@@ -24,7 +24,7 @@ import org.eclipse.ui.progress.WorkbenchJob;
* Internal implementation of the {@link IViewerInputUpdate} interface. Allows
* implementors to translate the active debug context into an appropriate viewer
* input.
- *
+ *
* @since 3.4
* @see IViewerInputUpdate
*/
@@ -34,32 +34,32 @@ public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
* Presentation context
*/
private IPresentationContext fContext;
-
+
/**
* New viewer input
*/
private Object fSource;
-
+
/**
* Whether this update is done
*/
private boolean fDone;
-
+
/**
* Viewer input to use
*/
private Object fInputElement;
-
+
/**
* Viewer input at the time the request was made
*/
private Object fViewerInput;
-
+
/**
* Client making request
*/
private IViewerInputRequestor fRequestor;
-
+
/**
* When <code>done()</code> is called, the viewer must be informed that the update is complete in the UI thread.
*/
@@ -73,10 +73,10 @@ public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
return Status.OK_STATUS;
}
};
-
+
/**
* Constructs a viewer input update request.
- *
+ *
* @param context presentation context
* @param viewerInput viewer input at the time the request was made
* @param requestor client making the request
@@ -97,7 +97,7 @@ public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
public IPresentationContext getPresentationContext() {
return fContext;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#done()
*/
@@ -111,10 +111,10 @@ public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
}
fViewerInputUpdateJob.schedule();
}
-
+
/**
* Returns whether this request is done yet.
- *
+ *
* @return whether this request is done yet
*/
protected synchronized boolean isDone() {
@@ -144,7 +144,7 @@ public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
public void setInputElement(Object element) {
fInputElement = element;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate#getViewerInput()
*/
@@ -160,7 +160,7 @@ public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
public Object getViewerInput() {
return fViewerInput;
}
-
-
+
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java
index e951d65a4..6368a43df 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* IBM Corporation - bug fixing
@@ -46,28 +46,28 @@ import org.eclipse.ui.IMemento;
import org.eclipse.ui.XMLMemento;
/**
- * Class containing logic to save and restore expanded state of the tree model
- * viewer.
+ * Class containing logic to save and restore expanded state of the tree model
+ * viewer.
* <p>
- * When the input to the viewer is changes, the tree model viewer attempts to
- * save the expansion state of elements as well as currently selected element and
+ * When the input to the viewer is changes, the tree model viewer attempts to
+ * save the expansion state of elements as well as currently selected element and
* scroll position. Each expanded element is queried for its memento and all the
* collected mementos are saved into a delta tree then serialized by the viewer.<br>
- * When a new input is set to the viewer, the viewer compares the input's memento
- * with the stored mementos and if a match is found, it attempts to restore the
+ * When a new input is set to the viewer, the viewer compares the input's memento
+ * with the stored mementos and if a match is found, it attempts to restore the
* previous expansion state to the viewer. As elements are revealed and realized
- * in the viewer, the element's memento is compared against the memento stored in
- * the saved state delta. If matching elements are found in the delta, the expansion
- * and selection state is then restored to those elements.
+ * in the viewer, the element's memento is compared against the memento stored in
+ * the saved state delta. If matching elements are found in the delta, the expansion
+ * and selection state is then restored to those elements.
* </p><p>
- * Additionally to saving restoring state on input change, the viewer also
+ * Additionally to saving restoring state on input change, the viewer also
* saves/restores elements' state when the model requests viewer to refresh model
* structure. Since the viewer items are matched to the model elements using items'
- * indexes, inserting or removing elements in model can cause the expansion state
+ * indexes, inserting or removing elements in model can cause the expansion state
* of elements to shift after a refresh. To compensate for this, the viewer saves
- * the elements before a refresh is performed into a delta, but without encoding
+ * the elements before a refresh is performed into a delta, but without encoding
* elements using mementos. As the refresh of the tree progresses, the save state
- * is restored to the tree and elements are expanded or collapsed as needed to
+ * is restored to the tree and elements are expanded or collapsed as needed to
* compensate for changes in model structure.
* </p>
* @see TreeModelContentProvider
@@ -79,14 +79,14 @@ class ViewerStateTracker {
static final int STATE_SAVE_SEQUENCE_COMPLETE = 5;
static final int STATE_RESTORE_SEQUENCE_BEGINS = 6;
static final int STATE_RESTORE_SEQUENCE_COMPLETE = 7;
-
+
/**
* Dummy marker element used in the state delta. The marker indicates that a
* given element in the pending state delta has been removed. It replaces
* the original element so that it may optionally be garbage collected.
*/
private final static String ELEMENT_REMOVED = "ELEMENT_REMOVED"; //$NON-NLS-1$
-
+
/**
* Collector of memento encoding requests.
*/
@@ -94,18 +94,18 @@ class ViewerStateTracker {
/**
* Adds the request to this manager.
- *
+ *
* @param request to add
*/
public void addRequest(ElementMementoRequest request);
-
+
/**
* Notification the request is complete.
- *
+ *
* @param request that was completed
*/
public void requestComplete(ElementMementoRequest request);
-
+
/**
* Process the queued requests. Accepts no more new requests.
*/
@@ -116,7 +116,7 @@ class ViewerStateTracker {
*/
public void cancel();
}
-
+
/**
* LRU cache for viewer states
*/
@@ -140,11 +140,11 @@ class ViewerStateTracker {
* Content provider that is using this state tracker.
*/
private TreeModelContentProvider fContentProvider;
-
+
ViewerStateTracker(TreeModelContentProvider contentProvider) {
fContentProvider = contentProvider;
}
-
+
/**
* Map of viewer states keyed by viewer input mementos
*/
@@ -157,21 +157,21 @@ class ViewerStateTracker {
/**
* Flag indicating that the content provider is performing
- * state restore operations.
+ * state restore operations.
*/
- private boolean fInStateRestore = false;
-
+ private boolean fInStateRestore = false;
+
/**
* State update listeners
*/
private ListenerList<IStateUpdateListener> fStateUpdateListeners = new ListenerList<>();
-
+
/**
* Postpone restoring REVEAL element until the current updates are complete.
* See bug 324100
*/
protected PendingRevealDelta fPendingSetTopItem = null;
-
+
/**
* Set of IMementoManager's that are currently saving state
*/
@@ -186,7 +186,7 @@ class ViewerStateTracker {
* Object used to key compare requests in map.
*/
private static class CompareRequestKey {
-
+
CompareRequestKey(TreePath path, IModelDelta delta) {
fPath = path;
fDelta = delta;
@@ -214,13 +214,13 @@ class ViewerStateTracker {
* Compare requests that are currently running.
*/
private Map<CompareRequestKey, ElementCompareRequest> fCompareRequestsInProgress = new LinkedHashMap<CompareRequestKey, ElementCompareRequest>();
-
-
+
+
/**
* Cancels pending updates.
*/
void dispose() {
- Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
+ Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
for (IElementMementoCollector emc : fPendingStateSaves) {
emc.cancel();
}
@@ -229,21 +229,21 @@ class ViewerStateTracker {
ecr.cancel();
}
fCompareRequestsInProgress.clear();
-
+
if (fPendingSetTopItem != null) {
fPendingSetTopItem.dispose();
}
}
-
+
/**
* Restores viewer state for the given input
- *
+ *
* @param input
* viewer input
*/
private void startRestoreViewerState(final Object input) {
- Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+ Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
+
fPendingState = null;
final IElementMementoProvider defaultProvider = ViewerAdapterService.getMementoProvider(input);
if (defaultProvider != null) {
@@ -256,7 +256,7 @@ class ViewerStateTracker {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.debug.internal.ui.viewers.model.provisional.viewers
* .
@@ -283,7 +283,7 @@ class ViewerStateTracker {
DebugUIPlugin.trace("STATE RESTORE INPUT COMARE ENDED : " + fRequest + " - MATCHING STATE FOUND"); //$NON-NLS-1$ //$NON-NLS-2$
}
- // Process start of restore in an async cycle because we may still be inside inputChanged()
+ // Process start of restore in an async cycle because we may still be inside inputChanged()
// call. I.e. the "input.equals(fContentProvider.getViewer().getInput())" test may fail.
fContentProvider.getViewer().getDisplay().asyncExec(new Runnable() {
@Override
@@ -322,7 +322,7 @@ class ViewerStateTracker {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.debug.internal.ui.viewers.model.provisional.viewers
* .IMementoManager#processReqeusts()
@@ -339,7 +339,7 @@ class ViewerStateTracker {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.debug.internal.ui.viewers.model.provisional.viewers
* .
@@ -350,7 +350,7 @@ class ViewerStateTracker {
public void addRequest(ElementMementoRequest req) {
fRequest = req;
}
-
+
@Override
public void cancel() {
// not used
@@ -364,7 +364,7 @@ class ViewerStateTracker {
} else {
if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
DebugUIPlugin.trace("STATE RESTORE: No input memento provider"); //$NON-NLS-1$
- }
+ }
}
}
@@ -377,7 +377,7 @@ class ViewerStateTracker {
{
return; // Not initialized yet.
}
-
+
if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
DebugUIPlugin.trace("STATE APPEND BEGIN: " + path.getLastSegment()); //$NON-NLS-1$
}
@@ -390,7 +390,7 @@ class ViewerStateTracker {
}
if (!fContentProvider.getViewer().saveElementState(path, delta, IModelDelta.COLLAPSE | IModelDelta.EXPAND | IModelDelta.SELECT)) {
- // Path to save the state was not found or there was no
+ // Path to save the state was not found or there was no
// (expansion) state to save! Abort.
if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
DebugUIPlugin.trace("STATE APPEND CANCEL: Element " + path.getLastSegment() + " not found."); //$NON-NLS-1$ //$NON-NLS-2$
@@ -424,14 +424,14 @@ class ViewerStateTracker {
DebugUIPlugin.trace("\tAPPEND OUTSTANDING RESTORE: " + fPendingState); //$NON-NLS-1$
}
- // If the append delta is generated for a sub-tree, copy the pending delta
+ // If the append delta is generated for a sub-tree, copy the pending delta
// attributes into the pending delta.
if (path.getSegmentCount() > 0) {
fPendingState.accept( new IModelDeltaVisitor() {
@Override
public boolean visit(IModelDelta pendingDeltaNode, int depth) {
TreePath pendingDeltaPath = fContentProvider.getViewerTreePath(pendingDeltaNode);
- if (path.startsWith(pendingDeltaPath, null))
+ if (path.startsWith(pendingDeltaPath, null))
{
ModelDelta appendDelta = findDeltaForPath(appendDeltaRoot, pendingDeltaPath);
appendDelta.setFlags(pendingDeltaNode.getFlags());
@@ -463,9 +463,9 @@ class ViewerStateTracker {
// If the pending state node does not contain any flags,
// we can also skip it.
ModelDelta saveDeltaNode = findSubDeltaParent(appendDeltaRoot, pendingDeltaNode);
- if (saveDeltaNode != null &&
+ if (saveDeltaNode != null &&
!isDeltaInParent(pendingDeltaNode, saveDeltaNode) &&
- pendingDeltaNode.getFlags() != IModelDelta.NO_CHANGE)
+ pendingDeltaNode.getFlags() != IModelDelta.NO_CHANGE)
{
saveDeltaNode.setChildCount(pendingDeltaNode.getParentDelta().getChildCount());
copyIntoDelta(pendingDeltaNode, saveDeltaNode);
@@ -485,7 +485,7 @@ class ViewerStateTracker {
return pendingDeltaNode.getChildCount() > 0;
}
}
-
+
});
}
@@ -533,9 +533,9 @@ class ViewerStateTracker {
// set back the pending reveal flag
ModelDelta revealDelta = fPendingSetTopItem.getDelta();
revealDelta.setFlags(revealDelta.getFlags() | IModelDelta.REVEAL);
-
+
fPendingSetTopItem.dispose();
-
+
ModelDelta saveDeltaNode = findSubDeltaParent(saveDeltaRoot, revealDelta);
if (saveDeltaNode != null) {
clearRevealFlag(saveDeltaRoot);
@@ -553,7 +553,7 @@ class ViewerStateTracker {
}
}
}
-
+
if (fPendingState != null) {
// If the restore for the current input was never completed,
// preserve
@@ -688,7 +688,7 @@ class ViewerStateTracker {
* Encodes delta elements into mementos using the given provider.
* @param rootDelta the {@link ModelDelta} to encode
* @param defaultProvider the default provider to use when processing the given delta
- *
+ *
*/
protected void encodeDelta(final ModelDelta rootDelta, final IElementMementoProvider defaultProvider) {
final Object input = rootDelta.getElement();
@@ -708,7 +708,7 @@ class ViewerStateTracker {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.debug.internal.ui.viewers.model.provisional.viewers
* .IMementoManager
@@ -717,7 +717,7 @@ class ViewerStateTracker {
*/
@Override
public void requestComplete(ElementMementoRequest request) {
- Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
+ Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
notifyStateUpdate(input, TreeModelContentProvider.UPDATE_COMPLETE, request);
if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
@@ -725,8 +725,8 @@ class ViewerStateTracker {
}
if (!request.isCanceled() && (request.getStatus() == null || request.getStatus().isOK())) {
- boolean requestsComplted = false;
- if (!fCanceled) {
+ boolean requestsComplted = false;
+ if (!fCanceled) {
fRequests.remove(request);
requestsComplted = fRequests.isEmpty();
}
@@ -751,12 +751,12 @@ class ViewerStateTracker {
@Override
public void cancel() {
- Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
+ Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
if (fCanceled) {
return;
}
-
+
fCanceled = true;
for (IElementMementoRequest req : fRequests) {
req.cancel();
@@ -767,18 +767,18 @@ class ViewerStateTracker {
}
stateSaveComplete(input, this);
}
-
+
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.debug.internal.ui.viewers.model.provisional.viewers
* .IMementoManager#processReqeusts()
*/
@Override
public void processReqeusts() {
- Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+ Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
+
Map<IElementMementoProvider, List<IElementMementoRequest>> providers = new HashMap<IElementMementoProvider, List<IElementMementoRequest>>();
for (IElementMementoRequest request : fRequests) {
notifyStateUpdate(input, TreeModelContentProvider.UPDATE_BEGINS, request);
@@ -802,7 +802,7 @@ class ViewerStateTracker {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.debug.internal.ui.viewers.model.provisional.viewers
* .IMementoManager
@@ -811,8 +811,8 @@ class ViewerStateTracker {
*/
@Override
public void addRequest(ElementMementoRequest request) {
- Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+ Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
+
fRequests.add(request);
}
@@ -820,14 +820,14 @@ class ViewerStateTracker {
IModelDeltaVisitor visitor = new IModelDeltaVisitor() {
@Override
public boolean visit(IModelDelta delta, int depth) {
- // Add the CONTENT flag to all nodes with an EXPAND flag.
- // During restoring, this flag is used as a marker indicating
- // whether all the content of a given element has been
+ // Add the CONTENT flag to all nodes with an EXPAND flag.
+ // During restoring, this flag is used as a marker indicating
+ // whether all the content of a given element has been
// retrieved.
if ((delta.getFlags() | IModelDelta.EXPAND) != 0) {
((ModelDelta)delta).setFlags(delta.getFlags() | IModelDelta.CONTENT);
}
-
+
// This is the root element, save the root element memento in 'inputMemento'.
if (delta.getParentDelta() == null) {
manager.addRequest(new ElementMementoRequest(fContentProvider, input, manager,
@@ -855,8 +855,8 @@ class ViewerStateTracker {
* @param manager the manager to notify
*/
private void stateSaveStarted(Object input, IElementMementoCollector manager) {
- Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+ Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
+
notifyStateUpdate(input, STATE_SAVE_SEQUENCE_BEGINS, null);
fPendingStateSaves.add(manager);
}
@@ -867,8 +867,8 @@ class ViewerStateTracker {
* @param manager the manager to notify
*/
private void stateSaveComplete(Object input, IElementMementoCollector manager) {
- Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+ Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
+
notifyStateUpdate(input, STATE_SAVE_SEQUENCE_COMPLETE, null);
fPendingStateSaves.remove(manager);
if (fQueuedRestore != null) {
@@ -880,11 +880,11 @@ class ViewerStateTracker {
/**
* Returns whether any state saving is in progress.
- *
+ *
* @return whether any state saving is in progress
*/
private boolean isSavingState() {
- Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
+ Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
return !fPendingStateSaves.isEmpty();
}
@@ -892,13 +892,13 @@ class ViewerStateTracker {
/**
* Restores the viewer state unless a save is taking place. If a save is
* taking place, the restore is queued.
- *
+ *
* @param input
* viewer input
*/
protected void restoreViewerState(final Object input) {
- Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+ Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
+
fPendingState = null;
if (isSavingState()) {
fQueuedRestore = input;
@@ -910,7 +910,7 @@ class ViewerStateTracker {
public void cancelRestore(final TreePath path, final int flags) {
if (fInStateRestore) {
- // If we are currently processing pending state already, ignore
+ // If we are currently processing pending state already, ignore
// cancelRestore requests. These requests may be triggered in the viewer
// by changes to the tree state (Bug 295585).
return;
@@ -921,15 +921,15 @@ class ViewerStateTracker {
return;
}
- // Nothing else to do
+ // Nothing else to do
if (fPendingState == null) {
return;
}
-
+
if ((flags & (IModelDelta.SELECT | IModelDelta.REVEAL)) != 0) {
// If we're canceling reveal and this is waiting for updates to complete
// then just cancel it and return
-
+
// If we're canceling select or reveal, cancel it for all of pending deltas
final int mask = flags & (IModelDelta.SELECT | IModelDelta.REVEAL);
fPendingState.accept(new IModelDeltaVisitor() {
@@ -977,12 +977,12 @@ class ViewerStateTracker {
// Descend delta to clear the EXPAND flags of a canceled expand
return true;
}
- }
+ }
return false;
} else {
// We're clearing out flags of a matching sub-tree
// assert (flags & IModelDelta.EXPAND) != 0;
-
+
if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
if (delta.getFlags() != IModelDelta.NO_CHANGE) {
DebugUIPlugin.trace("\tCANCEL: " + delta.getElement() + "(" + Integer.toHexString(delta.getFlags()) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -995,14 +995,14 @@ class ViewerStateTracker {
});
}
}
-
+
/**
* Perform any restoration required for the given tree path.
* <p>
- * This method is called after every viewer update completion to continue
- * restoring the expansion state that was previously saved.
- *
+ * This method is called after every viewer update completion to continue
+ * restoring the expansion state that was previously saved.
+ *
* @param path the tree path to update
* @param modelIndex the index in the current model
* @param knowsHasChildren if the content provider knows it has children already
@@ -1010,10 +1010,10 @@ class ViewerStateTracker {
* @param checkChildrenRealized if any realized children should be checked or not
*/
void restorePendingStateOnUpdate(final TreePath path, final int modelIndex, final boolean knowsHasChildren,
- final boolean knowsChildCount, final boolean checkChildrenRealized)
+ final boolean knowsChildCount, final boolean checkChildrenRealized)
{
- Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+ Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
+
if (fPendingState == null) {
return;
}
@@ -1072,7 +1072,7 @@ class ViewerStateTracker {
try {
fInStateRestore = true;
fPendingState.accept(visitor);
- }
+ }
finally {
fInStateRestore = false;
}
@@ -1080,15 +1080,15 @@ class ViewerStateTracker {
}
/**
- * Checks whether restoring pending state is already complete.
+ * Checks whether restoring pending state is already complete.
*/
void checkIfRestoreComplete() {
- Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+ Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
+
if (fPendingState == null) {
return;
}
-
+
/**
* Used to determine when restoration delta has been processed
*/
@@ -1097,7 +1097,7 @@ class ViewerStateTracker {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.debug.internal.ui.viewers.provisional.IModelDeltaVisitor
* #visit(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta,
@@ -1107,20 +1107,20 @@ class ViewerStateTracker {
public boolean visit(IModelDelta delta, int depth) {
// Filter out the CONTENT flags from the delta flags, the content
// flag is only used as a marker indicating that all the sub-elements
- // of a given delta have been retrieved.
+ // of a given delta have been retrieved.
int flags = (delta.getFlags() & ~IModelDelta.CONTENT);
-
+
if (flags != IModelDelta.NO_CHANGE) {
IModelDelta parentDelta = delta.getParentDelta();
// Remove the delta if :
- // - The parent delta has no more flags on it (the content flag is removed as well),
+ // - The parent delta has no more flags on it (the content flag is removed as well),
// which means that parent element's children have been completely exposed.
// - There are no more pending updates for the element.
// - If element is a memento, there are no state requests pending.
if (parentDelta != null && parentDelta.getFlags() == IModelDelta.NO_CHANGE) {
TreePath deltaPath = fContentProvider.getViewerTreePath(delta);
if ( !fContentProvider.areElementUpdatesPending(deltaPath) &&
- (!(delta.getElement() instanceof IMemento) || !areMementoUpdatesPending(delta)) )
+ (!(delta.getElement() instanceof IMemento) || !areMementoUpdatesPending(delta)) )
{
removeDelta(delta);
return false;
@@ -1170,7 +1170,7 @@ class ViewerStateTracker {
fPendingState.accept(state);
if (state.isComplete()) {
// notify restore complete if REVEAL was restored also, otherwise
- // postpone until then.
+ // postpone until then.
if (fPendingSetTopItem == null) {
if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
DebugUIPlugin.trace("STATE RESTORE COMPELTE: " + fPendingState); //$NON-NLS-1$
@@ -1178,14 +1178,14 @@ class ViewerStateTracker {
notifyStateUpdate(fPendingState.getElement(), STATE_RESTORE_SEQUENCE_COMPLETE, null);
}
-
- fPendingState = null;
+
+ fPendingState = null;
}
}
/**
* Restores the pending state in the given delta node. This method is called
- * once the state tracker has found the element which matches the element in
+ * once the state tracker has found the element which matches the element in
* the given delta node.
* @param delta the {@link ModelDelta} to restore from
* @param knowsHasChildren if the content provider has computed its children
@@ -1217,7 +1217,7 @@ class ViewerStateTracker {
delta.setFlags(delta.getFlags() & ~IModelDelta.COLLAPSE);
}
}
-
+
if ((delta.getFlags() & IModelDelta.SELECT) != 0) {
delta.setFlags(delta.getFlags() & ~IModelDelta.SELECT);
if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
@@ -1235,9 +1235,9 @@ class ViewerStateTracker {
break;
}
}
- // Only set the selection if the element is not yet in
- // selection. Otherwise the setSelection() call will
- // update selection listeners needlessly.
+ // Only set the selection if the element is not yet in
+ // selection. Otherwise the setSelection() call will
+ // update selection listeners needlessly.
if (!pathInSelection) {
TreePath[] newPaths = new TreePath[currentPaths.length + 1];
System.arraycopy(currentPaths, 0, newPaths, 0, currentPaths.length);
@@ -1246,11 +1246,11 @@ class ViewerStateTracker {
}
}
}
-
+
if ((delta.getFlags() & IModelDelta.REVEAL) != 0) {
delta.setFlags(delta.getFlags() & ~IModelDelta.REVEAL);
- // Look for the reveal flag in the child deltas. If
- // A child delta has the reveal flag, do not set the
+ // Look for the reveal flag in the child deltas. If
+ // A child delta has the reveal flag, do not set the
// top element yet.
boolean setTopItem = true;
IModelDelta[] childDeltas = delta.getChildDeltas();
@@ -1261,18 +1261,18 @@ class ViewerStateTracker {
setTopItem = false;
}
}
-
- if (setTopItem) {
+
+ if (setTopItem) {
Assert.isTrue(fPendingSetTopItem == null);
-
+
fPendingSetTopItem = new PendingRevealDelta(treePath, delta);
viewer.addViewerUpdateListener(fPendingSetTopItem);
- }
+ }
}
- // If we know the child count of the element, look for the reveal
- // flag in the child deltas. For the children with reveal flag start
- // a new update.
+ // If we know the child count of the element, look for the reveal
+ // flag in the child deltas. For the children with reveal flag start
+ // a new update.
// If the child delta's index is out of range, strip the reveal flag
// since it is no longer applicable.
if (knowsChildCount) {
@@ -1287,81 +1287,81 @@ class ViewerStateTracker {
fContentProvider.doUpdateElement(treePath, modelIndex);
} else {
childDelta.setFlags(childDelta.getFlags() & ~IModelDelta.REVEAL);
- }
+ }
}
}
}
}
-
- // Some children of this element were just updated. If all its
- // children are now realized, clear out any elements that still
+
+ // Some children of this element were just updated. If all its
+ // children are now realized, clear out any elements that still
// have flags, because they represent elements that were removed.
- if ((checkChildrenRealized &&
- !fContentProvider.areChildrenUpdatesPending(treePath) &&
+ if ((checkChildrenRealized &&
+ !fContentProvider.areChildrenUpdatesPending(treePath) &&
fContentProvider.getViewer().getElementChildrenRealized(treePath)) ||
- (knowsHasChildren && !viewer.getHasChildren(treePath)) )
+ (knowsHasChildren && !viewer.getHasChildren(treePath)) )
{
if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
DebugUIPlugin.trace("\tRESTORE CONTENT: " + treePath.getLastSegment()); //$NON-NLS-1$
}
- delta.setFlags(delta.getFlags() & ~IModelDelta.CONTENT);
+ delta.setFlags(delta.getFlags() & ~IModelDelta.CONTENT);
}
}
/**
- * Utility that reveals the saved top item in the viewer. It listens for
+ * Utility that reveals the saved top item in the viewer. It listens for
* all content updates to complete in order to avoid having the desired top item
* scroll out as view content is filled in.
- * <br>
+ * <br>
* Revealing some elements can trigger expanding some of elements
- * that have been just revealed. Therefore, we have to check one
+ * that have been just revealed. Therefore, we have to check one
* more time after the new triggered updates are completed if we
* have to set again the top index
*/
private class PendingRevealDelta implements IViewerUpdateListener {
-
+
private final TreePath fPathToReveal;
private final ModelDelta fRevealDelta;
-
+
PendingRevealDelta(TreePath pathToReveal, ModelDelta revealDelta) {
fPathToReveal = pathToReveal;
fRevealDelta = revealDelta;
}
-
+
/**
* Counter that tracks how many time the viewer updates were completed.
*/
private int fCounter = 0;
private Object fModelInput = fPendingState.getElement();
-
+
@Override
public void viewerUpdatesComplete() {
- Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
-
+ Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
+
IInternalTreeModelViewer viewer = fContentProvider.getViewer();
if (viewer == null || fPendingSetTopItem != this) {
return;
}
-
+
TreePath topPath = viewer.getTopElementPath();
if (!fPathToReveal.equals(topPath)) {
TreePath parentPath = fPathToReveal.getParentPath();
int index = viewer.findElementIndex(parentPath, fPathToReveal.getLastSegment());
- if (index >= 0) {
+ if (index >= 0) {
if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
DebugUIPlugin.trace("\tRESTORE REVEAL: " + fPathToReveal.getLastSegment()); //$NON-NLS-1$
}
viewer.reveal(parentPath, index);
-
+
}
}
-
+
fCounter++;
// in case the pending state was already set to null, we assume that
// all others elements are restored, so we don't expect that REVEAL will
// trigger other updates
if (fCounter > 1 || fPendingState == null) {
- dispose();
+ dispose();
}
}
@@ -1371,7 +1371,7 @@ class ViewerStateTracker {
public void updateStarted(IViewerUpdate update) {}
@Override
public void updateComplete(IViewerUpdate update) {}
-
+
/**
* Returns delta that is used to reveal the item.
* @return delta to be revealed.
@@ -1381,20 +1381,20 @@ class ViewerStateTracker {
}
/**
- * Resets the item
+ * Resets the item
*/
public void dispose() {
// top item is set
fPendingSetTopItem = null;
-
+
IInternalTreeModelViewer viewer = fContentProvider.getViewer();
if (viewer == null) {
return;
}
-
+
// remove myself as viewer update listener
viewer.removeViewerUpdateListener(this);
-
+
if (fPendingState == null) {
if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
DebugUIPlugin.trace("STATE RESTORE COMPELTE: " + fPendingState); //$NON-NLS-1$
@@ -1404,20 +1404,20 @@ class ViewerStateTracker {
checkIfRestoreComplete();
}
}
-
+
}
-
+
/**
* Restore selection/expansion based on items already in the viewer
* @param delta the {@link ModelDelta} to restore from
*/
protected void doInitialRestore(ModelDelta delta) {
- // Find the reveal delta and mark nodes on its path
+ // Find the reveal delta and mark nodes on its path
// to reveal as elements are updated.
markRevealDelta(delta);
-
- // Restore visible items.
- // Note (Pawel Piech): the initial list of items is normally
+
+ // Restore visible items.
+ // Note (Pawel Piech): the initial list of items is normally
// empty, so in most cases the code below does not do anything.
// Instead doRestore() is called when various updates complete.
int count = fContentProvider.getViewer().getChildCount(TreePath.EMPTY);
@@ -1427,11 +1427,11 @@ class ViewerStateTracker {
restorePendingStateOnUpdate(new TreePath(new Object[]{data}), i, false, false, false);
}
}
-
+
}
/**
- * Finds the delta with the reveal flag, then it walks up this
+ * Finds the delta with the reveal flag, then it walks up this
* delta and marks all the parents of it with the reveal flag.
* These flags are then used by the restore logic to restore
* and reveal all the nodes leading up to the element that should
@@ -1452,10 +1452,10 @@ class ViewerStateTracker {
return revealDelta[0] == null;
}
};
-
+
rootDelta.accept(visitor);
if (revealDelta[0] != null) {
- ModelDelta parentDelta = (ModelDelta)revealDelta[0].getParentDelta();
+ ModelDelta parentDelta = (ModelDelta)revealDelta[0].getParentDelta();
while(parentDelta.getParentDelta() != null) {
revealDelta[0] = parentDelta;
revealDelta[0].setFlags(revealDelta[0].getFlags() | IModelDelta.REVEAL);
@@ -1467,14 +1467,14 @@ class ViewerStateTracker {
/**
* Builds a delta with the given root delta for expansion/selection state.
- *
+ *
* @param delta
* root delta
*/
private void buildViewerState(ModelDelta delta) {
IInternalTreeModelViewer viewer = fContentProvider.getViewer();
viewer.saveElementState(TreeModelContentProvider.EMPTY_TREE_PATH, delta, IModelDelta.SELECT | IModelDelta.EXPAND);
-
+
// Add memento for top item if it is mapped to an element. The reveal memento
// is in its own path to avoid requesting unnecessary data when restoring it.
TreePath topElementPath = viewer.getTopElementPath();
@@ -1495,7 +1495,7 @@ class ViewerStateTracker {
parentDelta.setFlags(parentDelta.getFlags() | IModelDelta.REVEAL);
}
}
-
+
/**
* Cancels any outstanding compare requests for given element and its children.
* @param path Path of element to cancel updates for.
@@ -1524,9 +1524,9 @@ class ViewerStateTracker {
restorePendingStateNode(delta, request.knowsHasChildren(), request.knowChildCount(), request.checkChildrenRealized());
} else if (request.getModelIndex() != -1) {
// Comparison failed.
- // Check if the delta has a reveal flag, and if its index
- // matches the index of the element that it was compared
- // against. If this is the case, strip the reveal flag from
+ // Check if the delta has a reveal flag, and if its index
+ // matches the index of the element that it was compared
+ // against. If this is the case, strip the reveal flag from
// the delta as it is most likely not applicable anymore.
if ((delta.getFlags() & IModelDelta.REVEAL) != 0 && delta.getIndex() == request.getModelIndex()) {
delta.setFlags(delta.getFlags() & ~IModelDelta.REVEAL);
@@ -1583,5 +1583,5 @@ class ViewerStateTracker {
});
}
}
- }
+ }
}
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
*/
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
index e8cac9cf6..3510c9dd6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
@@ -4,14 +4,14 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Wind River Systems - refactored on top of VirtualTreeModelViewer
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model;
-
+
import java.lang.reflect.InvocationTargetException;
import java.util.Collections;
import java.util.HashSet;
@@ -50,29 +50,29 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDelegate {
-
+
private TreeModelViewer fClientViewer;
private static final String TAB = "\t"; //$NON-NLS-1$
private static final String SEPARATOR = "line.separator"; //$NON-NLS-1$
-
+
/**
* Virtual viewer listener. It tracks progress of copy and increments
* the progress monitor.
*/
private class VirtualViewerListener implements ILabelUpdateListener, IVirtualItemListener {
-
+
VirtualTreeModelViewer fVirtualViewer;
IProgressMonitor fProgressMonitor;
int fSelectionRootDepth;
Set<VirtualItem> fItemsToUpdate;
-
+
@Override
public void labelUpdateStarted(ILabelUpdate update) {}
@Override
public void labelUpdateComplete(ILabelUpdate update) {
VirtualItem updatedItem = fVirtualViewer.findItem(update.getElementPath());
if (fItemsToUpdate.remove(updatedItem)) {
- incrementProgress(1);
+ incrementProgress(1);
}
}
@Override
@@ -81,18 +81,18 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
@Override
public void labelUpdatesComplete() {
}
-
+
@Override
public void revealed(VirtualItem item) {
}
-
+
@Override
public void disposed(VirtualItem item) {
if (fItemsToUpdate.remove(item)) {
incrementProgress(1);
}
}
-
+
private void incrementProgress(int count) {
IProgressMonitor pm;
synchronized (VirtualCopyToClipboardActionDelegate.this) {
@@ -102,7 +102,7 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
pm.worked(count);
if (fItemsToUpdate.isEmpty()) {
pm.done();
- }
+ }
}
}
}
@@ -121,7 +121,7 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
adapter.setAction(getActionId(), action);
}
return super.initialize(action, selection);
- }
+ }
return false;
}
@@ -129,7 +129,7 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
return IDebugView.COPY_ACTION;
}
- /**
+ /**
* Appends the representation of the specified element (using the label provider and indent)
* to the buffer. For elements down to stack frames, children representations
* are append to the buffer as well.
@@ -154,19 +154,19 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
}
private class ItemsToCopyVirtualItemValidator implements IVirtualItemValidator {
-
+
Set<VirtualItem> fItemsToCopy = Collections.EMPTY_SET;
Set<VirtualItem> fItemsToValidate = Collections.EMPTY_SET;
-
+
@Override
public boolean isItemVisible(VirtualItem item) {
return fItemsToValidate.contains(item);
}
-
+
@Override
public void showItem(VirtualItem item) {
}
-
+
void setItemsToCopy(Set<VirtualItem> itemsToCopy) {
fItemsToCopy = itemsToCopy;
fItemsToValidate = new HashSet<VirtualItem>();
@@ -175,19 +175,19 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
fItemsToValidate.add(itemToCopy);
itemToCopy = itemToCopy.getParent();
}
- }
+ }
}
}
-
+
private VirtualTreeModelViewer initVirtualViewer(TreeModelViewer clientViewer, VirtualViewerListener listener, ItemsToCopyVirtualItemValidator validator) {
Object input = clientViewer.getInput();
ModelDelta stateDelta = new ModelDelta(input, IModelDelta.NO_CHANGE);
clientViewer.saveElementState(TreePath.EMPTY, stateDelta, IModelDelta.EXPAND);
VirtualTreeModelViewer virtualViewer = new VirtualTreeModelViewer(
- clientViewer.getDisplay(),
- SWT.VIRTUAL,
- clientViewer.getPresentationContext(),
- validator);
+ clientViewer.getDisplay(),
+ SWT.VIRTUAL,
+ clientViewer.getPresentationContext(),
+ validator);
virtualViewer.setFilters(clientViewer.getFilters());
virtualViewer.addLabelUpdateListener(listener);
virtualViewer.getTree().addItemListener(listener);
@@ -198,7 +198,7 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
virtualViewer.setVisibleColumns(columns);
}
virtualViewer.updateViewer(stateDelta);
-
+
// Parse selected items from client viewer and add them to the virtual viewer selection.
listener.fSelectionRootDepth = Integer.MAX_VALUE;
TreeItem[] selection = getSelectedItems(clientViewer);
@@ -225,11 +225,11 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
virtualViewer.getTree().validate();
return virtualViewer;
}
-
+
protected TreeItem[] getSelectedItems(TreeModelViewer clientViewer) {
return clientViewer.getTree().getSelection();
}
-
+
/**
* Do the specific action using the current selection.
* @param action Action that is running.
@@ -239,16 +239,16 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
if (fClientViewer.getSelection().isEmpty()) {
return;
}
-
+
final VirtualViewerListener listener = new VirtualViewerListener();
ItemsToCopyVirtualItemValidator validator = new ItemsToCopyVirtualItemValidator();
VirtualTreeModelViewer virtualViewer = initVirtualViewer(fClientViewer, listener, validator);
listener.fVirtualViewer = virtualViewer;
-
+
ProgressMonitorDialog dialog = new TimeTriggeredProgressMonitorDialog(fClientViewer.getControl().getShell(), 500);
final IProgressMonitor monitor = dialog.getProgressMonitor();
dialog.setCancelable(true);
-
+
IRunnableWithProgress runnable = new IRunnableWithProgress() {
@Override
public void run(final IProgressMonitor m) throws InvocationTargetException, InterruptedException {
@@ -256,10 +256,10 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
listener.fProgressMonitor = m;
listener.fProgressMonitor.beginTask(DebugUIPlugin.removeAccelerators(getAction().getText()), listener.fItemsToUpdate.size());
}
-
+
while (!listener.fItemsToUpdate.isEmpty() && !listener.fProgressMonitor.isCanceled()) {
Thread.sleep(1);
- }
+ }
synchronized(listener) {
listener.fProgressMonitor = null;
}
@@ -277,7 +277,7 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
if (!monitor.isCanceled()) {
copySelectionToClipboard(virtualViewer, validator.fItemsToCopy, listener.fSelectionRootDepth);
}
-
+
virtualViewer.removeLabelUpdateListener(listener);
virtualViewer.getTree().removeItemListener(listener);
virtualViewer.dispose();
@@ -288,7 +288,7 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
writeItemToBuffer (virtualViewer.getTree(), itemsToCopy, buffer, -selectionRootDepth);
writeBufferToClipboard(buffer);
}
-
+
protected void writeItemToBuffer(VirtualItem item, Set<VirtualItem> itemsToCopy, StringBuffer buffer, int indent) {
if (itemsToCopy.contains(item)) {
append(item, buffer, indent);
@@ -305,25 +305,25 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
if (buffer.length() == 0) {
return;
}
-
+
TextTransfer plainTextTransfer = TextTransfer.getInstance();
- Clipboard clipboard= new Clipboard(fClientViewer.getControl().getDisplay());
+ Clipboard clipboard= new Clipboard(fClientViewer.getControl().getDisplay());
try {
clipboard.setContents(
- new String[]{buffer.toString()},
+ new String[]{buffer.toString()},
new Transfer[]{plainTextTransfer});
} catch (SWTError e){
if (e.code != DND.ERROR_CANNOT_SET_CLIPBOARD) {
throw e;
}
- if (MessageDialog.openQuestion(fClientViewer.getControl().getShell(), ActionMessages.CopyToClipboardActionDelegate_Problem_Copying_to_Clipboard_1, ActionMessages.CopyToClipboardActionDelegate_There_was_a_problem_when_accessing_the_system_clipboard__Retry__2)) { //
+ if (MessageDialog.openQuestion(fClientViewer.getControl().getShell(), ActionMessages.CopyToClipboardActionDelegate_Problem_Copying_to_Clipboard_1, ActionMessages.CopyToClipboardActionDelegate_There_was_a_problem_when_accessing_the_system_clipboard__Retry__2)) { //
writeBufferToClipboard(buffer);
}
} finally {
clipboard.dispose();
}
}
-
+
protected TreeModelViewer getViewer() {
return fClientViewer;
}
@@ -338,7 +338,7 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
protected void doAction(Object element) {
//not used
}
-
+
@Override
protected boolean getEnableStateForSelection(IStructuredSelection selection) {
if (selection.isEmpty()) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
index 0c6208b47..1835c308f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
@@ -54,36 +54,36 @@ import com.ibm.icu.text.MessageFormat;
/**
* Action which prompts user with a filtered list selection dialog to find an element in tree.
- *
+ *
* @since 3.3
*/
public class VirtualFindAction extends Action implements IUpdate {
-
+
private TreeModelViewer fClientViewer;
-
+
private class VirtualViewerListener implements IViewerUpdateListener, ILabelUpdateListener {
-
+
private boolean fViewerUpdatesComplete = false;
private boolean fLabelUpdatesComplete = false;
private IProgressMonitor fProgressMonitor;
- private int fRemainingUpdatesCount = 0;
-
+ private int fRemainingUpdatesCount = 0;
+
@Override
public void labelUpdateStarted(ILabelUpdate update) {}
@Override
public void labelUpdateComplete(ILabelUpdate update) {
- incrementProgress(1);
+ incrementProgress(1);
}
@Override
public void labelUpdatesBegin() {
- fLabelUpdatesComplete = false;
+ fLabelUpdatesComplete = false;
}
@Override
public void labelUpdatesComplete() {
fLabelUpdatesComplete = true;
completeProgress();
}
-
+
@Override
public void updateStarted(IViewerUpdate update) {}
@Override
@@ -94,14 +94,14 @@ public class VirtualFindAction extends Action implements IUpdate {
}
@Override
public void viewerUpdatesBegin() {
- fViewerUpdatesComplete = false;
+ fViewerUpdatesComplete = false;
}
@Override
public void viewerUpdatesComplete() {
fViewerUpdatesComplete = true;
completeProgress();
}
-
+
private void completeProgress() {
IProgressMonitor pm;
synchronized (this) {
@@ -109,9 +109,9 @@ public class VirtualFindAction extends Action implements IUpdate {
}
if (pm != null && fLabelUpdatesComplete && fViewerUpdatesComplete) {
pm.done();
- }
+ }
}
-
+
private void incrementProgress(int count) {
IProgressMonitor pm;
synchronized (this) {
@@ -120,11 +120,11 @@ public class VirtualFindAction extends Action implements IUpdate {
}
if (pm != null && fLabelUpdatesComplete && fViewerUpdatesComplete) {
pm.worked(count);
- }
+ }
}
}
-
+
private static class FindLabelProvider extends LabelProvider {
private VirtualTreeModelViewer fVirtualViewer;
private Map<VirtualItem, String> fTextCache = new HashMap<VirtualItem, String>();
@@ -136,7 +136,7 @@ public class VirtualFindAction extends Action implements IUpdate {
fTextCache.put(item, fVirtualViewer.getText(item, 0));
}
}
-
+
@Override
public Image getImage(Object element) {
return fVirtualViewer.getImage((VirtualItem) element, 0);
@@ -150,7 +150,7 @@ public class VirtualFindAction extends Action implements IUpdate {
public VirtualFindAction(TreeModelViewer viewer) {
fClientViewer = viewer;
-
+
setText(ActionMessages.FindAction_0);
setId(DebugUIPlugin.getUniqueIdentifier() + ".FindElementAction"); //$NON-NLS-1$
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.FIND_ELEMENT_ACTION);
@@ -164,8 +164,8 @@ public class VirtualFindAction extends Action implements IUpdate {
clientViewer.saveElementState(TreePath.EMPTY, stateDelta, IModelDelta.EXPAND);
listener.fRemainingUpdatesCount = calcUpdatesCount(stateDelta);
VirtualTreeModelViewer fVirtualViewer = new VirtualTreeModelViewer(
- clientViewer.getDisplay(),
- SWT.NONE,
+ clientViewer.getDisplay(),
+ SWT.NONE,
clientViewer.getPresentationContext());
fVirtualViewer.setFilters(clientViewer.getFilters());
fVirtualViewer.addViewerUpdateListener(listener);
@@ -179,19 +179,19 @@ public class VirtualFindAction extends Action implements IUpdate {
fVirtualViewer.updateViewer(stateDelta);
return fVirtualViewer;
}
-
+
@Override
public void run() {
final VirtualViewerListener listener = new VirtualViewerListener();
VirtualTreeModelViewer virtualViewer = initVirtualViewer(fClientViewer, listener);
-
+
ProgressMonitorDialog dialog = new TimeTriggeredProgressMonitorDialog(fClientViewer.getControl().getShell(), 500);
final IProgressMonitor monitor = dialog.getProgressMonitor();
dialog.setCancelable(true);
-
+
try {
dialog.run(
- true, true,
+ true, true,
new IRunnableWithProgress() {
@Override
public void run(final IProgressMonitor m) throws InvocationTargetException, InterruptedException {
@@ -199,10 +199,10 @@ public class VirtualFindAction extends Action implements IUpdate {
listener.fProgressMonitor = m;
listener.fProgressMonitor.beginTask(DebugUIPlugin.removeAccelerators(getText()), listener.fRemainingUpdatesCount);
}
-
+
while ((!listener.fLabelUpdatesComplete || !listener.fViewerUpdatesComplete) && !listener.fProgressMonitor.isCanceled()) {
Thread.sleep(1);
- }
+ }
synchronized(listener) {
listener.fProgressMonitor = null;
}
@@ -214,7 +214,7 @@ public class VirtualFindAction extends Action implements IUpdate {
} catch (InterruptedException e) {
return;
}
-
+
VirtualItem root = virtualViewer.getTree();
if (!monitor.isCanceled()) {
List<VirtualItem> list = new ArrayList<VirtualItem>();
@@ -230,7 +230,7 @@ public class VirtualFindAction extends Action implements IUpdate {
virtualViewer.removeViewerUpdateListener(listener);
virtualViewer.dispose();
}
-
+
private int calcUpdatesCount(IModelDelta stateDelta) {
final int[] count = new int[] {0};
stateDelta.accept( new IModelDeltaVisitor() {
@@ -243,11 +243,11 @@ public class VirtualFindAction extends Action implements IUpdate {
return false;
}
});
-
+
// Double it to account for separate element and label update ticks.
return count[0] * 2;
}
-
+
private void collectAllChildren(VirtualItem element, List<VirtualItem> collect) {
VirtualItem[] children = element.getItems();
if (children != null) {
@@ -259,11 +259,11 @@ public class VirtualFindAction extends Action implements IUpdate {
}
}
}
-
+
protected VirtualItem performFind(List<VirtualItem> items, FindLabelProvider labelProvider) {
FindElementDialog dialog = new FindElementDialog(
- fClientViewer.getControl().getShell(),
- labelProvider,
+ fClientViewer.getControl().getShell(),
+ labelProvider,
items.toArray());
dialog.setTitle(ActionMessages.FindDialog_3);
dialog.setMessage(ActionMessages.FindDialog_1);
@@ -275,7 +275,7 @@ public class VirtualFindAction extends Action implements IUpdate {
}
return null;
}
-
+
protected void setSelectionToClient(VirtualTreeModelViewer virtualViewer, ILabelProvider labelProvider, VirtualItem findItem) {
virtualViewer.getTree().setSelection(new VirtualItem[] { findItem } );
ModelDelta stateDelta = new ModelDelta(virtualViewer.getInput(), IModelDelta.NO_CHANGE);
@@ -291,23 +291,23 @@ public class VirtualFindAction extends Action implements IUpdate {
}
});
fClientViewer.updateViewer(stateDelta);
-
+
ISelection selection = fClientViewer.getSelection();
if (!selection.isEmpty() &&
- selection instanceof IStructuredSelection &&
+ selection instanceof IStructuredSelection &&
((IStructuredSelection)selection).getFirstElement().equals(findItem.getData()) ) {
} else {
DebugUIPlugin.errorDialog(
- fClientViewer.getControl().getShell(),
+ fClientViewer.getControl().getShell(),
ActionMessages.VirtualFindAction_0,
MessageFormat.format(ActionMessages.VirtualFindAction_1, new Object[] { labelProvider.getText(findItem) }),
new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), ActionMessages.VirtualFindAction_1));
- }
+ }
}
-
+
@Override
public void update() {
setEnabled( fClientViewer.getInput() != null && fClientViewer.getChildCount(TreePath.EMPTY) > 0 );
}
-
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckUpdate.java
index 7e31d3589..c2d1f79e8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckUpdate.java
@@ -12,25 +12,25 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
/**
* Label update which allows the label provider to set the checked element state.
- * The label provider can use the presentation context to determine whether the
- * viewer is showing item check boxes.
- *
+ * The label provider can use the presentation context to determine whether the
+ * viewer is showing item check boxes.
+ *
* @since 3.6
*/
public interface ICheckUpdate extends ILabelUpdate {
/**
- * Property of the presentation context which indicates that the viewer
+ * Property of the presentation context which indicates that the viewer
* has the check box style.
*/
public static final String PROP_CHECK = "org.eclipse.debug.ui.check"; //$NON-NLS-1$
-
+
/**
* Sets the check state of the tree node.
- *
+ *
* @param checked Whether element should be checked.
* @param grayed Whether element should be grayed out.
*/
public void setChecked(boolean checked, boolean grayed);
-
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckboxModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckboxModelProxy.java
index 3513b2adf..3c3346ff3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckboxModelProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckboxModelProxy.java
@@ -16,22 +16,22 @@ import org.eclipse.jface.viewers.TreePath;
/**
* Optional extension to a model proxy for models that use a check box tree viewer. Provides
- * notification for check state changes in the tree.
- *
+ * notification for check state changes in the tree.
+ *
* @since 3.6
* @see IModelProxy
*/
public interface ICheckboxModelProxy {
/**
- * Notifies the receiver that the given element has had its
+ * Notifies the receiver that the given element has had its
* checked state modified in the viewer.
* <p>
* This method is called in the UI thread. Clients that execute long running operations or
* communicate with a potentially unreliable or blocking model should run those operations
* asynchronously.
* </p>
- *
+ *
* @param context Presentation context in which the element was updated.
* @param viewerInput The root element of the viewer where the check
* selection took place.
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 55818113c..2cc395bd3 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
@@ -14,7 +14,7 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
/**
* Request monitor used to collect the number of children for an element in a viewer.
- *
+ *
* @noimplement This interface is not intended to be implemented by clients.
* @since 3.3
*/
@@ -22,7 +22,7 @@ public interface IChildrenCountUpdate extends IViewerUpdate {
/**
* Sets the number of children for this update.
- *
+ *
* @param numChildren number of children
*/
public void setChildCount(int numChildren);
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 9ee12df28..188dad545 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
@@ -14,7 +14,7 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
/**
* Context sensitive children update request for a parent and subrange of its
* children.
- *
+ *
* @noimplement This interface is not intended to be implemented by clients.
* @since 3.3
*/
@@ -23,23 +23,23 @@ public interface IChildrenUpdate extends IViewerUpdate {
/**
* Returns the offset at which children have been requested for. This is
* the index of the first child being requested.
- *
+ *
* @return offset at which children have been requested for
*/
public int getOffset();
-
+
/**
* Returns the number of children requested.
- *
+ *
* @return number of children requested
*/
public int getLength();
-
+
/**
* Sets the child for this request's parent at the given offset.
- *
+ *
* @param child child
* @param offset child offset
*/
- public void setChild(Object child, int offset);
+ public void setChild(Object child, int offset);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation.java
index 991765351..b20f6f400 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation.java
@@ -16,71 +16,71 @@ import org.eclipse.jface.resource.ImageDescriptor;
* Defines the possible set of columns presented in a view for a model.
* A column presentation is customizable per presentation context (view) and
* view input, and is created by an <code>IColumnPresentationFactory</code>.
- *
+ *
* @since 3.2
*/
public interface IColumnPresentation {
-
+
/**
* Initializes this column presentation to be used in the
* given context.
- *
+ *
* @param context Presentation context.
*/
public void init(IPresentationContext context);
-
+
/**
* Disposes this column presentation
*/
public void dispose();
-
+
/**
* Returns an array of all columns supported by this adapter as
* column identifiers.
- *
+ *
* @return column identifiers
*/
public String[] getAvailableColumns();
-
+
/**
* Returns an ordered array of columns that should be displayed initially for
* this presentation as column IDs.
- *
+ *
* @return initial columns to display
*/
public String[] getInitialColumns();
-
+
/**
* Returns the column header for the column with the given identifier.
- *
+ *
* @param id a column identifier included in <code>getColumns()</code>
* @return column header
*/
public String getHeader(String id);
-
+
/**
* Returns the image for the column with the given identifier, or <code>null</code>
- *
+ *
* @param id column id
* @return image descriptor or <code>null</code>
*/
public ImageDescriptor getImageDescriptor(String id);
-
+
/**
* Returns an identifier for this columns presentation.
- * The identifier should be unique per kind of column presentation
+ * The identifier should be unique per kind of column presentation
* (for example, the column presentation for Java stack frames
* in the variables view). Allows visible column information to be
* persisted by the platform.
- *
+ *
* @return identifier
*/
public String getId();
-
+
/**
* Returns whether this column presentation is optional. When a column presentation
* is optional, the user may toggle columns on/off.
- *
+ *
* @return whether this column presentation is optional
*/
public boolean isOptional();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation2.java
index d7b59f7ea..2f96073ea 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation2.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation2.java
@@ -11,21 +11,21 @@
package org.eclipse.debug.internal.ui.viewers.model.provisional;
/**
- * Extension to allow column presentation to specify initial column sizes in a
+ * Extension to allow column presentation to specify initial column sizes in a
* TreeModelViewer.
- *
+ *
* @since 3.7
- *
+ *
* @see TreeModelViewer
*/
public interface IColumnPresentation2 extends IColumnPresentation {
-
+
/**
* Returns the initial column width for the column with the given identifier.
- *
+ *
* @param id a column identifier included in <code>getAvailableColumns()</code>
* @param treeWidgetWidth tree widget width
- * @param visibleColumnIds identifiers of visible columns
+ * @param visibleColumnIds identifiers of visible columns
* @return initial column width. Return -1 if this implementation does not decide the width
* and let the caller to decide the width. The caller may make the initial width
* be treeWidgetWidth / visibleColumnIds.length
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentationFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentationFactory.java
index 49795c6cf..d32a2e371 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentationFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentationFactory.java
@@ -12,7 +12,7 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
/**
* An adapter used to create column presentations.
- *
+ *
* @see IColumnPresentation
* @since 3.2
*/
@@ -21,18 +21,18 @@ public interface IColumnPresentationFactory {
/**
* Constructs and returns the column presentation for the given presentation
* context (view) and input element, or <code>null</code> of none.
- *
+ *
* @param context presentation context
* @param element the input element
* @return column presentation or <code>null</code>
*/
public IColumnPresentation createColumnPresentation(IPresentationContext context, Object element);
-
+
/**
* Returns the type of column presentation to be used for the given context and object
* or <code>null</code> if none. Allows a previous column presentation to be re-used if
* it has not changed type.
- *
+ *
* @param context presentation context
* @param element input element
* @return column presentation id or <code>null</code>
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 d6258f468..64a7549b7 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
@@ -13,16 +13,16 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
/**
* Request to compare an element to a previously created memento.
- *
+ *
* @noimplement This interface is not intended to be implemented by clients.
* @since 3.3
*/
public interface IElementCompareRequest extends IElementMementoRequest {
-
+
/**
* Sets whether this request's memento represents this requests's element.
- *
- * @param equal whether the memento represents the element
+ *
+ * @param equal whether the memento represents the element
*/
public void setEqual(boolean equal);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementContentProvider.java
index d3b682880..126850d2b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementContentProvider.java
@@ -16,10 +16,10 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
* Provides content for an element in a tree model viewer.
* <p>
* Note: provider methods are called in the Display thread of the viewer.
- * To avoid blocking the UI, long running operations should be performed
+ * To avoid blocking the UI, long running operations should be performed
* asynchronously.
* </p>
- *
+ *
* @since 3.3
*/
public interface IElementContentProvider {
@@ -27,29 +27,29 @@ public interface IElementContentProvider {
/**
* Updates the number of children for the given parent elements in the
* specified requests.
- *
+ *
* @param updates Each update specifies an element to update and provides
- * a store for the result. The update array is guaranteed to have at least
+ * a store for the result. The update array is guaranteed to have at least
* one element, and for all updates to have the same presentation context.
*/
public void update(IChildrenCountUpdate[] updates);
-
+
/**
* Updates children as requested by the given updates.
- *
+ *
* @param updates Each update specifies children to update and stores results.
- * The update array is guaranteed to have at least one element, and for
+ * The update array is guaranteed to have at least one element, and for
* all updates to have the same presentation context.
- */
+ */
public void update(IChildrenUpdate[] updates);
-
+
/**
* Updates whether elements have children.
- *
+ *
* @param updates Each update specifies an element to update and provides
- * a store for the result. The update array is guaranteed to have at least
+ * a store for the result. The update array is guaranteed to have at least
* one element, and for all updates to have the same presentation context.
*/
public void update(IHasChildrenUpdate[] updates);
-
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementEditor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementEditor.java
index e1890aa4f..df2183113 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementEditor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementEditor.java
@@ -16,15 +16,15 @@ import org.eclipse.swt.widgets.Composite;
/**
* Creates context specific cell modifiers and editors for elements.
- *
+ *
* @since 3.3
*/
public interface IElementEditor {
-
+
/**
* Returns a cell editor to use for the specified column and object or <code>null</code>
* if none.
- *
+ *
* @param context presentation context
* @param columnId column id
* @param element object to be edited
@@ -32,15 +32,15 @@ public interface IElementEditor {
* @return cell editor or <code>null</code>
*/
public CellEditor getCellEditor(IPresentationContext context, String columnId, Object element, Composite parent);
-
+
/**
* Returns a cell modifier for the specified element in the given context
* or <code>null</code> if none.
* @param context Presentation context
* @param element Model element.
- *
+ *
* @return cell modifier or <code>null</code>
*/
- public ICellModifier getCellModifier(IPresentationContext context, Object element);
+ public ICellModifier getCellModifier(IPresentationContext context, Object 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 90551a572..c99a3f67c 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
@@ -16,20 +16,20 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
* or implemented directly.
* <p>
* Note: provider methods are called in the Display thread of the viewer.
- * To avoid blocking the UI, long running operations should be performed
+ * To avoid blocking the UI, long running operations should be performed
* asynchronously.
* </p>
- *
+ *
* @since 3.3
*/
public interface IElementLabelProvider {
-
+
/**
* Updates the specified labels.
- *
+ *
* @param updates Each update specifies the element and context for which a label is requested and
- * stores label attributes. The update array is guaranteed to have at least one element, and for
- * all updates to have the same presentation context.
+ * stores label attributes. The update array is guaranteed to have at least one element, and for
+ * all updates to have the same presentation context.
*/
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 416072148..112a0a2a5 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
@@ -17,30 +17,30 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
* in order to support viewer state save/restore.
* <p>
* Note: provider methods are called in the Display thread of the viewer.
- * To avoid blocking the UI, long running operations should be performed
+ * To avoid blocking the UI, long running operations should be performed
* asynchronously.
* </p>
*
* @since 3.3
*/
public interface IElementMementoProvider {
-
+
/**
* 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 requests Specifies elements and provides memento stores.
- * The requests array is guaranteed to have at least one element, and for
+ *
+ * @param requests Specifies elements and provides memento stores.
+ * The requests array is guaranteed to have at least one element, and for
* all requests to have the same presentation context.
*/
public void encodeElements(IElementMementoRequest[] requests);
-
+
/**
* Determines whether mementos represent associated elements specified in the requests.
- *
- * @param requests Specifies each element and previously created memento.
- * The requests array is guaranteed to have at least one element, and for
+ *
+ * @param requests Specifies each element and previously created memento.
+ * The requests array is guaranteed to have at least one element, and for
* all requests to have the same presentation context.
*/
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 9e664dff2..e7e2f4eb1 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
@@ -20,10 +20,10 @@ import org.eclipse.ui.IMemento;
* @since 3.3
*/
public interface IElementMementoRequest extends IViewerUpdate {
-
+
/**
* Returns the memento used to persist the element.
- *
+ *
* @return memento
*/
public IMemento getMemento();
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 85232d9ed..40716074c 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
@@ -13,7 +13,7 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
/**
* Context sensitive update request for whether an element has children.
- *
+ *
* @noimplement This interface is not intended to be implemented by clients.
* @since 3.3
*/
@@ -21,7 +21,7 @@ public interface IHasChildrenUpdate extends IViewerUpdate {
/**
* Sets whether there are children for this update.
- *
+ *
* @param hasChildren whether there are children
*/
public void setHasChilren(boolean hasChildren);
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 451fd2a6d..8dc771bcd 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
@@ -16,57 +16,57 @@ import org.eclipse.swt.graphics.RGB;
/**
* Context sensitive label update request for an element.
- *
+ *
* @noimplement This interface is not intended to be implemented by clients.
* @since 3.3
*/
public interface ILabelUpdate extends IViewerUpdate {
-
+
/**
* Returns the id's of the columns which are to be updated
* or <code>null</code> if none. Note, these columns may be different
- * than the visible columns in the view which are returned by
+ * than the visible columns in the view which are returned by
* {@link IPresentationContext#getColumns()}.
- *
+ *
* @return column id's or <code>null</code>
*/
public String[] getColumnIds();
/**
* Sets the text of the label of the specified column. Cannot be <code>null</code>.
- *
+ *
* @param text to set to viewer
* @param columnIndex column index (0 when no columns)
*/
public void setLabel(String text, int columnIndex);
-
+
/**
* Sets the font of the label.
- *
+ *
* @param fontData to set to viewer
* @param columnIndex column index (0 when no columns)
*/
public void setFontData(FontData fontData, int columnIndex);
-
+
/**
* Sets the image of the label.
- *
+ *
* @param image to set to viewer
* @param columnIndex column index (0 when no columns)
*/
public void setImageDescriptor(ImageDescriptor image, int columnIndex);
-
+
/**
* Sets the foreground color of the label.
- *
+ *
* @param foreground to set to viewer
* @param columnIndex column index (0 when no columns)
*/
public void setForeground(RGB foreground, int columnIndex);
-
+
/**
* Sets the background color of the label.
- *
+ *
* @param background to set to viewer
* @param columnIndex column index (0 when no columns)
*/
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelChangedListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelChangedListener.java
index 98470bc83..8bae97f27 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelChangedListener.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelChangedListener.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -19,10 +19,10 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
* @see IModelDelta
*/
public interface IModelChangedListener {
-
+
/**
* Notification a model has changed as described by the given delta.
- *
+ *
* @param delta model delta
* @param proxy proxy that created the delta
*/
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDelta.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDelta.java
index 3fb1dd65c..37f9f4c2a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDelta.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDelta.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -16,14 +16,14 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
* Describes a change within a model. A delta is a hierarchical description of changes
* within a model. It consists of a tree of nodes. Each node references an element
* from a model describing how that element changed. A model proxy fires model deltas
- * as its model changes in order to update views displaying that model.
+ * as its model changes in order to update views displaying that model.
* <p>
* Each node in a model delta describes the following:
* <ul>
* <li>the type of change - for example, whether an element was added, removed,
* or whether its content or state changed</li>
* <li>action to consider - for example, select or reveal the element</li>
- * </ul>
+ * </ul>
* </p>
* <p>
* @noimplement Clients are not intended to implement this interface directly. Instead, clients
@@ -32,9 +32,9 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
* @since 3.2
*/
public interface IModelDelta {
-
+
// types of changes
-
+
/**
* Indicates an element has not changed, but has children that have
* changed in some way.
@@ -54,16 +54,16 @@ public interface IModelDelta {
* Indicates an element has been replaced in the model, as described by
* its path. In this case a replacement element is also specified in the
* model delta node.
- */
+ */
public static int REPLACED = 1 << 3;
/**
* Indicates an element has been inserted into the model, as described
* by its path and index.
*/
public static int INSERTED = 1 << 4;
-
+
// how an element changed
-
+
/**
* Indicates an elements content has changed (i.e. its children).
*/
@@ -72,9 +72,9 @@ public interface IModelDelta {
* Indicates an elements state has changed (i.e. label)
*/
public static int STATE = 1 << 11;
-
+
// Suggested actions
-
+
/**
* Suggests that the element should be expanded, as described by its path.
*/
@@ -83,79 +83,79 @@ public interface IModelDelta {
* Suggests that the element should be selected, as described by its path.
*/
public static int SELECT = 1 << 21;
-
+
/**
* Suggests that the element should be revealed, as described by its path.
* @since 3.3
*/
- public static int REVEAL = 1 << 24;
-
+ public static int REVEAL = 1 << 24;
+
/**
* Indicates a model proxy should be installed for the given element
* @since 3.3
*/
public static int INSTALL = 1 << 22;
-
+
/**
* Indicates a model proxy should be uninstalled for the given element
* @since 3.3
*/
public static int UNINSTALL = 1 << 23;
-
+
/**
* Suggests that the element should be collapsed, as described by its path.
* @since 3.3
*/
- public static int COLLAPSE = 1 << 25;
-
+ public static int COLLAPSE = 1 << 25;
+
/**
- * Flag indicating that the view layout deltas should override the
+ * Flag indicating that the view layout deltas should override the
* model selection policy. This flag can be used in conjunction with
- * SELECT and REVEAL flags.
- *
+ * SELECT and REVEAL flags.
+ *
* @see IModelSelectionPolicy
= * @since 3.5
*/
public static int FORCE = 1 << 26;
-
+
/**
* Returns the parent of this node, or <code>null</code> if this is
* a root node.
- *
+ *
* @return parent node or <code>null</code> if this is a root node
*/
public IModelDelta getParentDelta();
-
+
/**
* Returns the model element this node describes.
- *
+ *
* @return associated model element
*/
public Object getElement();
-
+
/**
* Returns flags describing how this element changed. A bit mask of the
* change type constants described in {@link IModelDelta}.
- *
+ *
* @return change flags
*/
public int getFlags();
-
+
/**
* Returns nodes describing changed children, possibly an empty collection.
- *
+ *
* @return changed children, possibly empty
*/
public IModelDelta[] getChildDeltas();
-
+
/**
* When a node indicates the <code>IModelDelta.REPLACED</code> flag, this method
* returns the replacement element, otherwise <code>null</code>.
- *
+ *
* @return replacement element or <code>null</code>
*/
public Object getReplacementElement();
-
+
/**
* Returns this node's index in its parents child collection or -1 if unknown.
* This attribute is required when expanding or selecting an element.
@@ -167,7 +167,7 @@ public interface IModelDelta {
* @return insertion index or -1
*/
public int getIndex();
-
+
/**
* Returns the total number of children this element has, or -1 if unknown. Note
* that this number may be greater than the number of child delta nodes for this
@@ -175,17 +175,17 @@ public interface IModelDelta {
* <p>
* This attribute is required when expanding or selecting an element.
* </p>
- *
+ *
* @return total number of child elements this element has
*/
public int getChildCount();
-
+
/**
* Accepts the given visitor.
- *
+ *
* @param visitor delta visitor to accept
* @since 3.3
*/
public void accept(IModelDeltaVisitor visitor);
-
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDeltaVisitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDeltaVisitor.java
index 1d4154651..252ba7148 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDeltaVisitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDeltaVisitor.java
@@ -13,14 +13,14 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
/**
* An objects that visits model deltas.
- *
+ *
* @since 3.3
*/
public interface IModelDeltaVisitor {
-
- /**
+
+ /**
* Visits the given model delta.
- *
+ *
* @param delta the delta to visit
* @param depth depth in the delta where 0 == root node
* @return <code>true</code> if the model delta's children should
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy.java
index adabf4e78..fd2fabc27 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy.java
@@ -23,14 +23,14 @@ import org.eclipse.jface.viewers.Viewer;
* is then installed into the viewer and the viewer listens to model deltas
* in order to update that element. Generally, a model proxy factory creates
* model proxies for root elements in a model, and then represents all elements
- * within that model for a specific presentation context.
+ * within that model for a specific presentation context.
* </p>
* <p>
* Note: provider methods are called in the Display thread of the viewer.
- * To avoid blocking the UI, long running operations should be performed
+ * To avoid blocking the UI, long running operations should be performed
* asynchronously.
* </p>
- *
+ *
* @noimplement Clients are not intended to implement this interface directly. Instead, clients
* creating and firing model deltas should create instances of {@link AbstractModelProxy}.
* @see IModelDelta
@@ -41,7 +41,7 @@ import org.eclipse.jface.viewers.Viewer;
* @since 3.2
*/
public interface IModelProxy {
-
+
/**
* Notification this model proxy has been created and is about to be installed
* in the following context. This is the first method called after a model proxy
@@ -54,13 +54,13 @@ public interface IModelProxy {
* @see IModelProxy2#initialize(ITreeModelViewer)
*/
public void init(IPresentationContext context);
-
- /**
- * Notification this model proxy has been installed in the specified
+
+ /**
+ * Notification this model proxy has been installed in the specified
* viewer. This indicates that the model proxy has been created and registered
- * model change listeners are ready to process deltas. This method is called
- * by the {@link AbstractModelProxy} base class using a job and NOT in viewers
- * display thread. It allows the client to initialize the proxy without
+ * model change listeners are ready to process deltas. This method is called
+ * by the {@link AbstractModelProxy} base class using a job and NOT in viewers
+ * display thread. It allows the client to initialize the proxy without
* blocking the UI. The default implementaiton is a no-op.
* <p>
* This method is called by the asynchronous viewer framework and should not
@@ -71,7 +71,7 @@ public interface IModelProxy {
* @since 3.3
*/
public void installed(Viewer viewer);
-
+
/**
* Disposes this model proxy.
* <p>
@@ -80,27 +80,27 @@ public interface IModelProxy {
* </p>
*/
public void dispose();
-
+
/**
* Registers the given listener for model delta notification.
- *
+ *
* @param listener model delta listener
*/
public void addModelChangedListener(IModelChangedListener listener);
-
+
/**
* Unregisters the given listener from model delta notification.
- *
+ *
* @param listener model delta listener
*/
public void removeModelChangedListener(IModelChangedListener listener);
-
+
/**
* Returns whether this proxy has been disposed.
- *
+ *
* @return whether this proxy has been disposed
* @since 3.3
*/
public boolean isDisposed();
-
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy2.java
index 7187edc48..dc779cb56 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy2.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy2.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -16,26 +16,26 @@ import org.eclipse.jface.viewers.Viewer;
/**
* Extension to the model proxy interface which allows the proxy to be initialized
* on the viewer's Display thread
- *
+ *
* @noimplement Clients are not intended to implement this interface directly. Instead, clients
* creating and firing model deltas should create instances of {@link AbstractModelProxy}.
* @since 3.8
*/
public interface IModelProxy2 extends IModelProxy {
-
+
/**
- * Initialize model proxy with given tree model viewer. This method is
- * called on the viewer's Display thread and is guaranteed to be called
- * before the dispose() method is called on the same proxy. The default
- * implementation of this method calls {@link #init(IPresentationContext)}
- * and {@link #installed(Viewer)} asynchornously and not in the Display
+ * Initialize model proxy with given tree model viewer. This method is
+ * called on the viewer's Display thread and is guaranteed to be called
+ * before the dispose() method is called on the same proxy. The default
+ * implementation of this method calls {@link #init(IPresentationContext)}
+ * and {@link #installed(Viewer)} asynchornously and not in the Display
* thread.
* <p>
- * This method is called by the asynchronous viewer framework and should
+ * This method is called by the asynchronous viewer framework and should
* not be called by clients.
* </p>
* @param viewer Viewer that is installing this model proxy.
- *
+ *
*/
public void initialize(ITreeModelViewer viewer);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory.java
index e46847fdd..e971580e9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory.java
@@ -11,7 +11,7 @@
package org.eclipse.debug.internal.ui.viewers.model.provisional;
/**
- * A model proxy factory creates model proxies for elements based on
+ * A model proxy factory creates model proxies for elements based on
* specific presentation contexts. A model proxy factory is provided for
* a model element by registering a model proxy factory adapter for
* an element.
@@ -26,7 +26,7 @@ public interface IModelProxyFactory {
/**
* Creates and returns a model proxy for the given element in the specified
* context or <code>null</code> if none.
- *
+ *
* @param element model element to create a model proxy for
* @param context presentation context
* @return model proxy or <code>null</code>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory2.java
index 2bbd8114e..177fcd963 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory2.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory2.java
@@ -13,32 +13,32 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
import org.eclipse.jface.viewers.TreePath;
/**
- * A model proxy factory creates model proxies for elements based on
+ * A model proxy factory creates model proxies for elements based on
* specific presentation contexts. A model proxy factory is provided for
* a model element by registering a model proxy factory adapter for
* an element.
* <p>
- * This interface is an alternative to the {@link IModelProxyFactory}
- * interface. Unlike its predecessor <code>IModelProxyFactory2</code> allows
- * the full path to the tree element to be specified when creating an
- * <code>IModelProxy<code> instance. Using the full patch allows models to
- * provide proper model deltas even if the root element of this proxy is at
+ * This interface is an alternative to the {@link IModelProxyFactory}
+ * interface. Unlike its predecessor <code>IModelProxyFactory2</code> allows
+ * the full path to the tree element to be specified when creating an
+ * <code>IModelProxy<code> instance. Using the full patch allows models to
+ * provide proper model deltas even if the root element of this proxy is at
* variable or unknown location in the viewer.
- * </p>
+ * </p>
* <p>
* Clients may implement this interface.
* </p>
* @see IModelProxyFactory
* @see IModelProxy
* @see IModelDelta
- *
+ *
* @since 3.6
*/
public interface IModelProxyFactory2 {
/**
* Creates and returns a model proxy for the given element in the specified
* context or <code>null</code> if none.
- *
+ *
* @param input viewer input context
* @param path to model element to create a model proxy for
* @param context presentation context
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicy.java
index f672adef1..0174054a0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicy.java
@@ -27,27 +27,27 @@ import org.eclipse.jface.viewers.ISelection;
* will then be asked to create a model selection policy adapter.
* The adapter represents selections from an instance of a model.
* </p>
- *
+ *
* @see IModelSelectionPolicyFactory
* @since 3.2
*/
public interface IModelSelectionPolicy {
-
+
/**
* Returns whether the given selection is contained in this model.
- *
+ *
* @param selection Selection to check
* @param context Presentation context of the viewer.
* @return true if selection is contained in model.
*/
public boolean contains(ISelection selection, IPresentationContext context);
-
+
/**
* Returns whether the candidate selection overrides the
* existing selection. The policy is only asked about selections
* that it contains.
- *
- * @param existing Existing selection to check.
+ *
+ * @param existing Existing selection to check.
* @param candidate New proposed selection.
* @param context Presentation context of viewer.
* @return true if candidate selection should be set to viewer
@@ -57,13 +57,13 @@ public interface IModelSelectionPolicy {
/**
* Returns whether the given selection should be maintained in the
* face of a selection attempt from a different model.
- *
+ *
* @param selection selection to test
* @param context Presentation context of viewer.
* @return true if selection is sticky
*/
public boolean isSticky(ISelection selection, IPresentationContext context);
-
+
/**
* Replaces an invalid selection.
* <p>
@@ -75,7 +75,7 @@ public interface IModelSelectionPolicy {
* elements removed). Model selection policies may implement a different strategy
* for picking a new selection when the old selection becomes invalid.
* </p>
- *
+ *
* @param invalidSelection
* the selection before the viewer was updated
* @param newSelection
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicyFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicyFactory.java
index d318f8e07..34b4e75ba 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicyFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicyFactory.java
@@ -12,7 +12,7 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
/**
- * A model selection policy factory creates a model selection policy for an element based on
+ * A model selection policy factory creates a model selection policy for an element based on
* a specific presentation context. A model selection policy factory is provided for
* a model element by registering a model selection policy factory adapter for
* an element.
@@ -26,7 +26,7 @@ public interface IModelSelectionPolicyFactory {
/**
* Creates and returns a model selection policy for the given element in the specified
* context or <code>null</code> if none.
- *
+ *
* @param element model element to create a selection policy for
* @param context presentation context
* @return model selection policy or <code>null</code>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java
index 12d0b1b2d..7e542cf02 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java
@@ -33,99 +33,99 @@ public interface IPresentationContext {
/**
* Property indicating whether the presentation context is disposed.
- * It is set to <code>Boolean.TRUE</code> after the presentation context
- * is disposed. This property may be <code>null</code>, which indicates
+ * It is set to <code>Boolean.TRUE</code> after the presentation context
+ * is disposed. This property may be <code>null</code>, which indicates
* that context is not yet disposed.
- *
+ *
* @since 3.6
*/
public static final String PROPERTY_DISPOSED = "PROPERTY_DISPOSED"; //$NON-NLS-1$
-
+
/**
* Returns identifiers of the visible columns in the order
* labels should be provided, or <code>null</code> if columns
* are not being displayed. Label providers use this
- * information.
- *
+ * information.
+ *
* @return visible column identifiers or <code>null</code>
* @see IColumnPresentation
*/
public String[] getColumns();
-
+
/**
* Registers the given listener for property change notification.
- *
+ *
* @param listener property listener
*/
public void addPropertyChangeListener(IPropertyChangeListener listener);
-
+
/**
* Unregisters the given listener from property change notification.
- *
+ *
* @param listener property listener.
*/
public void removePropertyChangeListener(IPropertyChangeListener listener);
-
+
/**
* Returns the id of this presentation context. Usually this is the id of
* the associated part. However, when no part is associated with this context,
* the id may exist on its own. Allows for a context that is not tied to a part.
- *
+ *
* @return id
* @since 3.3
*/
public String getId();
-
+
/**
* Sets the specified property and notifies listeners of changes.
- *
+ *
* @param property property name
* @param value property value
*/
public void setProperty(String property, Object value);
-
+
/**
* Returns the property with the specified name or <code>null</code>
* if none.
- *
+ *
* @param property property name
* @return property value or <code>null</code>
*/
public Object getProperty(String property);
-
+
/**
* Disposes this presentation context. Called by the framework
* when the associated viewer is disposed.
*/
public void dispose();
-
+
/**
* Returns all keys of properties currently set in this context,
* possibly an empty collection
- *
+ *
* @return keys of all current properties
* @since 3.4
*/
public String[] getProperties();
-
+
/**
* Returns the part that this presentation context is associated with.
- * May return <code>null</code> if the presentation is not associated
+ * May return <code>null</code> if the presentation is not associated
* with a part.
- *
- * @return IWorkbenchPart or <code>null</code>
+ *
+ * @return IWorkbenchPart or <code>null</code>
* @since 3.6
*/
public IWorkbenchPart getPart();
-
+
/**
* Returns the window that this presentation context is associated with.
- * May return <code>null</code> if the presentation is not associated
+ * May return <code>null</code> if the presentation is not associated
* with a window.
- *
- * @return IWorkbenchWindow or <code>null</code>
+ *
+ * @return IWorkbenchWindow or <code>null</code>
* @since 3.6
*/
public IWorkbenchWindow getWindow();
-
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStateUpdateListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStateUpdateListener.java
index 49830e0af..fa328c449 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStateUpdateListener.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStateUpdateListener.java
@@ -13,37 +13,37 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
/**
* Listener for viewer state updates.
- *
+ *
* @since 3.6
*/
public interface IStateUpdateListener {
/**
* Notification that a sequence of state saving updates are starting.
- *
+ *
* @param input Input object for the state operation.
*/
public void stateSaveUpdatesBegin(Object input);
-
+
/**
* Notification that viewer updates are complete. Corresponds to
* a <code>viewerUpdatesBegin()</code> notification.
- *
+ *
* @param input Input object for the state operation.
*/
public void stateSaveUpdatesComplete(Object input);
/**
* Notification that a sequence of viewer updates are starting.
- *
+ *
* @param input Input object for the state operation.
*/
public void stateRestoreUpdatesBegin(Object input);
-
+
/**
* Notification that viewer updates are complete. Corresponds to
* a <code>viewerUpdatesBegin()</code> notification.
- *
+ *
* @param input Input object for the state operation.
*/
public void stateRestoreUpdatesComplete(Object input);
@@ -51,16 +51,16 @@ public interface IStateUpdateListener {
/**
* Notification that a specific update has started within
* a sequence of updates.
- *
+ *
* @param input Input object for the state operation.
* @param update update
*/
public void stateUpdateStarted(Object input, IViewerUpdate update);
-
+
/**
* Notification that a specific update has completed within a
* sequence of updates.
- *
+ *
* @param input Input object for the state operation.
* @param update update
*/
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStatusMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStatusMonitor.java
index 0ba8af669..4703e1e1a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStatusMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStatusMonitor.java
@@ -1,10 +1,10 @@
/*******************************************************************************
* Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -16,7 +16,7 @@ import org.eclipse.core.runtime.IStatus;
/**
* A progress monitor that accepts a status. This common base interface is used
* to make non-blocking requests on models that may reply asynchronously. A request
- * may be cancelled by the caller or by the client fulfilling the request (by
+ * may be cancelled by the caller or by the client fulfilling the request (by
* calling <code>setCancelled(true)</code> on the request). Failure and error
* states are reported by setting a status on a monitor. When a request
* is complete, the client fulfilling the request must call <code>done()</code> on the
@@ -43,14 +43,14 @@ public interface IStatusMonitor extends IProgressMonitor {
* Sets the status for a request, possibly <code>null</code>.
* When a request fails, the status indicates why the request failed.
* A <code>null</code> status is considered to be successful.
- *
+ *
* @param status request status
*/
public void setStatus(IStatus status);
-
+
/**
* Returns the status of this request, or <code>null</code>.
- *
+ *
* @return request status - <code>null</code> is equivalent
* to an OK status
*/
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ITreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ITreeModelViewer.java
index 1b1f38a48..39b1db200 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ITreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ITreeModelViewer.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* IBM Corporation - ongoing bug fixes and enhancements
@@ -21,7 +21,7 @@ import org.eclipse.swt.widgets.Display;
/**
* Interface of an tree model viewer. It declares the common methods for the
- * JFace-based {@link TreeModelViewer} and the UI-less
+ * JFace-based {@link TreeModelViewer} and the UI-less
* {@link VirtualTreeModelViewer}.
*
* @since 3.8
@@ -41,14 +41,14 @@ public interface ITreeModelViewer extends ISelectionProvider {
* Returns the Display object that this viewer is in. The
* display object can be used by clients to access the display thread
* to call the viewer methods.
- *
+ *
* @return The display.
*/
public Display getDisplay();
/**
* Returns this viewer's presentation context.
- *
+ *
* @return presentation context
*/
public IPresentationContext getPresentationContext();
@@ -57,23 +57,23 @@ public interface ITreeModelViewer extends ISelectionProvider {
* Returns the current input of this viewer, or <code>null</code>
* if none. The viewer's input provides the "model" for the viewer's
* content.
- *
+ *
* @return Input object
*/
public Object getInput();
/**
- * Sets the input of this viewer. Setting the input resets the
+ * Sets the input of this viewer. Setting the input resets the
* viewer's contents and triggers an update starting at the input
* element.
- *
+ *
* @param object Input element, or <code>null</code> if none.
*/
public void setInput(Object object);
-
+
/**
* Returns the current selection in viewer.
- *
+ *
* @return selection object
*/
@Override
@@ -83,20 +83,20 @@ public interface ITreeModelViewer extends ISelectionProvider {
* Sets a new selection for this viewer and optionally makes it visible.
* The selection is not set if the model selection policy overrides the
* attempt to set the selection.
- *
+ *
* @param selection the new selection
* @param reveal <code>true</code> if the selection is to be made
* visible, and <code>false</code> otherwise
- * @param force <code>true</code> if the selection should override the
+ * @param force <code>true</code> if the selection should override the
* model selection policy
*/
public void setSelection(ISelection selection, boolean reveal, boolean force);
-
+
/**
* Attempts to set the selection for this viewer and optionally makes it visible.
* The selection is not set if the model selection policy overrides the
* attempt to set the selection.
- *
+ *
* @param selection the new selection
* @param reveal whether to make the selection visible after successfully setting
* the selection
@@ -112,7 +112,7 @@ public interface ITreeModelViewer extends ISelectionProvider {
* @return non-negative level, or <code>ALL_LEVELS</code> if all levels of
* the tree are expanded automatically
* @see #setAutoExpandLevel
- */
+ */
public int getAutoExpandLevel();
/**
@@ -128,115 +128,115 @@ public interface ITreeModelViewer extends ISelectionProvider {
* The value <code>ALL_LEVELS</code> means that all subtrees should be
* expanded.
* </p>
- *
+ *
* @param level
* non-negative level, or <code>ALL_LEVELS</code> to expand all
* levels of the tree
*/
public void setAutoExpandLevel(int level);
-
+
/**
- * Returns the label data for the given element and for the given column,
- * Returns <code>null</code> if the given element is not found or is not
- * materialized in the virtual viewer. Clients may listen to label update
+ * Returns the label data for the given element and for the given column,
+ * Returns <code>null</code> if the given element is not found or is not
+ * materialized in the virtual viewer. Clients may listen to label update
* events to be notified when element labels are updated.
- *
+ *
* @param path Path of the element.
* @param columnId ID of the column for which to return the label data.
- * @return Label object containing the label information. Can be
- * <code>null</code> if the given element is not found or is not
+ * @return Label object containing the label information. Can be
+ * <code>null</code> if the given element is not found or is not
* materialized in the virtual viewer.
*/
public ViewerLabel getElementLabel(TreePath path, String columnId);
-
+
/**
* Registers the specified listener for view update notifications.
- *
+ *
* @param listener Listener to add
*/
public void addViewerUpdateListener(IViewerUpdateListener listener);
-
+
/**
* Removes the specified listener from update notifications.
- *
+ *
* @param listener Listener to remove
*/
public void removeViewerUpdateListener(IViewerUpdateListener listener);
-
+
/**
* Registers the specified listener for state update notifications.
- *
+ *
* @param listener Listener to add
*/
public void addStateUpdateListener(IStateUpdateListener listener);
-
+
/**
* Removes the specified listener from state update notifications.
- *
+ *
* @param listener Listener to remove
*/
public void removeStateUpdateListener(IStateUpdateListener listener);
-
+
/**
* Registers the specified listener for view label update notifications.
- *
+ *
* @param listener Listener to add
*/
public void addLabelUpdateListener(ILabelUpdateListener listener);
-
+
/**
* Removes the specified listener from view label update notifications.
- *
+ *
* @param listener Listener to remove
*/
public void removeLabelUpdateListener(ILabelUpdateListener listener);
-
+
/**
* Registers the given listener for model delta notification.
* This listener is called immediately after the viewer processes
* the delta.
- *
+ *
* @param listener Listener to add
*/
public void addModelChangedListener(IModelChangedListener listener);
-
+
/**
* Removes the given listener from model delta notification.
- *
+ *
* @param listener Listener to remove
*/
public void removeModelChangedListener(IModelChangedListener listener);
-
+
/**
* Writes state information into a delta for the sub-tree at the given
- * path. It adds delta nodes and IModelDelta.EXPAND and IModelDelta.SELECT
+ * path. It adds delta nodes and IModelDelta.EXPAND and IModelDelta.SELECT
* as it parses the sub-tree.
- *
+ *
* @param path Path where to start saving the state.
* @param delta The delta where the state is to be saved.
- * @param flagsToSave The flags to preserve during the state save. The
- * supported flags are <code>IModelDelta.SELECT</code>,
+ * @param flagsToSave The flags to preserve during the state save. The
+ * supported flags are <code>IModelDelta.SELECT</code>,
* <code>IModelDelta.EXPAND</code>, <code>IModelDelta.COLLAPSE</code>.
- * @return Returns whether the state was saved for the given path. Will
- * return <code>false</code> if an element at the given path cannot
+ * @return Returns whether the state was saved for the given path. Will
+ * return <code>false</code> if an element at the given path cannot
* be found.
*/
public boolean saveElementState(TreePath path, ModelDelta delta, int flagsToSave);
-
+
/**
* Causes the viewer to process the given delta as if it came from a
* model proxy. This method is intended to be used to restore state
* saved using {@link #saveElementState(TreePath, ModelDelta, int)}.
- *
+ *
* @param delta Delta to process.
*/
public void updateViewer(IModelDelta delta);
-
+
/**
- * Triggers an update of the given element and its children. If
- * multiple instances of the given element are found in the tree,
+ * Triggers an update of the given element and its children. If
+ * multiple instances of the given element are found in the tree,
* they will all be updated.
- *
+ *
* @param element Element to update.
*/
public void refresh(Object element);
@@ -249,7 +249,7 @@ public interface ITreeModelViewer extends ISelectionProvider {
/**
* Returns the paths at which the given element is found realized in viewer
* or an empty array if not found.
- *
+ *
* @param element Element to find.
* @return Array of paths for given element.
*/
@@ -257,21 +257,21 @@ public interface ITreeModelViewer extends ISelectionProvider {
/**
* Returns filters currently configured in viewer.
- *
+ *
* @return filter array in viewer.
*/
public ViewerFilter[] getFilters();
-
+
/**
* Add a new filter to use in viewer.
- *
+ *
* @param filter Filter to add.
*/
public void addFilter(ViewerFilter filter);
-
+
/**
* Sets viewer filters to the filters in array.
- *
+ *
* @param filters New filter array to use.
*/
public void setFilters(ViewerFilter... filters);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewActionProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewActionProvider.java
index b493d2ac8..0c87ff80d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewActionProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewActionProvider.java
@@ -14,21 +14,21 @@ import org.eclipse.jface.action.IAction;
/**
- * Action provider allows a debug model to override the standard actions in the
- * variables view. The client should return this provider as an adapter to the
+ * Action provider allows a debug model to override the standard actions in the
+ * variables view. The client should return this provider as an adapter to the
* input element of the variables view.
- *
+ *
* @since 3.8
*/
public interface IViewActionProvider {
/**
* Get action for a given presentation context and action id. Implementation
* should return an action implementation appropriate for given view and action ID.
- * The implementation may register itself as listener to presentation context
+ * The implementation may register itself as listener to presentation context
* to determine when to dispose the returned action.
* @param presentationContext presentation context
* @param actionID action id
- * @return action or null
+ * @return action or null
*/
public IAction getAction(IPresentationContext presentationContext, String actionID);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputProvider.java
index dca273093..f691d2841 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputProvider.java
@@ -24,15 +24,15 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
* @see ViewerInputService
*/
public interface IViewerInputProvider {
-
+
/**
* Asynchronously determine the viewer input to the based on the active
* debug context and presentation context.
- *
- * @param update provides details about the request and stores the newly
+ *
+ * @param update provides details about the request and stores the newly
* computed viewer input
*/
public void update(IViewerInputUpdate update);
-
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputRequestor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputRequestor.java
index 1ac26036e..9ac314eb3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputRequestor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputRequestor.java
@@ -11,20 +11,20 @@
package org.eclipse.debug.internal.ui.viewers.model.provisional;
/**
- * Clients using a {@link ViewerInputService} implement this interface to be notified of
+ * Clients using a {@link ViewerInputService} implement this interface to be notified of
* the computed viewer input.
* <p>
* Clients may implement this interface.
* </p>
* @see ViewerInputService
- * @since 3.4
+ * @since 3.4
*/
public interface IViewerInputRequestor {
/**
* Notification that a viewer input update request is complete. The given update
* contains the result of the request, which may have been canceled.
- *
+ *
* @param update viewer input update request
*/
public void viewerInputComplete(IViewerInputUpdate update);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputUpdate.java
index d56225ef3..3443b28f3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputUpdate.java
@@ -27,15 +27,15 @@ public interface IViewerInputUpdate extends IViewerUpdate {
* Sets the input to use for this request's presentation context, or <code>null</code>
* if none (empty viewer). The source used to derive the viewer input is available
* from this request's <code>getElement()</code> method.
- *
+ *
* @param element viewer input for this request's presentation context, possibly <code>null</code>
*/
public void setInputElement(Object element);
-
+
/**
* Returns the computed viewer input or <code>null</code> if none. The return value of this method
* only contains valid data if this request is complete (i.e. <code>done()</code> has been called).
- *
+ *
* @return viewer input or <code>null</code>
*/
public Object getInputElement();
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 baa6971ce..0df2ce637 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
@@ -15,7 +15,7 @@ import org.eclipse.jface.viewers.TreePath;
/**
* A context sensitive viewer update request.
- *
+ *
* @noimplement This interface is not intended to be implemented by clients.
* @since 3.3
*/
@@ -23,30 +23,30 @@ public interface IViewerUpdate extends IRequest {
/**
* Returns the context this update was requested in.
- *
+ *
* @return context this update was requested in
*/
public IPresentationContext getPresentationContext();
-
+
/**
* Returns the model element associated with this request.
- *
+ *
* @return associated model element
*/
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();
-
+
/**
* Returns the element that was the viewer input at the time the
* request was made, possibly <code>null</code>.
- *
+ *
* @return viewer input element, possibly <code>null</code>
* @since 3.4
*/
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdateListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdateListener.java
index c8b9d923e..647f2ea3f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdateListener.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdateListener.java
@@ -13,7 +13,7 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
/**
* Notified of viewer updates.
- *
+ *
* @since 3.3
*/
public interface IViewerUpdateListener {
@@ -22,25 +22,25 @@ public interface IViewerUpdateListener {
* Notification that a sequence of viewer updates are starting.
*/
public void viewerUpdatesBegin();
-
+
/**
* Notification that viewer updates are complete. Corresponds to
* a <code>viewerUpdatesBegin()</code> notification.
*/
public void viewerUpdatesComplete();
-
+
/**
* Notification that a specific update has started within
* a sequence of updates.
- *
+ *
* @param update update
*/
public void updateStarted(IViewerUpdate update);
-
+
/**
* Notification that a specific update has completed within a
* sequence of updates.
- *
+ *
* @param update update
*/
public void updateComplete(IViewerUpdate update);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IVirtualItemListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IVirtualItemListener.java
index f2f52d0a6..67ffdb815 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IVirtualItemListener.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IVirtualItemListener.java
@@ -11,27 +11,27 @@
package org.eclipse.debug.internal.ui.viewers.model.provisional;
/**
- * Interface for listeners that need to be notified when items
+ * Interface for listeners that need to be notified when items
* are disposed or revealed. It should be implemented by the viewer.
- *
+ *
* @see VirtualTreeModelViewer
* @since 3.8
*/
public interface IVirtualItemListener {
-
+
/**
- * Called when the item has been shown in the virtual viewer's
+ * Called when the item has been shown in the virtual viewer's
* view-port. This indicates to the viewer that it should check
* the item's status and request needed data.
- *
+ *
* @param item The item that was revealed.
*/
public void revealed(VirtualItem item);
-
+
/**
* Called when an item is disposed. It tells the viewer to
* clean up any remaining mappings and cached data of this item.
- *
+ *
* @param item The itam that was disposed.
*/
public void disposed(VirtualItem item);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IVirtualItemValidator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IVirtualItemValidator.java
index b460c486c..2ed6682e7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IVirtualItemValidator.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IVirtualItemValidator.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -13,25 +13,25 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
/**
* A validator to be used with a VirtualTreeModelViewer to determine which viewer
- * items should be updated by the viewer.
- *
+ * items should be updated by the viewer.
+ *
* @see VirtualTreeModelViewer
* @since 3.8
*/
public interface IVirtualItemValidator {
-
+
/**
- * Allows the validator to determine whether the given item is to be deemed
+ * Allows the validator to determine whether the given item is to be deemed
* visible in the virtual tree.
- *
+ *
* @param item Item to be tested.
* @return returns true if the item should be considered visible.
*/
public boolean isItemVisible(VirtualItem item);
-
+
/**
* Indicates that the viewer requested to reveal the given item in viewer.
- *
+ *
* @param item Item to show.
*/
public void showItem(VirtualItem item);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java
index f40307d4c..219b1e1b9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java
@@ -4,10 +4,10 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- * Wind River Systems - Fix for viewer state save/restore [188704]
+ * Wind River Systems - Fix for viewer state save/restore [188704]
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model.provisional;
@@ -40,7 +40,7 @@ public class ModelDelta implements IModelDelta {
/**
* Constructs a new delta for the given element.
- *
+ *
* @param element model element
* @param flags change flags
*/
@@ -52,7 +52,7 @@ public class ModelDelta implements IModelDelta {
/**
* Constructs a new delta for the given element to be replaced
* with the specified replacement element.
- *
+ *
* @param element model element
* @param replacement replacement element
* @param flags change flags
@@ -66,7 +66,7 @@ public class ModelDelta implements IModelDelta {
/**
* Constructs a new delta for the given element to be inserted at
* the specified index.
- *
+ *
* @param element model element
* @param index insertion position
* @param flags change flags
@@ -76,11 +76,11 @@ public class ModelDelta implements IModelDelta {
fIndex = index;
fFlags = flags;
}
-
+
/**
* Constructs a new delta for the given element at the specified index
* relative to its parent with the given number of children.
- *
+ *
* @param element model element
* @param index insertion position
* @param flags change flags
@@ -112,7 +112,7 @@ public class ModelDelta implements IModelDelta {
/**
* Adds a child node to this delta with the given element and change flags,
* and returns the child delta.
- *
+ *
* @param element child element to add
* @param flags change flags for child
* @return newly created child delta
@@ -123,10 +123,10 @@ public class ModelDelta implements IModelDelta {
addDelta(node);
return node;
}
-
+
/**
* Returns the child delta for the given element, or <code>null</code> if none.
- *
+ *
* @param element child element
* @return corresponding delta node, or <code>null</code>
*/
@@ -145,11 +145,11 @@ public class ModelDelta implements IModelDelta {
/**
* Returns the child delta for the given element and index, or <code>null</code> if none.
- *
+ *
* @param element Element of the child delta to find
* @param index Index of the child delta to find.
* @return corresponding delta node, or <code>null</code>
- *
+ *
* @since 3.8
*/
public ModelDelta getChildDelta(Object element, int index) {
@@ -184,7 +184,7 @@ public class ModelDelta implements IModelDelta {
mapNode( fNodesList.get(i) );
}
}
-
+
private void mapNode(ModelDelta node) {
Object oldValue = fNodesMap.put(node.getElement(), node);
if (oldValue instanceof ModelDelta) {
@@ -200,13 +200,13 @@ public class ModelDelta implements IModelDelta {
fNodesMap.put(node.getElement(), newNodes);
}
}
-
+
/**
* Adds a child node to this delta to replace the given element with the
- * specified replacement element and change flags, and returns the
+ * specified replacement element and change flags, and returns the
* newly created child delta.
- *
+ *
* @param element child element to add to this delta
* @param replacement replacement element for the child element
* @param flags change flags
@@ -222,7 +222,7 @@ public class ModelDelta implements IModelDelta {
/**
* Adds a child delta to this delta to insert the specified element at
* the given index, and returns the newly created child delta.
- *
+ *
* @param element child element in insert
* @param index index of insertion
* @param flags change flags
@@ -234,11 +234,11 @@ public class ModelDelta implements IModelDelta {
addDelta(node);
return node;
}
-
+
/**
* Adds a child delta to this delta at the specified index with the
* given number of children, and returns the newly created child delta.
- *
+ *
* @param element child element in insert
* @param index index of the element relative to parent
* @param flags change flags
@@ -251,16 +251,16 @@ public class ModelDelta implements IModelDelta {
addDelta(node);
return node;
}
-
+
/**
* Sets the parent delta of this delta
- *
+ *
* @param node parent delta
*/
void setParent(ModelDelta node) {
fParent = node;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getParent()
*/
@@ -284,7 +284,7 @@ public class ModelDelta implements IModelDelta {
public int getIndex() {
return fIndex;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getNodes()
*/
@@ -295,7 +295,7 @@ public class ModelDelta implements IModelDelta {
}
return fNodes;
}
-
+
private void addDelta(ModelDelta delta) {
if (fNodesList == null) {
fNodesList = new ArrayList<ModelDelta>(4);
@@ -306,7 +306,7 @@ public class ModelDelta implements IModelDelta {
mapNode(delta);
}
}
-
+
@Override
public String toString() {
StringBuffer buf = new StringBuffer();
@@ -315,7 +315,7 @@ public class ModelDelta implements IModelDelta {
buf.append("Model Delta End\n"); //$NON-NLS-1$
return buf.toString();
}
-
+
private void appendDetail(String indent, StringBuffer buf, IModelDelta delta) {
buf.append(indent);
buf.append("Element: "); //$NON-NLS-1$
@@ -396,7 +396,7 @@ public class ModelDelta implements IModelDelta {
public void accept(IModelDeltaVisitor visitor) {
doAccept(visitor, 0);
}
-
+
protected void doAccept(IModelDeltaVisitor visitor, int depth) {
if (visitor.visit(this, depth)) {
IModelDelta[] childDeltas = getChildDeltas();
@@ -405,19 +405,19 @@ public class ModelDelta implements IModelDelta {
}
}
}
-
+
/**
* Sets this delta's element
- *
+ *
* @param element element to set
*/
public void setElement(Object element) {
fElement = element;
}
-
+
/**
* Sets this delta's flags.
- *
+ *
* @param flagsnew flags to set
*/
public void setFlags(int flags) {
@@ -426,17 +426,17 @@ public class ModelDelta implements IModelDelta {
/**
* Sets this delta's index
- *
+ *
* @param index new index to set
* @since 3.6
*/
public void setIndex(int index) {
fIndex = index;
}
-
+
/**
* Sets this delta's child count.
- *
+ *
* @param count new child count to set
*/
public void setChildCount(int count) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java
index 805187af3..0a73045fd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java
@@ -36,13 +36,13 @@ import org.eclipse.ui.PlatformUI;
* @since 3.2
*/
public class PresentationContext implements IPresentationContext {
-
+
private static final String PRESENTATION_CONTEXT_PROPERTIES = "PRESENTATION_CONTEXT_PROPERTIES"; //$NON-NLS-1$
private static final String BOOLEAN = "BOOLEAN"; //$NON-NLS-1$
private static final String STRING = "STRING"; //$NON-NLS-1$
private static final String INTEGER = "INTEGER"; //$NON-NLS-1$
private static final String PERSISTABLE = "PERSISTABLE"; //$NON-NLS-1$
-
+
final private String fId;
final private ListenerList<IPropertyChangeListener> fListeners = new ListenerList<>();
final private Map<String, Object> fProperties = new HashMap<String, Object>();
@@ -51,7 +51,7 @@ public class PresentationContext implements IPresentationContext {
/**
* Constructs a presentation context for the given id.
- *
+ *
* @param id presentation context id
*/
public PresentationContext(String id) {
@@ -60,7 +60,7 @@ public class PresentationContext implements IPresentationContext {
/**
* Constructs a presentation context for the given id and window.
- *
+ *
* @param id presentation context id
* @param window presentation context window, may be <code>null</code>
*/
@@ -71,7 +71,7 @@ public class PresentationContext implements IPresentationContext {
/**
* Constructs a presentation context for the given id and part.
* The presentation context window is derived from the part.
- *
+ *
* @param id presentation context id
* @param part presentation context part, may be <code>null</code>
*/
@@ -82,7 +82,7 @@ public class PresentationContext implements IPresentationContext {
/**
* Constructs a presentation context for the given id and part.
* The presentation context id and window are derived from the part.
- *
+ *
* @param part presentation context part, can NOT be <code>null</code>
*/
public PresentationContext(IWorkbenchPart part) {
@@ -102,10 +102,10 @@ public class PresentationContext implements IPresentationContext {
public String[] getColumns() {
return (String[]) getProperty(IPresentationContext.PROPERTY_COLUMNS);
}
-
+
/**
* Fires a property change event to all registered listeners
- *
+ *
* @param property property name
* @param oldValue old value or <code>null</code>
* @param newValue new value or <code>null</code>
@@ -124,16 +124,16 @@ public class PresentationContext implements IPresentationContext {
}
}
}
-
+
/**
* Sets the visible column ids.
- *
+ *
* @param ids column identifiers
*/
public void setColumns(String[] ids) {
setProperty(IPresentationContext.PROPERTY_COLUMNS, ids);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext#dispose()
@@ -196,19 +196,19 @@ public class PresentationContext implements IPresentationContext {
fProperties.put(property, value);
}
}
-
+
if (propertySet) {
firePropertyChange(property, oldValue, value);
}
}
-
+
/**
* Restores the presentation context properties from the given memento.
* @param memento Memento to restore from.
*/
public void initProperties(IMemento memento) {
IMemento presentationMemento = null;
-
+
IMemento[] mementos = memento.getChildren(PRESENTATION_CONTEXT_PROPERTIES);
for (int i = 0; i < mementos.length; i++) {
if (getId().equals(mementos[i].getID())) {
@@ -222,24 +222,24 @@ public class PresentationContext implements IPresentationContext {
for (int i = 0; i < stringProperties.length; i++) {
fProperties.put(stringProperties[i].getID(), stringProperties[i].getString(STRING));
}
-
+
IMemento[] integerMementos = presentationMemento.getChildren(INTEGER);
for (int i = 0; i < integerMementos.length; i++) {
fProperties.put(integerMementos[i].getID(), integerMementos[i].getInteger(INTEGER));
}
-
+
IMemento[] booleanMementos = presentationMemento.getChildren(BOOLEAN);
for (int i = 0; i < booleanMementos.length; i++) {
fProperties.put(booleanMementos[i].getID(), booleanMementos[i].getBoolean(BOOLEAN));
}
-
+
IMemento[] persistableMementos = presentationMemento.getChildren(PERSISTABLE);
for (int i = 0; i < persistableMementos.length; i++) {
String factoryID = persistableMementos[i].getString(PERSISTABLE);
if (factoryID != null) {
IElementFactory factory = PlatformUI.getWorkbench().getElementFactory(factoryID);
if (factory != null) {
- Object element = factory.createElement(persistableMementos[i]);
+ Object element = factory.createElement(persistableMementos[i]);
if (element != null) {
fProperties.put(persistableMementos[i].getID(), element);
}
@@ -248,9 +248,9 @@ public class PresentationContext implements IPresentationContext {
}
}
}
-
+
/**
- * Saves the current presentation context properties to the given memento.
+ * Saves the current presentation context properties to the given memento.
* @param memento Memento to save to.
*/
public void saveProperites(IMemento memento) {
@@ -276,7 +276,7 @@ public class PresentationContext implements IPresentationContext {
}
}
}
-
+
private boolean isEqual(Object a, Object b) {
if (a == null) {
return b == null;
@@ -304,6 +304,6 @@ public class PresentationContext implements IPresentationContext {
public IWorkbenchWindow getWindow() {
return fWindow;
}
-
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewer.java
index 5e3d35722..15bdacacf 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewer.java
@@ -20,17 +20,17 @@ import org.eclipse.ui.IMemento;
/**
* A tree viewer for a model.
* <p>
- * Style flags supported by this viewer are the same as for {@link org.eclipse.jface.viewers.TreeViewer},
+ * Style flags supported by this viewer are the same as for {@link org.eclipse.jface.viewers.TreeViewer},
* except:
* <ul>
- * <li>SWT.VIRTUAL - Indicates that the viewer should be in lazy mode. This
+ * <li>SWT.VIRTUAL - Indicates that the viewer should be in lazy mode. This
* flag is required when creating this viewer.
* <li>SWT.POP_UP - Indicates that the viewer is used in a popup window, and it
- * should ignore requests from the model to select, expand, or collapse tree
+ * should ignore requests from the model to select, expand, or collapse tree
* elements.</li>
* </ul>
* </p>
- * @since 3.3
+ * @since 3.3
* @noextend Clients may instantiate this class. Clients may not subclass this class.
*/
public class TreeModelViewer extends InternalTreeModelViewer {
@@ -38,152 +38,152 @@ public class TreeModelViewer extends InternalTreeModelViewer {
public TreeModelViewer(Composite parent, int style, IPresentationContext context) {
super(parent, style, context);
}
-
+
/**
* Returns this viewer's presentation context.
- *
+ *
* @return presentation context
*/
@Override
public IPresentationContext getPresentationContext() {
return super.getPresentationContext();
- }
+ }
/**
* Registers the given listener for model delta notification.
- *
+ *
* @param listener model delta listener
*/
@Override
public void addModelChangedListener(IModelChangedListener listener) {
- super.addModelChangedListener(listener);
+ super.addModelChangedListener(listener);
}
-
+
/**
* Unregisters the given listener from model delta notification.
- *
+ *
* @param listener model delta listener
*/
@Override
public void removeModelChangedListener(IModelChangedListener listener) {
super.removeModelChangedListener(listener);
- }
-
+ }
+
/**
* Registers the specified listener for view update notifications.
- *
+ *
* @param listener listener
*/
@Override
public void addViewerUpdateListener(IViewerUpdateListener listener) {
super.addViewerUpdateListener(listener);
}
-
+
/**
* Removes the specified listener from update notifications.
- *
+ *
* @param listener listener
*/
@Override
public void removeViewerUpdateListener(IViewerUpdateListener listener) {
super.removeViewerUpdateListener(listener);
}
-
+
/**
* Returns whether columns can be toggled on/off for this viewer's current
* input element.
- *
+ *
* @return whether columns can be toggled on/off
*/
@Override
public boolean canToggleColumns() {
return super.canToggleColumns();
- }
-
+ }
+
/**
* Returns the current column presentation for this viewer, or <code>null</code>
* if none.
- *
+ *
* @return column presentation or <code>null</code>
*/
@Override
public IColumnPresentation getColumnPresentation() {
return super.getColumnPresentation();
- }
-
+ }
+
/**
* Returns identifiers of the visible columns in this viewer, or <code>null</code>
* if there are currently no columns.
- *
+ *
* @return visible columns identifiers or <code>null</code>
*/
@Override
public String[] getVisibleColumns() {
return super.getVisibleColumns();
- }
-
+ }
+
/**
* Initializes viewer state from the memento
- *
+ *
* @param memento the {@link IMemento} to read from
*/
@Override
public void initState(IMemento memento) {
super.initState(memento);
}
-
+
/**
* Save viewer state into the given memento.
- *
+ *
* @param memento the {@link IMemento} to save to
*/
@Override
public void saveState(IMemento memento) {
super.saveState(memento);
}
-
+
/**
- * @return Returns true if columns are being displayed currently.
+ * @return Returns true if columns are being displayed currently.
*/
@Override
public boolean isShowColumns() {
return super.isShowColumns();
- }
-
+ }
+
/**
* Resets any persisted column size for the given columns
- *
+ *
* @param columnIds array of column identifiers
*/
@Override
public void resetColumnSizes(String[] columnIds) {
super.resetColumnSizes(columnIds);
}
-
+
/**
* Toggles columns on/off for the current column presentation, if any.
- *
+ *
* @param show whether to show columns if the current input supports
* columns
*/
@Override
public void setShowColumns(boolean show) {
super.setShowColumns(show);
- }
-
+ }
+
/**
- * Sets the visible columns for this viewer. Id's correspond to
+ * Sets the visible columns for this viewer. Id's correspond to
* column identifiers from a column presentation. Use <code>null</code>
* or an empty collection to display default columns for the current
* column presentation. Only affects the current column presentation.
- *
+ *
* @param ids column identifiers or <code>null</code>
*/
@Override
public void setVisibleColumns(String[] ids) {
super.setVisibleColumns(ids);
- }
-
+ }
+
@Override
public ViewerLabel getElementLabel(TreePath path, String columnId) {
return super.getElementLabel(path, columnId);
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 57cdc7fda..b0f417e74 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -16,22 +16,22 @@ import org.eclipse.jface.viewers.ViewerFilter;
* Viewer filter for the Tree Model Viewer which allows more efficient filtering
* in the lazy viewer.
* <p>
- * The standard {@link ViewerFilter} class must be applied to all elements in the
+ * The standard {@link ViewerFilter} class must be applied to all elements in the
* tree, thus forcing the lazy viewer to retrieve all children of all elements and
* defeating the lazy loading behavior. This class adds an {@link #isApplicable(ITreeModelViewer, Object)}
- * method, which can be used by the filter to discern which parent elements the
- * filter should apply to.
- * </p>
- *
+ * method, which can be used by the filter to discern which parent elements the
+ * filter should apply to.
+ * </p>
+ *
* @since 3.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
+ * @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 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/ViewerInputService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java
index d2c0815fe..5b10f6986 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java
@@ -24,10 +24,10 @@ import org.eclipse.debug.internal.ui.viewers.model.ViewerInputUpdate;
* @noextend This class is not intended to be subclassed by clients.
*/
public class ViewerInputService {
-
+
/**
- * An input object which will yield a null input element.
- *
+ * An input object which will yield a null input element.
+ *
* @since 3.6
*/
public final static Object NULL_INPUT = new IViewerInputProvider() {
@@ -37,14 +37,14 @@ public class ViewerInputService {
update.done();
}
};
-
+
// previous update request, cancelled when a new request comes in
private IViewerInputUpdate fPendingUpdate = null;
-
+
private IViewerInputRequestor fRequestor = null;
-
+
private ITreeModelViewer fViewer;
-
+
private IViewerInputRequestor fProxyRequest = new IViewerInputRequestor() {
@Override
public void viewerInputComplete(final IViewerInputUpdate update) {
@@ -56,24 +56,24 @@ public class ViewerInputService {
fRequestor.viewerInputComplete(update);
}
};
-
+
/**
* Constructs a viewer input service for the given requester and presentation context.
- *
+ *
* @param viewer for which inputs are required
- * @param requestor client requesting viewer inputs
+ * @param requestor client requesting viewer inputs
*/
public ViewerInputService(ITreeModelViewer viewer, IViewerInputRequestor requestor) {
fRequestor = requestor;
fViewer = viewer;
}
-
+
/**
* Resolves a viewer input derived from the given source object.
* Reports the result to the given this service's requester. A requester may be called back
* in the same or thread, or asynchronously in a different thread. Cancels any previous
* incomplete request from this service's requester.
- *
+ *
* @param source source from which to derive a viewer input
*/
public void resolveViewerInput(Object source) {
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 34ebb6ead..7f6c66fcb 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -21,8 +21,8 @@ import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
/**
* Virtual item, which is analogous to the SWT's tree item. This class is used
- * by the {@link VirtualTreeModelViewer}.
- *
+ * by the {@link VirtualTreeModelViewer}.
+ *
* @see VirtualTreeModelViewer
* @since 3.8
*/
@@ -34,34 +34,34 @@ public class VirtualItem {
public static String FONT_KEY = "FONT_KEY"; //$NON-NLS-1$
public static String FOREGROUND_KEY = "FOREGROUND_KEY"; //$NON-NLS-1$
public static String BACKGROUND_KEY = "BACKGROUND_KEY"; //$NON-NLS-1$
-
+
public static String ELEMENT_DATA_KEY = "element"; //$NON-NLS-1$
-
+
/**
* Index object of a tree item. It allows the indexes to be modified
* as items are inserted and removed.
*/
public static class Index implements Comparable<Object> {
private Integer fIndexValue;
-
+
public Index(int index) {
fIndexValue = Integer.valueOf(index);
}
-
+
@Override
public boolean equals(Object obj) {
return obj instanceof Index && ((Index)obj).fIndexValue.equals(fIndexValue);
}
-
+
@Override
public int hashCode() {
return fIndexValue.hashCode();
}
-
+
public void increment() {
fIndexValue = Integer.valueOf(fIndexValue.intValue() + 1);
}
-
+
public void decrement() {
fIndexValue = Integer.valueOf(fIndexValue.intValue() - 1);
}
@@ -69,36 +69,36 @@ public class VirtualItem {
public int intValue() {
return fIndexValue.intValue();
}
-
+
@Override
public int compareTo(Object obj) {
- return obj instanceof Index ? fIndexValue.compareTo(((Index)obj).fIndexValue) : 0;
+ return obj instanceof Index ? fIndexValue.compareTo(((Index)obj).fIndexValue) : 0;
}
-
+
@Override
public String toString() {
return fIndexValue.toString();
}
}
-
+
/**
* Parent items of this item.
*/
final private VirtualItem fParent;
/**
- * The index of this item.
+ * The index of this item.
*/
final private Index fIndex;
-
+
/**
- * Map of child items. The key to the map is the item's index, which
+ * Map of child items. The key to the map is the item's index, which
* must be the same object instance as the index in the item. The tree map
- * keeps the items sorted while allowing indexes (keys) to be modified as
- * child items are inserted and removed.
+ * keeps the items sorted while allowing indexes (keys) to be modified as
+ * child items are inserted and removed.
*/
private Map<Index, VirtualItem> fItems = new TreeMap<Index, VirtualItem>();
-
+
/**
* Flag indicating whether this item has child items.
*/
@@ -111,14 +111,14 @@ public class VirtualItem {
private boolean fExpanded = false;
/**
- * The count of child items. <code>-1</code> indicates that the count
+ * The count of child items. <code>-1</code> indicates that the count
* is not known.
*/
private int fItemCount = -1;
-
+
/**
* The data held by this item. It includes the element as well as the item
- * display attributes.
+ * display attributes.
*/
private Map<String, Object> fData = new HashMap<String, Object>(1);
@@ -126,22 +126,22 @@ public class VirtualItem {
* Flag indicating that the item needs to have it's label updated.
*/
private boolean fNeedsLabelUpdate = true;
-
+
/**
* Flag indicating that the item's count needs to be updated.
*/
private boolean fNeedsCountUpdate = true;
-
+
/**
* Flag indicating that the item's element needs to be updated.
*/
private boolean fNeedsDataUpdate = true;
-
+
/**
* Indicates that this item has been disposed.
*/
private boolean fDisposed = false;
-
+
/**
* Virtual item constructor.
@@ -154,7 +154,7 @@ public class VirtualItem {
}
/**
- * Clears the child item at the given index.
+ * Clears the child item at the given index.
* @param index index of item to clear.
*/
public void clear(Index index) {
@@ -163,10 +163,10 @@ public class VirtualItem {
item.dispose();
}
}
-
+
/**
* Clears all child items.
- *
+ *
* @since 3.9
*/
public void clearAll() {
@@ -183,14 +183,14 @@ public class VirtualItem {
public VirtualItem getParent() {
return fParent;
}
-
+
/**
* @return Returns the index of this item.
*/
public Index getIndex() {
return fIndex;
}
-
+
/**
* Finds the given item in the child items of this element.
* @param element Data object of the item to be found.
@@ -205,7 +205,7 @@ public class VirtualItem {
}
return null;
}
-
+
/**
* @return Returns whether the data element of this item is stale.
*/
@@ -219,7 +219,7 @@ public class VirtualItem {
public void setNeedsDataUpdate() {
fNeedsDataUpdate = true;
}
-
+
/**
* Clears the stale status of the item's data element.
*/
@@ -233,9 +233,9 @@ public class VirtualItem {
public boolean needsCountUpdate() {
return fNeedsCountUpdate;
}
-
+
/**
- * Marks the item as having a stale child count.
+ * Marks the item as having a stale child count.
*/
public void setNeedsCountUpdate() {
fNeedsCountUpdate = true;
@@ -255,9 +255,9 @@ public class VirtualItem {
public boolean needsLabelUpdate() {
return fNeedsLabelUpdate;
}
-
+
/**
- * Marks the item as having a stale label data.
+ * Marks the item as having a stale label data.
*/
public void setNeedsLabelUpdate() {
fNeedsLabelUpdate = true;
@@ -269,32 +269,32 @@ public class VirtualItem {
public void clearNeedsLabelUpdate() {
fNeedsLabelUpdate = false;
}
-
+
/**
* @return Returns whether the item has been disposed.
*/
public boolean isDisposed() {
return fDisposed;
}
-
+
/**
* Disposes the item.
*/
public void dispose() {
clearAll();
-
+
fDisposed = true;
findTree().fireItemDisposed(this);
}
/**
* @param key Key to retrieve data for.
- * @return Returns item data corresponding to given key.
+ * @return Returns item data corresponding to given key.
*/
public Object getData (String key) {
return fData.get(key);
}
-
+
/**
* Sets given data element for given key.
* @param key Key for data.
@@ -305,13 +305,13 @@ public class VirtualItem {
}
/**
- * Sets the item's data element.
+ * Sets the item's data element.
* @param data Item's new element.
*/
public void setData(Object data) {
fData.put(ELEMENT_DATA_KEY, data);
}
-
+
/**
* @return Returns item's data element.
*/
@@ -333,8 +333,8 @@ public class VirtualItem {
setNeedsCountUpdate();
}
-
- Assert.isTrue(!fExpanded || hasItems());
+
+ Assert.isTrue(!fExpanded || hasItems());
// If collapsed, make sure that all the children are collapsed as well.
if (!fExpanded) {
@@ -343,7 +343,7 @@ public class VirtualItem {
}
}
}
-
+
/**
* @return Returns item's expanded state.
*/
@@ -365,14 +365,14 @@ public class VirtualItem {
setItemCount(-1);
}
}
-
+
/**
* @return Returns true if item has child items.
*/
public boolean hasItems() {
return fHasItems;
}
-
+
/**
* Sets the item's child count.
* @param count Child count.
@@ -383,7 +383,7 @@ public class VirtualItem {
Entry<Index, VirtualItem> entry = itr.next();
int index = entry.getKey().intValue();
if (index >= count) {
- VirtualItem item = entry.getValue();
+ VirtualItem item = entry.getValue();
item.dispose();
itr.remove();
}
@@ -401,31 +401,31 @@ public class VirtualItem {
}
}
}
-
+
/**
* @return Returns item's child count.
*/
public int getItemCount() {
return fItemCount;
}
-
+
/**
- * Returns the child item at given index. Child item is created if needed.
- *
+ * Returns the child item at given index. Child item is created if needed.
+ *
* @param index Index of the child item.
* @return Child item.
*/
public VirtualItem getItem(Index index) {
ensureItems();
-
- VirtualItem item = fItems.get(index);
+
+ VirtualItem item = fItems.get(index);
if (item == null) {
item = new VirtualItem(this, index);
fItems.put(index, item);
}
return item;
}
-
+
/**
* @return Returns true if any of the child items need a data update.
*/
@@ -443,18 +443,18 @@ public class VirtualItem {
}
return false;
}
-
+
/**
- * Returns an array of current child items. The returned array contains
- * only the items that have been created. It may not contain as many items as the
- * item count.
- *
+ * Returns an array of current child items. The returned array contains
+ * only the items that have been created. It may not contain as many items as the
+ * item count.
+ *
* @return Child items array.
*/
public VirtualItem[] getItems() {
return fItems.values().toArray(new VirtualItem[fItems.size()]);
}
-
+
/**
* Adds a child item at the given index position.
* @param position The index position to inser the new item at.
@@ -467,7 +467,7 @@ public class VirtualItem {
if (fItemCount < 0) {
fItemCount = 0;
}
-
+
// Increment all items with an index higher than the given position.
fItemCount++;
ensureItems();
@@ -476,15 +476,15 @@ public class VirtualItem {
childIndex.increment();
}
}
-
- // Note: the same index object used to create the item has to
- // be used as the key into the map.
+
+ // Note: the same index object used to create the item has to
+ // be used as the key into the map.
Index childIndex = new Index(position);
VirtualItem newChild = new VirtualItem(this, childIndex);
fItems.put(childIndex, newChild);
return newChild;
}
-
+
/**
* Removes the item at the given index.
* @param position Index of the item to remove.
@@ -494,7 +494,7 @@ public class VirtualItem {
if (fItemCount < 0) {
fHasItems = false;
}
-
+
ensureItems();
VirtualItem removedItem = null;
@@ -510,13 +510,13 @@ public class VirtualItem {
}
}
}
-
+
private void ensureItems() {
if (fItems == null) {
fItems = new HashMap<Index, VirtualItem>(Math.max(1, Math.min(fItemCount, 16)));
}
}
-
+
private VirtualTree findTree() {
VirtualItem item = this;
while (!(item instanceof VirtualTree)) {
@@ -524,14 +524,14 @@ public class VirtualItem {
}
return (VirtualTree)item;
}
-
+
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
toStringItem(buffer, IInternalDebugCoreConstants.EMPTY_STRING);
return buffer.toString();
}
-
+
void toStringItem(StringBuffer buffer, String indent) {
buffer.append(indent);
buffer.append(toStringElement());
@@ -546,12 +546,12 @@ public class VirtualItem {
}
}
}
-
+
private String toStringElement() {
String[] label = (String[])fData.get(LABEL_KEY);
if (label != null && label.length != 0) {
return label[0];
- }
+ }
Object data = fData.get(ELEMENT_DATA_KEY);
if (data != null) {
return data.toString();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTree.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTree.java
index 41194464d..d6442c9c6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTree.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTree.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* IBM Corporation - bug fixing
@@ -19,8 +19,8 @@ import org.eclipse.swt.SWT;
/**
* Tree of virtual items that is analogous to SWT's tree control. The tree is used
- * by the {@link VirtualTreeModelViewer}.
- *
+ * by the {@link VirtualTreeModelViewer}.
+ *
* @see VirtualTreeModelViewer
* @since 3.8
*/
@@ -31,15 +31,15 @@ public class VirtualTree extends VirtualItem {
* except for the selected elements.
*/
private boolean fLazy;
-
+
private IVirtualItemValidator fValidator;
-
+
private class SelectedItemValidator implements IVirtualItemValidator {
@Override
public boolean isItemVisible(VirtualItem item) {
// visible items. For now only mark the selected items as visible.
for (int i = 0; i < fSelection.length; i++) {
- VirtualItem selectionItem = fSelection[i];
+ VirtualItem selectionItem = fSelection[i];
while (selectionItem != null) {
if (item.equals(selectionItem)) {
return true;
@@ -49,12 +49,12 @@ public class VirtualTree extends VirtualItem {
}
return false;
}
-
+
@Override
public void showItem(VirtualItem item) {
}
}
-
+
/**
* Set of listeners of the virtual tree.
*/
@@ -65,10 +65,10 @@ public class VirtualTree extends VirtualItem {
* the leaf items which are selected.
*/
private VirtualItem[] fSelection = new VirtualItem[0];
-
+
/**
* Constructs the virtual tree with the given style and validator.
- *
+ *
* @param style The style flag. Only SWT.VIRTUAL flag is used.
* @param validator Item validator used to determine item visibility.
*/
@@ -77,13 +77,13 @@ public class VirtualTree extends VirtualItem {
fLazy = (style & SWT.VIRTUAL) != 0;
if (fLazy && validator == null) {
fValidator = new SelectedItemValidator();
- } else {
+ } else {
fValidator = validator;
}
clearNeedsLabelUpdate();
clearNeedsDataUpdate();
}
-
+
/**
* Disposes the virtual tree.
*/
@@ -99,7 +99,7 @@ public class VirtualTree extends VirtualItem {
clearNeedsLabelUpdate();
clearNeedsDataUpdate();
}
-
+
@Override
public void setNeedsLabelUpdate() {
// no-op
@@ -112,9 +112,9 @@ public class VirtualTree extends VirtualItem {
clearNeedsDataUpdate();
}
}
-
+
/**
- * Adds a listener for when virtual items are revealed in the view.
+ * Adds a listener for when virtual items are revealed in the view.
* @param listener Listener to add to list of listeners.
*/
public void addItemListener(IVirtualItemListener listener) {
@@ -128,33 +128,33 @@ public class VirtualTree extends VirtualItem {
public VirtualItem[] getSelection() {
return fSelection;
}
-
+
public void setSelection(VirtualItem[] items) {
fSelection = items;
}
-
+
public void showItem(VirtualItem item) {
if (fValidator != null) {
fValidator.showItem(item);
}
}
-
+
public void fireItemDisposed(VirtualItem item) {
for (IVirtualItemListener listener : fVirtualItemListeners) {
listener.disposed(item);
}
}
-
+
public void fireItemRevealed(VirtualItem item) {
for (IVirtualItemListener listener : fVirtualItemListeners) {
listener.revealed(item);
- }
+ }
}
@Override
public void setData(Object data) {
super.setData(data);
- // The root item always has children as long as the input is non-null,
+ // The root item always has children as long as the input is non-null,
// so that it should be expanded.
setHasItems(data != null);
}
@@ -162,16 +162,16 @@ public class VirtualTree extends VirtualItem {
@Override
public void setHasItems(boolean hasChildren) {
super.setHasItems(hasChildren);
- // The root item is always expanded as long as it has children.
+ // The root item is always expanded as long as it has children.
if (hasChildren) {
setExpanded(true);
}
}
-
+
/**
- * Returns whether the given item is considered visible by the tree as
+ * Returns whether the given item is considered visible by the tree as
* determined by its virtual item validator.
- *
+ *
* @param item Item to check.
* @return true if items is vislble.
* @see IVirtualItemValidator
@@ -189,11 +189,11 @@ public class VirtualTree extends VirtualItem {
public void validate() {
validate(VirtualTree.this);
}
-
+
/**
- * Validates the item and its children, identifying children which were
+ * Validates the item and its children, identifying children which were
* revealed and need to be updated.
- *
+ *
* @param item The item which to validate.
*/
public void validate(VirtualItem item) {
@@ -207,7 +207,7 @@ public class VirtualTree extends VirtualItem {
fireItemRevealed(item);
}
}
-
+
if (item.getData() != null && item.getItemCount() > 0 && item.getExpanded()) {
for (int i = 0; i < item.getItemCount(); i++) {
validate(item.getItem(new Index(i)));
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTreeModelViewer.java
index e376ec92c..8e95ba664 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTreeModelViewer.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* IBM Corporation - initial API and implementation
@@ -18,15 +18,15 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IMemento;
/**
- * A virtual tree model viewer. This viewer does not have a user
+ * A virtual tree model viewer. This viewer does not have a user
* interface. Instead, clients configure and access the viewer's data through
* its public methods.
* <p>
* Style flags supported by this viewer are:
* <ul>
- * <li>SWT.VIRTUAL - Indicates that the viewer should be in lazy mode:
+ * <li>SWT.VIRTUAL - Indicates that the viewer should be in lazy mode:
* retrieving only elements that are requested.</li>
- * <li>SWT.POP_UP - Indicates that the viewer should ignore requests from the
+ * <li>SWT.POP_UP - Indicates that the viewer should ignore requests from the
* model to select, expand, or collapse tree elements.</li>
* </ul>
* </p>
@@ -34,7 +34,7 @@ import org.eclipse.ui.IMemento;
* @noextend This class is not intended to be sub-classed by clients.
*/
public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
-
+
/**
* Creates a virtual tree model viewer.
@@ -46,17 +46,17 @@ public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
public VirtualTreeModelViewer(Display display, int style, IPresentationContext context) {
super(display, style, context, null);
}
-
+
/**
* Creates a virtual tree model viewer.
* @param display Display used by the viewer to call the data providers
* on the UI thread.
* @param style style flags.
* @param context Viewer's presentation context.
- * @param validator Optional validator that is used to determine which items should be
- * considered visible when SWT.VIRTUAL style is used. If <code>null</code> then the
+ * @param validator Optional validator that is used to determine which items should be
+ * considered visible when SWT.VIRTUAL style is used. If <code>null</code> then the
* standard validator is used that updates only the selected items.
- *
+ *
* @since 3.8
*/
public VirtualTreeModelViewer(Display display, int style, IPresentationContext context, IVirtualItemValidator validator) {
@@ -65,37 +65,37 @@ public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
/**
* Returns this viewer's presentation context.
- *
+ *
* @return presentation context
*/
@Override
public IPresentationContext getPresentationContext() {
return super.getPresentationContext();
- }
+ }
/**
* Registers the given listener for model delta notification.
- *
+ *
* @param listener model delta listener
*/
@Override
public void addModelChangedListener(IModelChangedListener listener) {
- super.addModelChangedListener(listener);
+ super.addModelChangedListener(listener);
}
-
+
/**
* Unregisters the given listener from model delta notification.
- *
+ *
* @param listener model delta listener
*/
@Override
public void removeModelChangedListener(IModelChangedListener listener) {
super.removeModelChangedListener(listener);
- }
-
+ }
+
/**
* Registers the specified listener for view update notifications.
- *
+ *
* @param listener listener
*/
@Override
@@ -105,119 +105,119 @@ public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
/**
* Removes the specified listener from update notifications.
- *
+ *
* @param listener listener
*/
@Override
public void removeViewerUpdateListener(IViewerUpdateListener listener) {
super.removeViewerUpdateListener(listener);
}
-
+
/**
* Returns whether columns can be toggled on/off for this viewer's current
* input element.
- *
+ *
* @return whether columns can be toggled on/off
*/
@Override
public boolean canToggleColumns() {
return super.canToggleColumns();
- }
-
+ }
+
/**
* Returns the current column presentation for this viewer, or <code>null</code>
* if none.
- *
+ *
* @return column presentation or <code>null</code>
*/
@Override
public IColumnPresentation getColumnPresentation() {
return super.getColumnPresentation();
- }
-
+ }
+
/**
* Returns identifiers of the visible columns in this viewer, or <code>null</code>
* if there are currently no columns.
- *
+ *
* @return visible columns identifiers or <code>null</code>
*/
@Override
public String[] getVisibleColumns() {
return super.getVisibleColumns();
- }
-
+ }
+
/**
* Initializes viewer state from the memento
- *
+ *
* @param memento the {@link IMemento} to read from
*/
@Override
public void initState(IMemento memento) {
super.initState(memento);
}
-
+
/**
* Save viewer state into the given memento.
- *
+ *
* @param memento the {@link IMemento} to save to
*/
@Override
public void saveState(IMemento memento) {
super.saveState(memento);
}
-
+
/**
- * @return Returns true if columns are being displayed currently.
- */
+ * @return Returns true if columns are being displayed currently.
+ */
@Override
public boolean isShowColumns() {
return super.isShowColumns();
- }
-
+ }
+
/**
* Toggles columns on/off for the current column presentation, if any.
- *
+ *
* @param show whether to show columns if the current input supports
* columns
*/
@Override
public void setShowColumns(boolean show) {
super.setShowColumns(show);
- }
-
+ }
+
/**
- * Sets the visible columns for this viewer. Id's correspond to
+ * Sets the visible columns for this viewer. Id's correspond to
* column identifiers from a column presentation. Use <code>null</code>
* or an empty collection to display default columns for the current
* column presentation. Only affects the current column presentation.
- *
+ *
* @param ids column identifiers or <code>null</code>
*/
@Override
public void setVisibleColumns(String[] ids) {
super.setVisibleColumns(ids);
- }
+ }
@Override
public void updateViewer(IModelDelta delta) {
super.updateViewer(delta);
}
-
+
@Override
public ViewerLabel getElementLabel(TreePath path, String columnId) {
return super.getElementLabel(path, columnId);
}
-
+
@Override
public VirtualItem[] findItems(Object elementOrTreePath) {
return super.findItems(elementOrTreePath);
}
-
+
@Override
public VirtualItem findItem(TreePath path) {
return super.findItem(path);
}
-
-
+
+
}

Back to the top