jeters.components
Class DefaultGUI

java.lang.Object
  extended by jeters.components.DefaultGUI
All Implemented Interfaces:
Component, Configurable, UIComponent, UIComponent_HomeView

public class DefaultGUI
extends java.lang.Object
implements UIComponent_HomeView, Configurable

the default implementation of a graphical UI component for JETERS. For a command line UI, see DefaultCUI.


Constructor Summary
DefaultGUI()
           
 
Method Summary
 java.lang.String confirmChanges(java.lang.String label, java.lang.String oldVersion, java.lang.String newVersion, java.lang.String descriptionOfChanges)
          allows the user to accept/decline changes made by a replacer component (i.e. an implementation of ReplacerComponent).
 NamedDataSet getConfiguration()
          this method is called to retrieve the current configuration for this component.
 void presentHomeView(Core coreClass)
          This method is called when the program starts and every time a replacement series is completed.
 NamedDataSet request(UIRequest... requests)
          way for other components to communicate with the user via the UI
 void setConfiguration(NamedDataSet configurationSet)
          sets the configuration for this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultGUI

public DefaultGUI()
Method Detail

presentHomeView

public void presentHomeView(Core coreClass)
Description copied from interface: UIComponent_HomeView
This method is called when the program starts and every time a replacement series is completed. It is a possibility to provide a starting window, where the user can do some or all of the following: It is recommended (but not required) to prevent the user from choosing a set of components which are not compatible with each other (e.g. a replacer component generating only PlainText together with an output component requiring MediaWikiText).

Specified by:
presentHomeView in interface UIComponent_HomeView

confirmChanges

public java.lang.String confirmChanges(java.lang.String label,
                                       java.lang.String oldVersion,
                                       java.lang.String newVersion,
                                       java.lang.String descriptionOfChanges)
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, ...). This parameter can be "", but not null.
oldVersion - the text before the replacer's actions. This parameter can be "", but not null.
newVersion - the text after the replacer's actions. This parameter can be "", but not null.
descriptionOfChanges - an explanation of the differences between oldVersion and newVersion provided by the replacer component. This parameter can be "", but not null.
Returns:
String object containing the corrected text as the user wants it, may also be different from both oldVersion and newVersion. Not null.

request

public NamedDataSet request(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-objects (can use vararg-syntax). Neither the array nor the array's entries may be null.
Returns:
the user's replies to the requests, as a NamedDataSet.
The name of a reply must equal the name of the answered request. 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.

getConfiguration

public NamedDataSet getConfiguration()
Description copied from interface: Configurable
this method is called to retrieve the current configuration for this component. It will e.g. be used for generating the configuration file.

Specified by:
getConfiguration in interface Configurable
Returns:
configuration data, null is allowed (doesn't make much sense however)

setConfiguration

public void setConfiguration(NamedDataSet configurationSet)
Description copied from interface: Configurable
sets the configuration for this object. If setConfiguration is not called, the component must work properly nevertheless, using default settings.

Specified by:
setConfiguration in interface Configurable
Parameters:
configurationSet - the configuration data to be used by the component if null, the object has to use default settings