Skip to main content



      Home
Home » Archived » Sapphire » BooleanValue/IntegerValue
BooleanValue/IntegerValue [message #663924] Wed, 06 April 2011 15:59 Go to next message
Eclipse UserFriend
Ok... Last question for now I promise...

Looking at the docs, I'm trying to figure out how to implement a Boolean property that uses option buttons to offer true or false in the UI.

I found the discussion of Value Properties in the doc and saw that I should be able to define a BooleanValue something like this example of how to use the IntegerValue:
@Label( standard = "age" )
@NonNullValue
ValueProperty PROP_AGE = new ValueProperty( TYPE, "Age" );
IntegerValue getAge();
void setAge( String age );
void setAge( Integer age );

Just one problem... IntegerValue doesn't seem to exist. Neither does BooleanValue. Is there another example that I can refer to?

Konstantin - I know I saw you do something similar to this in the brief demo you did for me at EclipseCon, but can't seem to find an example that does the same thing.

Any and all help is greatly appreciated.

Thanks!
--Fitz
Re: BooleanValue/IntegerValue [message #663933 is a reply to message #663924] Wed, 06 April 2011 17:02 Go to previous messageGo to next message
Eclipse UserFriend
Along the same lines, I see that Boolean properties are rendered in the UI as a checkbox with the checkbox part on the left and the label on the right. Is there a "hint" to suggest that the checkbox should be to the right of the label?
Re: BooleanValue/IntegerValue [message #663934 is a reply to message #663924] Wed, 06 April 2011 17:06 Go to previous messageGo to next message
Eclipse UserFriend
The doc must be out of date. Here is how you would write your example:

@Type( base = Integer.class )
@Label( standard = "age" )
@NonNullValue
ValueProperty PROP_AGE = new ValueProperty( TYPE, "Age" );
Value<Integer> getAge();
void setAge( String age );
void setAge( Integer age );


If you grab the Sapphire samples project, the gallery sample has quite a bit of usage of different data types.
Re: BooleanValue/IntegerValue [message #663937 is a reply to message #663934] Wed, 06 April 2011 17:09 Go to previous messageGo to next message
Eclipse UserFriend
> Along the same lines, I see that Boolean properties are rendered in
> the UI as a checkbox with the checkbox part on the left and the label
> on the right. Is there a "hint" to suggest that the checkbox should be
> to the right of the label?

There is an open enhancement request for that:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=329068

Right now, we only support the native "label on the right" style of checkboxes, but you can choose if you it should be aligned on first column or the second column.

To get it to align on the second column, create a composite part, set "indent" property on the composite" and place the boolean property editor inside the composite.

- Konstantin
Re: BooleanValue/IntegerValue [message #663957 is a reply to message #663937] Wed, 06 April 2011 18:54 Go to previous messageGo to next message
Eclipse UserFriend
Ok. I chimed in on the enhancement request. Thanks Konstantin for the additional suggestion as well!
Re: BooleanValue/IntegerValue [message #663998 is a reply to message #663957] Thu, 07 April 2011 02:56 Go to previous message
Eclipse UserFriend
Enhancement implemented.
Previous Topic:List Constraints
Next Topic:Graphiti Integration
Goto Forum:
  


Current Time: Tue Jul 08 06:13:13 EDT 2025

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

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

Back to the top