net.datacrow.core.settings
Class Setting

java.lang.Object
  extended by net.datacrow.core.settings.Setting

public class Setting
extends java.lang.Object

A Settings definition. The setting is always added to a file (the settings file) and if specified, the setting is also editable in the SettingsView.

Author:
Robert Jan van der Waals

Constructor Summary
Setting(int dataType, java.lang.String key, java.lang.Object value, int componentType, java.lang.String helpText, java.lang.String labelText, boolean displayLabel, boolean showToUser)
          Creates a setting
 
Method Summary
 boolean displayLabel()
           
 int getDataType()
          The value type.
 java.lang.String getHelpText()
           
 java.lang.String getKey()
          The setting key (DcRepository.Settings, DcRepository.ModuleSettings).
 java.lang.String getLabelText()
           
 int getSettingsGroup()
           
 int getSettingsGroupParent()
           
 javax.swing.JComponent getUIComponent()
           
 java.lang.Object getValue()
           
 java.lang.String getValueAsString()
          Creates a string representation of the value which can be used to store the value.
 boolean isTemporary()
           
 void isTemporary(boolean b)
           
 void setStringAsValue(java.lang.String s)
          Allows a string representation to be set as a value.
 void setValue(java.lang.Object o)
           
 boolean showToUser()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Setting

public Setting(int dataType,
               java.lang.String key,
               java.lang.Object value,
               int componentType,
               java.lang.String helpText,
               java.lang.String labelText,
               boolean displayLabel,
               boolean showToUser)
Creates a setting

Parameters:
iDataType - the data type of the value
sKey - a unique identifier, also used for the settings file
oValue - the default value for thsi setting
componentType - the UI component
helptext - helptext for this setting, used as tooltip
labeltext - the display text for the label
displaylabel - show the label on screen ?
showToUser - is the setting meant to be display in the panel ?
Method Detail

isTemporary

public void isTemporary(boolean b)

isTemporary

public boolean isTemporary()

getLabelText

public java.lang.String getLabelText()

displayLabel

public boolean displayLabel()

showToUser

public boolean showToUser()

getSettingsGroup

public int getSettingsGroup()

getSettingsGroupParent

public int getSettingsGroupParent()

getUIComponent

public javax.swing.JComponent getUIComponent()

getDataType

public int getDataType()
The value type.

Returns:
DcRepository.ValueTypes

getKey

public java.lang.String getKey()
The setting key (DcRepository.Settings, DcRepository.ModuleSettings).


getValue

public java.lang.Object getValue()

getHelpText

public java.lang.String getHelpText()

getValueAsString

public java.lang.String getValueAsString()
Creates a string representation of the value which can be used to store the value.

Returns:
String representation of the value.

setValue

public void setValue(java.lang.Object o)

setStringAsValue

public void setStringAsValue(java.lang.String s)
Allows a string representation to be set as a value. The string will be parsed. The result will be set as the actual value for this setting.

Parameters:
s - String representation of the value.