Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Commercial » Displaying custom property in SWT Designer
Displaying custom property in SWT Designer [message #14384] Tue, 23 October 2007 14:53 Go to next message
Eclipse User
Originally posted by: viswanathan_s.hcl.in

Hi,

I am in the assignment of creating a custom control using custom composite
feature in the SWT designer.

I need to display a string property in the Property grid for which the
value could be any from a set of values that are to be determined at
runtime from the XML Schema.

If it could have been determined already I would prefer associating them
using a Enum variable so that it display the list of items in a combo
control in the Propery grid against my property.

Since the list of values are undetermined at design time how do I proceed
with this? Is there anything that can do for getting the list of values in
the property grid for my property.

I saw the similar kind in .NET where a new class is derived from an
existing class and some methods are overridden to associate the State
property to a set of values.

NET Code Sample
-----------------

Public Class StatesList : Inherits System.ComponentModel.StringConverter

Private _State As String
'''
<TypeConverter(GetType(StatesList)), _
CategoryAttribute("Custom List"), DefaultValueAttribute(""), _
DescriptionAttribute("Select a state from the list")> _
Public Property State() As String

Get
Return _State
End Get
Set(ByVal Value As String)
_State = Value
End Set
End Property

Dim _States As String() = New String() {"Alabama", "Alaska",_
"Arizona", "Arkansas", _
"California", "Colorado", "Connecticut", "Delaware",_
"Florida", "Georgia", _
"Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", _
"Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts",
_
"Michigan", "Minnesota", "Mississippi", "Missouri", "Montana",
_
"Nebraska", "Nevada", "New Hampshire", _
"New Jersey", "New Mexico", _
"New York", "North Carolina", "North Dakota",_
"Ohio", "Oklahoma", _
"Oregon", "Pennsylvania", "Rhode Island", "South Carolina", _
"South Dakota", "Tennessee", "Texas", "Utah",_
"Vermont", "Virginia",_
"Washington", "West Virginia", "Wisconsin", "Wyoming"}

Public Overloads Overrides Function _
GetStandardValues(ByVal context As _
System.ComponentModel.ITypeDescriptorContext) _
As System.ComponentModel.TypeConverter.StandardValuesCollection

Return New StandardValuesCollection(_States)
End Function

It would be great if you could provide me a solution.

Thanks.
Re: Displaying custom property in SWT Designer [message #14413 is a reply to message #14384] Tue, 23 October 2007 20:02 Go to previous messageGo to next message
Eclipse User
Originally posted by: eclipse6.rizzoweb.com

Viswanathan wrote:
> Hi,
>
> I am in the assignment of creating a custom control using custom
> composite feature in the SWT designer.
>
> I need to display a string property in the Property grid for which the
> value could be any from a set of values that are to be determined at
> runtime from the XML Schema.

Have you even read the articles, tutorials, and support forums available
at http://www.swt-designer.com/ ?

Instantiations provides those to support the SWT Designer product; I
doubt anyone here (eclipes.org) will provide free support for that
commercial product.

Eric
Re: Displaying custom property in SWT Designer [message #14437 is a reply to message #14384] Wed, 24 October 2007 17:23 Go to previous message
Eric Clayberg is currently offline Eric Clayberg
Messages: 860
Registered: July 2009
Location: Boston, MA
Senior Member
"Viswanathan" <viswanathan_s@hcl.in> wrote in message
news:8e2f936ebb1b0fb0083215d7dcfb957a$1@www.eclipse.org...
>
> I am in the assignment of creating a custom control using custom composite
> feature in the SWT designer.
>
> I need to display a string property in the Property grid for which the
> value could be any from a set of values that are to be determined at
> runtime from the XML Schema.
>
> If it could have been determined already I would prefer associating them
> using a Enum variable so that it display the list of items in a combo
> control in the Propery grid against my property.
>
> Since the list of values are undetermined at design time how do I proceed
> with this? Is there anything that can do for getting the list of values in
> the property grid for my property.

See the following SWT Designer forum discussion threads and sample
projects...

Enumerated property in custom SWT composite
http://www.instantiations.com/forum/viewtopic.php?t=700

Properties for custom controls
http://www.instantiations.com/forum/viewtopic.php?t=756

Support for enums
http://www.instantiations.com/forum/viewtopic.php?t=769

Sample code:

http://www.instantiations.com/windowbuilderpro/files/enum_ex ample.zip

http://www.instantiations.com/windowbuilderpro/files/custom- swt-controls-test.zip

-Eric Clayberg
Sr. Vice President of Product Development
Instantiations, Inc.
http://www.instantiations.com
http://www.windowbuilderpro.com/

Author: "Eclipse: Building Commercial Quality Plug-ins"
http://www.awprofessional.com/title/032142672X
Re: Displaying custom property in SWT Designer [message #564548 is a reply to message #14384] Tue, 23 October 2007 20:02 Go to previous message
Eric Rizzo is currently offline Eric Rizzo
Messages: 2247
Registered: July 2009
Senior Member
Viswanathan wrote:
> Hi,
>
> I am in the assignment of creating a custom control using custom
> composite feature in the SWT designer.
>
> I need to display a string property in the Property grid for which the
> value could be any from a set of values that are to be determined at
> runtime from the XML Schema.

Have you even read the articles, tutorials, and support forums available
at http://www.swt-designer.com/ ?

Instantiations provides those to support the SWT Designer product; I
doubt anyone here (eclipes.org) will provide free support for that
commercial product.

Eric
Re: Displaying custom property in SWT Designer [message #564565 is a reply to message #14384] Wed, 24 October 2007 17:23 Go to previous message
Eric Clayberg is currently offline Eric Clayberg
Messages: 860
Registered: July 2009
Location: Boston, MA
Senior Member
"Viswanathan" <viswanathan_s@hcl.in> wrote in message
news:8e2f936ebb1b0fb0083215d7dcfb957a$1@www.eclipse.org...
>
> I am in the assignment of creating a custom control using custom composite
> feature in the SWT designer.
>
> I need to display a string property in the Property grid for which the
> value could be any from a set of values that are to be determined at
> runtime from the XML Schema.
>
> If it could have been determined already I would prefer associating them
> using a Enum variable so that it display the list of items in a combo
> control in the Propery grid against my property.
>
> Since the list of values are undetermined at design time how do I proceed
> with this? Is there anything that can do for getting the list of values in
> the property grid for my property.

See the following SWT Designer forum discussion threads and sample
projects...

Enumerated property in custom SWT composite
http://www.instantiations.com/forum/viewtopic.php?t=700

Properties for custom controls
http://www.instantiations.com/forum/viewtopic.php?t=756

Support for enums
http://www.instantiations.com/forum/viewtopic.php?t=769

Sample code:

http://www.instantiations.com/windowbuilderpro/files/enum_ex ample.zip

http://www.instantiations.com/windowbuilderpro/files/custom- swt-controls-test.zip

-Eric Clayberg
Sr. Vice President of Product Development
Instantiations, Inc.
http://www.instantiations.com
http://www.windowbuilderpro.com/

Author: "Eclipse: Building Commercial Quality Plug-ins"
http://www.awprofessional.com/title/032142672X
Previous Topic:Displaying custom property in SWT Designer
Next Topic:RCP Training - One on-site visit still available for 2007
Goto Forum:
  


Current Time: Thu Sep 18 19:55:16 GMT 2014

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

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