Skip to main content



      Home
Home » Newcomers » Newcomers » How to add a new property for my own control
How to add a new property for my own control [message #165983] Wed, 16 August 2006 05:27 Go to next message
Eclipse UserFriend
Originally posted by: dongzhi.gmail.com

Hi Everyone,

I create a VE class of SWT composite. The class is named as CONTROL_TEST.
I create a VE class, and add the CONTROL_TEST class to the new VE class.
There are some properties of CONTROL_TEST in Property Panel. My question
is how to add a new property for CONTROL_TEST, and the property is visable
in Property Panel.

Thanks.
Re: How to add a new property for my own control [message #166054 is a reply to message #165983] Wed, 16 August 2006 09:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jefmyers.us.ibm.com

Liu Ming,

The properties are automatically detected based on the Java Bean
getters/setters available on your class. For instance if you had a
string property called name, you'd have to do the following:

private String name;

public void setName(String name) {
this.name = name;
}

public String getName() {
return this.name;
}

Eclipse includes a source assistant to create getters & setters for
fields defined in your class. In your source, right click and select
Source -> Generate Getters and Setters...

Hope this helps,
- Jeff

Liu Ming wrote:
> Hi Everyone,
>
> I create a VE class of SWT composite. The class is named as
> CONTROL_TEST. I create a VE class, and add the CONTROL_TEST class to the
> new VE class. There are some properties of CONTROL_TEST in Property
> Panel. My question is how to add a new property for CONTROL_TEST, and
> the property is visable in Property Panel.
>
> Thanks.
>
Re: How to add a new property for my own control [message #166143 is a reply to message #166054] Wed, 16 August 2006 20:47 Go to previous message
Eclipse UserFriend
Originally posted by: dongzhi.gmail.com

Jeff Myers,

Thank you very much. That is what I want.

Best Regards,

Liu Ming
Previous Topic:what do I have to do to get visual classes?
Next Topic:Creating a library without prefix lib
Goto Forum:
  


Current Time: Fri Jul 18 01:54:18 EDT 2025

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

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

Back to the top