Home » Eclipse Projects » Commercial » Displaying custom property in SWT Designer
Displaying custom property in SWT Designer [message #14384] |
Tue, 23 October 2007 14:53 |
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 |
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
|
|
| | | |
Goto Forum:
Current Time: Tue Sep 24 09:23:18 GMT 2024
Powered by FUDForum. Page generated in 0.04790 seconds
|