Bug 93351 - [new wizard] Need way to change label texts in NewTypeWizardPage
Summary: [new wizard] Need way to change label texts in NewTypeWizardPage
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 enhancement with 1 vote (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2005-04-30 14:38 EDT by Morten Christensen CLA
Modified: 2006-01-23 03:52 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Morten Christensen CLA 2005-04-30 14:38:09 EDT
I am using org.eclipse.jdt.ui.wizards.NewTypeWizardPage as a base for a wizard
for creating java-like types. I use some of nice controls like the
SuperClassControls but I would like to change the left label text to something
more descriptive for my use case. Unfortunately, I can't currently do this as
all NewTypeWizardPage controls are private and no accessor methods for labels
are available.

Trivial public accessor methods that allow me to change the labels would be nice!!
Comment 1 Dirk Baeumer CLA 2005-05-01 18:34:52 EDT
The API is froozen for 3.1. This has to wait > 3.1
Comment 2 Martin Aeschlimann CLA 2005-05-02 09:34:51 EDT
maybe you can add some extra description on top of the control?
Comment 3 Morten Christensen CLA 2005-05-02 12:55:49 EDT
(In reply to comment #1)
> The API is froozen for 3.1. This has to wait > 3.1

Is it far to late or can it somehow still make it into 3.0 ? It should take 5
minutes to add some access methods. Also, adding a few getters shouldn't
possibly be able to "break" any existing code (not counting for wird reflection
stuff).
Comment 4 Morten Christensen CLA 2005-05-02 15:41:39 EDT
(In reply to comment #3)
> Is it far to late or can it somehow still make it into 3.0 ?

Correction: ... into 3.1 (indeed too late for 3.0 :-))
Comment 5 Martin Aeschlimann CLA 2005-05-03 03:04:28 EDT
At the current stage we are API frozen, and API can only be added by PMC approval.

As a workaround you can override the createXYControls methods and create the
controls yourself. Also create the getXY/setXY method where the values of your
widgets are accessed. Note that accesses can also happen before the controls are
created.

The drawback of doing that for the super class fields is that you would loose
the code assist functionality.
Therefore, as I suggested why not just add an extra description label over or
below the super class control?

Comment 6 Morten Christensen CLA 2006-01-11 15:55:34 EST
Has this been fixed in 3.2?
Comment 7 Martin Aeschlimann CLA 2006-01-12 03:57:36 EST
No, this in not yet implemented. As asked in comment 5, what about just adding an extra description label over or below the super class control? Or is the current term 'superclass' wrong in your context?
Comment 8 Morten Christensen CLA 2006-01-14 20:29:14 EST
I am using the wizard to generate code generation templates files for a special java-like languages. 

The Wizard does almost everything I need, although the meaning of the different settings changes slightly. This makes the current labels somewhat misleading in my case....And I don't like having to include text above the control essentially saying "please disregard the text below .. it really means ...". 

Could you please make the label controls protected or provide an accessor method ?
Comment 9 Martin Aeschlimann CLA 2006-01-18 12:29:06 EST
I can do that. But all errors and warnings will still talk about super classes. The dialog that shows up on browse will also be titeled 'Super Class Selection'.

I don't want to make that customize that as well. Can you still use the new API to customize the labels then?
Comment 10 Morten Christensen CLA 2006-01-18 15:17:08 EST
(In reply to comment #9)
> I can do that. But all errors and warnings will still talk about super classes.
> The dialog that shows up on browse will also be titeled 'Super Class
> Selection'.
> 
> I don't want to make that customize that as well. Can you still use the new API
> to customize the labels then?

Thanks for the warning about "super class" showing up in errors, warnings and the dialog too. Did not notice that. Hmmm, don't know what to do then.

The NewTypeWizardPage is really good and I would prefer to use it as it will take quite some time to duplicate the functionality just in order to change "super class" to "super template" everywhere (also I don't want to maintain a copy if I can avoid it). On the other hand, the term "super class" is really misleading in my case. 

I do understand and respect that we can't have everything change just to allow my kind of customization. On ther other hand, small - however incomplete - changes like making the labels protected could be a start (and provide me with some choice in the matter).

Question: I has been some time since I looked at the source, but isn't there some virtual methods I can override in order to change the dialog which will pop  up? Maybe I can get what I need by overriding a few methods in addition to changing the labels ?
Comment 11 Martin Aeschlimann CLA 2006-01-18 17:05:53 EST
I could make the method protected that open the dialog.

The original idea of the design was more that you don't use createSuperClassControls but have your own method that created label, textfield and browse button. By overriding 'getSuperClass' to access your controls you will be able to use validation and creation.
Comment 12 Morten Christensen CLA 2006-01-19 12:30:18 EST
>I could make the method protected that open the dialog.

Great, sounds like a plan!

>The original idea of the design was more that you don't use
>createSuperClassControls but have your own method that created label, textfield
>and browse button. By overriding 'getSuperClass' to access your controls you
>will be able to use validation and creation.

I can't remember the details, but as far as I remember, if I don't use createSuperClassControls, I would have to do a lot of work to recreate your advanced functionality like completion etc. Right? 

Comment 13 Martin Aeschlimann CLA 2006-01-20 03:43:25 EST
Rebuilding the code assist is also not that much work anymore in 3.2.

However, there are now overridable methods that return the labels and also the choose APIs that open the selection dialogs are now overridable.

released > 20060119
Comment 14 Morten Christensen CLA 2006-01-21 06:54:25 EST
Great, I look forward to try it out in M6!

Thanks and thanks again!

BTW: What do you mean by the interesting comment "Rebuilding the code assist is also not that much work anymore in 3.2". Any fancy new features that I do not know about ? :-)
Comment 15 Martin Aeschlimann CLA 2006-01-23 03:52:39 EST
There's new JFace API to add code assist to text fields.