Package snap.viewx
Class DevPaneConsoleTextArea
java.lang.Object
snap.props.PropObject
snap.view.View
snap.view.TextArea
snap.viewx.DevPaneConsoleTextArea
- All Implemented Interfaces:
PropChange.DoChange
,XMLArchiver.Archivable
- Direct Known Subclasses:
ScanPane.ScanView
A TextView subclass with methods to act like a terminal/console.
-
Field Summary
Fields inherited from class snap.view.TextArea
Editable_Prop, FireActionOnEnterKey_Prop, FireActionOnFocusLost_Prop, isSpellChecking, Selection_Prop, SNAP_RICHTEXT_TYPE, SourceText_Prop, WrapLines_Prop
Fields inherited from class snap.view.View
_align, _borderRadius, _effect, _font, _margin, _padding, _repaintRect, _showing, _spacing, _vertical, Action, Align_Prop, Border_Prop, BorderRadius_Prop, Clip_Prop, Cursor_Prop, DEFAULT_ALIGN, DEFAULT_MARGIN, DEFAULT_PADDING, DEFAULT_SPACING, Disabled_Prop, DragEvents, Effect_Prop, Fill_Prop, Focusable_Prop, Focused_Prop, FocusWhenPressed_Prop, Font_Prop, GrowHeight_Prop, GrowWidth_Prop, Height_Prop, KeyEvents, KeyPress, KeyRelease, KeyType, LeanX_Prop, LeanY_Prop, Managed_Prop, Margin_Prop, MaxHeight_Prop, MaxWidth_Prop, MinHeight_Prop, MinWidth_Prop, MouseDrag, MouseEnter, MouseEvents, MouseExit, MouseMove, MousePress, MouseRelease, Name_Prop, Opacity_Prop, Padding_Prop, Paintable_Prop, Parent_Prop, Pickable_Prop, PrefHeight_Prop, PrefWidth_Prop, Rotate_Prop, ScaleX_Prop, ScaleY_Prop, Scroll, Showing_Prop, Spacing_Prop, Text_Prop, ToolTip_Prop, TransX_Prop, TransY_Prop, Vertical_Prop, Visible_Prop, Width_Prop, X_Prop, Y_Prop
Fields inherited from class snap.props.PropObject
_pcs, EMPTY_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Appends a string.void
Clears the console.executeCommand
(String aCommand) Executes command.protected String
executeCommandImpl
(String aCommand) Executes command.executeHelp
(String aCommand) Execute a help command.executePrint
(String aCommand) Executes a print command.getInput()
Gets input String from console starting at current input location.int
Returns the location of the end of the last text appended to console.Returns the prompt.protected void
keyPressed
(ViewEvent anEvent) Handles key events.protected void
Called when a key is typed.protected void
Called when enter is hit.void
replaceChars
(CharSequence theChars, TextStyle aStyle, int aStart, int anEnd, boolean doUpdateSel) Override to update input location.void
Sets a command from history.void
Sets a command from history.void
Sets the prompt.Methods inherited from class snap.view.TextArea
addChars, addChars, addChars, charAt, clear, copy, createTextAreaKeys, cut, delete, delete, deleteBackward, deleteForward, deleteToLineEnd, fromXML, fromXMLTextArea, getCharIndexForXY, getClipboardContent, getDefaultFill, getDefaultLineStyle, getDefaultStyle, getFontScale, getFormat, getLine, getLineAlign, getLineCount, getLineForCharIndex, getPrefHeightImpl, getPrefWidthImpl, getSel, getSelAnchor, getSelColor, getSelEnd, getSelIndex, getSelLineStyle, getSelPath, getSelStart, getSelStyle, getSourceText, getText, getTextBlock, getTextBounds, getTextColor, getTextFont, getTextLinkForXY, getTextStyleForCharIndex, getTokenForCharIndex, getUndoer, getValuePropName, handleSourceTextPropChange, hideCursor, isCaretAnim, isCaretNeeded, isEditable, isFireActionOnEnterKey, isFireActionOnFocusLost, isHyphenating, isLineJustify, isRichText, isSelEmpty, isShowCaret, isSpellChecking, isSyncTextFont, isUnderlined, isWrapLines, keyReleased, length, mouseDragged, mouseMoved, mousePressed, mouseReleased, openLink, paintFront, paintSel, parentFontChanged, paste, processActionEvent, processEvent, redo, repaintSel, replaceChars, replaceChars, replaceCharsWithContent, scaleTextToFit, scrollSelToVisible, selectAll, selectBackward, selectDown, selectForward, selectLineEnd, selectLineStart, selectUp, setAlign, setCaretAnim, setCaretAnim, setDefaultLineStyle, setDefaultStyle, setEditable, setFireActionOnEnterKey, setFireActionOnFocusLost, setFocused, setFont, setFontScale, setFormat, setHeight, setHyphenating, setLineAlign, setLineJustify, setParent, setSel, setSel, setSelLineStyleValue, setSelStyleValue, setShowCaret, setShowing, setSourceText, setSubscript, setSuperscript, setSyncTextFont, setText, setTextBlock, setTextColor, setTextFont, setUnderlined, setWidth, setWrapLines, showCursor, textDidChange, toString, toXML, toXMLTextArea, undo, updateTextBlockBounds
Methods inherited from class snap.view.View
addBinding, addEventFilter, addEventHandler, clone, contains, contains, containsShape, createActionEvent, disableEvents, enableEvents, fireActionEvent, getAlign, getAlignX, getAlignY, getAnim, getAnimCleared, getAnimTimeDeep, getBestHeight, getBestSize, getBestWidth, getBinding, getBinding, getBindingCount, getBindings, getBorder, getBorderRadius, getBounds, getBoundsLocal, getBoundsParent, getBoundsShape, getBoundsShapeParent, getClip, getClipAll, getClipAllBounds, getClipBounds, getClippedRect, getCursor, getDefaultBorder, getDefaultFont, getEffect, getEnv, getEventAdapter, getFill, getFillColor, getFocusNext, getFocusPrev, getFont, getHeight, getHost, getInsetsAll, getLean, getLeanX, getLeanY, getLocalToParent, getLocalToParent, getMargin, getMaxHeight, getMaxSize, getMaxWidth, getMaxX, getMaxY, getMidX, getMidY, getMinHeight, getMinHeightImpl, getMinSize, getMinWidth, getMinWidthImpl, getName, getOpacity, getOpacityAll, getOwner, getOwner, getPadding, getParent, getParent, getParentCount, getParentToLocal, getParentToLocal, getPhysics, getPhysics, getPrefHeight, getPrefHeight, getPrefSize, getPrefWidth, getPrefWidth, getProp, getPropDefault, getProps, getPropValue, getRealClassName, getRepaintRect, getRepaintRectExpanded, getRootView, getRotate, getScale, getScaleX, getScaleY, getSize, getSpacing, getToolTip, getToolTip, getTransX, getTransY, getUpdater, getVisRect, getWidth, getWindow, getX, getXY, getY, indexInHost, indexInParent, initProps, intersectsShape, isActionable, isAncestor, isClipToBounds, isDisabled, isEnabled, isFocusable, isFocused, isFocusKeysEnabled, isFocusPainted, isFocusWhenPressed, isFontSet, isGrowHeight, isGrowWidth, isGuest, isHorizontal, isLocalToParentSimple, isManaged, isManagedVisible, isMaxHeightSet, isMaxWidthSet, isMinHeightSet, isMinWidthSet, isMouseDown, isMouseOver, isNeedsRepaint, isPaintable, isPickable, isPickableVisible, isPrefHeightSet, isPrefWidthSet, isShowing, isToolTipEnabled, isVertical, isVisible, localToParent, localToParent, localToParent, localToParent, localToScreen, paintAll, paintBack, parentToLocal, parentToLocal, parentToLocal, parentToLocal, playAnimDeep, processEventAll, processEventFilters, processEventHandlers, relayout, relayoutParent, removeBinding, removeBinding, removeEventFilter, removeEventHandler, repaint, repaint, repaint, repaintInParent, requestFocus, runDelayed, runIntervals, runLater, scrollToVisible, setActionable, setAlignX, setAlignY, setAnimProps, setAnimString, setAnimTimeDeep, setBorder, setBorder, setBorderRadius, setBounds, setBounds, setBoundsLocal, setClip, setClipToBounds, setCursor, setDisabled, setEffect, setEnabled, setFill, setFocusable, setFocusKeysEnabled, setFocusPainted, setFocusWhenPressed, setGrowHeight, setGrowWidth, setLean, setLeanX, setLeanY, setManaged, setMargin, setMargin, setMaxHeight, setMaxSize, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinSize, setMinWidth, setName, setOpacity, setOwner, setPadding, setPadding, setPaintable, setPickable, setPrefHeight, setPrefSize, setPrefSize, setPrefWidth, setProp, setPropValue, setRealClassName, setRotate, setScale, setScaleX, setScaleY, setSize, setSize, setSizeLocal, setSizeToBestSize, setSizeToPrefSize, setSpacing, setToolTip, setToolTipEnabled, setTransX, setTransY, setVertical, setVisible, setX, setXY, setXYLocal, setY, stopAnimDeep, stopIntervals, themeChanged, toStringProps
Methods inherited from class snap.props.PropObject
addDeepChangeListener, addPropChangeListener, addPropChangeListener, firePropChange, firePropChange, firePropChange, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, getPropsString, isPropDefault, processPropChange, removeDeepChangeListener, removePropChangeListener, removePropChangeListener, setPropsString, setPropValues
-
Constructor Details
-
DevPaneConsoleTextArea
public DevPaneConsoleTextArea()Creates new ConsoleView.
-
-
Method Details
-
getPrompt
Returns the prompt. -
setPrompt
Sets the prompt. -
getInputLocation
public int getInputLocation()Returns the location of the end of the last text appended to console. -
keyPressed
Handles key events.- Overrides:
keyPressed
in classTextArea
-
keyTyped
Called when a key is typed. -
processEnterAction
protected void processEnterAction()Called when enter is hit. -
append
Appends a string. -
replaceChars
public void replaceChars(CharSequence theChars, TextStyle aStyle, int aStart, int anEnd, boolean doUpdateSel) Override to update input location.- Overrides:
replaceChars
in classTextArea
-
getInput
Gets input String from console starting at current input location. -
executeCommand
Executes command. -
executeCommandImpl
Executes command. -
executeHelp
Execute a help command. -
executePrint
Executes a print command. -
clearConsole
public void clearConsole()Clears the console. -
setCommandHistoryPrevious
public void setCommandHistoryPrevious()Sets a command from history. -
setCommandHistoryNext
public void setCommandHistoryNext()Sets a command from history.
-