| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectix.iface.ui.JPropertiesManager
public abstract class JPropertiesManager
An abstarct class for managing the properties and preferences of an
 application. Provides lots of generically useful things for
 property management, including running an editor to change
 properties.
 Abstract methods are: 
   setDefaultProperties(Properties props)
   makePreferencesDialog()
 This used to be part of the application whose properties are to be
 managed; it was moved to de-clutter the application and to make
 mechanisms available to other applications.
 JPropertyManagers manage Properties for PropertyApplications. If
 the Properties are user editable, they work together with
 PropertyEditors like the JPreferenceDialogs. Here is how these
 classes split the work:
 Properties hold all values under the keys. Provided by Java.
 PropertyManagers look after Properties, their default values,
 loading/saving properties, and initiating updates to the
 application to make the properties take effect, and updates from
 the application to make sure current settings are saved. The
 PropertyMangers also provide links between all property-related classes.
 PropertyEditors, e.g. JPreferencesDialogue, build the editor
 window, let the user change property values (providing help where
 available), let the user load, save, use defaults, apply, etc.
 PropertyApplications get changed by the values of the properties.
 {\bf How to make this work:}
 Make your application implement the PropertiesApplication interface and 
 write the setProperty and getProperty methods; the former sets a given
 property in the application which should update the application, the latter 
 determines the current setting of the property from the application. The 
 application name is used to work out what the default property file should
 be (./ 
 
 
 
 
 
 
 
 
Field Summary 
 
 
protected  PropertiesApplicationapplication
           
 
 
 java.util.HashSetnoEditComponents
           
 
 
protected  JPreferencesDialogpreferencesDialog
           
 
 
protected  java.util.Propertiesproperties
           
 
 
Constructor Summary 
 
JPropertiesManager(PropertiesApplication application)
           
 
 
Method Summary 
 
 
 voideditPreferences()
           
 
 
 JPreferencesDialogensurePreferencesDialog()
           
 
 
 java.io.FilegetDefaultPropertiesFile()
          Uses the application name to build a preferences file name in the
 current directory.
 
 
 java.util.PropertiesgetProperties()
           
 
 
 java.io.FilegetPropertiesFile()
          Specify the name of the properties file to use; 
 set to getDefaultPropertiesFile() if you don't care.
 
 
 java.lang.StringgetProperty(java.lang.String key)
           
 
 
 voidinitProperties()
          Sets up default properties, then loads the properties from file
 and passes them to the application.
 
 
static booleanisBooleanProperty(java.lang.String key,
                  java.lang.String value)
           
 
 
 booleanisEditable(java.lang.String key)
           
 
 
 java.util.PropertiesloadProperties()
           
 
 
 java.util.PropertiesloadProperties(java.util.Properties props)
           
 
 
abstract  JPreferencesDialogmakePreferencesDialog()
           
 
 
 voidnoteNoEditable(java.lang.String property)
          If there are properties that cannot be edited here, mark them as such.
 
 
 voidsaveApplicationProperties()
           
 
 
 voidsaveProperties()
           
 
 
 voidsaveProperties(java.util.Properties properties)
           
 
 
abstract  voidsetDefaultProperties(java.util.Properties props)
          Sets the default properties for the application into the given
 properties object; application specific.
 
 
 voidsetProperty(java.lang.String key,
            java.lang.String value)
           
 
 
 voidupdateApplicationFromProperties()
           
 
 
 voidupdateApplicationFromProperties(PropertiesApplication app)
           
 
 
 voidupdatePropertiesFromApplication()
           
 
 
 voidupdatePropertiesFromApplication(PropertiesApplication app)
           
 
 
Methods inherited from class java.lang.Object 
 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Field Detail 
application
protected PropertiesApplication application
properties
protected java.util.Properties properties
preferencesDialog
protected JPreferencesDialog preferencesDialog
noEditComponents
public java.util.HashSet noEditComponents
 
Constructor Detail 
JPropertiesManager
public JPropertiesManager(PropertiesApplication application)
 
Method Detail 
setDefaultProperties
public abstract void setDefaultProperties(java.util.Properties props)
makePreferencesDialog
public abstract JPreferencesDialog makePreferencesDialog()
noteNoEditable
public void noteNoEditable(java.lang.String property)
isEditable
public boolean isEditable(java.lang.String key)
getPropertiesFile
public java.io.File getPropertiesFile()
getProperties
public java.util.Properties getProperties()
getProperty
public java.lang.String getProperty(java.lang.String key)
setProperty
public void setProperty(java.lang.String key,
                        java.lang.String value)
editPreferences
public void editPreferences()
ensurePreferencesDialog
public JPreferencesDialog ensurePreferencesDialog()
getDefaultPropertiesFile
public java.io.File getDefaultPropertiesFile()
initProperties
public void initProperties()
saveProperties
public void saveProperties()
saveProperties
public void saveProperties(java.util.Properties properties)
loadProperties
public java.util.Properties loadProperties()
loadProperties
public java.util.Properties loadProperties(java.util.Properties props)
saveApplicationProperties
public void saveApplicationProperties()
updateApplicationFromProperties
public void updateApplicationFromProperties()
updateApplicationFromProperties
public void updateApplicationFromProperties(PropertiesApplication app)
updatePropertiesFromApplication
public void updatePropertiesFromApplication()
updatePropertiesFromApplication
public void updatePropertiesFromApplication(PropertiesApplication app)
isBooleanProperty
public static boolean isBooleanProperty(java.lang.String key,
                                        java.lang.String value)
 
 
  
   
    Overview  
      Package  
    Class  
      Use  
      Tree  
      Deprecated  
      Index  
      Help  
  
 
 
 PREV CLASS 
 NEXT CLASS 
  FRAMES   
 NO FRAMES   
 
 
 
  SUMMARY: NESTED | FIELD | CONSTR | METHOD 
DETAIL: FIELD | CONSTR | METHOD