Bug 284885 - [launching] manage launch configurations using features (feature based launching)
Summary: [launching] manage launch configurations using features (feature based launch...
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 3.6 M6   Edit
Assignee: Ankur Sharma CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
: 26165 (view as bug list)
Depends on: 284882 300507
Blocks: 284887
  Show dependency tree
 
Reported: 2009-07-28 11:43 EDT by Curtis Windatt CLA
Modified: 2010-09-15 04:38 EDT (History)
10 users (show)

See Also:
curtis.windatt.public: review+


Attachments
WIP Patch (42.60 KB, patch)
2010-01-20 13:32 EST, Ankur Sharma CLA
no flags Details | Diff
Working Patch (14.29 KB, patch)
2010-02-05 13:32 EST, Ankur Sharma CLA
no flags Details | Diff
Working Patch (45.75 KB, patch)
2010-02-16 08:10 EST, Ankur Sharma CLA
no flags Details | Diff
Patch with changes as described in comment 15 (26.56 KB, patch)
2010-02-19 13:49 EST, Ankur Sharma CLA
no flags Details | Diff
fixed launching (13.06 KB, patch)
2010-02-19 17:38 EST, Ankur Sharma CLA
no flags Details | Diff
Patch to fix launching of legacy launch configs (1.18 KB, patch)
2010-02-23 15:47 EST, Achim Demelt CLA
ankur_sharma: iplog+
Details | Diff
New UI Patch (29.62 KB, patch)
2010-03-04 06:33 EST, Ankur Sharma CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Windatt CLA 2009-07-28 11:43:25 EDT
When launching an Eclipse application, if the user wants to customize what to include in the launch configuration, they must select individual plug-ins.  This can be quite difficult due to the number of plug-ins available.

Launch configs could be managed by features.
Comment 1 Chris Aniszczyk CLA 2009-07-28 11:46:58 EDT
Are features being improved at all at the core level (via the p2 team)?
Comment 2 Curtis Windatt CLA 2009-07-28 11:52:04 EDT
(In reply to comment #1)
> Are features being improved at all at the core level (via the p2 team)?
> 

Features are going to be an important consideration in 3,6 for p2, but I don't know what improvements, if any, will come of it.
Comment 3 Chris Aniszczyk CLA 2009-07-28 11:56:48 EDT
Also, we should consider making this a bit extensible.

Some people like to launch via features... some via bundles... some via packages...

Some people have also defined things similar to features. For example, the SpringSource people have PARs (http://static.springsource.com/projects/dm-server/1.0.x/programmer-guide/html/ch04.html#architecture-pars) and the spec has a notion of "Bundle-Category" (which is crap, but some people use it)

Essentially, it comes down to a mechanism that allows people to group bundles in some fashion.
Comment 4 Darin Wright CLA 2009-12-16 12:41:23 EST
Discussed feature based launch with Ankur and Curtis. We are proposing the following:

* On the Plug-ins tab, add a new option in the drop down called "features and plug-ins selected below"
* When the option is selected that tab will display a composite with two panes. The top pane will be a check box table of available workspace and external features. The table will contain *one* entry for each available feature and have a column cell editor to allow the user to choose between workspace and external feature (if available in both the workspace an target platform).
* By default, workspace features will be chosen over external features
* A second pane (arranged below the features pane) will show what bundles are contained in the feature selected in the top pane (basically a "feature details pane"). We do not intend to support editing in this pane - you get all the bundles in the feature and workpace bundles are chosen over external bundles in the target platform.
* Operations (buttons) availabe in the features pane are:
  - Select All
  - Deselect All
  - Add Required Features
  - Add Required Bundles
  - Use Workspace Feature
  - Use External Feature
  - Restore Defaults
* We likely need the operation to "add required bundles" in the event that a selected feature and its required features don't have all bundles required to run. In this case, we'll need to create a fake "group" of bunldes in the features pane called "Required Bundles", and add those bundles here.
* The "Use Workspace/Exeternal Feature" buttons would be used to change where a feature originates from - the workspace or external target platform. They would also work for a multi-select scenarios.
* This feature would appear on OSGi ad Eclipse Application launch configurations.
* We will also add a "filter" text box at the top of the feature pane to allow a subset of the list to be displayed
Comment 5 Darin Wright CLA 2009-12-16 12:43:51 EST
Additional notes:

* Available features are derived from the ExternalFeatureModelManager and the FeatureModelManager.
* The launch configuration itself needs to store selected features in addition to selected plug-ins. So if the user moves between plug-in/feature modes, their selection is still maintained.
* The launch delegate needs to generate a plug-in/bundle launch list dynamically from the chosen features, as one of the common use cases of feature based launch is to deal with a set of changing bundles within features.
Comment 6 Ankur Sharma CLA 2009-12-16 13:00:30 EST
(In reply to comment #4)
> The top pane will be a check box table of available workspace and external
> features. The table will contain *one* entry for each available feature and
> have a column cell editor to allow the user to choose between workspace and
> external feature (if available in both the workspace an target platform).

We can now have multiple features with same id and different versions (bug #18500). How we manage them? A checkbox saying "Pick only latest version"?
Comment 7 Darin Wright CLA 2009-12-16 13:09:56 EST
In general, I don't think you can install different versions of a feature at the same time... In a runtime, I would think that only one version could be installed, so we should only allow you to launch one. (I'm not sure the import work in bug 18500 allows mutltiple versions of features to be imported - as feature import is a separate action/wizard).

That being said, one could have two projects in the workspace for the same feature. This should be uncommon. To keep it simple, we could choose the newest version in the workspace.

However, we'll also need an "Add Bundles" button to selectively add bundles to a launch. For example, select some features to launch and then add a test bundle that is not part of any feature. This will add the selected (bundle(s)) to the "Other" or "Required Bundles" group.
Comment 8 Ankur Sharma CLA 2010-01-20 13:32:03 EST
Created attachment 156688 [details]
WIP Patch

The UI needs a little finishing touches.
Comment 9 Curtis Windatt CLA 2010-01-22 14:46:41 EST
In M6 when the launching is working, I'll help with the UI.  Integrate it with the FilteredCheckboxTree proposed in bug 300507.
Comment 10 Ankur Sharma CLA 2010-02-05 13:32:26 EST
Created attachment 158334 [details]
Working Patch

Sord order persisted
Launching fixed

Add required bundles remains
Comment 11 Ankur Sharma CLA 2010-02-05 13:36:32 EST
I had to add a dummy attribute to config file to make the tab dirty. The sort order is persisted in preferences and not in config file. Thus, when sort order changes, the tab doesnt gets marked dirty because it looks for changes in config file. I have added an undocumented dummy attribute just to get the 'apply changes'. suggest me any better alternative approach.
Comment 12 Darin Wright CLA 2010-02-08 12:29:09 EST
(In reply to comment #11)
> I had to add a dummy attribute to config file to make the tab dirty. The sort
> order is persisted in preferences and not in config file. Thus, when sort order
> changes, the tab doesnt gets marked dirty because it looks for changes in
> config file. I have added an undocumented dummy attribute just to get the
> 'apply changes'. suggest me any better alternative approach.

There should be no attribute in the config for this. When the user changes the sort order, simply update the preference immediately. It's not something they should have to "apply" - it's just presentation and has nothing to do with the actual config.
Comment 13 Curtis Windatt CLA 2010-02-10 15:37:31 EST
For the UI, there is a new PDE implementation of the FilteredCheckboxTree that would be worth trying to use here.
Comment 14 Ankur Sharma CLA 2010-02-16 08:10:44 EST
Created attachment 159172 [details]
Working Patch

Patch applied in HEAD. UI updated. The Launch is not yet 100% - working on it. Curtis, you may go ahead with FilteredCheckboxTree related changes in meantime.
Comment 15 Curtis Windatt CLA 2010-02-16 17:23:12 EST
I've switch the UI over to the FilteredCheckboxTree and make a few tweaks.  Found a number of things that should be fixed.  I don't plan on working on them right now, but I can probably help with them later.

There is one issue that I'm having that I will have to spend more time on this week.  The combo boxes for the cell editors keep opening behind the tree.

1) Can't use GRAY/WHITE colors for the backgrounds as the user may be using a high contrast setting.
2) Instead of having 6 maps, there should be a single list of features (possibly a custom object to store resolution/location).
3) I had a few problems with the select all buttons, probably due to the filtering.
4) If the user has not previously turned on feature based launching the default setting should be all features checked.
5) The cell editor combos may need minimum widths set because of the sizing of the controls on the Mac (see AbstractPluginBlock)
6) The counter should be aligned to the bottom of the tree. (I see there is code t try and fix this, but it isn't working correctly).
7) There is some dead space at the bottom of the tree, no idea where it is being created.
Comment 16 Ankur Sharma CLA 2010-02-17 03:20:44 EST
(In reply to comment #15)
> I've switch the UI over to the FilteredCheckboxTree and make a few tweaks. 
> Found a number of things that should be fixed.  I don't plan on working on them
> right now, but I can probably help with them later.

I can fix them up. Will seek your help if am stuck.

> There is one issue that I'm having that I will have to spend more time on this
> week.  The combo boxes for the cell editors keep opening behind the tree.

OK
 
> 1) Can't use GRAY/WHITE colors for the backgrounds as the user may be using a
> high contrast setting.
What colors shall be used then? or shall be remove the conditional enabling of combos completely?

