net.sf.cuf.state.package.html Maven / Gradle / Ivy
package
The State/StateAdapter library eases the management and reaction of binary states.
It greatly reduces the code needed to keep the internal (logical)
state of an application with its visual representation, e.g.
concerning the enabling/disabeling of buttons depending on
the possible actions that can be taken.
The State/StateAdapter library is also great for expressing and acting on complex "if A then B" rules.
Example: "If the actual user is jzeller and a record with number range
01 is loaded, than the record modification button should be enabled".
The state of the State/StateAdapter library is modeled in the
{@link net.sf.cuf.state.State}
interface, the observing
of a state is described in the {@link
net.sf.cuf.state.StateAdapter}
interface.
The binary value of a state can be derived by a particular State
implemention from widgets (e.g. the {@link
net.sf.cuf.state.ui.SwingListModelFillState}
watches the
number of entries of a JList).
Also the adaption of a state via a particular StateAdapter can change widgets (e.g. the {@link
net.sf.cuf.state.ui.SwingEnabledAdapter}
adapts 0/1 of its state to enabling/disabling of Swing widgets).
A major goal of the State/StateAdapter library is the reduction of the
LOC (lines of code) that are coded in callback methods and the shift
from callback code to declarative code.