Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.ui.propertypages
Class SystemKeyValueFieldEditor


java.lang.Object
  extended by 

org.eclipse.jface.preference.FieldEditor
      extended by 
org.eclipse.rse.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.


Field Summary
protected   ISystemValidator defaultValueValidator
           
protected   ISystemValidator valueValidator
           
 
Fields inherited from class org.eclipse.jface.preference. FieldEditor
HORIZONTAL_GAP, IS_VALID, VALUE
 
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 org.eclipse.jface.preference. FieldEditor
applyFont, checkParent, clearErrorMessage, clearMessage, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, createControl, dispose, fillIntoGrid, fireStateChanged, fireValueChanged, getFieldEditorFontName, getLabelControl, getLabelControl, getLabelText, getPage, getPreferenceName, getPreferencePage, getPreferenceStore, init, isValid, load, loadDefault, presentsDefaultValue, refreshValidState, setButtonLayoutData, setEnabled, setFocus, setLabelText, setPage, setPreferenceName, setPreferencePage, setPreferenceStore, setPresentsDefaultValue, setPropertyChangeListener, showErrorMessage, showMessage, store
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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()
Specified by:
getNumberOfControls in class FieldEditor
See Also:
FieldEditor.getNumberOfControls()

doStore

protected void doStore()
Specified by:
doStore in class FieldEditor
See Also:
FieldEditor.doStore()

doLoadDefault

protected void doLoadDefault()
Specified by:
doLoadDefault in class FieldEditor
See Also:
FieldEditor.doLoadDefault()

doLoad

protected void doLoad()
Specified by:
doLoad in class FieldEditor
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)
Specified by:
doFillIntoGrid in class FieldEditor
See Also:
FieldEditor.doFillIntoGrid(Composite, int)

adjustForNumColumns

protected void adjustForNumColumns(int numColumns)
Specified by:
adjustForNumColumns in class FieldEditor
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


RSE
Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire