Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-debug-dev] Launch Configuration API Feedback


Comments below

* Dependencies between tabs
I like the ideas about communicating between tabs using the working copy, and I like the new tab cycle, where the tabs are updated on exit and entry.  

* Global initialization of configuration values/overriding default values that a tab places in a configuration
With respect to overriding the default values I am a little confused as to how this will happen.  Are you saying that each tab will still update the defaults as they are now, but then the tab group setDefaults will be called last to override anything it wants?  If that is true then it would be ok, assuming that the java tabs are very relaxed about setting defaults.  I would not want to have the java tabs throw some excpetion when it can't find the classpath on a project, and I am about to override the classpath anyway.

* Tab re-use
Glad to hear that the java tabs will be made quasi-public.

* Java Launch Configuration Delegate Reuse
Creating an AbstractJavaLaunchConfigurationDelegate which is public is great if people want to change the way that the java launching happens, but what I really want to do is to use the java launch delegates exactly as they are.  Now, I don't have to redo the validation but I still have to copy the actual launch code, which is the most interesting part of the class.



Darin_Wright@xxxxxxx
Sent by: platform-debug-dev-admin@xxxxxxxxxxx

03/19/2002 08:20 PM
Please respond to platform-debug-dev

       
        To:        platform-debug-dev@xxxxxxxxxxx
        cc:        
        Subject:        Re: [platform-debug-dev] Launch Configuration API Feedback




There a few common issues that have come up with regards to the launch configuration tab API:
* Dependencies between tabs
* Global initialization of configuration values/overriding default values that a tab places in a configuration
* Tab re-use

To address these problems, we intend to introduce the concept of a "tab group" (and corresponding interface ILaunchConfigurationTabGroup). A tab group will be to tabs, as a wizard is to wizard pages. The tab extendsion point will be replaced with a "tab group" extension point. Following is the proposed tab group interface definition. As well, we will provide an abstract implementation of a tab group that does everything except create the tabs specific to the group.

To address the first problem, tab grops that want to perform custom initialization would override #setDefaults(...). To address the second problem (tab dependencies, or inter-tab communication), we will adpot the suggested mechanism of applying values to a configuration when a tab is exited, and initializing from a configuration when a tab is entered. This means that tabs should communicate via launch configuration attributes. (Tabs could interact directly with other tabs in a tab group, but this reduces the possibility of tab re-use).

There are several considerations when it comes to tab re-use.
* The "Common" tab will be promoted to API such that all configruations may re-use the tab.
* The Java tabs will be promoted to API, but they are not intended to be subclassed - only instantiated.  The classes will have public constructors, but all implementation will be considered internal and non-public. The reason for this is that the tabs are expected to change dramatically in the near term, as we receive user feedback. It is not possible to consider the tabs as stable API. Currently, the only inter-tab dependency is the notion of a "project" which is used to set default values (i.e. classpath). The tabs will use the launch configuration working copy mechanism to perform this communication. Creating a "java tab" framework is not something that we have time to do in the 2.0 release.
* Please note that there is now an "AbstractJavaLaunchConfigurationDelegate" which is public API. It provides convenience methods for verifying launch configuration attributes.

Please let us know if there any concerns as soon as possible. Thanks.

Darin

--------------------------------------------------------------------

package org.eclipse.debug.ui;

/*
 * (c) Copyright IBM Corp. 2000, 2001.
 * All Rights Reserved.
 */

import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
 
/**
 * A launch configuration tab group is used to edit/view attributes
 * of a specific type of launch configuration. Launch
 * configurations are presented in a dialog, with a tab folder.
 * Each tab manipulates one ore more attributes of a launch
 * configuration. The tab group controls which tabs are
 * displayed for a specific type of launch configuration,
 * and provides a mechanism for overriding configuration
 * initialization performed by tabs.
 * <p>
 * The tab group's lifecycle begins when <code>createTabs(ILaunchConfigurationDialog, String)</code>
 * is called. A tab group may then be asked repeatedly to initialize its
 * tabs to display values for a launch configuration (see
 * <code>initializeFrom(ILaunchConfiguration)</code>), and to
 * apply its current settings to a launch configuration (see
 * <code>performApply(ILaunchConfigurationWorkingCopy)</code>).
 * While a user manipulates a tab's controls, the tab is not
 * intended to update a launch configuration. Updating a launch
 * configuration should only be performed when <code>performApply</code>
 * is called. To end a tab group's lifecyle, <code>dispose()</code> will
 * be called. Note that a tab group can be disposed before its controls
 * have been created.
 * </p>
 * When a user leaves a tab, a tab is asked to apply its current settings
 * to a launch configuration working copy. When a tab is entered, it is
 * asked to initialize itself from a working copy. This mechanism is used
 * to support inter-tab dependencies.
 * <p>
 * To support single-click launching, a tab group is required to initialize
 * default values into launch configurations (possibly when controls
 * have not been created). See <code>setDefaults(ILaunchConfigurationWorkingCopy)</code>.
 * As well, the method <code>launched</code> can be called when the ! tab's
 * control does not exist.
 * </p>
 * <p>
 * A launch configuration group extension is defined in <code>plugin.xml</code>.
 * Following is an example definition of a launch configuration
 * group extension.
 * <pre>
 * &lt;extension point="org.eclipse.debug.ui.launchConfigurationTabGroups"&gt;
 *   &lt;launchConfigurationTabGroup
 *      id="com.example.ExampleTabGroup"
 *      type="com.example.ExampleLaunchConfigurationTypeIdentifier"
 *      class="com.example.ExampleLaunchConfigurationTabGroupClass"
 *   &lt;/launchConfigurationTabGroup&gt;
 * &lt;/extension&gt;
 * </pre>
 * The attributes are specified as follows:
 * <ul>
 * <li><code>id</code> specifies a unique identifier for this launch configuration
 *  tab group.</li>
 * <li><code>type</code> specifies launch configuration type that this tab
 *  group is applicable to (corresponds to the id of a launch configuration type
 *  extension).</li>
 * <li><code>class</code>specifies a fully qualified name of a Java class
 *  that implements <code>ILanuchConfigurationTabGroup</code>.</li>
 * </ul>
 * </p>
 * <p>
 * This interface is intended to be implemented by clients.
 * </p>
 * <p>
 * <b>NOTE:</b> This class/interface is part of an interim API that ! is still under development and expected to
 * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
 * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
 * (repeatedly) as the API evolves.
 * </p>
 * @see ILaunchConfigurationType
 * @see ILaunchConfiguration
 * @see ILaunchConfigurationTab
 */
