Enum Class Change.Origin
- All Implemented Interfaces:
Serializable,Comparable<Change.Origin>,Constable
- Enclosing interface:
Change
The handler runs when, and only when, the user operated this widget. The watchers run for every change, whatever moved it.
A component decides the origin at the seam that announces, without any judgement about
what a method is called: it knows whether it is inside onMouseEvent,
onKeyEvent, onCharTyped or onPreedit, or inside a public setter.
Three consequences, and all three are subtractions. Termination is structural: a handler's writes are not user input, so they reach no second handler and two controls bound to each other through their handlers cannot recurse at all. The echo guards delete: a caller writing a widget to keep it in step with another can no longer be heard by that widget's application handler, so there is nothing to guard against. And a poll that writes a widget ten times a second — a transport bar following a film — is a caller's write, so it moves the bar and scrubs nothing.
A 1.x minor release may add constants to this enum: a switch over it needs a
default branch.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe widget moved this itself, because something else changed: a step grid re-snapping a value, a list refreshing past its selection, a tab pane taking its first tab, focus revoked because the widget holding it was hidden.A caller wrote the state this mutator names:setValue,setChecked,setText,setSelectedIndex,setVisible, and a verb invoked from code.A person operated this control: a pointer, a key, an IME commit, or an assistive technology performing the control's action on the person's behalf. -
Method Summary
Modifier and TypeMethodDescriptionstatic Change.OriginReturns the enum constant of this class with the specified name.static Change.Origin[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
USER
A person operated this control: a pointer, a key, an IME commit, or an assistive technology performing the control's action on the person's behalf. This is the only origin that reaches the handler. -
CODE
A caller wrote the state this mutator names:setValue,setChecked,setText,setSelectedIndex,setVisible, and a verb invoked from code.A change is
CODEwhen its aspect is the one the call's own contract names and the call is one an application can make. A mutator that is not public has noCODEreading to default to: its origin is the origin its callers hand it, and if every caller is an input handler it takesUSERand nothing else. -
ADJUSTMENT
The widget moved this itself, because something else changed: a step grid re-snapping a value, a list refreshing past its selection, a tab pane taking its first tab, focus revoked because the widget holding it was hidden.CODEandADJUSTMENTare treated identically by the rule — neither reaches the handler. The distinction earns its keep by naming what a bridge announces as a state update rather than an interaction, and by letting a two-way binding break an echo.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-