Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.propertypages
Class SystemKeyValueFieldEditor

java.lang.Object
  extended byFieldEditor
      extended bycom.ibm.etools.systems.core.ui.propertypages.SystemKeyValueFieldEditor

public class SystemKeyValueFieldEditor
extends FieldEditor

For string key,value pair properties that have a discrete list of key values. Used in preference pages.

See Also:
Serialized Form

Field Summary
static String copyright
           
protected  ISystemValidator defaultValueValidator
           
protected  ISystemValidator valueValidator
           
 
Constructor Summary
SystemKeyValueFieldEditor(String name, String labelText, String[] keys, String keysLabelString, String valueLabelString, Composite parent)
          Constructor
 
Method Summary
protected  void adjustForNumColumns(int numColumns)
           
 void createSelectionListener()
          Creates a selection listener.
protected  String createString(Hashtable keyValues)
          Convert hashtable of key-value pairs into a single string
protected  void doFillIntoGrid(Composite parent, int numColumns)
           
protected  void doLoad()
           
protected  void doLoadDefault()
           
protected  void doStore()
           
protected  List getKeysControl()
          Returns this field editor's List control for the keys.
 Composite getKeysControl(Composite parent)
          Returns this field editor's text control.
 int getNumberOfControls()
           
 String getToolTipText()
          Get the tooltip text
protected  Text getValueControl()
          Returns this field editor's Text control for the key value.
 Composite getValueControl(Composite parent)
          Returns this field editor's value entry field control.
 Hashtable parseString(String allvalues)
          Parse out list of key-value pairs into a hashtable
 void setDelimiterCharacters(char keyValueDelimiter, char keyValuePairDelimiter)
          Call this to set the characters used to delimit the strings in the preferences store
 void setHeightHint(int hint)
          Change the height hint for this composite.
 void setKeysWidthHint(int hint)
          Change the width hint for the keys list Default is 150 pixels.
 void setToolTipText(String tip)
          Set the tooltip text
 void setValuesWidthHint(int hint)
          Change the width hint for the values fields on the right Default is not set
 void setValueValidator(ISystemValidator v)
          Call this to specify a validator for the value entry field.
protected  SystemMessage validateValueInput()
          This hook method is called whenever the text changes in the input field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

valueValidator

protected ISystemValidator valueValidator

defaultValueValidator

protected ISystemValidator defaultValueValidator
Constructor Detail

SystemKeyValueFieldEditor

public SystemKeyValueFieldEditor(String name,
                                 String labelText,
                                 String[] keys,
                                 String keysLabelString,
                                 String valueLabelString,
                                 Composite parent)
Constructor

Method Detail

setValueValidator

public void setValueValidator(ISystemValidator v)
Call this to specify a validator for the value entry field. It will be called per keystroke. By default we just check against the special characters used to delimit the key and value (=) and to delimiter each key/value pair (;)


setDelimiterCharacters

public void setDelimiterCharacters(char keyValueDelimiter,
                                   char keyValuePairDelimiter)
Call this to set the characters used to delimit the strings in the preferences store

Parameters:
keyValueDelimiter - The char to distinguish between key and value. Default is =
keyValuePairDelimiter - The char to distinguish between each key/value pair. Default is ;

getNumberOfControls

public int getNumberOfControls()
See Also:
FieldEditor#getNumberOfControls()

doStore

protected void doStore()
See Also:
FieldEditor#doStore()

doLoadDefault

protected void doLoadDefault()
See Also:
FieldEditor#doLoadDefault()

doLoad

protected void doLoad()
See Also:
FieldEditor#doLoad()

parseString

public Hashtable parseString(String allvalues)
Parse out list of key-value pairs into a hashtable


createString

protected String createString(Hashtable keyValues)
Convert hashtable of key-value pairs into a single string


doFillIntoGrid

protected void doFillIntoGrid(Composite parent,
                              int numColumns)
See Also:
FieldEditor#doFillIntoGrid(Composite, int)

adjustForNumColumns

protected void adjustForNumColumns(int numColumns)
See Also:
FieldEditor#adjustForNumColumns(int)

getKeysControl

protected List getKeysControl()
Returns this field editor's List control for the keys.


getValueControl

protected Text getValueControl()
Returns this field editor's Text control for the key value.


getKeysControl

public Composite getKeysControl(Composite parent)
Returns this field editor's text control.

The control is created if it does not yet exist

Parameters:
parent - the parent
Returns:
the text control

getValueControl

public Composite getValueControl(Composite parent)
Returns this field editor's value entry field control.

Parameters:
parent - the parent control
Returns:
the list control

createSelectionListener

public void createSelectionListener()
Creates a selection listener.


validateValueInput

protected SystemMessage validateValueInput()
This hook method is called whenever the text changes in the input field. The default implementation delegates the request to an ISystemValidator object. If the ISystemValidator reports an error the error message is displayed in the PreferencePage's message line.

See Also:
setValueValidator(ISystemValidator)

setHeightHint

public void setHeightHint(int hint)
Change the height hint for this composite. Default is 100 pixels.


setKeysWidthHint

public void setKeysWidthHint(int hint)
Change the width hint for the keys list Default is 150 pixels.


setValuesWidthHint

public void setValuesWidthHint(int hint)
Change the width hint for the values fields on the right Default is not set


setToolTipText

public void setToolTipText(String tip)
Set the tooltip text


getToolTipText

public String getToolTipText()
Get the tooltip text


Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.