Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 254970

Summary: [ds tooling] Service Component wizard: Persist "File name" field
Product: [Eclipse Project] PDE Reporter: Simon Archer <sja.eclipse>
Component: UIAssignee: Chris Aniszczyk <caniszczyk>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: caniszczyk
Version: 3.5   
Target Milestone: 3.5 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
DSWizard and WizardPage updates
caniszczyk: iplog+
mylyn/context/zip none

Description Simon Archer CLA 2008-11-11 21:52:22 EST
Using Eclipse 3.5M3. Extracted from bug 253635.

The value of the "File name" field should be persisted (using either dialog settings or plug-in preferences) so that the user does not have to enter their preferred name every time.

While the default is "component.xml", it would be annoying for people that don't want to use this filename, so the wizard should persist the field value so that the user only needs to enter it once.  This is consist with the way the new Plug-in Project wizard works.
Comment 1 Rafael Oliveira Nóbrega CLA 2008-11-18 17:11:42 EST
Created attachment 118198 [details]
DSWizard and WizardPage updates

Done.
Comment 2 Simon Archer CLA 2008-11-18 17:59:02 EST
I tried the patch and it works well. The only problem I saw was that the pre-populated "File name:" field is not get validated, so if the file already exists you end up overwriting it! This feels like one of those cases where the field's change listener is added after the field's default value is set. 

Test case:

1. Use the wizard to generate a service component document, say "component.xml".

2. Use the wizard to generate another service component document in the same folder, and accept the default "File name:" field value of "component.xml".  You'll NOT get an error saying that the "component.xml" file already exists.

3. Try "touching" the "File name:" field's value and then you'll get the error message.

You should get the error message immediately and it should not be necessary to touch the "File name:" field.
Comment 3 Rafael Oliveira Nóbrega CLA 2008-11-18 18:12:35 EST
Simon,

I reproduced what you said. Actually, this is implemented by WizardNewFileCreationPage or its parent's classes.

Probably this is from validatePage() method too. 
Comment 4 Chris Aniszczyk CLA 2008-12-08 12:15:13 EST
done.

> 20081208
Comment 5 Chris Aniszczyk CLA 2008-12-08 12:15:16 EST
Created attachment 119818 [details]
mylyn/context/zip