net.sf.jeters.components
Class DefaultCLI
java.lang.Object
net.sf.jeters.util.AssistedConfigurable
net.sf.jeters.components.DefaultCLI
- All Implemented Interfaces:
- Component, UIComponent, Configurable
public class DefaultCLI
- extends AssistedConfigurable
- implements UIComponent
the default implementation of a (very basic) command line UI component for JETERS.
For a graphical UI, see DefaultGUI
.
- Author:
- Tobias Knerr
Method Summary |
java.lang.String |
confirmChanges(java.lang.String label,
java.lang.String oldVersion,
java.lang.String newVersion,
java.lang.String descriptionOfChanges,
boolean allowCancel)
allows the user to accept/decline changes made by a replacer component
(i.e. an implementation of ReplacerComponent ). |
void |
output(java.lang.String message)
|
net.sf.jeters.componentInterface.dataStructs.NamedDataSet |
request(net.sf.jeters.componentInterface.dataStructs.UIRequest... requests)
way for other components to communicate with the user via the UI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultCLI
public DefaultCLI()
confirmChanges
public java.lang.String confirmChanges(java.lang.String label,
java.lang.String oldVersion,
java.lang.String newVersion,
java.lang.String descriptionOfChanges,
boolean allowCancel)
- Description copied from interface:
UIComponent
- allows the user to accept/decline changes made by a replacer component
(i.e. an implementation of
ReplacerComponent
).
UIComponents should at least offer the possibility of choosing between
the old and the new version of the text. Additionally, they can allow
manual editing.
- Specified by:
confirmChanges
in interface UIComponent
- Parameters:
label
- a kind of "name" (filename, article title, ...);
can be "", but not null.oldVersion
- the text before the replacer's actions;
can be "", but not null.newVersion
- the text after the replacer's actions;
can be "", but not null.descriptionOfChanges
- an explanation of the differences between
oldVersion and newVersion provided by the
replacer component; can be "", but not null.allowCancel
- if false, cancelling must not be possible;
if true, possibility depends on UI
- Returns:
- String containing the corrected text as the user wants it,
may also be different from both oldVersion and newVersion;
null indicates that the user chose to cancel the editing process
and is only possible if allowCancel == true.
request
public net.sf.jeters.componentInterface.dataStructs.NamedDataSet request(net.sf.jeters.componentInterface.dataStructs.UIRequest... requests)
- Description copied from interface:
UIComponent
- way for other components to communicate with the user via the UI
- Specified by:
request
in interface UIComponent
- Parameters:
requests
- array of UIRequest
s (can use vararg-syntax).
Neither the array nor the array's entries may be null.
- Returns:
- user's replies to the requests, as a
NamedDataSet
.
The name of a reply must equal the name of the answered request.
null has a special meaning here: It indicates that the user
intentionally cancels the request. Otherwise, null must
not be returned! If getting proper replies fails,
return a NamedDataSet that is empty or contains at least those
replies which were properly entered.
output
public void output(java.lang.String message)