API review: Conversion methods in Binding API

Richard Bair richard.bair at oracle.com
Tue Nov 6 10:34:18 PST 2012


Ha! Now we know what alias Michael is using in JIRA :-)

Was there anything here that needed to be deprecated or these are all new methods?

On Nov 6, 2012, at 12:15 AM, Martin Sladecek <martin.sladecek at oracle.com> wrote:

> One request just came last Friday: http://javafx-jira.kenai.com/browse/RT-25996 ;-)
> 
> -Martin
> 
> On 11/02/2012 09:54 PM, Richard Bair wrote:
>> I haven't seen this as a request by developers yet, I tend to think we ought to keep this feature / tweak in our backlog and revisit if / when we see some demand from users?
>> 
>> Richard
>> 
>> On Sep 18, 2012, at 12:00 AM, Michael Heinrichs <michael.heinrichs at oracle.com> wrote:
>> 
>>> Hi,
>>> 
>>> there are sometimes situations, when a developer has a general typed value, but needs a specific type, e.g. a user may have an ObjectProperty<Integer> but needs an ObservableIntegerValue. I want to add some conversion methods for these kind of cases. http://javafx-jira.kenai.com/browse/RT-19020
>>> 
>>> class BooleanExpression:
>>> public static BooleanExpression booleanExpression(ObservableValue<Boolean>)
>>> The current booleanExpression() method will be marked as deprecated and should be removed when we do an incompatible update of the JavaFX API. Same for the methods in DoubleExpression etc.
>>> 
>>> class DoubleExpression:
>>> public static <T extends Number> DoubleExpression doubleExpression(ObservableValue<T>)
>>> 
>>> class FloatExpression:
>>> public static <T extends Number> FloatExpression floatExpression(ObservableValue<T>)
>>> 
>>> class IntegerExpression:
>>> public static <T extends Number> IntegerExpression integerExpression(ObservableValue<T>)
>>> 
>>> class LongExpression:
>>> public static <T extends Number> LongExpression longExpression(ObservableValue<T>)
>>> 
>>> class ObjectExpression:
>>> public BooleanBinding asBoolean()
>>> public DoubleBinding asDouble()
>>> public FloatBinding asFloat()
>>> public IntegerBinding asInteger()
>>> public LongBinding asLong()
>>> The bindings returned by these methods will return the default value, if the type of the wrapped Object does not match the expected.
>>> 
>>> class Bindings:
>>> public static BooleanExpression convertToBoolean(ObservableValue<Boolean>)
>>> public static <T extends Number> DoubleExpression convertToDouble(ObservableValue<T>)
>>> public static <T extends Number> FloatExpression convertToFloat(ObservableValue<T>)
>>> public static <T extends Number> IntegerExpression convertToInteger(ObservableValue<T>)
>>> public static <T extends Number> LongExpression convertToLong(ObservableValue<T>)
>>> 
>>> Thanks,
>>> Michael
> 



More information about the openjfx-dev mailing list