Skip to content
mlabuda edited this page Feb 17, 2014 · 9 revisions

API / Abstract

  • Button / AbstractButton

Implementation(s)

  • PushButton
  • CheckBox
  • RadioButton
  • ToggleButton

Usage

PushButton

Look up a push button with text "Push Button 1"

Button pushButton = new PushButton("Push Button 1");

Click a button

pushButton.click(); 

Short notation

new PushButton("Push Button 1").click();

CheckBox

Look up a check box with text "Checkbox 0"

CheckBox checkBox = new CheckBox("Checkbox 0");

Check if check box is checked

boolean isChecked = checkBox.isChecked(); 

Set check box to checked

checkBox.toggle(true);

RadioButton

Look up a radio button with text "Radio Button 0"

RadioButton radioButton = new RadioButton("Radio Button 0");

Check if radio button is selected

boolean isSelected = radioButton.isSelected();

Select radio button

radioButton.toggle(true);

ToggleButton

Look up a toggle button with text "Toggle Button1"

ToggleButton toggleButton = new ToggleButton("Toggle Button1");

Check if toggle button is checked

boolean isChecked = toggleButton.isSelected();

Check toggle button

togggleButton.toggle(true);

Predefined buttons

There are also some predefined basic eclipse buttons. Whole list of predefined buttons:

  • BackButton
  • CancelButton
  • FinishButton
  • NextButton
  • NoButton
  • OkButton
  • YesButton
Clone this wiki locally