Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-debug-dev] Some questions about using the LaunchView Context support.


Hi Darin/Jared,

I have a question about how to get the LaunchView Context support to do what I'm looking for.

Basically we have some Views that we would like to hide when there is no debug target running for which they make sense.   So for simplicity let's consider the "Modules" view that is used for Compiled Language Debug.  
The flow I'm trying to get to is the following:

1.  When the user goes to a fresh Debug Perspective the Modules View is not shown (reduction of initial clutter)
2.  When the user starts a Java Debug Session the Modules View is not shown (not applicable yet)
3.  When the user starts a Compiled Debug Session the Modules View is then shown.
4.  When the user decides to go back and do some Java Debugging the Modules View does not disappear (since the Compiled Debug Session is still running)
5.  When the user terminates the Compiled Debug Session, the Modules View is removed.

I can get some of this working, but am having some issues in a couple spots:

1.  It seems that on a fresh Debug Perspective, the LauchViewContext Listener deems there to be no active contexts so it shows all views.
4.  I can't seem to find the right combination of autoOpen/autoClose settings to both allow the Modules view to only open for the Compiled Debug context, but ALSO stay open when the user selects a Java Stack Frame.   So what I think I'm asking for is that my context bindings be respected even if my StackFrame is not selected in the Debug View.   Just the fact that it's there, means I may want to examine the contents of the views.  I don't necessarily want all my Compiled Language Views to disappear when I click on a different type of Stack Frame.   But I DO want my views to disappear when there is no applicable Stack Frame. (does that make sense?)

Just FYI on what I'm working with:

1.  I implemented IDebugModelProvider for our Compiled Language Stack Frame.    It returns the following:
public String[] getModelIdentifiers() {
                String modelID = new String("com.ibm.debug.pdt");
                return new String[] {modelID};
        }

2.  Then I have the following in the plugin.xml

   <!-- Context support -->
   <extension
         point="org.eclipse.ui.contexts">
      <context
            name="Debugging Compiled Languages"
            description="Debugging Compiled Languages"
            id="com.ibm.debug.pdt.ui.debugging">
      </context>
   </extension>
   <extension
         point="org.eclipse.debug.ui.debugModelContextBindings">
      <modelContextBinding
            debugModelId="com.ibm.debug.pdt"
            contextId="com.ibm.debug.pdt.ui.debugging">
      </modelContextBinding>
   </extension>
   <extension
         point="org.eclipse.debug.ui.contextViewBindings">
      <contextViewBinding
            viewId="com.ibm.debug.pdt.ui.ModulesView"
            contextId="com.ibm.debug.pdt.ui.debugging"
            autoOpen="true"
            autoClose="false">
      </contextViewBinding>
    </extension>
   <!-- End of Context support -->

Thanks...Jeff.

Back to the top