Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] 'Load Symbols For All' action

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.ui/ChangeLog,v
retrieving revision 1.97
diff -u -r1.97 ChangeLog
--- ChangeLog 10 Feb 2003 23:40:08 -0000 1.97
+++ ChangeLog 11 Feb 2003 19:15:36 -0000
@@ -1,5 +1,16 @@
+2003-02-11 Mikhail Khodjaiants
+ The 'Load Symbole For All' action is added to the 'Shared Libraries' view
+ * CDebugImages.java
+ * ICDebugHelpContextIds.java
+ * LoadSymbolsForAllAction.java: new
+ * SharedLibrariesView.java
+ * ICDebugUIConstants.java
+ * icons/full/clcl16/load_all_symbols_co.gif: new
+ * icons/full/dlcl16/load_all_symbols_co.gif: new
+ * icons/full/elcl16/load_all_symbols_co.gif: new
+
 2003-02-10 Mikhail Khodjaiants
- The 'Auto-Refresh' and 'Refresh' actions added to the 'Shared Libraries' view.
+ The 'Auto-Refresh' and 'Refresh' actions are added to the 'Shared Libraries' view.
  * RefreshAction.java: new
  * AutoRefreshAction.java: new
  * RefreshMemoryAction.java
Index: icons/full/clcl16/load_all_symbols_co.gif
===================================================================
RCS file: icons/full/clcl16/load_all_symbols_co.gif
diff -N icons/full/clcl16/load_all_symbols_co.gif
Binary files /dev/null and load_all_symbols_co.gif differ
Index: icons/full/dlcl16/load_all_symbols_co.gif
===================================================================
RCS file: icons/full/dlcl16/load_all_symbols_co.gif
diff -N icons/full/dlcl16/load_all_symbols_co.gif
Binary files /dev/null and load_all_symbols_co.gif differ
Index: icons/full/elcl16/load_all_symbols_co.gif
===================================================================
RCS file: icons/full/elcl16/load_all_symbols_co.gif
diff -N icons/full/elcl16/load_all_symbols_co.gif
Binary files /dev/null and load_all_symbols_co.gif differ
Index: src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java,v
retrieving revision 1.16
diff -u -r1.16 CDebugImages.java
--- src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java 10 Feb 2003 23:40:08 -0000 1.16
+++ src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java 11 Feb 2003 19:15:37 -0000
@@ -76,6 +76,7 @@
  public static final String IMG_LCL_MEMORY_SAVE = NAME_PREFIX + "memory_update.gif"; //$NON-NLS-1$
  public static final String IMG_LCL_MEMORY_CLEAR = NAME_PREFIX + "memory_clear.gif"; //$NON-NLS-1$
  public static final String IMG_LCL_SHOW_ASCII = NAME_PREFIX + "show_ascii.gif"; //$NON-NLS-1$
+ public static final String IMG_LCL_LOAD_ALL_SYMBOLS = NAME_PREFIX + "load_all_symbols_co.gif"; //$NON-NLS-1$
 
  public static final String IMG_TOOLS_ADD_DIR_SOURCE_LOCATION = NAME_PREFIX + "adddirsource_wiz.gif"; //$NON-NLS-1$
  public static final String IMG_TOOLS_ADD_PRJ_SOURCE_LOCATION = NAME_PREFIX + "addprjsource_wiz.gif"; //$NON-NLS-1$
Index: src/org/eclipse/cdt/debug/internal/ui/ICDebugHelpContextIds.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ICDebugHelpContextIds.java,v
retrieving revision 1.12
diff -u -r1.12 ICDebugHelpContextIds.java
--- src/org/eclipse/cdt/debug/internal/ui/ICDebugHelpContextIds.java 10 Feb 2003 23:40:08 -0000 1.12
+++ src/org/eclipse/cdt/debug/internal/ui/ICDebugHelpContextIds.java 11 Feb 2003 19:15:36 -0000
@@ -32,6 +32,7 @@
  public static final String MEMORY_SHOW_ASCII_ACTION = PREFIX + "memory_show_ascii_action_context"; //$NON-NLS-1$
  public static final String REFRESH_SHARED_LIBRARIES_ACTION = PREFIX + "refresh_shared_libraries_action_context"; //$NON-NLS-1$
  public static final String AUTO_REFRESH_SHARED_LIBRARIES_ACTION = PREFIX + "auto_refresh_shared_libraries_action_context"; //$NON-NLS-1$
+ public static final String LOAD_SYMBOLS_FOR_ALL = PREFIX + "load_symbols_for_all_action_context"; //$NON-NLS-1$
 
  // Views
  public static final String REGISTERS_VIEW = PREFIX + "registers_view_context"; //$NON-NLS-1$
Index: src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsForAllAction.java
===================================================================
RCS file: src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsForAllAction.java
diff -N src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsForAllAction.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsForAllAction.java 11 Feb 2003 19:15:37 -0000
@@ -0,0 +1,80 @@
+/*
+ *(c) Copyright QNX Software Systems Ltd. 2002.
+ * All Rights Reserved.
+ *
+ */
+package org.eclipse.cdt.debug.internal.ui.actions;
+
+import org.eclipse.cdt.debug.core.ICSharedLibraryManager;
+import org.eclipse.cdt.debug.core.model.ICDebugTarget;
+import org.eclipse.cdt.debug.internal.ui.CDebugImages;
+import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
+import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.ui.help.WorkbenchHelp;
+import org.eclipse.ui.texteditor.IUpdate;
+
+/**
+ * Enter type comment.
+ *
+ * @since: Feb 11, 2003
+ */
+public class LoadSymbolsForAllAction extends Action implements IUpdate
+{
+ private Viewer fViewer = null;
+
+ /**
+  * Constructor for LoadSymbolsForAllAction.
+  */
+ public LoadSymbolsForAllAction( Viewer viewer )
+ {
+  super( "Load Symbols For All" );
+  fViewer = viewer;
+  CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_LOAD_ALL_SYMBOLS );
+  setDescription( "Load symbols for all shared libraries." );
+  setToolTipText( "Load Symbols For All" );
+  WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.LOAD_SYMBOLS_FOR_ALL );
+ }
+
+ /* (non-Javadoc)
+  * @see org.eclipse.ui.texteditor.IUpdate#update()
+  */
+ public void update()
+ {
+  if ( fViewer != null && fViewer.getInput() instanceof IAdaptable )
+  {
+   ICDebugTarget target = (ICDebugTarget)((IAdaptable)fViewer.getInput()).getAdapter( ICDebugTarget.class );
+   if ( target != null )
+   {
+    setEnabled( target.isSuspended() );
+    return;
+   }
+  }
+  setEnabled( false );
+ }
+
+ /* (non-Javadoc)
+  * @see org.eclipse.jface.action.IAction#run()
+  */
+ public void run()
+ {
+  if ( fViewer != null && fViewer.getInput() instanceof IAdaptable )
+  {
+   ICSharedLibraryManager slm = (ICSharedLibraryManager)((IAdaptable)fViewer.getInput()).getAdapter( ICSharedLibraryManager.class );
+   if ( slm != null )
+   {
+    try
+    {
+     slm.loadSymbolsForAll();
+    }
+    catch( DebugException e )
+    {
+     CDebugUIPlugin.errorDialog( "Unable to load symbols.", e.getStatus() );
+    }
+   }
+  }
+ }
+}
Index: src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java,v
retrieving revision 1.6
diff -u -r1.6 SharedLibrariesView.java
--- src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java 10 Feb 2003 23:40:07 -0000 1.6
+++ src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java 11 Feb 2003 19:15:37 -0000
@@ -13,6 +13,7 @@
 import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
 import org.eclipse.cdt.debug.internal.ui.PixelConverter;
 import org.eclipse.cdt.debug.internal.ui.actions.AutoRefreshAction;
