making getXXX methods public/protected [message #117005] |
Mon, 06 February 2006 15:54 |
Eclipse User |
|
|
|
Originally posted by: markus.wawra.shark-soft.com
Hi!
When I add a component (f.e. JButton) with the VE, it creates a private
getXXX Method in the source code. Like:
/**
* This method initializes jButton1
*
* @return javax.swing.JButton
*/
private JButton getJButton1() {
if (jButton1 == null) {
jButton1 = new JButton();
}
return jButton1;
}
Can I tell VE to create public or protected getXXX methods?
Regards,
Markus
|
|
|
Re: making getXXX methods public/protected [message #117071 is a reply to message #117005] |
Mon, 06 February 2006 19:27 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
No. Typically you would not want to do that because you are exposing the
internals of the class. Which is usually not a good idea. You would
typically only want a small subset of the internals to be public.
Because of that you would simply change it to public in the class editor
pane for those you want public.
Markus wrote:
> Hi!
>
> When I add a component (f.e. JButton) with the VE, it creates a private
> getXXX Method in the source code. Like:
>
> /**
> * This method initializes jButton1
> *
> * @return javax.swing.JButton
> */
> private JButton getJButton1() {
> if (jButton1 == null) {
> jButton1 = new JButton();
> }
> return jButton1;
> }
>
>
> Can I tell VE to create public or protected getXXX methods?
>
> Regards,
> Markus
>
--
Thanks,
Rich Kulp
|
|
|
Re: making getXXX methods public/protected [message #117255 is a reply to message #117071] |
Thu, 09 February 2006 15:04 |
Eclipse User |
|
|
|
Originally posted by: markus.wawra.shark-soft.com
Even if it's untypically I want to create a VE extension which generates
protected (or public, I'm not sure so far) getXXX methods. I found a file
where I can easily change the text for the created methods
(org.eclipse.ve.java.core_1.1.0\templates\org\eclipse\ve\int ernal\java\codegen\jjet\util\DefaultMethod
Template.javajet). This works fine if I change the file directly in the
org.eclipse.ve.java.core plugin.
My next problem is:
How can I change it with a VE plugin extension?
Is there an extensionpoint?
Or is the editing in the org.eclipse.ve.java.core plugin the only way?
Regards,
Markus
|
|
|
Re: making getXXX methods public/protected [message #117281 is a reply to message #117255] |
Thu, 09 February 2006 19:42 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
That is the only way, and is not a good way. We were thinking of doing
that way back in the past, but it has many problems. But we never
removed the code. But we don't provide any official support to allow the
change.
Markus wrote:
> Even if it's untypically I want to create a VE extension which generates
> protected (or public, I'm not sure so far) getXXX methods. I found a
> file where I can easily change the text for the created methods
> (org.eclipse.ve.java.core_1.1.0\templates\org\eclipse\ve\int ernal\java\codegen\jjet\util\DefaultMethod
> Template.javajet). This works fine if I change the file directly in the
> org.eclipse.ve.java.core plugin.
>
> My next problem is:
> How can I change it with a VE plugin extension?
> Is there an extensionpoint?
> Or is the editing in the org.eclipse.ve.java.core plugin the only way?
>
> Regards,
> Markus
>
--
Thanks,
Rich Kulp
|
|
|
Re: making getXXX methods public/protected [message #611978 is a reply to message #117005] |
Mon, 06 February 2006 19:27 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
No. Typically you would not want to do that because you are exposing the
internals of the class. Which is usually not a good idea. You would
typically only want a small subset of the internals to be public.
Because of that you would simply change it to public in the class editor
pane for those you want public.
Markus wrote:
> Hi!
>
> When I add a component (f.e. JButton) with the VE, it creates a private
> getXXX Method in the source code. Like:
>
> /**
> * This method initializes jButton1
> *
> * @return javax.swing.JButton
> */
> private JButton getJButton1() {
> if (jButton1 == null) {
> jButton1 = new JButton();
> }
> return jButton1;
> }
>
>
> Can I tell VE to create public or protected getXXX methods?
>
> Regards,
> Markus
>
--
Thanks,
Rich Kulp
|
|
|
|
Re: making getXXX methods public/protected [message #611994 is a reply to message #117255] |
Thu, 09 February 2006 19:42 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
That is the only way, and is not a good way. We were thinking of doing
that way back in the past, but it has many problems. But we never
removed the code. But we don't provide any official support to allow the
change.
Markus wrote:
> Even if it's untypically I want to create a VE extension which generates
> protected (or public, I'm not sure so far) getXXX methods. I found a
> file where I can easily change the text for the created methods
> (org.eclipse.ve.java.core_1.1.0\templates\org\eclipse\ve\int ernal\java\codegen\jjet\util\DefaultMethod
> Template.javajet). This works fine if I change the file directly in the
> org.eclipse.ve.java.core plugin.
>
> My next problem is:
> How can I change it with a VE plugin extension?
> Is there an extensionpoint?
> Or is the editing in the org.eclipse.ve.java.core plugin the only way?
>
> Regards,
> Markus
>
--
Thanks,
Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.02364 seconds