API review: Conversion methods in Binding API (original) (raw)
Richard Bair richard.bair at oracle.com
Fri Nov 2 13:54:12 PDT 2012
- Previous message: API Review: Use ObservableNumberValue as parameter for valueAt() methods
- Next message: API review: Conversion methods in Binding API
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 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) 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 DoubleExpression doubleExpression(ObservableValue) class FloatExpression: public static FloatExpression floatExpression(ObservableValue) class IntegerExpression: public static IntegerExpression integerExpression(ObservableValue) class LongExpression: public static LongExpression longExpression(ObservableValue) 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) public static DoubleExpression convertToDouble(ObservableValue) public static FloatExpression convertToFloat(ObservableValue) public static IntegerExpression convertToInteger(ObservableValue) public static LongExpression convertToLong(ObservableValue) Thanks, Michael
- Previous message: API Review: Use ObservableNumberValue as parameter for valueAt() methods
- Next message: API review: Conversion methods in Binding API
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]