Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344545 - 'Append launch configuration name' feature might not work
Summary: 'Append launch configuration name' feature might not work
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 RC1   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-03 06:06 EDT by Dani Megert CLA
Modified: 2011-05-16 09:28 EDT (History)
6 users (show)

See Also:
pawel.1.piech: review+
markus.kell.r: review+


Attachments
Fix (17.10 KB, patch)
2011-05-10 10:28 EDT, Dani Megert CLA
no flags Details | Diff
PDE only fix (5.50 KB, patch)
2011-05-11 05:48 EDT, Dani Megert CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2011-05-03 06:06:51 EDT
3.7 M7.

If the user already has a workspace at <chosen default> + "New_configuration" then the 'append' feature won't work.

We should update the location if the configuration is newly added.
Comment 1 Dani Megert CLA 2011-05-03 06:07:31 EDT
We should try to find a fix for RC1.
Comment 2 Dani Megert CLA 2011-05-10 10:26:30 EDT
The launch configuration handling in the launch configuration dialog is a bit messy:
- as soon as one adds a new one, it gets saved instead of staying a working 
  copy (==> launch configuration stays, even if I cancel the dialog)
- the information about whether a launch config is old, new or duplicated
  is not available
- transient attributes on the working copy are not possible: all attributes are
  considered persistent ones


This patch add a new launch configuration attribute (to me made API in 3.8) which is then consumed by PDE to decide whether a launch configuration is new or not.

Pawel or Mike: can you check the Debug part of the patch? The only thing I'm not 100% sure is whether saving again on close might do some harm.
Comment 3 Dani Megert CLA 2011-05-10 10:28:01 EDT
Created attachment 195222 [details]
Fix
Comment 4 Dani Megert CLA 2011-05-10 10:59:18 EDT
This patch makes the workspace location auto-update more predictable for the user as it now only (but consistently) happens for new (but not duplicated) launch configurations and no longer depends on whether there's already a resource on disk at that location.
Comment 5 Michael Rennie CLA 2011-05-10 11:49:14 EDT
> If the user already has a workspace at <chosen default> + "New_configuration"
> then the 'append' feature won't work.

Some updated steps:

1. create a new Eclipse launch configuration - location correctly has name appended
2. select the new configuration and duplicate it - location is the same as the original and does not have the duplicated name appended
Comment 6 Michael Rennie CLA 2011-05-10 11:57:56 EDT
I'm not sure how I feel about the platform debug changes for 3.7.

I think, if anything, for 3.7 this should be a PDE-only fix. Perhaps a new attribute to know if the user has edited the location field? If the user has not edited the field (based on the new flag attribute), auto-update the location value in the initializeFrom call-back in WorkspaceDataBlock.
Comment 7 Dani Megert CLA 2011-05-10 12:00:30 EDT
(In reply to comment #6)
> I'm not sure how I feel about the platform debug changes for 3.7.
> 
> I think, if anything, for 3.7 this should be a PDE-only fix.

We need to know whether the launch configuration is new. I'd be very happy to hear how this can be done with a PDE only code change :-)
Comment 8 Dani Megert CLA 2011-05-10 12:04:23 EDT
(In reply to comment #6)
> I'm not sure how I feel about the platform debug changes for 3.7.
What part(s) of the fix worries you?
Comment 9 Pawel Piech CLA 2011-05-10 12:19:26 EDT
I don't think the extra save should do any harm. In the worst case it would just cause some extra processing by launch listeners.  I'm not as familiar with the launch configurations handling as Mike though.
Comment 10 Michael Rennie CLA 2011-05-10 12:22:43 EDT
> What part(s) of the fix worries you?

I guess the biggest concern is adding a new attribute this late in the game.

> We need to know whether the launch configuration is new. I'd be very happy to
> hear how this can be done with a PDE only code change :-)

What if we added a new attribute like loc_edited=false during the #setDefaults call-back, then if the user manually edits the location we set it to loc_edited=true. Then say you wanted to duplicate the configuration; in the the #initializeFrom call-back you ask "is it the default (loc_edited == false) or has the user changed it (loc_edited=true)?", if it is the default, generate a new location attribute with the current name.

The down-side of this fix is that each time #initializeFrom is called you will check this new attribute, but the impact would be minimal.
Comment 11 Dani Megert CLA 2011-05-11 05:47:58 EDT
>I guess the biggest concern is adding a new attribute this late in the game.
I don't see a risk with that. The only thing I was not 100% sure is the additional save which can trigger event.

Mike, I like your suggested solution. The only difference will be that as soon as the user applies/saves the changes, he locks the launch configuration. One could even see this as a plus.
Comment 12 Dani Megert CLA 2011-05-11 05:48:30 EDT
Created attachment 195319 [details]
PDE only fix
Comment 13 Dani Megert CLA 2011-05-11 05:48:54 EDT
Markus, can you try the new patch?
Comment 14 Markus Keller CLA 2011-05-11 08:33:58 EDT
(In reply to comment #12)
> Created attachment 195319 [details] [diff]
> PDE only fix

Good that we took the extra turn. This is much better. +1 for RC1.
Comment 15 Dani Megert CLA 2011-05-11 08:36:55 EDT
Committed patch to HEAD.
Comment 16 Raksha Vasisht CLA 2011-05-16 09:28:14 EDT
Verified for RC1 with I20110514-0800.