mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
[251452] - [update policies] Add a "Refresh All" action.
This commit is contained in:
parent
97ce30ebc7
commit
70dec0bd0d
19 changed files with 688 additions and 207 deletions
|
@ -48,10 +48,10 @@
|
|||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/IExpressionUpdate.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.IExpressionUpdate">
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterCellModifier.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterCellModifier">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.IExpressionUpdate"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterCellModifier"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
|
@ -64,10 +64,10 @@
|
|||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterCellModifier.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterCellModifier">
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/IExpressionUpdate.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.IExpressionUpdate">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterCellModifier"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.IExpressionUpdate"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
|
@ -88,14 +88,6 @@
|
|||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/BreakpointHitUpdatePolicy.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.BreakpointHitUpdatePolicy">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.BreakpointHitUpdatePolicy"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterBitFieldCellModifier.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterBitFieldCellModifier">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
|
@ -104,6 +96,14 @@
|
|||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/BreakpointHitUpdatePolicy.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.BreakpointHitUpdatePolicy">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.BreakpointHitUpdatePolicy"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/ExpressionVMProvider.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.ExpressionVMProvider">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
|
@ -192,14 +192,6 @@
|
|||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/variable/SyncVariableDataAccess.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.SyncVariableDataAccess">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.SyncVariableDataAccess"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/AbstractExpressionVMNode.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.AbstractExpressionVMNode">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
|
@ -208,6 +200,14 @@
|
|||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/variable/SyncVariableDataAccess.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.SyncVariableDataAccess">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.SyncVariableDataAccess"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModulesVMNode.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules.ModulesVMNode">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
|
@ -224,14 +224,6 @@
|
|||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/RefreshActionDelegate.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.RefreshActionDelegate">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.RefreshActionDelegate"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/IFormattedValueVMContext.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.IFormattedValueVMContext">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
|
@ -264,14 +256,6 @@
|
|||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/variable/VariableCellModifier.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableCellModifier">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableCellModifier"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/FormattedValuePreferenceStore.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.FormattedValuePreferenceStore">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
|
@ -280,6 +264,14 @@
|
|||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/variable/VariableCellModifier.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableCellModifier">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableCellModifier"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/ExpressionVMProviderModelProxyStrategy.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.ExpressionVMProviderModelProxyStrategy">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
|
@ -288,6 +280,22 @@
|
|||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterVMNode.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterVMNode">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterVMNode"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/variable/VariableColumnPresentation.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableColumnPresentation">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableColumnPresentation"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="META-INF/MANIFEST.MF" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.AutomaticUpdatePolicyAction">
|
||||
<filter id="305324134">
|
||||
<message_arguments>
|
||||
|
@ -336,14 +344,6 @@
|
|||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="META-INF/MANIFEST.MF">
|
||||
<filter id="923795461">
|
||||
<message_arguments>
|
||||
<message_argument value="1.1.0.qualifier"/>
|
||||
<message_argument value="1.0.0.v20080609"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="META-INF/MANIFEST.MF" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.SelectUpdatePolicyAction">
|
||||
<filter id="305324134">
|
||||
<message_arguments>
|
||||
|
@ -352,6 +352,14 @@
|
|||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="META-INF/MANIFEST.MF">
|
||||
<filter id="923795461">
|
||||
<message_arguments>
|
||||
<message_argument value="1.1.0.qualifier"/>
|
||||
<message_argument value="1.0.0.v20080609"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="META-INF/MANIFEST.MF" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.actions.SetDefaultFormatBinary">
|
||||
<filter id="305324134">
|
||||
<message_arguments>
|
||||
|
@ -368,6 +376,14 @@
|
|||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="META-INF/MANIFEST.MF" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.RefreshActionDelegate">
|
||||
<filter id="305324134">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.RefreshActionDelegate"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="META-INF/MANIFEST.MF" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.actions.SetDefaultFormatDecimal">
|
||||
<filter id="305324134">
|
||||
<message_arguments>
|
||||
|
@ -376,20 +392,4 @@
|
|||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/variable/VariableColumnPresentation.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableColumnPresentation">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableColumnPresentation"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterVMNode.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterVMNode">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterVMNode"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
</component>
|
||||
|
|
|
@ -37,7 +37,6 @@ Export-Package:
|
|||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat;x-internal:=true,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register;x-internal:=true,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update;x-internal:=true,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions;x-internal:=true,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable;x-internal:=true,
|
||||
org.eclipse.dd.dsf.debug.ui,
|
||||
org.eclipse.dd.dsf.debug.ui.actions,
|
||||
|
|
|
@ -28,8 +28,6 @@ commandContext.description= When debugging in assembly mode
|
|||
# actions
|
||||
action.breakpointProperties.label = Breakpoint Properties...
|
||||
|
||||
action.refresh.label = Refresh
|
||||
|
||||
menu.updatePolicy = Update Policy
|
||||
menu.threadsUpdatePolicy = Threads Update Policy
|
||||
menu.updateScope = Update Scope
|
||||
|
@ -40,6 +38,10 @@ preferencePage.name = DSF
|
|||
|
||||
action.expandStack.label = E&xpand Stack
|
||||
|
||||
action.refreshAll.name=Refresh Debug Views
|
||||
|
||||
command.refresh.name=Refresh
|
||||
|
||||
# Preferences
|
||||
|
||||
debugCallStack = Debug Call Stack
|
||||
|
|
|
@ -55,61 +55,6 @@
|
|||
</specification>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="org.eclipse.ui.viewActions">
|
||||
<!-- Variables View menu contributions -->
|
||||
<viewContribution
|
||||
id="org.eclipse.dd.dsf.debug.ui.viewmodel.update.Refresh"
|
||||
targetID="org.eclipse.debug.ui.VariableView">
|
||||
<action
|
||||
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.RefreshActionDelegate"
|
||||
icon="icons/refresh.gif"
|
||||
id="org.eclipse.dd.dsf.debug.ui.viewmodel.update.actions.Refresh"
|
||||
label="%action.refresh.label"
|
||||
toolbarPath="additions">
|
||||
</action>
|
||||
</viewContribution>
|
||||
|
||||
<!-- Registers View menu contributions -->
|
||||
<viewContribution
|
||||
id="org.eclipse.dd.dsf.debug.ui.viewmodel.update.Refresh"
|
||||
targetID="org.eclipse.debug.ui.RegisterView">
|
||||
<action
|
||||
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.RefreshActionDelegate"
|
||||
icon="icons/refresh.gif"
|
||||
id="org.eclipse.dd.dsf.debug.ui.viewmodel.update.actions.Refresh"
|
||||
label="%action.refresh.label"
|
||||
toolbarPath="additions">
|
||||
</action>
|
||||
</viewContribution>
|
||||
|
||||
<!-- Expressions View menu contributions -->
|
||||
<viewContribution
|
||||
id="org.eclipse.dd.dsf.debug.ui.viewmodel.update.Refresh"
|
||||
targetID="org.eclipse.debug.ui.ExpressionView">
|
||||
<action
|
||||
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.RefreshActionDelegate"
|
||||
icon="icons/refresh.gif"
|
||||
id="org.eclipse.dd.dsf.debug.ui.viewmodel.update.actions.Refresh"
|
||||
label="%action.refresh.label"
|
||||
toolbarPath="additions">
|
||||
</action>
|
||||
</viewContribution>
|
||||
|
||||
<!-- Debug View menu contributions -->
|
||||
<viewContribution
|
||||
id="org.eclipse.dd.dsf.debug.ui.viewmodel.update.debugView.Refresh"
|
||||
targetID="org.eclipse.debug.ui.DebugView">
|
||||
<action
|
||||
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.RefreshActionDelegate"
|
||||
icon="icons/refresh.gif"
|
||||
id="org.eclipse.dd.dsf.debug.ui.viewmodel.update.actions.Refresh"
|
||||
label="%action.refresh.label"
|
||||
toolbarPath="additions">
|
||||
</action>
|
||||
</viewContribution>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="org.eclipse.ui.menus">
|
||||
<!-- Debug view menu commands -->
|
||||
|
@ -140,9 +85,21 @@
|
|||
</visibleWhen>
|
||||
<dynamic
|
||||
id="org.eclipse.dd.dsf.debug.ui.UpdatePolicies"
|
||||
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.UpdatePoliciesContribution">
|
||||
class="org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions.UpdatePoliciesContribution">
|
||||
</dynamic>
|
||||
</menu>
|
||||
</menu>
|
||||
</menuContribution>
|
||||
<menuContribution
|
||||
locationURI="toolbar:org.eclipse.debug.ui.DebugView?after=additions">
|
||||
<command
|
||||
commandId="org.eclipse.ui.file.refresh"
|
||||
icon="icons/refresh.gif"
|
||||
style="push"
|
||||
label="%command.refresh.name">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference definitionId="org.eclipse.dd.dsf.debug.ui.testAreUpdatePoliciesSupported"/>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
|
||||
<!-- Registers view menu commands -->
|
||||
|
@ -162,7 +119,7 @@
|
|||
</visibleWhen>
|
||||
<dynamic
|
||||
id="org.eclipse.dd.dsf.debug.ui.registersUpdatePolicies"
|
||||
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.UpdatePoliciesContribution">
|
||||
class="org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions.UpdatePoliciesContribution">
|
||||
</dynamic>
|
||||
</menu>
|
||||
<menu
|
||||
|
@ -173,7 +130,7 @@
|
|||
</visibleWhen>
|
||||
<dynamic
|
||||
id="org.eclipse.dd.dsf.debug.ui.registersUpdateScopes"
|
||||
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.UpdateScopesContribution">
|
||||
class="org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions.UpdateScopesContribution">
|
||||
</dynamic>
|
||||
</menu>
|
||||
</menuContribution>
|
||||
|
@ -191,6 +148,18 @@
|
|||
</dynamic>
|
||||
</menu>
|
||||
</menuContribution>
|
||||
<menuContribution
|
||||
locationURI="toolbar:org.eclipse.debug.ui.RegisterView?after=additions">
|
||||
<command
|
||||
commandId="org.eclipse.ui.file.refresh"
|
||||
icon="icons/refresh.gif"
|
||||
style="push"
|
||||
label="%command.refresh.name">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference definitionId="org.eclipse.dd.dsf.debug.ui.testAreUpdatePoliciesSupported"/>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
|
||||
<!-- Variables view menu commands -->
|
||||
<menuContribution
|
||||
|
@ -209,7 +178,7 @@
|
|||
</visibleWhen>
|
||||
<dynamic
|
||||
id="org.eclipse.dd.dsf.debug.ui.variablesUpdatePolicies"
|
||||
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.UpdatePoliciesContribution">
|
||||
class="org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions.UpdatePoliciesContribution">
|
||||
</dynamic>
|
||||
</menu>
|
||||
<menu
|
||||
|
@ -220,7 +189,7 @@
|
|||
</visibleWhen>
|
||||
<dynamic
|
||||
id="org.eclipse.dd.dsf.debug.ui.variablesUpdateScopes"
|
||||
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.UpdateScopesContribution">
|
||||
class="org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions.UpdateScopesContribution">
|
||||
</dynamic>
|
||||
</menu>
|
||||
</menuContribution>
|
||||
|
@ -238,6 +207,18 @@
|
|||
</dynamic>
|
||||
</menu>
|
||||
</menuContribution>
|
||||
<menuContribution
|
||||
locationURI="toolbar:org.eclipse.debug.ui.VariableView?after=additions">
|
||||
<command
|
||||
commandId="org.eclipse.ui.file.refresh"
|
||||
icon="icons/refresh.gif"
|
||||
style="push"
|
||||
label="%command.refresh.name">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference definitionId="org.eclipse.dd.dsf.debug.ui.testAreUpdatePoliciesSupported"/>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
|
||||
<!-- Expressions view menu commands -->
|
||||
<menuContribution
|
||||
|
@ -256,7 +237,7 @@
|
|||
</visibleWhen>
|
||||
<dynamic
|
||||
id="org.eclipse.dd.dsf.debug.ui.expressionUpdatePolicies"
|
||||
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.UpdatePoliciesContribution">
|
||||
class="org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions.UpdatePoliciesContribution">
|
||||
</dynamic>
|
||||
</menu>
|
||||
<menu
|
||||
|
@ -267,7 +248,7 @@
|
|||
</visibleWhen>
|
||||
<dynamic
|
||||
id="org.eclipse.dd.dsf.debug.ui.expressionUpdateScopes"
|
||||
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.UpdateScopesContribution">
|
||||
class="org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions.UpdateScopesContribution">
|
||||
</dynamic>
|
||||
</menu>
|
||||
</menuContribution>
|
||||
|
@ -285,8 +266,30 @@
|
|||
</dynamic>
|
||||
</menu>
|
||||
</menuContribution>
|
||||
<menuContribution
|
||||
locationURI="toolbar:org.eclipse.debug.ui.ExpressionView?after=additions">
|
||||
<command
|
||||
commandId="org.eclipse.ui.file.refresh"
|
||||
icon="icons/refresh.gif"
|
||||
style="push"
|
||||
label="%command.refresh.name">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference definitionId="org.eclipse.dd.dsf.debug.ui.testAreUpdatePoliciesSupported"/>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.ui.handlers">
|
||||
<handler
|
||||
class="org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions.RefreshHandler"
|
||||
commandId="org.eclipse.ui.file.refresh">
|
||||
<activeWhen>
|
||||
<reference definitionId="org.eclipse.dd.dsf.debug.ui.testAreUpdatePoliciesSupported"/>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="org.eclipse.core.expressions.definitions">
|
||||
<definition
|
||||
|
@ -297,6 +300,11 @@
|
|||
args="org.eclipse.dd.dsf.debug.ui"
|
||||
value="ACTIVE"/>
|
||||
</with>
|
||||
<with variable="activeContexts">
|
||||
<iterate operator="or">
|
||||
<equals value="org.eclipse.dd.dsf.debug.ui.updateModes"/>
|
||||
</iterate>
|
||||
</with>
|
||||
<or>
|
||||
<with variable="activePart">
|
||||
<test property="org.eclipse.dd.dsf.debug.ui.areUpdatePoliciesSupported"/>
|
||||
|
@ -315,6 +323,11 @@
|
|||
args="org.eclipse.dd.dsf.debug.ui"
|
||||
value="ACTIVE"/>
|
||||
</with>
|
||||
<with variable="activeContexts">
|
||||
<iterate operator="or">
|
||||
<equals value="org.eclipse.dd.dsf.debug.ui.updateModes"/>
|
||||
</iterate>
|
||||
</with>
|
||||
<or>
|
||||
<with variable="activePart">
|
||||
<test property="org.eclipse.dd.dsf.debug.ui.areUpdateScopesSupported"/>
|
||||
|
@ -348,14 +361,14 @@
|
|||
<extension
|
||||
point="org.eclipse.core.expressions.propertyTesters">
|
||||
<propertyTester
|
||||
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.UpdatePoliciesPropertyTester"
|
||||
class="org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions.UpdatePoliciesPropertyTester"
|
||||
id="org.eclipse.dd.dsf.debug.ui.selectionUpdatePoliciesTester"
|
||||
namespace="org.eclipse.dd.dsf.debug.ui"
|
||||
properties="areUpdatePoliciesSupported,isUpdatePolicyAvailable,isUpdatePolicyActive"
|
||||
type="org.eclipse.dd.dsf.ui.viewmodel.IVMContext">
|
||||
</propertyTester>
|
||||
<propertyTester
|
||||
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.UpdatePoliciesPropertyTester"
|
||||
class="org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions.UpdatePoliciesPropertyTester"
|
||||
id="org.eclipse.dd.dsf.debug.ui.partUpdatePoliciesTester"
|
||||
namespace="org.eclipse.dd.dsf.debug.ui"
|
||||
properties="areUpdatePoliciesSupported,isUpdatePolicyAvailable,isUpdatePolicyActive"
|
||||
|
@ -363,14 +376,14 @@
|
|||
</propertyTester>
|
||||
|
||||
<propertyTester
|
||||
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.UpdateScopesPropertyTester"
|
||||
class="org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions.UpdateScopesPropertyTester"
|
||||
id="org.eclipse.dd.dsf.debug.ui.selectionUpdateScopesTester"
|
||||
namespace="org.eclipse.dd.dsf.debug.ui"
|
||||
properties="areUpdateScopesSupported,isUpdateScopeAvailable,isUpdateScopeActive"
|
||||
type="org.eclipse.dd.dsf.ui.viewmodel.IVMContext">
|
||||
</propertyTester>
|
||||
<propertyTester
|
||||
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.UpdateScopesPropertyTester"
|
||||
class="org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions.UpdateScopesPropertyTester"
|
||||
id="org.eclipse.dd.dsf.debug.ui.partUpdateScopesTester"
|
||||
namespace="org.eclipse.dd.dsf.debug.ui"
|
||||
properties="areUpdateScopesSupported,isUpdateScopeAvailable,isUpdateScopeActive"
|
||||
|
@ -552,5 +565,22 @@
|
|||
</action>
|
||||
</objectContribution>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="org.eclipse.ui.actionSets">
|
||||
<actionSet
|
||||
id="org.eclipse.dd.dsf.debug.ui.updateModes"
|
||||
label="Debug Update Modes">
|
||||
<action
|
||||
class="org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions.RefreshAllRetargetAction"
|
||||
definitionId="org.eclipse.dd.dsf.debug.ui.refreshAll"
|
||||
helpContextId="org.eclipse.dd.dsf.debug.ui.refreshAll_context"
|
||||
icon="icons/refreshall.gif"
|
||||
id="org.eclipse.dd.dsf.debug.ui.refreshAll"
|
||||
label="%action.refreshAll.name"
|
||||
menubarPath="window/additions"
|
||||
toolbarPath="org.eclipse.ui.dd.dsf.debug.ui.actionSet.update_modes/debugUpdateModes">
|
||||
</action>
|
||||
</actionSet>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Wind River Systems and others.
|
||||
* 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:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
|
||||
/**
|
||||
* A retargetable action target which allows a debugger to refresh all of its
|
||||
* active views with fresh data from the debug target.
|
||||
*
|
||||
* @since 1.1
|
||||
*/
|
||||
public interface IRefreshAllTarget {
|
||||
|
||||
/**
|
||||
* Refreshes the debugger data of the given debug context.
|
||||
* @param debugContext The active window debug context.
|
||||
*
|
||||
* @throws CoreException
|
||||
*/
|
||||
public void refresh(ISelection debugContext) throws CoreException;
|
||||
}
|
|
@ -10,6 +10,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions;
|
||||
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.IVMAdapter;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.IVMContext;
|
||||
|
@ -27,6 +28,7 @@ import org.eclipse.ui.ISelectionService;
|
|||
import org.eclipse.ui.IViewPart;
|
||||
import org.eclipse.ui.IViewSite;
|
||||
import org.eclipse.ui.IWorkbenchPart;
|
||||
import org.eclipse.ui.handlers.HandlerUtil;
|
||||
import org.eclipse.ui.services.IServiceLocator;
|
||||
|
||||
/**
|
||||
|
@ -36,7 +38,7 @@ import org.eclipse.ui.services.IServiceLocator;
|
|||
* @since 1.1
|
||||
*/
|
||||
@SuppressWarnings("restriction")
|
||||
public class VMCommandUtils {
|
||||
public class VMHandlerUtils {
|
||||
|
||||
/**
|
||||
* Retrieves the active VM provider based on the currently active
|
||||
|
@ -67,7 +69,25 @@ public class VMCommandUtils {
|
|||
return getVMProviderForPart(part);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves the active VM provider based on the given execution event.
|
||||
* @param event The execution event which is usually given as an argument
|
||||
* to the command handler execution call.
|
||||
*
|
||||
* @return The active VM provder.
|
||||
*/
|
||||
static public IVMProvider getActiveVMProvider(ExecutionEvent event) {
|
||||
ISelection selection = HandlerUtil.getCurrentSelection(event);
|
||||
if (selection != null && !selection.isEmpty()) {
|
||||
return getVMProviderForSelection(selection);
|
||||
}
|
||||
else {
|
||||
IWorkbenchPart part = HandlerUtil.getActivePart(event);
|
||||
return getVMProviderForPart(part);
|
||||
}
|
||||
}
|
||||
|
||||
public static IVMProvider getVMProviderForPart(IWorkbenchPart part) {
|
||||
IDebugContextService contextService =
|
||||
DebugUITools.getDebugContextManager().getContextService(part.getSite().getWorkbenchWindow());
|
|
@ -16,7 +16,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.IDebugVMConstants;
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions.VMCommandUtils;
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions.VMHandlerUtils;
|
||||
import org.eclipse.dd.dsf.debug.service.IFormattedValues;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.IVMProvider;
|
||||
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
|
||||
|
@ -87,7 +87,7 @@ public class NumberFormatsContribution extends CompoundContributionItem implemen
|
|||
|
||||
@Override
|
||||
protected IContributionItem[] getContributionItems() {
|
||||
IVMProvider provider = VMCommandUtils.getActiveVMProvider(fServiceLocator);
|
||||
IVMProvider provider = VMHandlerUtils.getActiveVMProvider(fServiceLocator);
|
||||
|
||||
// If no part or selection, disable all.
|
||||
if (provider == null) {
|
||||
|
|
|
@ -15,7 +15,7 @@ import java.util.List;
|
|||
|
||||
import org.eclipse.core.expressions.PropertyTester;
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.IDebugVMConstants;
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions.VMCommandUtils;
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions.VMHandlerUtils;
|
||||
import org.eclipse.dd.dsf.debug.service.IFormattedValues;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.IVMContext;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.IVMProvider;
|
||||
|
@ -65,7 +65,7 @@ public class NumberFormatsPropertyTester extends PropertyTester {
|
|||
return testProvider(provider, property, expectedValue);
|
||||
}
|
||||
} else if (receiver instanceof IDebugView) {
|
||||
IVMProvider provider = VMCommandUtils.getVMProviderForPart((IDebugView)receiver);
|
||||
IVMProvider provider = VMHandlerUtils.getVMProviderForPart((IDebugView)receiver);
|
||||
if (provider != null) {
|
||||
return testProvider(provider, property, expectedValue);
|
||||
}
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2008 Wind River Systems and others.
|
||||
* 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:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions;
|
||||
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions.AbstractVMProviderActionDelegate;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.IVMProvider;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.update.ICachingVMProvider;
|
||||
import org.eclipse.debug.ui.contexts.DebugContextEvent;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.ui.IViewPart;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class RefreshActionDelegate extends AbstractVMProviderActionDelegate {
|
||||
|
||||
public void run(IAction action) {
|
||||
IVMProvider provider = getVMProvider();
|
||||
if (provider instanceof ICachingVMProvider) {
|
||||
((ICachingVMProvider)provider).refresh();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(IViewPart view) {
|
||||
super.init(view);
|
||||
getAction().setEnabled(getVMProvider() instanceof ICachingVMProvider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debugContextChanged(DebugContextEvent event) {
|
||||
super.debugContextChanged(event);
|
||||
getAction().setEnabled(getVMProvider() instanceof ICachingVMProvider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectionChanged(IAction action, ISelection selection) {
|
||||
super.selectionChanged(action, selection);
|
||||
getAction().setEnabled(getVMProvider() instanceof ICachingVMProvider);
|
||||
}
|
||||
}
|
|
@ -9,21 +9,24 @@
|
|||
* Wind River Systems, Inc. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions;
|
||||
package org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions;
|
||||
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
|
||||
public class MessagesForVMUpdateActions extends NLS {
|
||||
public class MessagesForVMActions extends NLS {
|
||||
|
||||
private static final String BUNDLE_NAME = "org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.messages"; //$NON-NLS-1$
|
||||
private static final String BUNDLE_NAME = "org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions.messages"; //$NON-NLS-1$
|
||||
|
||||
public static String RetargetDebugContextAction_ErrorDialog_title;
|
||||
public static String RetargetDebugContextAction_ErrorDialog_message;
|
||||
|
||||
public static String UpdatePoliciesContribution_EmptyPoliciesList_label;
|
||||
public static String UpdateScopesContribution_EmptyScopesList_label;
|
||||
|
||||
|
||||
static {
|
||||
// initialize resource bundle
|
||||
NLS.initializeMessages(BUNDLE_NAME, MessagesForVMUpdateActions.class);
|
||||
NLS.initializeMessages(BUNDLE_NAME, MessagesForVMActions.class);
|
||||
}
|
||||
|
||||
private MessagesForVMUpdateActions() {}
|
||||
private MessagesForVMActions() {}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Wind River Systems and others.
|
||||
* 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:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions.IRefreshAllTarget;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class RefreshAllRetargetAction extends RetargetDebugContextAction {
|
||||
|
||||
@Override
|
||||
protected boolean canPerformAction(Object target, ISelection selection) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<?> getAdapterClass() {
|
||||
return IRefreshAllTarget.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void performAction(Object target, ISelection debugContext) throws CoreException {
|
||||
((IRefreshAllTarget)target).refresh(debugContext);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Wind River Systems and others.
|
||||
* 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:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions;
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions.VMHandlerUtils;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.IVMProvider;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.update.ICachingVMProvider;
|
||||
|
||||
public class RefreshHandler extends AbstractHandler {
|
||||
|
||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||
IVMProvider vmProvider = VMHandlerUtils.getActiveVMProvider(event);
|
||||
|
||||
if (vmProvider instanceof ICachingVMProvider) {
|
||||
((ICachingVMProvider)vmProvider).refresh();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,227 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2007 IBM Corporation and others.
|
||||
* 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
|
||||
* Anton Leherbauer (Wind River Systems) - bug 183291
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions;
|
||||
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.core.runtime.IAdapterManager;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.dialogs.ErrorDialog;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.ui.IEditorPart;
|
||||
import org.eclipse.ui.IPartListener;
|
||||
import org.eclipse.ui.IPartService;
|
||||
import org.eclipse.ui.IWorkbenchPart;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
|
||||
import org.eclipse.ui.texteditor.IUpdate;
|
||||
|
||||
/**
|
||||
* Global retargettable debug action.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public abstract class RetargetAction implements IWorkbenchWindowActionDelegate, IPartListener, IUpdate {
|
||||
|
||||
protected IWorkbenchWindow fWindow = null;
|
||||
private IWorkbenchPart fActivePart = null;
|
||||
private Object fTargetAdapter = null;
|
||||
private IAction fAction = null;
|
||||
private static final ISelection EMPTY_SELECTION = new EmptySelection();
|
||||
|
||||
static class EmptySelection implements ISelection {
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.viewers.ISelection#isEmpty()
|
||||
*/
|
||||
public boolean isEmpty() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current selection in the active part, possibly
|
||||
* and empty selection, but never <code>null</code>.
|
||||
*
|
||||
* @return the selection in the active part, possibly empty
|
||||
*/
|
||||
private ISelection getTargetSelection() {
|
||||
if (fActivePart != null) {
|
||||
ISelectionProvider selectionProvider = fActivePart.getSite().getSelectionProvider();
|
||||
if (selectionProvider != null) {
|
||||
return selectionProvider.getSelection();
|
||||
}
|
||||
}
|
||||
return EMPTY_SELECTION;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
|
||||
*/
|
||||
public void dispose() {
|
||||
fWindow.getPartService().removePartListener(this);
|
||||
fActivePart = null;
|
||||
fTargetAdapter = null;
|
||||
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
|
||||
*/
|
||||
public void init(IWorkbenchWindow window) {
|
||||
this.fWindow = window;
|
||||
IPartService partService = window.getPartService();
|
||||
partService.addPartListener(this);
|
||||
IWorkbenchPart part = partService.getActivePart();
|
||||
if (part != null) {
|
||||
partActivated(part);
|
||||
}
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
|
||||
*/
|
||||
public void run(IAction action) {
|
||||
if (fTargetAdapter != null) {
|
||||
try {
|
||||
performAction(fTargetAdapter, getTargetSelection(), fActivePart);
|
||||
} catch (CoreException e) {
|
||||
ErrorDialog.openError(fWindow.getShell(), MessagesForVMActions.RetargetDebugContextAction_ErrorDialog_title, MessagesForVMActions.RetargetDebugContextAction_ErrorDialog_message, e.getStatus());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs the specific breakpoint toggling.
|
||||
*
|
||||
* @param selection selection in the active part
|
||||
* @param part active part
|
||||
* @throws CoreException if an exception occurrs
|
||||
*/
|
||||
protected abstract void performAction(Object target, ISelection selection, IWorkbenchPart part) throws CoreException;
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
|
||||
*/
|
||||
public void selectionChanged(IAction action, ISelection selection) {
|
||||
this.fAction = action;
|
||||
// if the active part did not provide an adapter, see if the selectoin does
|
||||
if (fTargetAdapter == null && selection instanceof IStructuredSelection) {
|
||||
IStructuredSelection ss = (IStructuredSelection) selection;
|
||||
if (!ss.isEmpty()) {
|
||||
Object object = ss.getFirstElement();
|
||||
if (object instanceof IAdaptable) {
|
||||
fTargetAdapter = getAdapter((IAdaptable) object);
|
||||
}
|
||||
}
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.IPartListener#partActivated(org.eclipse.ui.IWorkbenchPart)
|
||||
*/
|
||||
public void partActivated(IWorkbenchPart part) {
|
||||
fActivePart = part;
|
||||
IResource resource = (IResource) part.getAdapter(IResource.class);
|
||||
if (resource == null && part instanceof IEditorPart) {
|
||||
resource = (IResource) ((IEditorPart)part).getEditorInput().getAdapter(IResource.class);
|
||||
}
|
||||
if (resource != null) {
|
||||
fTargetAdapter = getAdapter(resource);
|
||||
}
|
||||
if (fTargetAdapter == null) {
|
||||
fTargetAdapter = getAdapter(part);
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
protected Object getAdapter(IAdaptable adaptable) {
|
||||
Object adapter = adaptable.getAdapter(getAdapterClass());
|
||||
if (adapter == null) {
|
||||
IAdapterManager adapterManager = Platform.getAdapterManager();
|
||||
if (adapterManager.hasAdapter(adaptable, getAdapterClass().getName())) {
|
||||
fTargetAdapter = adapterManager.loadAdapter(adaptable, getAdapterClass().getName());
|
||||
}
|
||||
}
|
||||
return adapter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of adapter (target) this action works on.
|
||||
*
|
||||
* @return the type of adapter this action works on
|
||||
*/
|
||||
protected abstract Class getAdapterClass();
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.IPartListener#partBroughtToTop(org.eclipse.ui.IWorkbenchPart)
|
||||
*/
|
||||
public void partBroughtToTop(IWorkbenchPart part) {
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.IPartListener#partClosed(org.eclipse.ui.IWorkbenchPart)
|
||||
*/
|
||||
public void partClosed(IWorkbenchPart part) {
|
||||
clearPart(part);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears reference to active part and adapter when a relevant part
|
||||
* is closed or deactivated.
|
||||
*
|
||||
* @param part workbench part that has been closed or deactivated
|
||||
*/
|
||||
protected void clearPart(IWorkbenchPart part) {
|
||||
if (part.equals(fActivePart)) {
|
||||
fActivePart = null;
|
||||
fTargetAdapter = null;
|
||||
}
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.IPartListener#partDeactivated(org.eclipse.ui.IWorkbenchPart)
|
||||
*/
|
||||
public void partDeactivated(IWorkbenchPart part) {
|
||||
clearPart(part);
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.IPartListener#partOpened(org.eclipse.ui.IWorkbenchPart)
|
||||
*/
|
||||
public void partOpened(IWorkbenchPart part) {
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
||||
*/
|
||||
public void update() {
|
||||
if (fAction == null) {
|
||||
return;
|
||||
}
|
||||
if (fTargetAdapter != null) {
|
||||
fAction.setEnabled(canPerformAction(fTargetAdapter, getTargetSelection(), fActivePart));
|
||||
} else {
|
||||
fAction.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the specific operation is supported.
|
||||
*
|
||||
* @param target the target adapter
|
||||
* @param selection the selection to verify the operation on
|
||||
* @param part the part the operation has been requested on
|
||||
* @return whether the operation can be performed
|
||||
*/
|
||||
protected abstract boolean canPerformAction(Object target, ISelection selection, IWorkbenchPart part);
|
||||
}
|
|
@ -0,0 +1,148 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2008 Wind River Systems and others.
|
||||
* 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:
|
||||
* Ted R Williams (Wind River Systems, Inc.) - initial implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.core.runtime.IAdapterManager;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.debug.ui.DebugUITools;
|
||||
import org.eclipse.debug.ui.contexts.DebugContextEvent;
|
||||
import org.eclipse.debug.ui.contexts.IDebugContextListener;
|
||||
import org.eclipse.debug.ui.contexts.IDebugContextService;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.dialogs.ErrorDialog;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.ui.IActionDelegate2;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
abstract public class RetargetDebugContextAction implements IWorkbenchWindowActionDelegate, IDebugContextListener, IActionDelegate2 {
|
||||
|
||||
private IWorkbenchWindow fWindow = null;
|
||||
private IAction fAction = null;
|
||||
private ISelection fDebugContext;
|
||||
private Object fTargetAdapter = null;
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
|
||||
*/
|
||||
public void init(IWorkbenchWindow window) {
|
||||
fWindow = window;
|
||||
IDebugContextService debugContextService = DebugUITools.getDebugContextManager().getContextService(fWindow);
|
||||
debugContextService.addPostDebugContextListener(this);
|
||||
fDebugContext = debugContextService.getActiveContext();
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
public void selectionChanged(IAction action, ISelection selection) {
|
||||
if (fAction != action) {
|
||||
fAction = action;
|
||||
}
|
||||
// Update on debug context changed events
|
||||
}
|
||||
|
||||
public void runWithEvent(IAction action, Event event) {
|
||||
run(action);
|
||||
}
|
||||
|
||||
public void run(IAction action) {
|
||||
if (fTargetAdapter != null) {
|
||||
try {
|
||||
performAction(fTargetAdapter, fDebugContext);
|
||||
} catch (CoreException e) {
|
||||
ErrorDialog.openError(fWindow.getShell(), MessagesForVMActions.RetargetDebugContextAction_ErrorDialog_title, MessagesForVMActions.RetargetDebugContextAction_ErrorDialog_message, e.getStatus());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the specific operation is supported.
|
||||
*
|
||||
* @param target the target adapter
|
||||
* @param selection the selection to verify the operation on
|
||||
* @param part the part the operation has been requested on
|
||||
* @return whether the operation can be performed
|
||||
*/
|
||||
protected abstract boolean canPerformAction(Object target, ISelection debugContext);
|
||||
|
||||
/**
|
||||
* Performs the specific breakpoint toggling.
|
||||
*
|
||||
* @param selection selection in the active part
|
||||
* @param part active part
|
||||
* @throws CoreException if an exception occurrs
|
||||
*/
|
||||
protected abstract void performAction(Object target, ISelection debugContext) throws CoreException;
|
||||
|
||||
/**
|
||||
* Returns the type of adapter (target) this action works on.
|
||||
*
|
||||
* @return the type of adapter this action works on
|
||||
*/
|
||||
protected abstract Class<?> getAdapterClass();
|
||||
|
||||
public void init(IAction action) {
|
||||
fAction = action;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
||||
*/
|
||||
public void update() {
|
||||
if (fAction == null) {
|
||||
return;
|
||||
}
|
||||
if (fTargetAdapter != null) {
|
||||
fAction.setEnabled(canPerformAction(fTargetAdapter, fDebugContext));
|
||||
} else {
|
||||
fAction.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
DebugUITools.getDebugContextManager().getContextService(fWindow).removePostDebugContextListener(this);
|
||||
fTargetAdapter = null;
|
||||
}
|
||||
|
||||
public void debugContextChanged(DebugContextEvent event) {
|
||||
fDebugContext = event.getContext();
|
||||
fTargetAdapter = null;
|
||||
if (fDebugContext instanceof IStructuredSelection) {
|
||||
IStructuredSelection ss = (IStructuredSelection) fDebugContext;
|
||||
if (!ss.isEmpty()) {
|
||||
Object object = ss.getFirstElement();
|
||||
if (object instanceof IAdaptable) {
|
||||
fTargetAdapter = getAdapter((IAdaptable) object);
|
||||
}
|
||||
}
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
protected Object getAdapter(IAdaptable adaptable) {
|
||||
Object adapter = adaptable.getAdapter(getAdapterClass());
|
||||
if (adapter == null) {
|
||||
IAdapterManager adapterManager = Platform.getAdapterManager();
|
||||
if (adapterManager.hasAdapter(adaptable, getAdapterClass().getName())) {
|
||||
fTargetAdapter = adapterManager.loadAdapter(adaptable, getAdapterClass().getName());
|
||||
}
|
||||
}
|
||||
return adapter;
|
||||
}
|
||||
}
|
|
@ -8,12 +8,12 @@
|
|||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions;
|
||||
package org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions.VMCommandUtils;
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions.VMHandlerUtils;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.IVMProvider;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.update.ICachingVMProvider;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.update.IVMUpdatePolicy;
|
||||
|
@ -61,7 +61,7 @@ public class UpdatePoliciesContribution extends CompoundContributionItem impleme
|
|||
public void fill(Menu menu, int index) {
|
||||
MenuItem item = new MenuItem(menu, SWT.NONE);
|
||||
item.setEnabled(false);
|
||||
item.setText(MessagesForVMUpdateActions.UpdateScopesContribution_EmptyScopesList_label);
|
||||
item.setText(MessagesForVMActions.UpdateScopesContribution_EmptyScopesList_label);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -73,7 +73,7 @@ public class UpdatePoliciesContribution extends CompoundContributionItem impleme
|
|||
|
||||
@Override
|
||||
protected IContributionItem[] getContributionItems() {
|
||||
IVMProvider provider = VMCommandUtils.getActiveVMProvider(fServiceLocator);
|
||||
IVMProvider provider = VMHandlerUtils.getActiveVMProvider(fServiceLocator);
|
||||
|
||||
// If no part or selection, disable all.
|
||||
if (provider == null || !(provider instanceof ICachingVMProvider)) {
|
|
@ -8,10 +8,10 @@
|
|||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions;
|
||||
package org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions;
|
||||
|
||||
import org.eclipse.core.expressions.PropertyTester;
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions.VMCommandUtils;
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions.VMHandlerUtils;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.IVMContext;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.IVMProvider;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.update.ICachingVMProvider;
|
||||
|
@ -51,7 +51,7 @@ public class UpdatePoliciesPropertyTester extends PropertyTester {
|
|||
return testProvider((ICachingVMProvider)provider, property, expectedValue);
|
||||
}
|
||||
} else if (receiver instanceof IDebugView) {
|
||||
IVMProvider provider = VMCommandUtils.getVMProviderForPart((IDebugView)receiver);
|
||||
IVMProvider provider = VMHandlerUtils.getVMProviderForPart((IDebugView)receiver);
|
||||
if (provider instanceof ICachingVMProvider) {
|
||||
return testProvider((ICachingVMProvider)provider, property, expectedValue);
|
||||
}
|
|
@ -8,12 +8,12 @@
|
|||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions;
|
||||
package org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions.VMCommandUtils;
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions.VMHandlerUtils;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.IVMProvider;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.update.ICachingVMProviderExtension;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.update.IVMUpdateScope;
|
||||
|
@ -61,7 +61,7 @@ public class UpdateScopesContribution extends CompoundContributionItem implement
|
|||
public void fill(Menu menu, int index) {
|
||||
MenuItem item = new MenuItem(menu, SWT.NONE);
|
||||
item.setEnabled(false);
|
||||
item.setText(MessagesForVMUpdateActions.UpdateScopesContribution_EmptyScopesList_label);
|
||||
item.setText(MessagesForVMActions.UpdateScopesContribution_EmptyScopesList_label);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -73,7 +73,7 @@ public class UpdateScopesContribution extends CompoundContributionItem implement
|
|||
|
||||
@Override
|
||||
protected IContributionItem[] getContributionItems() {
|
||||
IVMProvider provider = VMCommandUtils.getActiveVMProvider(fServiceLocator);
|
||||
IVMProvider provider = VMHandlerUtils.getActiveVMProvider(fServiceLocator);
|
||||
|
||||
// If no part or selection, disable all.
|
||||
if (provider == null || !(provider instanceof ICachingVMProviderExtension)) {
|
|
@ -8,10 +8,10 @@
|
|||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions;
|
||||
package org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions;
|
||||
|
||||
import org.eclipse.core.expressions.PropertyTester;
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions.VMCommandUtils;
|
||||
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions.VMHandlerUtils;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.IVMContext;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.IVMProvider;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.update.ICachingVMProviderExtension;
|
||||
|
@ -51,7 +51,7 @@ public class UpdateScopesPropertyTester extends PropertyTester {
|
|||
return testProvider((ICachingVMProviderExtension)provider, property, expectedValue);
|
||||
}
|
||||
} else if (receiver instanceof IDebugView) {
|
||||
IVMProvider provider = VMCommandUtils.getVMProviderForPart((IDebugView)receiver);
|
||||
IVMProvider provider = VMHandlerUtils.getVMProviderForPart((IDebugView)receiver);
|
||||
if (provider instanceof ICachingVMProviderExtension) {
|
||||
return testProvider((ICachingVMProviderExtension)provider, property, expectedValue);
|
||||
}
|
|
@ -9,5 +9,8 @@
|
|||
# Wind River Systems Inc - copied for non-restricted version for DSDP/DD/DSF
|
||||
###############################################################################
|
||||
|
||||
RetargetDebugContextAction_ErrorDialog_title=Error
|
||||
RetargetDebugContextAction_ErrorDialog_message=Operation failed
|
||||
|
||||
UpdatePoliciesContribution_EmptyPoliciesList_label=No update policies available
|
||||
UpdateScopesContribution_EmptyScopesList_label=No update scopes available
|
Loading…
Add table
Reference in a new issue