This page is a reference document for all UI classes in Swift, namely those in the webil.ui package.

Back to the tutorial page.

Table of Contents

  1. class Button
  2. class CheckBox
  3. abstract class ClickableWidget
  4. interface ClickListener
  5. class Grid
  6. class HorizontalPanel
  7. class Image
  8. class LabeledWidget
  9. class NumberTextBox
  10. abstract class Panel
  11. class PasswordTextBox
  12. class Popup
  13. class RadioButton
  14. interface RadioButtonListener
  15. abstract class RootPanel
  16. class Text
  17. class TextBox
  18. class Timer
  19. interface TimerListener
  20. class VerticalPanel
  21. abstract class Widget

Class Button

public class Button[label L, label E] extends ClickableWidget[L, E]

A standard push-button widget.

Constructors

public Button(String{L} text)
Creates a button that displays the given text

text - the given text


public Button(String{this} id, String{L} text)
Creates a button given the id and text

id - A string that can be used to identify this button

text - the string displayed on the button

Methods

protected void initWidget()
public String{L} getText()
public void setText{L}(String{L} text)

text

public void setEnabled{L}(boolean{L} enabled)

enabled

Class CheckBox

public class CheckBox[label L, label E] extends ClickableWidget[L, E]

Constructors

public CheckBox(String{L} text)

text

public CheckBox(String{this} id, String{L} text)

id

Methods

protected void initWidget()
public String{L} getText()
public void setText{L}(String{L} text)

text -

public boolean{E} isChecked()
public boolean{E} isEnabled()
public void setChecked{E}(boolean{E} check)

check -

public void setEnabled{E}(boolean{E} enable)

enable -

abstract Class ClickableWidget

public abstract class ClickableWidget[label L, label E] extends Widget[L, E]

Constructors

public ClickableWidget()
public ClickableWidget(String{this} id)

id -

Methods

public void addListener{E}(ClickListener[L,E]{E} li)

li -

Interface ClickListener

public interface ClickListener[label L, label E]

Constructors

Methods

public void onClick{E;*<-Client}(Widget[L, E]{E} w):{E}

w -

Class Grid

public class Grid[label L, label E] extends Panel[L, E]

Constructors

public Grid()
public Grid(int{E} rows, int{E} columns)

rows -

columns -

Methods

public void resize{L}(int{L} rows, int{L} columns)

rows -

columns -

public void resizeRows{L}(int{L} rows)

rows -

protected void initWidget()
public void setWidget{L}(int{L} row, int{L} column, Widget[L, E]{L} widget)

row -

column -

widget -

Class HorizontalPanel

public class HorizontalPanel[label L, label E] extends Panel[L, E]

Constructors

public HorizontalPanel()
public HorizontalPanel(String{this} id)

id -

Methods

protected void initWidget()

Class Image

public class Image[label L, label E] extends ClickableWidget[L, E]

Constructors

public Image(String{L} url)

url -

public Image(String{this} id, String{L} url)

id -

url -

Methods

protected void initWidget()
public String{L} getUrl()
public void setUrl{L}(String{L} url)

url -

Class LabeledWidget

public class LabeledWidget

Fields

public final label{this} wL
public final label{this} wE
public final Widget[wL, wE]{*wE;this} widget

Constructors

LabeledWidget(label{this} wL, label{this} wE, Widget[wL, wE]{*wE;this} widget)

wL -

wE -

widget -

Methods

Class NumberTextBox

public class NumberTextBox[label L, label E] extends TextBox[L, E]

Constructors

public NumberTextBox()
public NumberTextBox(int{L} number)

number -

public NumberTextBox(String{this} id, int{L} number)

id -

number -

Methods

public java.lang.Integer{L} getInteger()
public void setNumber{L}(int{L} num)

num -

abstract Class Panel

public abstract class Panel[label L, label E] extends Widget[L, E]

Constructors

public Panel()
public Panel(String{this} id)

Methods

public void addChild{L}(label wL, label wE, Widget[wL, wE]{L} w) where {*wL} <= L, {E; w} <= {*wE};

wL -

wE -

w -

The second where constraint is the key constraint for tracking information flow from the path from the root to the widget w E is an upper bound on the info from the root panel to this widget, and {w} is the info to the child w, and since {*wE} is an upper bound on info from the root panel to w, we require that {E; w} <= {*wE}

public void addChild{L}(Widget[L, E]{L} w) where {w} <= {E}

w -

public void removeChild{L}(label wL, label wE, Widget[wL, wE]{L} w)

wL -

wE -

w -

public void removeAllChildren{L}()
public LabeledWidget{id; this; L} getChildById(String id)

id -

Class PasswordTextBox

public class PasswordTextBox[label L, label E] extends Widget[L, E]

Constructors

public PasswordTextBox()
public PasswordTextBox(String{this} id)

id -

Methods

protected void initWidget()
public String{L} getText()
public void setText{L}(String{L} text)

text -

public void setFocus{L}(boolean{L} state)

state -

Class Popup

public class Popup[label L, label E] extends Panel[L, E]

Constructors

public Popup()
public Popup(String id)

id -

Methods

public static void showMessage{L}(String{L} msg)

msg -

protected void initWidget()

Class RadioButton

public class RadioButton[label L, label E] extends CheckBox[L, E]

Constructors

public RadioButton(String{L} group, String{L} text)

group -

text -

public RadioButton(String{this} id, String{L} group, String{L} text)

id -

group -

text -

Methods

Interface RadioButtonListener

public interface RadioButtonListener[label L, label E]

Constructors

Methods

public void onClick{E}(RadioButton[L, E]{E} b):{E}

b -

abstract Class RootPanel

public abstract class RootPanel[label L, label E] extends Panel[L, E]

Constructors

protected RootPanel()

Methods

protected void initWidget()
public static RootPanel[L, E] getRootPanel(principal client_) where {L} <= {*->client_;_<-_}

client_ -

Class Text

public class Text[label L, label E] extends ClickableWidget[L, E]

Constructors

public Text(String{L} text)

text -

public Text(String{this} id, String{L} text)

id -

text -

Methods

protected void initWidget()
public String{L} getText()
public void setText{L}(String{L} text)

text -

Class TextBox

public class TextBox[label L, label E] extends ClickableWidget[L, E]

Constructors

public TextBox(String{L} text)

text -

public TextBox(String{this} id, String{L} text)

id -

text -

Methods

protected void initWidget()
public String{L} getText()
public void setText{L}(String{L} text)

text -

public void setFocus{L}(boolean{L} state)

state -

Class Timer

public class Timer[label E] extends Widget[E, E]

Constructors

public Timer()
public Timer(int millis)

millis -

public Timer(int millis, boolean repeat)

millis -

repeat -

Methods

protected void initWidget()
public void schedule(int millis)

millis -

public void schedule(int millis, boolean repeat)

millis -

repeat -

public void cancel()
public void addListener{E}(final TimerListener[E]{E} l)

l -

public void setStyleName(String style)

style -

public void setVisible(boolean visible)

visible -

Interface TimerListener

public interface TimerListener[label E]

Constructors

Methods

public void onTimer{E}(Timer[E]{E} t):{E}

t -

Class VerticalPanel

public class VerticalPanel[label L, label E] extends Panel[L, E]

Constructors

public VerticalPanel()
public VerticalPanel(String{this} id)

id -

Methods

protected void initWidget()

abstract Class Widget

public abstract class Widget[label L, label E]

Constructors

public Widget()
public Widget(String{this} id)

id -

Methods

public String getID()
protected abstract void initWidget()
public void setVisible{L}(boolean{L} visible)

visible -