com.gridsystems.config.modules.tomcat
Class ConnectorField

java.lang.Object
  extended by com.gridsystems.config.tools.console.Field
      extended by com.gridsystems.config.modules.tomcat.ConnectorField
All Implemented Interfaces:
ConsoleViewAction

public class ConnectorField
extends Field
implements ConsoleViewAction

Type description.

Version:
1.0
Author:
Rodrigo Ruiz Aguayo

Field Summary
 
Fields inherited from class com.gridsystems.config.tools.console.Field
bundle
 
Constructor Summary
ConnectorField(java.util.ResourceBundle bundle, Connector c, int index, java.lang.String keyMap)
          Creates a new instance.
 
Method Summary
 boolean execute(ConsoleConfiguratorView view)
          Performs a task related to the specified view.
 Connector getConnector()
          Gets the wrapped connector instance.
 java.lang.String[] getContents()
          Gets the contents of this field.
 java.lang.String getKeyMapping()
          Gets the keyMap to use for this instance.
protected  java.lang.String readLine(java.lang.String prompt, java.lang.String defValue)
          Reads a line of text from the console.
 void setIndex(int i)
          Sets the index of this instance.
 
Methods inherited from class com.gridsystems.config.tools.console.Field
getString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectorField

public ConnectorField(java.util.ResourceBundle bundle,
                      Connector c,
                      int index,
                      java.lang.String keyMap)
Creates a new instance.

Parameters:
bundle - the bundle for i18n
c - the connector to edit
index - the subindex
keyMap - the "container" keymap
Method Detail

getConnector

public Connector getConnector()
Gets the wrapped connector instance.

Returns:
the connector instance

setIndex

public void setIndex(int i)
Sets the index of this instance. Used on field removal.

Parameters:
i - the new index

getContents

public java.lang.String[] getContents()
Gets the contents of this field.

Specified by:
getContents in class Field
Returns:
The contents of this field

getKeyMapping

public java.lang.String getKeyMapping()
Gets the keyMap to use for this instance.

Instances of this class will be presented as list items. Each instance will build its keyMap from a combination of the "parent keyMap", and an "index" with its position in the list. Gets the key mapping of this action.

Specified by:
getKeyMapping in interface ConsoleViewAction
Returns:
The key mapping of this action

execute

public boolean execute(ConsoleConfiguratorView view)
Performs a task related to the specified view.

Specified by:
execute in interface ConsoleViewAction
Parameters:
view - The view invoking the execution
Returns:
false if the view must exit from its execution loop; true otherwise

readLine

protected java.lang.String readLine(java.lang.String prompt,
                                    java.lang.String defValue)
                             throws java.io.IOException
Reads a line of text from the console.

Parameters:
prompt - The prompt to show
defValue - The default text for empty lines
Returns:
The read text
Throws:
java.io.IOException - If an error occurs while reading from the console


Copyright © 2007-2008 Grid Systems, S.A.. All Rights Reserved.