Package snap.viewx
Class ConsoleView
java.lang.Object
snap.props.PropObject
snap.view.View
snap.view.TextArea
snap.viewx.ConsoleView
- All Implemented Interfaces:
PropChange.DoChange
,XMLArchiver.Archivable
A TextView subclass with methods to act like a terminal/console.
-
Nested Class Summary
Nested classes/interfaces inherited from class snap.view.TextArea
TextArea.UndoTextSel
-
Field Summary
Fields inherited from class snap.view.TextArea
Editable_Prop, FireActionOnEnterKey_Prop, FireActionOnFocusLost_Prop, isSpellChecking, Selection_Prop, SNAP_RICHTEXT_TYPE, TextDoc_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, 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
(String aString, 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, createTextBox, cut, delete, delete, deleteBackward, deleteForward, deleteToLineEnd, fromXML, getCharIndexForXY, getClipboardContent, getDefaultFill, getDefaultLineStyle, getDefaultStyle, getFont, getFontScale, getFormat, getLine, getLineAlign, getLineCount, getLineForCharIndex, getLineLast, getPrefHeightImpl, getPrefWidthImpl, getSel, getSelAnchor, getSelColor, getSelEnd, getSelIndex, getSelLineStyle, getSelPath, getSelStart, getSelStyle, getStyleForCharIndex, getText, getTextBorder, getTextBox, getTextBoxBounds, getTextColor, getTextDoc, getTextFill, getTextLinkForXY, getTokenForCharIndex, getUndoer, getUndoSelection, getValuePropName, hideCursor, isCaretAnim, isCaretNeeded, isEditable, isFireActionOnEnterKey, isFireActionOnFocusLost, isHyphenating, isLineJustify, isRichText, isSelEmpty, isShowCaret, isSpellChecking, isUnderlined, isWrapLines, keyReleased, length, mouseDragged, mouseMoved, mousePressed, mouseReleased, openLink, paintFront, paintSel, parentFontChanged, paste, processEvent, redo, repaintSel, replaceChars, replaceCharsWithContent, replaceCharsWithTextDoc, 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, setSubscript, setSuperscript, setText, setTextBorder, setTextBox, setTextBoxBounds, setTextColor, setTextDoc, setTextFill, setUnderlined, setWidth, setWrapLines, showCursor, textDidChange, textDocDidPropChange, toString, toXML, undo, undoerAddPropChange, undoerSaveChanges
Methods inherited from class snap.view.View
addBinding, addEventFilter, addEventHandler, clone, contains, contains, contains, disableEvents, dispatchEventToView, 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, 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, intersects, 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, processEventFilters, processEventHandlers, relayout, relayoutParent, removeBinding, removeBinding, removeEventFilter, removeEventHandler, repaint, repaint, repaint, repaintInParent, requestFocus, scrollToVisible, setActionable, setAlignX, setAlignY, 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, setSizeToPrefSize, setSpacing, setToolTip, setToolTipEnabled, setTransX, setTransY, setVertical, setVisible, setX, setXY, setXYLocal, setY, stopAnimDeep, themeChanged, toStringProps
Methods inherited from class snap.props.PropObject
addDeepChangeListener, addPropChangeListener, addPropChangeListener, firePropChange, firePropChange, firePropChange, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, isPropDefault, processPropChange, removeDeepChangeListener, removePropChangeListener, removePropChangeListener
-
Constructor Details
-
ConsoleView
public ConsoleView()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(String aString, 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.
-