de.lessvoid.nifty.controls
Interface NiftyControl

All Known Implementing Classes:
AbstractController, MenuItemControl

public interface NiftyControl

Interface for all Nifty Controls.

Author:
void

Method Summary
 void disable()
          Disable the control.
 void enable()
          Enable the control.
 Element getElement()
          Get the attached internal Nifty element for this Nifty control.
 int getHeight()
          Get height as SizeValue.
 String getId()
          Get the id.
 String getStyle()
          Get current style.
 int getWidth()
          Get width as SizeValue.
 boolean hasFocus()
          Returns true if this control has the focus.
 boolean isBound()
          Returns true when this NiftyControl is already bound (e.g. its Controllers bind() method has been called).
 boolean isEnabled()
          Get the current enabled state of the control.
 void layoutCallback()
          This method is called after the element this control is attached too has been layouted.
 void setEnabled(boolean enabled)
          Set the enabled state from the given boolean.
 void setFocus()
          Set the focus to this control.
 void setFocusable(boolean focusable)
          Change if this control is focusable (if it can get the focus or not).
 void setHeight(SizeValue height)
          Set Height as SizeValue.
 void setId(String id)
          Set the id.
 void setStyle(String style)
          Set style.
 void setWidth(SizeValue width)
          Set width as SizeValue.
 

Method Detail

getElement

Element getElement()
Get the attached internal Nifty element for this Nifty control.

Returns:
the element

getId

String getId()
Get the id.

Returns:
id

setId

void setId(String id)
Set the id.

Parameters:
id - new id

getWidth

int getWidth()
Get width as SizeValue.

Returns:
width

setWidth

void setWidth(SizeValue width)
Set width as SizeValue.

Parameters:
width - width

getHeight

int getHeight()
Get height as SizeValue.

Returns:
height

setHeight

void setHeight(SizeValue height)
Set Height as SizeValue.

Parameters:
height - new height

getStyle

String getStyle()
Get current style.

Returns:
current style

setStyle

void setStyle(String style)
Set style. Please note that currently not all style attributes are processed.

Parameters:
style - new style to apply

enable

void enable()
Enable the control.


disable

void disable()
Disable the control.


setEnabled

void setEnabled(boolean enabled)
Set the enabled state from the given boolean.

Parameters:
enabled - the new enabled state

isEnabled

boolean isEnabled()
Get the current enabled state of the control.

Returns:

setFocus

void setFocus()
Set the focus to this control.


setFocusable

void setFocusable(boolean focusable)
Change if this control is focusable (if it can get the focus or not). Usually controls are set up with focusable="true" but you can change this here if necessary.

Parameters:
focusable - true when this element can get the focus and false when not

hasFocus

boolean hasFocus()
Returns true if this control has the focus.

Returns:
true, when the control has the focus and false if not

layoutCallback

void layoutCallback()
This method is called after the element this control is attached too has been layouted. This callback allows the control to update any layout related things if necessary.


isBound

boolean isBound()
Returns true when this NiftyControl is already bound (e.g. its Controllers bind() method has been called).

Returns:
true if bound and false if not


Copyright © 2011. All Rights Reserved.