1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

[245454] - Cleaned up cut-n-paste left overs from IVMUpdateScope implementations.

This commit is contained in:
Pawel Piech 2008-10-07 18:09:45 +00:00
parent 4db894ab5d
commit 06c0d8e309
4 changed files with 14 additions and 51 deletions

View file

@ -730,16 +730,15 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
IVMModelProxyExtension proxyStrategyExtension = (IVMModelProxyExtension)proxyStrategy; IVMModelProxyExtension proxyStrategyExtension = (IVMModelProxyExtension)proxyStrategy;
if(fDelayEventHandleForViewUpdate) { if(fDelayEventHandleForViewUpdate) {
if(this.getActiveUpdateScope().getID().equals(AllUpdateScope.ALL_UPDATE_SCOPE_ID)) { if(this.getActiveUpdateScope().getID().equals(AllUpdateScope.ALL_UPDATE_SCOPE_ID)) {
MultiLevelUpdateHandler handler = new MultiLevelUpdateHandler( CountingRequestMonitor countingRm = new CountingRequestMonitor(getExecutor(), rm);
getExecutor(), proxyStrategyExtension, getPresentationContext(), this, new RequestMonitor(getExecutor(), null) { countingRm.setDoneCount(2);
@Override new MultiLevelUpdateHandler(getExecutor(), proxyStrategyExtension, getPresentationContext(), this, countingRm).
protected void handleCompleted() { startUpdate();
AbstractCachingVMProvider.super.handleEvent(proxyStrategy, event, rm); AbstractCachingVMProvider.super.handleEvent(proxyStrategy, event, countingRm);
}
});
handler.startUpdate();
} else { } else {
// block updating only the viewport // block updating only the viewport
CountingRequestMonitor countingRm = new CountingRequestMonitor(getExecutor(), rm);
countingRm.setDoneCount(2);
TreeViewer viewer = (TreeViewer) proxyStrategyExtension.getViewer(); TreeViewer viewer = (TreeViewer) proxyStrategyExtension.getViewer();
Tree tree = viewer.getTree(); Tree tree = viewer.getTree();
@ -749,14 +748,10 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
int index = computeTreeIndex(topItem); int index = computeTreeIndex(topItem);
MultiLevelUpdateHandler handler = new MultiLevelUpdateHandler( MultiLevelUpdateHandler handler = new MultiLevelUpdateHandler(
getExecutor(), proxyStrategyExtension, getPresentationContext(), this, new RequestMonitor(getExecutor(), null) { getExecutor(), proxyStrategyExtension, getPresentationContext(), this, countingRm);
@Override
protected void handleCompleted() {
AbstractCachingVMProvider.super.handleEvent(proxyStrategy, event, rm);
}
});
handler.setRange(index, index + count); handler.setRange(index, index + count);
handler.startUpdate(); handler.startUpdate();
AbstractCachingVMProvider.super.handleEvent(proxyStrategy, event, countingRm);
} }
} else { } else {
if(this.getActiveUpdateScope().getID().equals(AllUpdateScope.ALL_UPDATE_SCOPE_ID)) if(this.getActiveUpdateScope().getID().equals(AllUpdateScope.ALL_UPDATE_SCOPE_ID))

View file

@ -10,7 +10,6 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.dd.dsf.ui.viewmodel.update; package org.eclipse.dd.dsf.ui.viewmodel.update;
import org.eclipse.jface.viewers.TreePath;
/** /**
* An "automatic" update policy which causes the view model provider cache to * An "automatic" update policy which causes the view model provider cache to
@ -23,21 +22,6 @@ public class AllUpdateScope implements IVMUpdateScope {
public static String ALL_UPDATE_SCOPE_ID = "org.eclipse.dd.dsf.ui.viewmodel.update.allUpdateScope"; //$NON-NLS-1$ public static String ALL_UPDATE_SCOPE_ID = "org.eclipse.dd.dsf.ui.viewmodel.update.allUpdateScope"; //$NON-NLS-1$
public static IElementUpdateTester fgUpdateTester = new IElementUpdateTester() {
public int getUpdateFlags(Object viewerInput, TreePath path) {
return 0;
}
public boolean includes(IElementUpdateTester tester) {
return tester.equals(this);
}
@Override
public String toString() {
return ViewModelUpdateMessages.AllUpdateScope_name;
}
};
public String getID() { public String getID() {
return ALL_UPDATE_SCOPE_ID; return ALL_UPDATE_SCOPE_ID;
} }

View file

@ -11,4 +11,4 @@
AutomaticUpdatePolicy_name=Automatic AutomaticUpdatePolicy_name=Automatic
ManualUpdatePolicy_name=Manual ManualUpdatePolicy_name=Manual
AllUpdateScope_name=All Elements AllUpdateScope_name=All Elements
VisibleUpdateScope_name== Visible Elements VisibleUpdateScope_name=Visible Elements

View file

@ -10,7 +10,6 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.dd.dsf.ui.viewmodel.update; package org.eclipse.dd.dsf.ui.viewmodel.update;
import org.eclipse.jface.viewers.TreePath;
/** /**
* An "automatic" update policy which causes the view model provider cache to * An "automatic" update policy which causes the view model provider cache to
@ -22,21 +21,6 @@ public class VisibleUpdateScope implements IVMUpdateScope {
public static String VISIBLE_UPDATE_SCOPE_ID = "org.eclipse.dd.dsf.ui.viewmodel.update.visibleUpdateScope"; //$NON-NLS-1$ public static String VISIBLE_UPDATE_SCOPE_ID = "org.eclipse.dd.dsf.ui.viewmodel.update.visibleUpdateScope"; //$NON-NLS-1$
public static IElementUpdateTester fgUpdateTester = new IElementUpdateTester() {
public int getUpdateFlags(Object viewerInput, TreePath path) {
return 0;
}
public boolean includes(IElementUpdateTester tester) {
return tester.equals(this);
}
@Override
public String toString() {
return ViewModelUpdateMessages.VisibleUpdateScope_name;
}
};
public String getID() { public String getID() {
return VISIBLE_UPDATE_SCOPE_ID; return VISIBLE_UPDATE_SCOPE_ID;
} }