jeters.components
Class UserIO

java.lang.Object
  extended by jeters.components.UserIO
All Implemented Interfaces:
Component, InputComponent<EditableText>, OutputComponent<EditableText>

public class UserIO
extends java.lang.Object
implements InputComponent<EditableText>, OutputComponent<EditableText>

default implementation of a combined input and output component reading from and writing to the user interface component.
The output component can handle any implementation of EditableText. If, however, the text is an instance of MediaWikiText, it will display the additionally available information, too.


Constructor Summary
UserIO()
           
 
Method Summary
 PlainText getInput(UIComponent uiForRequests)
          receive a text that can be edited by the program
 void output(EditableText text, UIComponent uiForRequests)
          the output method necessary for all output components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserIO

public UserIO()
Method Detail

getInput

public PlainText getInput(UIComponent uiForRequests)
Description copied from interface: InputComponent
receive a text that can be edited by the program

Specified by:
getInput in interface InputComponent<EditableText>
Parameters:
uiForRequests - UI-component for communication with the user (if necessary)
Returns:
the text for editing, is allowed to be null in cases where loading fails for some reason

output

public void output(EditableText text,
                   UIComponent uiForRequests)
the output method necessary for all output components. Instead of directly handling the output, this method chooses a more specialized method depending on the true type of the parameter "text".

Specified by:
output in interface OutputComponent<EditableText>
Parameters:
text - the text that has been edited and should now be printed/written/etc. as the result
uiForRequests - UI-component for communication with the user (if necessary)