|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.palamedes.ui.preferences.stylesheets.StylesheetStore
public class StylesheetStore
A collection of style sheets.
Constructor Summary | |
---|---|
StylesheetStore(org.eclipse.jface.preference.IPreferenceStore store,
java.lang.String key)
Creates a new style sheet store. |
Method Summary | |
---|---|
void |
add(StylesheetPersistenceData data)
Adds a template encapsulated in its persistent form. |
void |
delete(StylesheetPersistenceData data)
Removes a template from the store. |
Stylesheet |
findStylesheet(java.lang.String name)
Returns the first enabled template that matches the name. |
Stylesheet |
findStylesheetById(java.lang.String id)
Returns the first enabled style sheet that matches the given style sheet id. |
StylesheetPersistenceData[] |
getStylesheetData(boolean includeDeleted)
Returns all style sheet data. |
StylesheetPersistenceData |
getStylesheetData(java.lang.String id)
Returns the style sheet data of the style sheet with id id
or null if no such style sheet can be found. |
Stylesheet[] |
getStylesheets()
Returns all enabled style sheets. |
protected void |
handleException(java.io.IOException x)
Handles an IOException thrown during reloading the preferences
due to a preference store update. |
protected void |
internalAdd(StylesheetPersistenceData data)
Adds a style sheet to the internal store. |
void |
load()
Loads the style sheets from contributions and preferences. |
protected void |
loadContributedStylesheets()
Hook method to load contributed style sheets. |
void |
restoreDefaults()
Deletes all user-added templates and reverts all contributed templates. |
void |
restoreDeleted()
Restores all contributed templates that have been deleted. |
void |
save()
Saves the style sheets to the preferences. |
void |
startListeningForPreferenceChanges()
Starts listening for property changes on the preference store. |
void |
stopListeningForPreferenceChanges()
Stops the auto-updating behavior started by calling startListeningForPreferenceChanges() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StylesheetStore(org.eclipse.jface.preference.IPreferenceStore store, java.lang.String key)
store
- the preference store in which to store custom style sheets
under key
key
- the key into store
where to store custom
style sheetMethod Detail |
---|
public void add(StylesheetPersistenceData data)
data
- the template to addpublic void delete(StylesheetPersistenceData data)
data
- the template to removepublic Stylesheet findStylesheet(java.lang.String name)
name
- the name of the template searched for
null
if none is foundpublic Stylesheet findStylesheetById(java.lang.String id)
id
- the id of the style sheet searched for
null
if none is foundpublic StylesheetPersistenceData[] getStylesheetData(boolean includeDeleted)
includeDeleted
- whether to include deleted data
public StylesheetPersistenceData getStylesheetData(java.lang.String id)
id
or null
if no such style sheet can be found.
id
- the id of the style sheet data
id
or null
public Stylesheet[] getStylesheets()
protected void handleException(java.io.IOException x)
IOException
thrown during reloading the preferences
due to a preference store update. The default is to write to stderr.
x
- the exceptionprotected void internalAdd(StylesheetPersistenceData data)
data
- the style sheet data to addpublic void load() throws java.io.IOException
java.io.IOException
- if loading fails.protected void loadContributedStylesheets() throws java.io.IOException
The default implementation does nothing.
java.io.IOException
- if loading failspublic void restoreDefaults()
public void restoreDeleted()
public void save() throws java.io.IOException
java.io.IOException
- if the style sheets cannot be writtenpublic final void startListeningForPreferenceChanges()
reloaded
. Call
stopListeningForPreferenceChanges()
to remove any listener and
stop the auto-updating behavior.
public final void stopListeningForPreferenceChanges()
startListeningForPreferenceChanges()
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |