Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[Dltk-dev] debug variable display

hello all -

  i've just committed changes that add support to enable/disable the display of debugging variables on a per language basis, instead of globally for all dltk implementations.

  a side effect of this change is that these display options can only be controlled from the 'Variables' debug view drop down menu, although this does bring the implementation more in-line w/ the jdt since it only lets you toggle display of static variables, etc from that menu as well. another side effect of this change is that the commands, handlers, and menu configuration need to be defined on a per language basis. since these commands need to operate per language implementation, they need their own command ids, etc in order to work properly.

  the menu items also don't reflect the current 'checked' state of the system when they are first displayed - i spent a good amount of time searching around on how to do this, but couldn't figure it out. i posted a message in the swt forum looking for some additional help. the settings default to enabled, so the behavior is the same for the user.

  in order to add this support, just add the following to your 'debug.ui' plugin.xml (make sure to update the 'ids' and classes to match your plugin) and sub-class the appropriate handler base class. use any one of the existing language implementations as an example.

  <extension point="org.eclipse.ui.commands">
    <command
      id="org.eclipse.dltk.python.debug.ui.commands.toggleGlobalVariables"
      description="%showGlobalVarsCommand.name"
      name="%showGlobalVarsCommand.description" />
    <command
      id="org.eclipse.dltk.python.debug.ui.commands.toggleClassVariables"
      description="%showClassVarsCommand.name"
      name="%showClassVarsCommand.description" />
    <command
      id="org.eclipse.dltk.python.debug.ui.commands.toggleLocalVariables"
      description="%showLocalVarsCommand.name"
      name="%showLocalVarsCommand.description" />     
  </extension>

  <extension point="org.eclipse.ui.menus">
    <menuContribution locationURI="menu:org.eclipse.debug.ui.VariableView">
      <menu
        label="%variablesViewMenu.name"
        id="org.eclipse.dltk.python.debug.ui.menu.VariableView" />
    </menuContribution>
    <menuContribution locationURI="menu:org.eclipse.dltk.python.debug.ui.menu.VariableView">
      <command
        commandId="org.eclipse.dltk.python.debug.ui.commands.toggleGlobalVariables"
        tooltip="%showGlobalVarsCommand.tooltip"    
        style="toggle" />
      <command
        commandId="org.eclipse.dltk.python.debug.ui.commands.toggleClassVariables"
        tooltip="%showClassVarsCommand.tooltip"     
        style="toggle" />      
      <command
        commandId="org.eclipse.dltk.python.debug.ui.commands.toggleLocalVariables"
        tooltip="%showLocalVarsCommand.tooltip"
        style="toggle" />                     
    </menuContribution> 
  </extension>

  <extension point="org.eclipse.ui.handlers">
    <handler
      commandId="org.eclipse.dltk.python.debug.ui.commands.toggleGlobalVariables"
      class="org.eclipse.dltk.python.internal.debug.ui.handlers.ToggleGlobalVariablesHandler" />
    <handler
      commandId="org.eclipse.dltk.python.debug.ui.commands.toggleClassVariables"
      class="org.eclipse.dltk.python.internal.debug.ui.handlers.ToggleClassVariablesHandler" />
    <handler
      commandId="org.eclipse.dltk.python.debug.ui.commands.toggleLocalVariables"
      class="org.eclipse.dltk.python.internal.debug.ui.handlers.ToggleLocalVariablesHandler" />     
  </extension>

--
-jae

Back to the top