Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » BooleanValue/IntegerValue
BooleanValue/IntegerValue [message #663924] Wed, 06 April 2011 19:59 Go to next message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
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 21:02 Go to previous messageGo to next message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
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 21:06 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 962
Registered: July 2009
Senior Member
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 21:09 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 962
Registered: July 2009
Senior Member
> 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 22:54 Go to previous messageGo to next message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
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 06:56 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 962
Registered: July 2009
Senior Member
Enhancement implemented.
Previous Topic:List Constraints
Next Topic:Graphiti Integration
Goto Forum:
  


Current Time: Sun Dec 21 18:45:36 GMT 2014

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

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