XdevSlider

The XdevSlider is a graphical selection component that allows you to select a value by using the mouse to slide an icon between the end points of a track that corresponds to a range of values. When the Orientation setting is selected, the XdevSlider can be displayed horizontally or vertically. When you move the slider, the current value is displayed. The value range can be defined with the Min and Max setting. The field is displayed via the XdevSlider.  

The XdevSlider is a form component and can be persisted via XdevFieldGroup

 

Important properties:
  • Caption -  Displays text as label.

  • Max - Maximum value within the value range. Floating point numbers up to 3 decimal places are allowed. The default value is 100.0.
  • Min - Minimum value within the value range. Floating-point numbers up to 3 decimal places are allowed. The default value is 0.0.
  • Orientation
    • null - Default value. Arranges the XdevSlider horizontally.
    • HORIZONTAL - Arranges the XdevSlider horizontally.
    • VERTICAL - Arranges the XdevSlider vertically.
  • Required - The form component is defined as a mandatory field. You need to make a selection from the available options, complete the field, or select the required option.

  • RequiredError - An error message that appears when a form component that is defined as a mandatory field is not filled out, selected or no selection has been made.

  • Resolution - Number of digits after the decimal point in the display. Only integers are permitted. The default value is 0.
  • Shortcut
  • TabIndex - Defines the sequence in the tab index. The tab index defines the order of several UI components. These can be selected one by one by pressing the Tab key.

  • Value - Text or value intended to represent the UI component.

Important events:
  • valueChange - Is triggered after changes to the content, mainly by adding or deleting characters, however only if the UI component loses the focus.




Data binding:


Data container (model) - Property

    • A property can be set to implicit using setValue

      // Sets the Property
      
      this.slider.setValue(50.0);


    • or by setting the property of an item as the model. As such, the allocation can be set using the setPropertyDataSource method.

      // Create a new property 
      Property<Float> newProperty = new ObjectProperty<>(50f, Float.class);
      
      // Sets the Property
      checkBox.setPropertyDataSource(newProperty);
Examples:
  • Read current value

    final Double value = this.slider.getValue();
  • Set value

    this.slider.setValue(50.0);
  • Reset XdevSlider

    this.slider.clear();
  • Allocate focus

    this.slider.focus();
  • Display slider vertically

    slider.setOrientation(SliderOrientation.VERTICAL);


All XdevSlider Methods 

XDEV Software Corp. - One Embarcadero Center, San Francisco, CA 94111, US
Copyright © 2015. XDEV Software Corp. All rights reserved.