mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-04 15:45:25 +02:00
Bugzilla entry 195703
AbstractVMlayoutNode.java Perform a update.done() even if the update has been cancelled. AbstractVMProvider.java Perform a update.done() even if the update has been cancelled. VMelementsCountUpdate.java Change assert to allow for the cancelling of the update VMHasElementsUpdate.java Change assert to allow for the cancelling of the update. VMViewerUpdate.java Create a negative status when an update is cancelled. Otherwise the getData() will be called and used when there is no valid data. Randy Rohrbach 781-364-2226
This commit is contained in:
parent
bd8ee802ca
commit
b838894fc8
5 changed files with 18 additions and 7 deletions
|
@ -330,7 +330,10 @@ abstract public class AbstractVMLayoutNode implements IVMLayoutNode {
|
|||
* that the layout node depends on, are not available.
|
||||
*/
|
||||
protected boolean checkUpdate(IViewerUpdate update) {
|
||||
if (update.isCanceled()) return false;
|
||||
if (update.isCanceled()) {
|
||||
update.done();
|
||||
return false;
|
||||
}
|
||||
if (fDisposed) {
|
||||
handleFailedUpdate(update);
|
||||
return false;
|
||||
|
|
|
@ -159,7 +159,7 @@ abstract public class AbstractVMProvider implements IVMProvider
|
|||
if (layoutNode == null) {
|
||||
// Stale update, most likely as a result of the layout nodes being
|
||||
// changed. Just ignore it.
|
||||
if (!update.isCanceled()) update.done();
|
||||
update.done();
|
||||
continue;
|
||||
}
|
||||
if (!nodeUpdatesMap.containsKey(layoutNode)) {
|
||||
|
@ -240,7 +240,10 @@ abstract public class AbstractVMProvider implements IVMProvider
|
|||
|
||||
public void update(final IChildrenCountUpdate[] updates) {
|
||||
for (final IChildrenCountUpdate update : updates) {
|
||||
if (update.isCanceled()) continue;
|
||||
if (update.isCanceled()) {
|
||||
update.done();
|
||||
continue;
|
||||
}
|
||||
|
||||
getChildrenCountsForNode(
|
||||
update,
|
||||
|
@ -346,7 +349,7 @@ abstract public class AbstractVMProvider implements IVMProvider
|
|||
final IVMLayoutNode layoutNode = getLayoutNodeForElement(update.getElement());
|
||||
if (layoutNode == null) {
|
||||
// Stale update. Just ignore.
|
||||
if (!update.isCanceled()) update.done();
|
||||
update.done();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -356,7 +359,7 @@ abstract public class AbstractVMProvider implements IVMProvider
|
|||
new MultiRequestMonitor<RequestMonitor>(getExecutor(), null) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (!update.isCanceled()) update.done();
|
||||
update.done();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ public class VMElementsCountUpdate extends VMViewerUpdate implements IChildrenCo
|
|||
|
||||
@Override
|
||||
public void done() {
|
||||
assert fCountRequestMonitor.getData() != null || !fCountRequestMonitor.getStatus().isOK();
|
||||
assert isCanceled() || fCountRequestMonitor.getData() != null || !fCountRequestMonitor.getStatus().isOK();
|
||||
super.done();
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ public class VMHasElementsUpdate extends VMViewerUpdate implements IHasChildrenU
|
|||
|
||||
@Override
|
||||
public void done() {
|
||||
assert fHasElemsRequestMonitor.getData() != null || !fHasElemsRequestMonitor.getStatus().isOK();
|
||||
assert isCanceled() || fHasElemsRequestMonitor.getData() != null || !fHasElemsRequestMonitor.getStatus().isOK();
|
||||
super.done();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,9 @@ package org.eclipse.dd.dsf.ui.viewmodel;
|
|||
import java.util.concurrent.RejectedExecutionException;
|
||||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||
import org.eclipse.dd.dsf.ui.DsfUIPlugin;
|
||||
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
|
||||
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
|
||||
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
|
||||
|
@ -46,6 +48,9 @@ public class VMViewerUpdate implements IViewerUpdate {
|
|||
|
||||
public void done() {
|
||||
try {
|
||||
if ( isCanceled() ) {
|
||||
fRequestMonitor.setStatus(new Status( IStatus.CANCEL, DsfUIPlugin.PLUGIN_ID," Update was cancelled") ); //$NON-NLS-1$
|
||||
}
|
||||
fRequestMonitor.done();
|
||||
} catch (RejectedExecutionException e) { // Ignore
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue