FieldCheckbox

public final class FieldCheckbox extends Field

Adds a toggleable checkbox to an Input.

Inherited Constant Summary

Inherited Field Summary

Public Constructor Summary

FieldCheckbox(String name, boolean checked)

Public Method Summary

FieldCheckbox
clone()
static FieldCheckbox
fromJson(JSONObject json)
String
boolean
void
setChecked(boolean checked)
Sets the state of the checkbox.
boolean
setFromString(String text)
Sets the values of the field from a string.

Inherited Method Summary

Public Constructors

public FieldCheckbox (String name, boolean checked)

Parameters
name
checked

Public Methods

public FieldCheckbox clone ()

public static FieldCheckbox fromJson (JSONObject json)

Parameters
json

public String getSerializedValue ()

Returns
  • The value serialized into a string.

public boolean isChecked ()

Returns
  • The current state of the checkbox.

public void setChecked (boolean checked)

Sets the state of the checkbox.

Parameters
checked

public boolean setFromString (String text)

Sets the values of the field from a string.

This is used for setting values of all types of fields when loading a workspace from XML. It is also used, however, as the primary means of setting text fields (e.g., inputs, labels, dates).

There should be a concrete implementation for each field type.

Parameters
text The text value for this field from the XML.
Returns
  • True if the value was set, false otherwise.