Class UiBinding.Binding
java.lang.Object
com.codename1.properties.UiBinding.Binding
- Enclosing class:
UiBinding
Binding allows us to have commit/auto-commit mode. This allows changes to properties to reflect
immediately or only when committed, e.g. if a Form has "OK" & "Cancel" buttons you
might want to do a commit on OK. We also provide a "rollback" method to reset to the original
property values.
UiBinding has a boolean auto commit flag that can be toggled to set the default for
new bindings.
Binding also provides the ability to disengage a "binding" between a property and a UI component
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidcommit()Set the value from the component into the property, note that this will throw an exception if autocommit is onabstract voidClears the listeners and disengages binding, this can be important for GC as binding can keep object references in RAMbooleanGets the autocommit value see#setAutoCommit(boolean)abstract voidrollback()Sets the value from the property into the component, note that this will throw an exception if autocommit is onvoidsetAutoCommit(boolean b) Toggles auto-commit mode and overrides theUiBindingautocommit default.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Constructor Details
-
Binding
public Binding()
-
-
Method Details
-
isAutoCommit
public boolean isAutoCommit()Gets the autocommit value see
#setAutoCommit(boolean)Returns
true if autocommit is on
-
setAutoCommit
public void setAutoCommit(boolean b) Toggles auto-commit mode and overrides the
UiBindingautocommit default. Autocommit instantly reflects changes to the property or component values.Parameters
b: true to enable auto-commit
-
commit
public abstract void commit()Set the value from the component into the property, note that this will throw an exception if autocommit is on -
rollback
public abstract void rollback()Sets the value from the property into the component, note that this will throw an exception if autocommit is on -
disconnect
public abstract void disconnect()Clears the listeners and disengages binding, this can be important for GC as binding can keep object references in RAM
-