de.lessvoid.nifty.controls.nullobjects
Class TextFieldNull

java.lang.Object
  extended by de.lessvoid.nifty.controls.nullobjects.TextFieldNull
All Implemented Interfaces:
NiftyControl, TextField

public class TextFieldNull
extends Object
implements TextField

The NullObject in case you're requesting this control and it could not be found. You'll get a warning in the log and an instance of this class back. This reduces NPE.

Author:
void

Constructor Summary
TextFieldNull()
           
 
Method Summary
 void disable()
           
 void disablePasswordChar()
          Disable the password character which displays the text again,
 void enable()
           
 void enablePasswordChar(char passwordChar)
          Enable a password character that is displayed instead of the actual text.
 Element getElement()
           
 int getHeight()
           
 String getId()
           
 String getStyle()
           
 String getText()
          Get the current TextField text.
 int getWidth()
           
 boolean hasFocus()
           
 boolean isBound()
           
 boolean isEnabled()
           
 boolean isPasswordCharEnabled()
          Checks if a password character is currently enabled.
 void layoutCallback()
           
 void setCursorPosition(int position)
          Set the cursorposition to the given index.
 void setEnabled(boolean enabled)
           
 void setFocus()
           
 void setFocusable(boolean focusable)
           
 void setHeight(SizeValue height)
           
 void setId(String id)
           
 void setMaxLength(int maxLength)
          Change the max. input length to a new length.
 void setStyle(String style)
           
 void setText(String text)
          Set the Text of the TextField.
 void setWidth(SizeValue width)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextFieldNull

public TextFieldNull()
Method Detail

getElement

public Element getElement()
Specified by:
getElement in interface NiftyControl

getId

public String getId()
Specified by:
getId in interface NiftyControl

setId

public void setId(String id)
Specified by:
setId in interface NiftyControl

getWidth

public int getWidth()
Specified by:
getWidth in interface NiftyControl

setWidth

public void setWidth(SizeValue width)
Specified by:
setWidth in interface NiftyControl

getHeight

public int getHeight()
Specified by:
getHeight in interface NiftyControl

setHeight

public void setHeight(SizeValue height)
Specified by:
setHeight in interface NiftyControl

getStyle

public String getStyle()
Specified by:
getStyle in interface NiftyControl

setStyle

public void setStyle(String style)
Specified by:
setStyle in interface NiftyControl

enable

public void enable()
Specified by:
enable in interface NiftyControl

disable

public void disable()
Specified by:
disable in interface NiftyControl

setEnabled

public void setEnabled(boolean enabled)
Specified by:
setEnabled in interface NiftyControl

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface NiftyControl

getText

public String getText()
Description copied from interface: TextField
Get the current TextField text.

Specified by:
getText in interface TextField
Returns:
text

setText

public void setText(String text)
Description copied from interface: TextField
Set the Text of the TextField.

Specified by:
setText in interface TextField
Parameters:
text - new text

setMaxLength

public void setMaxLength(int maxLength)
Description copied from interface: TextField
Change the max. input length to a new length.

Specified by:
setMaxLength in interface TextField
Parameters:
maxLength - max length

setCursorPosition

public void setCursorPosition(int position)
Description copied from interface: TextField
Set the cursorposition to the given index.

Specified by:
setCursorPosition in interface TextField
Parameters:
position - new cursor position

enablePasswordChar

public void enablePasswordChar(char passwordChar)
Description copied from interface: TextField
Enable a password character that is displayed instead of the actual text.

Specified by:
enablePasswordChar in interface TextField
Parameters:
passwordChar - charcter to use, like '*'

disablePasswordChar

public void disablePasswordChar()
Description copied from interface: TextField
Disable the password character which displays the text again,

Specified by:
disablePasswordChar in interface TextField

isPasswordCharEnabled

public boolean isPasswordCharEnabled()
Description copied from interface: TextField
Checks if a password character is currently enabled.

Specified by:
isPasswordCharEnabled in interface TextField
Returns:
true if password character is enabled and false if not.

setFocus

public void setFocus()
Specified by:
setFocus in interface NiftyControl

setFocusable

public void setFocusable(boolean focusable)
Specified by:
setFocusable in interface NiftyControl

hasFocus

public boolean hasFocus()
Specified by:
hasFocus in interface NiftyControl

layoutCallback

public void layoutCallback()
Specified by:
layoutCallback in interface NiftyControl

isBound

public boolean isBound()
Specified by:
isBound in interface NiftyControl


Copyright © 2011. All Rights Reserved.