+import org.eclipse.cdt.debug.internal.ui.actions.LoadSymbolsForAllAction;
 import org.eclipse.cdt.debug.internal.ui.actions.RefreshAction;
 import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants;
 import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler;
@@ -159,6 +160,11 @@
   setAction( "Refresh", action ); //$NON-NLS-1$
   add( (RefreshAction)action );
 
+  action = "" LoadSymbolsForAllAction( getViewer() );
+  action.setEnabled( false );
+  setAction( "LoadSymbolsForAll", action ); //$NON-NLS-1$
+  add( (LoadSymbolsForAllAction)action );
+
   // set initial content here, as viewer has to be set
   setInitialContent();
  }
@@ -176,11 +182,15 @@
   */
  protected void fillContextMenu( IMenuManager menu )
  {
+  menu.add( new Separator( ICDebugUIConstants.EMPTY_SHARED_LIBRARIES_GROUP ) );
+  menu.add( new Separator( ICDebugUIConstants.SHARED_LIBRARIES_GROUP ) );
+
   menu.add( new Separator( ICDebugUIConstants.EMPTY_REFRESH_GROUP ) );
   menu.add( new Separator( ICDebugUIConstants.REFRESH_GROUP ) );
 
   menu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) );
 
+  menu.appendToGroup( ICDebugUIConstants.SHARED_LIBRARIES_GROUP, getAction( "LoadSymbolsForAll" ) ); //$NON-NLS-1$
   menu.appendToGroup( ICDebugUIConstants.REFRESH_GROUP, getAction( "AutoRefresh" ) ); //$NON-NLS-1$
   menu.appendToGroup( ICDebugUIConstants.REFRESH_GROUP, getAction( "Refresh" ) ); //$NON-NLS-1$
  }
@@ -191,6 +201,10 @@
  protected void configureToolBar( IToolBarManager tbm )
  {
   tbm.add( new Separator( this.getClass().getName() ) );
+
+  tbm.add( new Separator( ICDebugUIConstants.SHARED_LIBRARIES_GROUP ) );
+  tbm.add( getAction( "LoadSymbolsForAll" ) ); //$NON-NLS-1$
+
   tbm.add( new Separator( ICDebugUIConstants.REFRESH_GROUP ) );
   tbm.add( getAction( "AutoRefresh" ) ); //$NON-NLS-1$
   tbm.add( getAction( "Refresh" ) ); //$NON-NLS-1$
@@ -231,6 +245,11 @@
    {
     slm = (ICSharedLibraryManager)((IDebugElement)input).getDebugTarget().getAdapter( ICSharedLibraryManager.class );
    }
+  }
+
+  if ( getViewer() == null )
+  {
+   return;
   }
 
   Object current = getViewer().getInput();
Index: src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java,v
retrieving revision 1.7
diff -u -r1.7 ICDebugUIConstants.java
--- src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java 10 Feb 2003 23:40:08 -0000 1.7
+++ src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java 11 Feb 2003 19:15:37 -0000
@@ -82,4 +82,18 @@
   * </code>).
   */
  public static final String REFRESH_GROUP = "refreshGroup"; //$NON-NLS-1$
+ /**
+  * Identifier for an empty group preceeding a
+  * shared libraries group  in a menu (value <code>"
+  * emptySharedLibrariesGroup"
+  * </code>).
+  */
+ public static final String EMPTY_SHARED_LIBRARIES_GROUP = "emptySharedLibrariesGroup"; //$NON-NLS-1$

+ /**
+  * Identifier for a shared libraries group in a menu (value <code>"
+  * sharedLibrariesGroup"
+  * </code>).
+  */
+ public static final String SHARED_LIBRARIES_GROUP = "sharedLibrariesGroup"; //$NON-NLS-1$
 }

Back to the top