public interface ILaunchConfigurationTabGroup {

        /**
         * Creates the tabs contained in this tab group for the specified
         * launch mode. The tabs control's are not created. This is the
         * fist method called in the lifecycle of a tab group.
         *
         * @param dialog the launch configuration dialog this tab group
         *  is contained in
         * @param mode the mode the launch configuration dialog was
         *  opened in
         */
        public void createTabs(ILaunchConfigurationDialog dialog, String mode);
       
        /**
         * Returns the tabs contained in this tab group.
         *
         * @return the tabs contained in this tab group
         */
        public ILaunchConfigurationTab[] getTabs();

        /**
         * Notifies this launch configuration tab group that it has
         * been disposed, and diposes this group's tabs. Marks the tt>end
         * of this tab group's lifecycle, allowing this tab group t>to
         * perform any cleanup required.
         */
        public void dispose();
                       
        /**
         * Initializes the given launch configuration with
         * default values for this tab group. This method
         * is called when a new launch configuration is created
         * such that the configuration can be initialized with
         * meaningful values. This method may be called before
         * tab controls are created, to support single-click launching.
         *
         * @param configuration launch configuration
         */
        public void setDefaults(ILaunchConfigurationWorkingCopy configuration);        
       
        /**
         * Initializes this group's tab controls with values from the given
         * launch configuration. This method is called when
         * a configuration is selected to view or edit.
         *
         * @param configuration launch configuration
         */
        public void initializeFrom(ILaunchConfiguration configuration);                
               
        /**
         * Copies values from this group's tabs into the given
         * launch configuration.
         *
         * @param configuration launch configuration
         */
        public void performApply(ILaunchConfigurationWorkingCopy configuration);
       
        /**
         * Notifies this tab that the specified configuration has been
         * launched, resulting in the given launch. This method can be
         * called when a tab's control does not exist, to support single-click
         * launching.
         *
         * @param launch the result of launching the current
         *  launch configuration
         */
        public void launched(ILaunch launch);
}





Matt_Lavin@xxxxxxx
Sent by: platform-debug-dev-admin@xxxxxxxxxxx

03/15/2002 07:31 AM
Please respond to platform-debug-dev
       
        To:        platform-debug-dev@xxxxxxxxxxx
        cc:        
        Subject:        [platform-debug-dev] Launch Configuration API Feedback



I have been working on a CDS(OSGi client) Launcher using the new launch configurations and I have some feedback.  I know that some of these problems are with the java debug code but I am not a member of the java-debug newsgroup and I figured they would get read here also.  I understand that some of these concerns have been mentioned before but I wanted you to know that they are desired by more than one person.  I have avoid writing bug reports for these things since some should be discussed first and some are duplicates.

General Problems
1.  Changes on one page do not get reflected onto another page.  For example, if I attach the JavaArgumentsTab and a different tab that analyzes the arguements to display some things to the user then if the user makes a change in the Arguements tab, my custom tab does not get notifed.  I personally think that this is a pretty simple problem to solve since they concept of a workingcopy already exists.  Right now the page is intialized from the LaunchConfiguration one time and the changes in the page are only applyed at the very end.  If the initializeFrom method was changed to use a ILaunchConfigurationWorkingCopy instead of  a ILaunchConfiguration, and the method was called each time the tab was shown then one page could effect other pages.  Another change that would have to be made would be to call performApply when each tab is switched away from.  A properly written tab should handle this already. &! nbsp;I think! that these chang! es would be very minor since the ILaunchConfigurationWorkingCopy is actually a sub interface of ILaunchConfiguration.  The methods on ILanchConfiguationTab would be more consistant since each method would have the same paramater.

2.  There is no general way to initialize the values of a page to what you want them to be.  For instance, the java pages all populate there settings based on the currently selected project, but if I want to override the settings I have to subclass the tab and override the setDefaults method.  Some initializer class could be made seperate and the setDefaults method could be removed.  That would also mean a headless launch configuration could set its defaults without loading a UI component.

Java Problems
1.  The java launch config delegate is not public.  
2.  The java launch config delegate generally loads all of its paramters from the launch configuration passed to it.  The only exception to this is the source locator.  If the source locator is not specified in the launch config it is created by the project.  This is the only option that this is done for an is very inconsistant.  I would suggest that the Project attribute be removed compeltly and all needed options should be made part of the launch configuration.
3.  The java tabs are not API and cannot be reused
4.  If the java tabs where API the widgets are marked as private so the subclasses could not programaticly disable certian options.






Back to the top