Package org.eclipse.jface.text.formatter
Interface IFormattingContext
-
- All Known Implementing Classes:
FormattingContext
public interface IFormattingContextFormatting context used in formatting strategies implementing interfaceIFormattingStrategyExtension.- Since:
- 3.0
- See Also:
IFormattingStrategyExtension
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddispose()Dispose of the formatting context.java.lang.String[]getPreferenceKeys()Returns the preference keys used for the retrieval of formatting preferences.java.lang.ObjectgetProperty(java.lang.Object key)Retrieves the propertykeyfrom the formatting contextbooleanisBooleanPreference(java.lang.String key)Is this preference key for a boolean preference?booleanisDoublePreference(java.lang.String key)Is this preference key for a double preference?booleanisFloatPreference(java.lang.String key)Is this preference key for a float preference?booleanisIntegerPreference(java.lang.String key)Is this preference key for an integer preference?booleanisLongPreference(java.lang.String key)Is this preference key for a long preference?booleanisStringPreference(java.lang.String key)Is this preference key for a string preference?voidmapToStore(java.util.Map<java.lang.Object,java.lang.Object> map, IPreferenceStore store)Stores the preferences from a map to a preference store.voidsetProperty(java.lang.Object key, java.lang.Object property)Stores the propertykeyin the formatting context.voidstoreToMap(IPreferenceStore store, java.util.Map<java.lang.Object,java.lang.Object> map, boolean useDefault)Retrieves the preferences from a preference store in a map.
-
-
-
Method Detail
-
dispose
void dispose()
Dispose of the formatting context.Must be called after the formatting context has been used in a formatting process.
-
getPreferenceKeys
java.lang.String[] getPreferenceKeys()
Returns the preference keys used for the retrieval of formatting preferences.- Returns:
- The preference keys for formatting
-
getProperty
java.lang.Object getProperty(java.lang.Object key)
Retrieves the propertykeyfrom the formatting context- Parameters:
key- the key of the property to store in the context. Must be aString.- Returns:
- the property
keyif available,nullotherwise
-
isBooleanPreference
boolean isBooleanPreference(java.lang.String key)
Is this preference key for a boolean preference?- Parameters:
key- the preference key to query its type- Returns:
trueiff this key is for a boolean preference,falseotherwise.
-
isDoublePreference
boolean isDoublePreference(java.lang.String key)
Is this preference key for a double preference?- Parameters:
key- the preference key to query its type- Returns:
trueiff this key is for a double preference,falseotherwise.
-
isFloatPreference
boolean isFloatPreference(java.lang.String key)
Is this preference key for a float preference?- Parameters:
key- The preference key to query its type- Returns:
trueiff this key is for a float preference,falseotherwise.
-
isIntegerPreference
boolean isIntegerPreference(java.lang.String key)
Is this preference key for an integer preference?- Parameters:
key- The preference key to query its type- Returns:
trueiff this key is for an integer preference,falseotherwise.
-
isLongPreference
boolean isLongPreference(java.lang.String key)
Is this preference key for a long preference?- Parameters:
key- The preference key to query its type- Returns:
trueiff this key is for a long preference,falseotherwise.
-
isStringPreference
boolean isStringPreference(java.lang.String key)
Is this preference key for a string preference?- Parameters:
key- The preference key to query its type- Returns:
trueiff this key is for a string preference,falseotherwise.
-
mapToStore
void mapToStore(java.util.Map<java.lang.Object,java.lang.Object> map, IPreferenceStore store)Stores the preferences from a map to a preference store.Note that the preference keys returned by
getPreferenceKeys()must not be used in the preference store. Otherwise the preferences are overwritten.- Parameters:
map- Map to retrieve the preferences fromstore- Preference store to store the preferences in
-
setProperty
void setProperty(java.lang.Object key, java.lang.Object property)Stores the propertykeyin the formatting context.- Parameters:
key- Key of the property to store in the context. Must be aString.property- Property to store in the context. If already present, the new property overwrites the present one.
-
storeToMap
void storeToMap(IPreferenceStore store, java.util.Map<java.lang.Object,java.lang.Object> map, boolean useDefault)
Retrieves the preferences from a preference store in a map.Note that the preference keys returned by
getPreferenceKeys()must not be used in the map. Otherwise the preferences are overwritten.- Parameters:
store- Preference store to retrieve the preferences frommap- Map to store the preferences inuseDefault-trueif the default preferences should be used,falseotherwise
-
-