Jump to: navigation, search

7 Basic Controls

Back to RWTOverview

RWT will have the same behavior for all basic controls as SWT does. Currently there exists an incomplete implementation that provides basic functionality.

Class Label

Currently implemented:

  • get/set text
  • get/set image
Note: Just like in SWT, the label can only display a string or an image but not both at the same time. When both is set, the label displays the object that was set last. However, the behavior of the RWT label differs slightly from SWT in that that setting an image clears the text and vice versa. As a result, calling getImage() after setting a text using setText() returns null even though an image has been set previously.
  • alignment (LEFT, CENTER, RIGHT)
  • SEPARATOR style, both horizontal and vertical with the same styles as supported by SWT: SHADOW_NONE, SHADOW_IN, SHADOW_OUT

Class Button

Currently implemented:

  • the types PUSH, CHECK, RADIO, and TOGGLE
  • get/set text and image (image is only displayed on PUSH and TOGGLE buttons yet)
  • selection
  • alignment (LEFT, CENTER, RIGHT)
  • SelectionListener
  • Default button behavior (see Shell). Please note that the default button is not yet highlighted (e.g. with a thick border) as it should be.

Class Text

Currently implemented:

  • get/set text
  • SINGLE, MULTI and PASSWORD styles
  • READ_ONLY and the get/setEditable methods which control whether the content of a text widget can be altered once it is created.
  • A first implementation of the ModifyEvent exists which is by far not meant to be final. With this we would like to get insight on what timings etc. are useful in practice. Through the distributed nature of RWT the inner workings are different from SWT (also see Events and Listeners). The current implementation sends a Modify Event in two cases:
    • when a keystroke event in the Text widget is detected, then, after a delay of 500 ms, the ModifyEvent is sent
    • when the Text widget loses focus, a ModifyEvent is sent immediately
  • The textLimit property can be use to control the number of characters that may be entered
  • Methods to control the text selection are implemented (setSelection, getSelection, getSelectionCount, getSelectionText, clearSelection, selectAll)

Class List

Currently implemented:

  • all selection-related methods
  • handling of focused item
  • all item operations
  • control scroll behaviour similar to SWT via H_SCROLL and V_SCROLL style flags: scroll never, scroll horizontal only, scroll vertical only, automatically scroll when necessary
  • SelectionListener including widgetDefaultSelected

Class Combo

Currently Implemented:

  • all selection-related methods
  • all item operations
  • SelectionListener