> 2) Instead of having 6 maps, there should be a single list of features
> (possibly a custom object to store resolution/location).
Right. I wanted to push in the UI changes fast so that filtered tree can come in sooner. Will fix it now.

> 3) I had a few problems with the select all buttons, probably due to the
> filtering.

Will analyze. didnt notice it.

> 4) If the user has not previously turned on feature based launching the default
> setting should be all features checked.

will fix it

> 5) The cell editor combos may need minimum widths set because of the sizing of
> the controls on the Mac (see AbstractPluginBlock)

will fix it

> 6) The counter should be aligned to the bottom of the tree. (I see there is
> code t try and fix this, but it isn't working correctly).

working on it
Shall we have a checkbox to hide source features? not sure how we will identify the source features though.

> 7) There is some dead space at the bottom of the tree, no idea where it is
> being created.

working on it.
Comment 17 Curtis Windatt CLA 2010-02-17 10:06:43 EST
(In reply to comment #16)
> What colors shall be used then? or shall be remove the conditional enabling of
> combos completely?

I don't know offhand how we can give cells a disabled look.  Will have to look around for an example.

> Shall we have a checkbox to hide source features? not sure how we will identify
> the source features though.

I don't believe there is anything distinct about the source features that would allow them to be identified (except for having source in their names).  I don't think this is worth looking into unless it has been explicitly requested.
Comment 18 Ankur Sharma CLA 2010-02-19 13:49:34 EST
Created attachment 159601 [details]
Patch with changes as described in comment 15

New model structure
few GUI cleansing
version persistence removed
Comment 19 Ankur Sharma CLA 2010-02-19 13:53:56 EST
> 2) Instead of having 6 maps, there should be a single list of features
> (possibly a custom object to store resolution/location).
Done in attached patch

