Package snap.viewx
Class CodeDoc
java.lang.Object
snap.props.PropObject
snap.text.TextDoc
snap.viewx.CodeDoc
- All Implemented Interfaces:
CharSequence
,Cloneable
,PropChange.DoChange
,CharSequenceX
This TextDoc subclass loads Java code with syntax coloring.
-
Field Summary
Fields inherited from class snap.text.TextDoc
_defaultLineStyle, _defaultTextStyle, _length, _lines, _parentTextStyle, _propChangeEnabled, _width, Chars_Prop, DefaultTextStyle_Prop, LineStyle_Prop, ParentTextStyle_Prop, Style_Prop, TextModified_Prop
Fields inherited from class snap.props.PropObject
_pcs, EMPTY_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected TextToken[]
createTokensForTextLine
(TextLine aTextLine) Override to create tokens.static Color
getColorForParseToken
(ParseToken aToken) Checks the given token for syntax coloring.static CodeDoc
newFromSource
(WebURL aURL) Returns a new CodeDoc from given source.Methods inherited from class snap.text.TextDoc
addChars, addChars, addDefaultLine, addLine, addTextDoc, charAt, clear, clone, createLine, getAlignX, getDefaultLineStyle, getDefaultStyle, getFontForCharIndex, getLine, getLineCount, getLineForCharIndex, getLineLast, getLineLongest, getLines, getLineStyleForCharIndex, getParentTextStyle, getPrefWidth, getPrefWidth, getRunForCharIndex, getRunForCharRange, getRunLast, getSourceFile, getSourceURL, getStartCharIndex, getString, getStyleForCharIndex, getStyleForCharRange, indexOf, isDefaultTextStyleSet, isPropChangeEnabled, isRichText, isTextModified, isUnderlined, length, newFromSource, readFromSourceURL, removeChars, removeLine, replaceChars, replaceChars, scaleFonts, setAlignX, setDefaultLineStyle, setDefaultStyle, setLineStyle, setLineStyleValue, setParentTextStyle, setPropChangeEnabled, setSourceURL, setString, setStyle, setStyleValue, setStyleValue, setStyleValue, setStyleValue, setTextModified, setUnderlined, subSequence, toStringProps, updateLines, writeToSourceFile
Methods inherited from class snap.props.PropObject
addDeepChangeListener, addPropChangeListener, addPropChangeListener, firePropChange, firePropChange, firePropChange, getPropDefault, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, getPropValue, initProps, isPropDefault, processPropChange, removeDeepChangeListener, removePropChangeListener, removePropChangeListener, setPropValue, toString
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty, toString
Methods inherited from interface snap.util.CharSequenceX
getIndentLength, getIndentString, getLastChar, indexAfterNewline, indexOfNewline, isAfterLineEnd, isLastCharNewline, isLineEnd, isLineEndChar, isWhiteSpace, lastIndexAfterNewline, lastIndexOfNewline, startsWith
-
Constructor Details
-
CodeDoc
public CodeDoc()Constructor.
-
-
Method Details
-
createTokensForTextLine
Override to create tokens.- Overrides:
createTokensForTextLine
in classTextDoc
-
getColorForParseToken
Checks the given token for syntax coloring. -
newFromSource
Returns a new CodeDoc from given source.
-