Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-debug-dev] Perspective switching when using private launch configurations

Hi Joe,

When I talk about the checked preference, I'm referring to the
Preferences->Debug->"Show debug perspective when program is launched in
Debug Mode".  This preference appears to be replaced by the perspective
switching choice on the launch configuration Common tab, but I thought I'd
mention it in case it is still used somewhere.

The reason I'm referring to "private" is the following code, taken from
org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager.java:

     /**
      * Switch to the perspective specified by the
      * launch configuration.
      *
      * @see ILaunchListener#launchAdded(ILaunch)
      */
     public void launchAdded(ILaunch launch) {
          String perspectiveId = null;
          // check event filters
          if (!isPrivate(launch)) {
               try {
                    perspectiveId = getPerspectiveId(launch);
               } catch (CoreException e) {
                    String name = DebugUIPlugin.getDefault
().getModelPresentation().getText(launch);
                    switchFailed(e, name);
               }
               if (perspectiveId != null) {
                    switchToPerspective(perspectiveId);
               }
          }
     }

So even if I set the run perspective, it will be ignored because it is
private.

Thanks.
Kristen


----- Forwarded by Kristen Desarmo/Toronto/IBM on 05/03/2002 05:32 PM -----
Kristen,

When you say you have 'the preference checked', what do you mean?  The only
way a config causes a perspective switch when it is launched is if you have
set the appropriate attribute (for example
IDebugUIConstants.ATTR_TARGET_RUN_PERSPECTIVE) with the desired perspective
ID.

So for example:

// Create config
ILaunchConfigurationWorkingCopy config = .......

// Set config to switch to debug perspective in Run mode
config.setAttribute(IDebugUIConstants.ATTR_TARGET_RUN_PERSPECTIVE,
debugPerspectiveID);

Thus, I don't think this has anything to do with the config being private.

Regarding relaunching private configs: they do not show up in the history
or in the dialog, but it is perfectly valid to relaunch them
programtically.  Thus it's probably better to say that a private config
cannot be relaunched by the user.

HTH,
Joe



                                                                          
  desarmo@xxxxxxxxxx                                                      
  Sent by:                        To:                                     
  platform-debug-dev-admi platform-debug-dev@xxxxxxxxxxx                  
  n@xxxxxxxxxxx                   cc:                                     
                                  Subject:        [platform-debug-dev]    
                          Perspective switching when using private launch 
  05/03/2002 03:21 PM     configurations                                  
  Please respond to                                                       
  platform-debug-dev                                                      
                                                                          




One of our scenarios is the following:  we have a daemon listening for
debug engine connections. When a connection is received, we create a
private launch configuration for it and launch it.  We would then expect to
switch to the debug view (we have the preference checked).
launchAdded(ILaunch) is called, but since the configuration is private, it
does not attempt to open the perspective.  (Note that even if I remove the
private attribute, it still will not switch because the perspective ID is
not set - since we did not use the dialog, the "Common" attributes were not
set.)

My understanding of private was that it was not relaunchable, so it
wouldn't be shown in the dialog or the launch history which is what I am
looking for.  Why does "private" also affect the perspective switching and
can it be changed?

Thanks.

Kristen Desarmo
IBM Distributed Debugger

_______________________________________________
platform-debug-dev mailing list
platform-debug-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-debug-dev








Back to the top