I am building an application using JavaFX 2. I intend to isolate the user interface from data and logic. Given that I have a lot of data objects like this:
public class Entity {
private String m_Value;
public Entity(String value) { m_Value = value; }
public String getValue() { return m_Value; }
public void setValue(String value) { m_Value = value; }
}
I find it difficult to create a binding between the m_Value attribute and the textProperty label, for example.
Another similar question suggested people use JFXtras, however I'm not sure that I am allowed to use this (company restrictions). Therefore, I am trying to find an alternative to this.
My idea would be to use objects to represent all the attributes of my data objects, not primitive types (int will use Integer, etc.). That way, I can take advantage of the java model reference pass. Then, in the user interface domain, I can create a property that references this attribute. But I'm not sure if this is possible or not.
Is it possible to solve this problem using the ObjectProperty class?
Another alternative would be to use the JavaBeanProperty class family, for example, JavaBeanStringPropertyBuilder, JavaBeanIntegerPropertyBuilder. Is it possible?
I tried in both directions, but I am afraid that I am not yet so versed in JavaFX to solve this problem. Can anyone help?
StringProperty IntegerProperty , JavaFX .
, Eclipse, , , JavaFX . , .
.