Spinner

A org.uqbar.arena.widgets.Spinner is a compound control,

  • it has an numeric input field
  • and two buttons to increase/decrease its value

Bindings

A spinner must bind its property value

 

Another properties

It inherits the following properties from Control:

  • enabled, visible & background (bindables)
  • height / width (manually configured)
  • And also inherits from Skinnable Control this properties:
    • fontSize, foreground, background
  • minimumValue(int): manual, defines the minimum value that can accept
  • maximumValue(int): manual, defines the maximum value that can accept

Example

We want to fill the product items of an order, every item has a quantity property:

// Xtend
new Spinner(mainPanel) => [ 
    value <=> "quantity"
]

// Java
new Spinner(mainPanel)
    .bindValueToProperty("quantity");

Order class has a quantity property (def Integer or int getQuantity() method)