public abstract class ContextBasedFormattingStrategy extends java.lang.Object implements IFormattingStrategy, IFormattingStrategyExtension
FormattingContextProperties.CONTEXT_PREFERENCES
property and makes them available to subclasses.
| Constructor and Description |
|---|
ContextBasedFormattingStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
format()
Formats the region with the properties indicated in the formatting
context previously supplied by
formatterStarts(IFormattingContext). |
java.lang.String |
format(java.lang.String content,
boolean start,
java.lang.String indentation,
int[] positions)
Formats the given string.
|
void |
formatterStarts(IFormattingContext context)
Informs the strategy about the start of a formatting process in which it will participate.
|
void |
formatterStarts(java.lang.String indentation)
Informs the strategy about the start of a formatting process in which it will
participate.
|
void |
formatterStops()
Informs the strategy that the formatting process in which it has participated
has been finished.
|
java.util.Map<java.lang.String,java.lang.String> |
getPreferences()
Returns the preferences used for the current formatting step.
|
public void format()
IFormattingStrategyExtensionformatterStarts(IFormattingContext).format in interface IFormattingStrategyExtensionpublic java.lang.String format(java.lang.String content,
boolean start,
java.lang.String indentation,
int[] positions)
IFormattingStrategyformat in interface IFormattingStrategycontent - the initial string to be formattedstart - indicates whether the beginning of content is a line start in its documentindentation - the indentation string to be usedpositions - the character positions to be updatedpublic void formatterStarts(IFormattingContext context)
IFormattingStrategyExtensionformatterStarts in interface IFormattingStrategyExtensioncontext - the formatting context used in the corresponding formatting process.public void formatterStarts(java.lang.String indentation)
IFormattingStrategyformatterStarts in interface IFormattingStrategyindentation - the indent string of the first line at which the
overall formatting process starts.public void formatterStops()
IFormattingStrategyformatterStops in interface IFormattingStrategyformatterStops in interface IFormattingStrategyExtensionpublic final java.util.Map<java.lang.String,java.lang.String> getPreferences()
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.