org.eclipse.xtend.ide.contentassist
Class ReplacingAppendable
java.lang.Object
org.eclipse.xtext.xbase.compiler.StringBuilderBasedAppendable
org.eclipse.xtend.ide.contentassist.ReplacingAppendable
- All Implemented Interfaces:
- IAppendable
public class ReplacingAppendable
- extends StringBuilderBasedAppendable
An IAppendable
to insert text into an Xtend document. Takes imports and
existing variable names into account.
- Author:
- Jan Koehnlein - Initial contribution and API
Methods inherited from class org.eclipse.xtext.xbase.compiler.StringBuilderBasedAppendable |
append, append, appendType, charAt, closeScope, declareSyntheticVariable, declareVariable, decreaseIndentation, getContent, getImportManager, getImports, getIndentationString, getLineSeparator, getName, getObject, hasName, hasObject, increaseIndentation, length, newLine, openPseudoScope, openScope, setScopeStack, subSequence |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ReplacingAppendable
public ReplacingAppendable(ImportManager importManager,
java.lang.String indentString,
IXtextDocument document,
XtendFile xtendFile,
WhitespaceHelper whitespaceHelper)
toString
@NonNull
public java.lang.String toString()
- Specified by:
toString
in interface IAppendable
- Overrides:
toString
in class StringBuilderBasedAppendable
getTotalOffset
public int getTotalOffset()
getCode
@NonNull
public java.lang.String getCode()
commitChanges
public void commitChanges()
throws org.eclipse.jface.text.BadLocationException
- Throws:
org.eclipse.jface.text.BadLocationException
commitChanges
public int commitChanges(int offset,
int length)
throws org.eclipse.jface.text.BadLocationException
- Throws:
org.eclipse.jface.text.BadLocationException
insertNewImports
public int insertNewImports()
throws org.eclipse.jface.text.BadLocationException
- Throws:
org.eclipse.jface.text.BadLocationException
getNewImports
protected java.util.List<java.lang.String> getNewImports()