com.tensegrity.skeleton.launch
Class AbstractLoadPreferencesLaunchTask

java.lang.Object
  extended bycom.tensegrity.gui.launch.LaunchTask
      extended bycom.tensegrity.skeleton.swing.launch.AbstractLaunchTask
          extended bycom.tensegrity.skeleton.launch.LoadFileLaunchTask
              extended bycom.tensegrity.skeleton.launch.AbstractLoadPreferencesLaunchTask

public abstract class AbstractLoadPreferencesLaunchTask
extends LoadFileLaunchTask

Reads the Preferences of the skeleton and applies it to the application frame. This class extracts the common characteristics of the SWING and SWT load preferences launch task.

Version:
$Id: AbstractLoadPreferencesLaunchTask.java,v 1.7 2005/07/19 11:47:29 MichaelKegel Exp $
Author:
GillesIachelini, Andreas Ebbert, Arnd Houben

Field Summary
protected  java.lang.String DEFAULT_PREFERENCES_LOCATION
          Location for the default preferences.
 
Fields inherited from class com.tensegrity.gui.launch.LaunchTask
lasterror, LAUNCHTASKSTATUS_FATAL, LAUNCHTASKSTATUS_FATAL_RETRY, LAUNCHTASKSTATUS_SERIOUS, LAUNCHTASKSTATUS_SERIOUS_RETRY, LAUNCHTASKSTATUS_SHUTDOWN, LAUNCHTASKSTATUS_SUCCESS, LAUNCHTASKSTATUS_WARNING
 
Constructor Summary
AbstractLoadPreferencesLaunchTask(ApplicationFrame applicationFrame)
          Constructor specifying the ApplicationFrame to use.
AbstractLoadPreferencesLaunchTask(ApplicationFrame applicationFrame, java.lang.String filename, java.lang.Class loadClass, java.lang.String defaultPreferences)
          Creates the LoadRulesLaunchTask based on the given filename and Class to load the file.
 
Method Summary
protected abstract  void enableToolTipManager(boolean b)
          Since the en- and disabling of a ToolTipManager is platform dependent a deriving class have to implement this.
protected  java.lang.String getDefaultPreferences()
          Returns the name of the file with all the default preferences.
protected  java.lang.String getFilename()
          Returns the name of the preferences file.
protected  java.lang.Class getLoadClass()
          When loading resource from jar files or other locations you may need a Class instance.
protected abstract  void initPreferenceListeners(Preferences prefs)
          This initializes all preferences listeners
protected abstract  void managingPreferences(Preferences prefs)
          This should connect the applictaion frame and a suitable PreferenceHelper
 int run()
          The run method of this launch task.
 
Methods inherited from class com.tensegrity.skeleton.launch.LoadFileLaunchTask
getName
 
Methods inherited from class com.tensegrity.skeleton.swing.launch.AbstractLaunchTask
findResourceText, getApplicationFrame, getStatusPrefix, getStatusPrefixResourceKey, postCreate
 
Methods inherited from class com.tensegrity.gui.launch.LaunchTask
getError, getStatusDetails
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PREFERENCES_LOCATION

protected final java.lang.String DEFAULT_PREFERENCES_LOCATION
Location for the default preferences. Either use the custom constructor or overload the getDefaultPreferences() method to specify a different location.

See Also:
Constant Field Values
Constructor Detail

AbstractLoadPreferencesLaunchTask

public AbstractLoadPreferencesLaunchTask(ApplicationFrame applicationFrame)
Constructor specifying the ApplicationFrame to use.

Parameters:
applicationFrame - the ApplicationFrame to use.

AbstractLoadPreferencesLaunchTask

public AbstractLoadPreferencesLaunchTask(ApplicationFrame applicationFrame,
                                         java.lang.String filename,
                                         java.lang.Class loadClass,
                                         java.lang.String defaultPreferences)
Creates the LoadRulesLaunchTask based on the given filename and Class to load the file. Furthermore you can provide the location for the default preferences file.

Parameters:
applicationFrame - Application context for this LaunchTask.
filename - a String which describes a filename.
loadClass - the resource class to use for loading.
defaultPreferences - location of the default preferences file
Method Detail

getFilename

protected java.lang.String getFilename()
Returns the name of the preferences file.

Overrides:
getFilename in class LoadFileLaunchTask
Returns:
String the filename as string.
See Also:
LoadFileLaunchTask.getFilename()

getDefaultPreferences

protected java.lang.String getDefaultPreferences()
Returns the name of the file with all the default preferences.

Returns:
String

getLoadClass

protected java.lang.Class getLoadClass()
Description copied from class: LoadFileLaunchTask
When loading resource from jar files or other locations you may need a Class instance. Return null to load from absolute file.

Overrides:
getLoadClass in class LoadFileLaunchTask
Returns:
Class the class to use as resource loader.
See Also:
LoadFileLaunchTask.getLoadClass()

run

public final int run()
              throws java.lang.Exception
Description copied from class: LaunchTask
The run method of this launch task. The returned status indicates what the invoker is supposed to do after the task executed.

Specified by:
run in class LaunchTask
Returns:
one of the LAUNCHTASKSTATUS_* constants defined in this interface.
Throws:
java.lang.Exception

enableToolTipManager

protected abstract void enableToolTipManager(boolean b)
Since the en- and disabling of a ToolTipManager is platform dependent a deriving class have to implement this. A Swing based launch task, e.g., could write something like this:
ToolTipManager.sharedInstance().setEnabled(b);

Parameters:
b -

managingPreferences

protected abstract void managingPreferences(Preferences prefs)
This should connect the applictaion frame and a suitable PreferenceHelper

Parameters:
prefs -

initPreferenceListeners

protected abstract void initPreferenceListeners(Preferences prefs)
This initializes all preferences listeners

Parameters:
prefs -


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.