From 06c0d8e309914dace144fdad202af84022fc4084 Mon Sep 17 00:00:00 2001 From: Pawel Piech Date: Tue, 7 Oct 2008 18:09:45 +0000 Subject: [PATCH] [245454] - Cleaned up cut-n-paste left overs from IVMUpdateScope implementations. --- .../update/AbstractCachingVMProvider.java | 25 ++++++++----------- .../ui/viewmodel/update/AllUpdateScope.java | 16 ------------ .../update/ViewModelUpdateMessages.properties | 8 +++--- .../viewmodel/update/VisibleUpdateScope.java | 16 ------------ 4 files changed, 14 insertions(+), 51 deletions(-) diff --git a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java index 9af35471274..6af86fa545c 100644 --- a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java +++ b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java @@ -730,16 +730,15 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa IVMModelProxyExtension proxyStrategyExtension = (IVMModelProxyExtension)proxyStrategy; if(fDelayEventHandleForViewUpdate) { if(this.getActiveUpdateScope().getID().equals(AllUpdateScope.ALL_UPDATE_SCOPE_ID)) { - MultiLevelUpdateHandler handler = new MultiLevelUpdateHandler( - getExecutor(), proxyStrategyExtension, getPresentationContext(), this, new RequestMonitor(getExecutor(), null) { - @Override - protected void handleCompleted() { - AbstractCachingVMProvider.super.handleEvent(proxyStrategy, event, rm); - } - }); - handler.startUpdate(); + CountingRequestMonitor countingRm = new CountingRequestMonitor(getExecutor(), rm); + countingRm.setDoneCount(2); + new MultiLevelUpdateHandler(getExecutor(), proxyStrategyExtension, getPresentationContext(), this, countingRm). + startUpdate(); + AbstractCachingVMProvider.super.handleEvent(proxyStrategy, event, countingRm); } 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(); Tree tree = viewer.getTree(); @@ -749,14 +748,10 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa int index = computeTreeIndex(topItem); MultiLevelUpdateHandler handler = new MultiLevelUpdateHandler( - getExecutor(), proxyStrategyExtension, getPresentationContext(), this, new RequestMonitor(getExecutor(), null) { - @Override - protected void handleCompleted() { - AbstractCachingVMProvider.super.handleEvent(proxyStrategy, event, rm); - } - }); + getExecutor(), proxyStrategyExtension, getPresentationContext(), this, countingRm); handler.setRange(index, index + count); handler.startUpdate(); + AbstractCachingVMProvider.super.handleEvent(proxyStrategy, event, countingRm); } } else { if(this.getActiveUpdateScope().getID().equals(AllUpdateScope.ALL_UPDATE_SCOPE_ID)) diff --git a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AllUpdateScope.java b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AllUpdateScope.java index ae1150026c1..720321eb387 100644 --- a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AllUpdateScope.java +++ b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AllUpdateScope.java @@ -10,7 +10,6 @@ *******************************************************************************/ 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 @@ -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 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() { return ALL_UPDATE_SCOPE_ID; } diff --git a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/ViewModelUpdateMessages.properties b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/ViewModelUpdateMessages.properties index 002d04b01d6..9de3c47ec66 100644 --- a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/ViewModelUpdateMessages.properties +++ b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/ViewModelUpdateMessages.properties @@ -8,7 +8,7 @@ # Contributors: # Wind River Systems - initial API and implementation ############################################################################### -AutomaticUpdatePolicy_name = Automatic -ManualUpdatePolicy_name = Manual -AllUpdateScope_name = All Elements -VisibleUpdateScope_name== Visible Elements \ No newline at end of file +AutomaticUpdatePolicy_name=Automatic +ManualUpdatePolicy_name=Manual +AllUpdateScope_name=All Elements +VisibleUpdateScope_name=Visible Elements \ No newline at end of file diff --git a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/VisibleUpdateScope.java b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/VisibleUpdateScope.java index 5201f166a08..e7475d2478e 100644 --- a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/VisibleUpdateScope.java +++ b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/VisibleUpdateScope.java @@ -10,7 +10,6 @@ *******************************************************************************/ 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 @@ -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 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() { return VISIBLE_UPDATE_SCOPE_ID; }