@Deprecated public abstract class IndentEngine extends ServiceType
ServiceType.Handle, ServiceType.Registry
PROP_NAME
Constructor and Description |
---|
IndentEngine()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
acceptMimeType(String mime)
Deprecated.
Allow subclasses to decide whether they are suitable
for the given mime-type or not.
|
abstract Writer |
createWriter(Document doc,
int offset,
Writer writer)
Deprecated.
Creates writer that formats text that is inserted into it.
|
static IndentEngine |
find(Document doc)
Deprecated.
Finds engine associated with given document.
|
static IndentEngine |
find(String mime)
Deprecated.
Finds engine associated with given mime type.
|
static IndentEngine |
getDefault()
Deprecated.
Returns a simple indentation engine that does no formatting.
|
HelpCtx |
getHelpCtx()
Deprecated.
|
static Enumeration<? extends IndentEngine> |
indentEngines()
Deprecated.
Returns enumeration of all registered indentation engines.
|
abstract int |
indentLine(Document doc,
int offset)
Deprecated.
Indents the current line.
|
abstract int |
indentNewLine(Document doc,
int offset)
Deprecated.
Inserts new line at given position and indents the new line with
spaces.
|
static void |
register(String mime,
IndentEngine eng)
Deprecated.
IndentEngine now is a ServiceType
|
addPropertyChangeListener, clone, createClone, displayName, firePropertyChange, getName, removePropertyChangeListener, setName
public HelpCtx getHelpCtx()
getHelpCtx
in interface HelpCtx.Provider
getHelpCtx
in class ServiceType
public abstract int indentLine(Document doc, int offset)
doc
- the document to work onoffset
- the offset of a character on the linepublic abstract int indentNewLine(Document doc, int offset)
doc
- the document to work onoffset
- the offset of a character on the linepublic abstract Writer createWriter(Document doc, int offset, Writer writer)
The provided document and offset are only informational, should not be modified but only used to find correct indentation strategy.
doc
- documentoffset
- position to begin inserts atwriter
- writer to write toprotected boolean acceptMimeType(String mime)
mime
- mime-type string@Deprecated public static void register(String mime, IndentEngine eng)
public static Enumeration<? extends IndentEngine> indentEngines()
public static IndentEngine find(String mime)
public static IndentEngine find(Document doc)
public static IndentEngine getDefault()