Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » making getXXX methods public/protected
making getXXX methods public/protected [message #117005] Mon, 06 February 2006 15:54 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 #611992 is a reply to message #117071] Thu, 09 February 2006 15:04 Go to previous message
Markus is currently offline MarkusFriend
Messages: 52
Registered: July 2009
Member
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 #611994 is a reply to message #117255] Thu, 09 February 2006 19:42 Go to previous message
Eclipse UserFriend
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
Previous Topic:Restricitions about bmp files
Next Topic:Override file is not processed
Goto Forum:
  


Current Time: Thu Apr 25 05:09:04 GMT 2024

Powered by FUDForum. Page generated in 0.03736 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top