Package org.eclipse.jface.text.formatter
Class FormattingContext
java.lang.Object
org.eclipse.jface.text.formatter.FormattingContext
- All Implemented Interfaces:
IFormattingContext
Default implementation of
IFormattingContext
.- Since:
- 3.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Dispose of the formatting context.String[]
Returns the preference keys used for the retrieval of formatting preferences.getProperty
(Object key) Retrieves the propertykey
from the formatting contextboolean
Is this preference key for a boolean preference?boolean
isDoublePreference
(String key) Is this preference key for a double preference?boolean
isFloatPreference
(String key) Is this preference key for a float preference?boolean
Is this preference key for an integer preference?boolean
isLongPreference
(String key) Is this preference key for a long preference?boolean
isStringPreference
(String key) Is this preference key for a string preference?void
mapToStore
(Map<Object, Object> map, IPreferenceStore store) Stores the preferences from a map to a preference store.void
setProperty
(Object key, Object property) Stores the propertykey
in the formatting context.void
storeToMap
(IPreferenceStore store, Map<Object, Object> map, boolean useDefault) Retrieves the preferences from a preference store in a map.
-
Constructor Details
-
FormattingContext
public FormattingContext()
-
-
Method Details
-
dispose
public void dispose()Description copied from interface:IFormattingContext
Dispose of the formatting context.Must be called after the formatting context has been used in a formatting process.
- Specified by:
dispose
in interfaceIFormattingContext
-
getPreferenceKeys
Description copied from interface:IFormattingContext
Returns the preference keys used for the retrieval of formatting preferences.- Specified by:
getPreferenceKeys
in interfaceIFormattingContext
- Returns:
- The preference keys for formatting
-
getProperty
Description copied from interface:IFormattingContext
Retrieves the propertykey
from the formatting context- Specified by:
getProperty
in interfaceIFormattingContext
- Parameters:
key
- the key of the property to store in the context. Must be aString
.- Returns:
- the property
key
if available,null
otherwise
-
isBooleanPreference
Description copied from interface:IFormattingContext
Is this preference key for a boolean preference?- Specified by:
isBooleanPreference
in interfaceIFormattingContext
- Parameters:
key
- the preference key to query its type- Returns:
true
iff this key is for a boolean preference,false
otherwise.
-
isDoublePreference
Description copied from interface:IFormattingContext
Is this preference key for a double preference?- Specified by:
isDoublePreference
in interfaceIFormattingContext
- Parameters:
key
- the preference key to query its type- Returns:
true
iff this key is for a double preference,false
otherwise.
-
isFloatPreference
Description copied from interface:IFormattingContext
Is this preference key for a float preference?- Specified by:
isFloatPreference
in interfaceIFormattingContext
- Parameters:
key
- The preference key to query its type- Returns:
true
iff this key is for a float preference,false
otherwise.
-
isIntegerPreference
Description copied from interface:IFormattingContext
Is this preference key for an integer preference?- Specified by:
isIntegerPreference
in interfaceIFormattingContext
- Parameters:
key
- The preference key to query its type- Returns:
true
iff this key is for an integer preference,false
otherwise.
-
isLongPreference
Description copied from interface:IFormattingContext
Is this preference key for a long preference?- Specified by:
isLongPreference
in interfaceIFormattingContext
- Parameters:
key
- The preference key to query its type- Returns:
true
iff this key is for a long preference,false
otherwise.
-
isStringPreference
Description copied from interface:IFormattingContext
Is this preference key for a string preference?- Specified by:
isStringPreference
in interfaceIFormattingContext
- Parameters:
key
- The preference key to query its type- Returns:
true
iff this key is for a string preference,false
otherwise.
-
mapToStore
Description copied from interface:IFormattingContext
Stores the preferences from a map to a preference store.Note that the preference keys returned by
IFormattingContext.getPreferenceKeys()
must not be used in the preference store. Otherwise the preferences are overwritten.- Specified by:
mapToStore
in interfaceIFormattingContext
- Parameters:
map
- Map to retrieve the preferences fromstore
- Preference store to store the preferences in
-
setProperty
Description copied from interface:IFormattingContext
Stores the propertykey
in the formatting context.- Specified by:
setProperty
in interfaceIFormattingContext
- 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
Description copied from interface:IFormattingContext
Retrieves the preferences from a preference store in a map.Note that the preference keys returned by
IFormattingContext.getPreferenceKeys()
must not be used in the map. Otherwise the preferences are overwritten.- Specified by:
storeToMap
in interfaceIFormattingContext
- Parameters:
store
- Preference store to retrieve the preferences frommap
- Map to store the preferences inuseDefault
-true
if the default preferences should be used,false
otherwise
-