diff options
author | Mikhail Khodjaiants | 2005-02-15 04:01:19 +0000 |
---|---|---|
committer | Mikhail Khodjaiants | 2005-02-15 04:01:19 +0000 |
commit | 30f8084e4fdeda7bf73ce498106a2f69e98c0aca (patch) | |
tree | 280267f72d1eed9d26c0d74a9835b70390535a77 /debug/org.eclipse.cdt.debug.ui | |
parent | 4a8913dad847c1a82d4f4954a8ebdb800d2cf7aa (diff) | |
download | org.eclipse.cdt-30f8084e4fdeda7bf73ce498106a2f69e98c0aca.tar.gz org.eclipse.cdt-30f8084e4fdeda7bf73ce498106a2f69e98c0aca.tar.xz org.eclipse.cdt-30f8084e4fdeda7bf73ce498106a2f69e98c0aca.zip |
Bug 82264: Enhance the Shared Libraries view. Added the "Load Symbols" action.
Diffstat (limited to 'debug/org.eclipse.cdt.debug.ui')
5 files changed, 124 insertions, 6 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/ChangeLog b/debug/org.eclipse.cdt.debug.ui/ChangeLog index 1bb55dca631..b2882243d82 100644 --- a/debug/org.eclipse.cdt.debug.ui/ChangeLog +++ b/debug/org.eclipse.cdt.debug.ui/ChangeLog @@ -1,5 +1,13 @@ 2005-02-14 Mikhail Khodjaiants
Bug 82264: Enhance the Shared Libraries view.
+ Added the "Load Symbols" action.
+ * LoadModuleSymbolsActionDelegate.java: new
+ * ActionMessages.properties
+ * plugin.xml
+ * plugin.properties
+
+2005-02-14 Mikhail Khodjaiants
+ Bug 82264: Enhance the Shared Libraries view.
Implementing module's properties.
* PropertyPageMessages.properties
* ModuleProperties.java (former ModuleProperties.java)
diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.properties b/debug/org.eclipse.cdt.debug.ui/plugin.properties index 9b0dd6d235f..99212f8e336 100644 --- a/debug/org.eclipse.cdt.debug.ui/plugin.properties +++ b/debug/org.eclipse.cdt.debug.ui/plugin.properties @@ -125,5 +125,5 @@ ModulesDetailPaneFontDefinition.description=The text font used in the detail pan CollapseAllModulesAction.label=Collapse All CollapseAllModulesAction.tooltip=Collapse All -ModulePropertiesAction.label=Module Properties... +ModulePropertiesAction.label=Properties... ModulePropertiesAction.tooltip=Open Module Properties Dialog diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.xml b/debug/org.eclipse.cdt.debug.ui/plugin.xml index c1799c377d8..02961680788 100644 --- a/debug/org.eclipse.cdt.debug.ui/plugin.xml +++ b/debug/org.eclipse.cdt.debug.ui/plugin.xml @@ -733,6 +733,15 @@ objectClass="org.eclipse.cdt.debug.core.model.ICModule" id="org.eclipse.cdt.debug.ui.ModuleActions"> <action + helpContextId="load_symbols_action_context" + enablesFor="1" + label="%LoadSymbolsAction.label" + tooltip="%LoadSymbolsAction.tooltip" + icon="icons/full/clcl16/load_symbols_co.gif" + class="org.eclipse.cdt.debug.internal.ui.actions.LoadModuleSymbolsActionDelegate" + menubarPath="modulesGroup" + id="org.eclipse.cdt.debug.ui.LoadSymbolsAction"/> + <action helpContextId="module_properties_action_context" enablesFor="1" label="%ModulePropertiesAction.label" @@ -740,11 +749,6 @@ class="org.eclipse.cdt.debug.internal.ui.actions.ModulesPropertiesActionDelegate" style="pulldown" id="org.eclipse.cdt.debug.ui.ModulePropertiesAction"> - <enablement> - <pluginState - value="activated" - id="org.eclipse.cdt.debug.ui.pluginState1"/> - </enablement> </action> </objectContribution> </extension> diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties index 659d1fcc8ba..e26dabb161a 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties @@ -17,6 +17,7 @@ LoadSymbolsForAllActionDelegate.Error(s)_occurred_loading_the_symbols_1=Error(s) LoadSymbolsForAllAction.Load_Symbols_For_All_2=Load Symbols For All LoadSymbolsForAllActionDelegate.Error_1=Error LoadSymbolsForAllActionDelegate.0=Operation failed. +LoadModuleSymbolsActionDelegate.0=Unable to load symbols. LoadSymbolsForAllAction.Unable_to_load_symbols_1=Unable to load symbols. SignalZeroWorkbenchActionDelegate.0=Exceptions occurred attempting to resume without signal. SignalZeroWorkbenchActionDelegate.1=Resume without signal failed. diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadModuleSymbolsActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadModuleSymbolsActionDelegate.java new file mode 100644 index 00000000000..b17bdfcffb5 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadModuleSymbolsActionDelegate.java @@ -0,0 +1,105 @@ +/********************************************************************** + * Copyright (c) 2004 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * QNX Software Systems - Initial API and implementation +***********************************************************************/ +package org.eclipse.cdt.debug.internal.ui.actions; + +import org.eclipse.cdt.debug.core.CDIDebugModel; +import org.eclipse.cdt.debug.core.CDebugUtils; +import org.eclipse.cdt.debug.core.model.ICModule; +import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.MultiStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.debug.core.DebugException; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.ui.IObjectActionDelegate; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.actions.ActionDelegate; + +/** + * The delegate of the "Load Symbols" action contribution to the "ICModule" objects. + */ +public class LoadModuleSymbolsActionDelegate extends ActionDelegate implements IObjectActionDelegate { + + private ICModule fModule; + + /* (non-Javadoc) + * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart) + */ + public void setActivePart( IAction action, IWorkbenchPart targetPart ) { + } + + protected ICModule getModule() { + return fModule; + } + + private void setModule( ICModule module ) { + fModule = module; + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) + */ + public void run( IAction action ) { + final ICModule module = getModule(); + if ( module != null ) { + + DebugPlugin.getDefault().asyncExec( + new Runnable() { + public void run() { + try { + doAction( module ); + } + catch( DebugException e ) { + failed( e ); + } + } + } ); + } + } + + protected void doAction( ICModule module ) throws DebugException { + module.loadSymbols(); + } + + /* (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 ) { + if ( selection instanceof IStructuredSelection ) { + if ( ((IStructuredSelection)selection).size() == 1 ) { + Object element = ((IStructuredSelection)selection).getFirstElement(); + if ( element instanceof ICModule ) { + boolean enabled = enablesFor( (ICModule)element ); + action.setEnabled( enabled ); + if ( enabled ) { + setModule( (ICModule)element ); + return; + } + } + } + } + action.setEnabled( false ); + setModule( null ); + } + + private boolean enablesFor( ICModule module ) { + return ( module != null && module.canLoadSymbols() ); + } + + protected void failed( Throwable e ) { + MultiStatus ms = new MultiStatus( CDIDebugModel.getPluginIdentifier(), ICDebugInternalConstants.STATUS_CODE_ERROR, ActionMessages.getString( "LoadModuleSymbolsActionDelegate.0" ), null ); //$NON-NLS-1$ + ms.add( new Status( IStatus.ERROR, CDIDebugModel.getPluginIdentifier(), ICDebugInternalConstants.STATUS_CODE_ERROR, e.getMessage(), null ) ); + CDebugUtils.error( ms, getModule() ); + } +} |