> 3) I had a few problems with the select all buttons, probably due to the
> filtering.

still cant find any issues with it

> 6) The counter should be aligned to the bottom of the tree. (I see there is
> code t try and fix this, but it isn't working correctly).

not able to get it right

> 7) There is some dead space at the bottom of the tree, no idea where it is
> being created.

dead space is part of tree control. Picasso revealed it.
Comment 20 Curtis Windatt CLA 2010-02-19 14:28:15 EST
Comment on attachment 159601 [details]
Patch with changes as described in comment 15

Committed a modified version of the patch.  Fixed the spacing and column editor problems by correcting the editor parent (was pointing at the composite holding the filtered tree).  Also fixed the location of the count.  Added some comments and cleanup.
Comment 21 Curtis Windatt CLA 2010-02-19 14:49:49 EST
Trying to launch with all features selected results in an AIOOBE.  The BundleHelper is assuming there will always be four entries when there may not be.

java.lang.ArrayIndexOutOfBoundsException: 3
at org.eclipse.pde.internal.launching.launcher.BundleLauncherHelper.getFeatureMaps(BundleLauncherHelper.java:404)
at org.eclipse.pde.internal.launching.launcher.BundleLauncherHelper.getMergedBundleMap(BundleLauncherHelper.java:89)
at org.eclipse.pde.launching.EclipseApplicationLaunchConfiguration.preLaunchCheck(EclipseApplicationLaunchConfiguration.java:246)
at org.eclipse.pde.launching.AbstractPDELaunchConfiguration.launch(AbstractPDELaunchConfiguration.java:57)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:919)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1122)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 22 Ankur Sharma CLA 2010-02-19 14:51:41 EST
(In reply to comment #21)
> Trying to launch with all features selected results in an AIOOBE.  The
> BundleHelper is assuming there will always be four entries when there may not
> be.
> 

That's because BundleLauncherHelper didn't get checked in from the patch.
Comment 23 Curtis Windatt CLA 2010-02-19 14:55:42 EST
(In reply to comment #22)
> That's because BundleLauncherHelper didn't get checked in from the patch.

Still happens after I fixed the missing update to BundleLauncherHelper.
Comment 24 Ankur Sharma CLA 2010-02-19 15:01:52 EST
(In reply to comment #23)
> (In reply to comment #22)
> > That's because BundleLauncherHelper didn't get checked in from the patch.
> 
> Still happens after I fixed the missing update to BundleLauncherHelper.

There are few other bugs too. Am working on it. Will check in the fix soon.
Comment 25 Ankur Sharma CLA 2010-02-19 17:38:34 EST
Created attachment 159628 [details]
fixed launching

fixed other ui problems
launching is working now
Comment 26 Curtis Windatt CLA 2010-02-22 10:54:43 EST
The current code in HEAD doesn't appear to launch.  No application service.  I checked the config.ini that is written out and the osgi.bundles property is empty.  Without the simpleconfigurator being started and included on the osgi.bundles property, we never write out the bundles.info.

java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
Comment 27 Achim Demelt CLA 2010-02-23 15:47:50 EST
Created attachment 159993 [details]
Patch to fix launching of legacy launch configs

There seem to be problems when launching "legacy" launch configs, i.e. those that were not aware of feature-based launching at their time of creation. In other words basically all launch configs out there ;-) I stumbled across this in the course of a bug with headless launching with Buckminster, which is using the bleeding edge o.e.pde.launching bundle. See http://www.eclipse.org/forums/index.php?t=msg&th=163025&start=0& for background.

The attached patch changes the code to assume a "false" default value for the USE_CUSTOM_FEATURES property if no value is given in the launch config. It thus falls back to (legacy) plug-in based launching, which is exactly what you want for legacy launch configs.

The patch is applicable to CVS HEAD.
Comment 28 Curtis Windatt CLA 2010-03-03 12:20:32 EST
I am proposing that we make one more significant change for M6.  I think that having such granular control over where features and plug-ins are coming from is necessary.  I think that having a single radio button or checkbox to control whether features come from the workspace (if available) or externally is enough.

I think we'll still need to have the plug-in location options as users have the ability to do so on when managing configs using plug-ins.

I'll work something up so when Ankur can give his thoughts when he is available.
Comment 29 Ankur Sharma CLA 2010-03-04 06:33:41 EST
Created attachment 160923 [details]
New UI Patch

Patch with new UI
Comment 30 Ankur Sharma CLA 2010-03-04 06:34:57 EST
(In reply to comment #28)
> I'll work something up so when Ankur can give his thoughts when he is
> available.

I have attached the patch with these changes. Have a look and let me know if I got it right.
Comment 31 Curtis Windatt CLA 2010-03-04 09:53:35 EST
I have a large number of my changes in my workspace, but was unable to get everything in working order last night, didn't want compile errors in the build :)  Sorry, I will get them in as soon as I can.
Comment 32 Curtis Windatt CLA 2010-03-04 17:01:21 EST
My changes have been committed.  Significant changes to the UI, overhaul of the backing model, fixes to how required plug-ins are calculated.

Only remaining issue that I see is that org.eclipse.sdk is required to launch the application.  However, because it is not a bundle, it doesn't get included in the requirements (or as a required feature).  We may have to put in some sort of hack to add it to the list (but it would be affected by what application the user has chosen to launch with).
Comment 33 Gunnar Wagenknecht CLA 2010-03-05 02:53:57 EST
(In reply to comment #32)
> Only remaining issue that I see is that org.eclipse.sdk is required to launch
> the application.  However, because it is not a bundle, it doesn't get included
> in the requirements (or as a required feature).  We may have to put in some
> sort of hack to add it to the list (but it would be affected by what
> application the user has chosen to launch with).

What about launching "non-sdk" Eclipse applications? That works currently without the need of "org.eclipse.sdk".
Comment 34 Curtis Windatt CLA 2010-03-05 09:38:28 EST
(In reply to comment #33)
> What about launching "non-sdk" Eclipse applications? That works currently
> without the need of "org.eclipse.sdk".

Which is why if we put a hack in to include the sdk feature we'll have to check what application is being run first.
Comment 35 Chris Aniszczyk CLA 2010-03-05 12:37:21 EST
Any interesting thing that comes up with this feature is the "Plug-ins" tab. The "Plug-ins" name isn't really accurate anymore.

Should we consider renaming it and if so, what?
Comment 36 Curtis Windatt CLA 2010-03-05 12:44:44 EST
(In reply to comment #35)
> Any interesting thing that comes up with this feature is the "Plug-ins" tab.
> The "Plug-ins" name isn't really accurate anymore.
> 
> Should we consider renaming it and if so, what?

Plug-ins is not entirely inaccurate, when you are selecting features you are just selecting groups of plug-ins to launch (and we are even launching required plug-ins).

If we do rename it, I would go with something like "Content".  Keeping it similar to the target editor.
Comment 37 Chris Aniszczyk CLA 2010-03-05 12:52:15 EST
(In reply to comment #36)
> (In reply to comment #35)
> If we do rename it, I would go with something like "Content".  Keeping it
> similar to the target editor.

Content seems to be a good word.

I opened bug 304851 to explore this a bit more.
Comment 38 Curtis Windatt CLA 2010-03-08 11:15:12 EST
Closing as FIXED.  We will be testing this further during the milestone test pass.
Comment 39 Ankur Sharma CLA 2010-09-15 04:38:52 EDT
*** Bug 26165 has been marked as a duplicate of this bug. ***