|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.gui.document.DocumentSettingsProvider
Implementation of PreferenceDialogProvider for editing the
documents settings in a preference style dialog.
| Nested Class Summary | |
static interface |
DocumentSettingsProvider.DocSetting
DocSetting |
| Constructor Summary | |
DocumentSettingsProvider(Document gDoc,
java.util.Map mapPref2Doc,
java.lang.String preferenceFileName,
java.lang.Class refClass)
Constructor |
|
| Method Summary | |
void |
applyChanges()
After an user has made changes in the PreferencesDialog this method is called to make the values the application can retrieve by calling getValue valid. |
void |
cancelChanges()
Cancels all changes made since the last call to applyChanges(). |
void |
flush()
Saves the preferences-file. |
AttributeList |
getAttributeList()
Returns the AttributeList holding the preference settings. |
PreferenceEvent[] |
getChangedPreferences()
Returns an array of PreferencesEvents. |
AttributeSet |
getDefaultAttributeSet(java.lang.String name)
Returns the top level set with the given name from the default list. |
boolean |
isRestorable()
Indicates whether this preference instance is restorable. |
static java.util.Map |
makeMap(java.lang.Object[] keys,
java.lang.Object[] values)
Creates a map by mapping each item of the first array to the item with the same index in the second array. |
static DocumentSettingsProvider.DocSetting |
newDocSetting(Document gDoc,
java.lang.String docKey,
java.util.Map prefValue2DocValue)
Creates a new DocSetting using the given information. |
DocumentSettingsProvider.DocSetting |
newDocSetting(java.lang.String docKey,
java.util.Map prefValue2DocValue)
Creates a new DocSetting using the given information. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DocumentSettingsProvider(Document gDoc,
java.util.Map mapPref2Doc,
java.lang.String preferenceFileName,
java.lang.Class refClass)
throws ReadException,
java.lang.CloneNotSupportedException
gDoc - The document which properties are editedmapPref2Doc - A map matching keys from the preferences to
the corresponding keys in the documentpreferenceFileName - The name of the preference filerefClass - The reference class for loading the
preferences file
ReadException - When reading the preferences file fails
java.lang.CloneNotSupportedException - If cloning the preferences fails| Method Detail |
public void applyChanges()
PreferenceDialogProvidergetValue valid.
applyChanges in interface PreferenceDialogProviderpublic void cancelChanges()
PreferenceDialogProviderapplyChanges().
cancelChanges in interface PreferenceDialogProvider
public void flush()
throws java.io.IOException
PreferenceDialogProviderpreferences.xml and it is located in the
user.dir.
flush in interface PreferenceDialogProviderjava.io.IOException - if the preference-file could not be saved.public AttributeList getAttributeList()
PreferenceDialogProviderAttributeList holding the preference settings.
getAttributeList in interface PreferenceDialogProviderAttributeList holding the preference settings.public AttributeSet getDefaultAttributeSet(java.lang.String name)
PreferenceDialogProvider
getDefaultAttributeSet in interface PreferenceDialogProvidername - the name of the set to retrieve.
AttributeSet; null otherwise.public PreferenceEvent[] getChangedPreferences()
PreferenceDialogProviderPreferencesEvents. Every listed entry
reflects a change made to the preferences.
getChangedPreferences in interface PreferenceDialogProviderPreferencesEvents reflecting the changes
made to the preferences.public boolean isRestorable()
PreferenceDialogProvider
isRestorable in interface PreferenceDialogProvidertrue, if this preference instance is restorable.
public DocumentSettingsProvider.DocSetting newDocSetting(java.lang.String docKey,
java.util.Map prefValue2DocValue)
DocSetting using the given information.
docKey - The key of this setting in the documentprefValue2DocValue - The map for converting a preference value
to a document value
DocSetting
public static DocumentSettingsProvider.DocSetting newDocSetting(Document gDoc,
java.lang.String docKey,
java.util.Map prefValue2DocValue)
DocSetting using the given information.
gDoc - The graph document this setting is applied todocKey - The key of this setting in the documentprefValue2DocValue - The map for converting a preference value
to a document value
DocSetting
public static java.util.Map makeMap(java.lang.Object[] keys,
java.lang.Object[] values)
keys - The array holding the keysvalues - The array holding the values
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||