|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JScrollPane
org.jext.console.Console
An internal console which provide different kinds of
prompts and which allows to execute both internal and
external (OS specific) commands. The console is embedded
in a JScrollPane
and handles it by itself.
Nested Class Summary |
Nested classes inherited from class javax.swing.JScrollPane |
javax.swing.JScrollPane.AccessibleJScrollPane, javax.swing.JScrollPane.ScrollBar |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
static java.lang.String[] |
DEFAULT_PROMPTS
Default prompt types: DOS, Jext, Linux and SunOS |
static int |
DOS_PROMPT
DOS prompt: /export/home/guy > |
java.awt.Color |
errorColor
|
java.awt.Color |
infoColor
|
static int |
JEXT_PROMPT
Jext prompt: Gfx@/export/home/guy > |
static int |
LINUX_PROMPT
Linux prompt: guy@csdlyon$ |
java.awt.Color |
outputColor
|
java.awt.Color |
promptColor
|
static int |
SUNOS_PROMPT
SunOS prompt: csdlyon% |
Fields inherited from class javax.swing.JScrollPane |
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.ScrollPaneConstants |
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
Console(JextFrame parent)
Instanciates a new console without displaying prompt. |
|
Console(JextFrame parent,
boolean display)
Creates a new console, embedding it in a JScrollPane . |
Method Summary | |
void |
add(java.lang.String add)
Adds a String to the current command line. |
void |
addCommand(Command command)
Adds a command to the linked list of commands. |
void |
addHistory(java.lang.String command)
Adds a command to the history. |
void |
append(java.lang.String text,
java.awt.Color color)
This method appends text in the text area. |
void |
deleteChar()
Delete a char from command line. |
void |
displayPrompt()
Displays the prompt according to the current selected prompt type. |
void |
doBackwardSearch()
Search backward in the history for a matching command, according to the command typed in the user typing space. |
void |
doCompletion()
Completes current filename if possible. |
void |
error(java.lang.String display)
Display a message using error color. |
void |
execute(java.lang.String command)
Execute command. |
protected void |
finalize()
Patch -> Memory management improvements : it may help the garbage collector. |
javax.swing.text.Document |
getOutputDocument()
Return the Document in which output is performed. |
JextFrame |
getParentFrame()
Returns this Console's parent. |
java.lang.String |
getPromptPattern()
Get prompt pattern. |
java.io.Writer |
getStdErr()
Returns a writer in which external classes can send String to make them being displayed in the
console as error output. |
java.io.Writer |
getStdOut()
Returns a writer in which external classes can send String to make them being displayed in the
console as standard output. |
java.lang.String |
getText()
Returns current command line. |
int |
getTypingLocation()
Returns the position of the end of the console prompt. |
int |
getUserLimit()
Returns the position in characters at which user is allowed to type his commands. |
void |
help()
Displays console help. |
void |
help(java.lang.String display)
Display a message using help color. |
void |
historyNext()
Get next item in the history list. |
void |
historyPrevious()
Get previous item in the history list. |
void |
load()
Load the last saved history. |
void |
output(java.lang.String display)
Display a message using output color. |
java.lang.String |
parseCommand(java.lang.String command)
Parse a command. |
void |
removeChar()
Remove a char from current command line. |
void |
save()
Save the history. |
void |
setBgColor(java.awt.Color color)
Set console background color. |
void |
setErrorColor(java.awt.Color color)
Set console error color. |
void |
setInfoColor(java.awt.Color color)
Set console info color. |
void |
setOutputColor(java.awt.Color color)
Set console output color. |
void |
setPromptColor(java.awt.Color color)
Set console prompt color. |
void |
setPromptPattern(java.lang.String prompt)
Set the prompt pattern. |
void |
setSelectionColor(java.awt.Color color)
Set console selection color. |
void |
setText(java.lang.String text)
Set user's command line content. |
void |
stop()
Stops current task. |
Methods inherited from class javax.swing.JScrollPane |
createHorizontalScrollBar, createVerticalScrollBar, createViewport, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, getViewportBorderBounds, isValidateRoot, isWheelScrollingEnabled, paramString, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView, setWheelScrollingEnabled, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int DOS_PROMPT
public static final int JEXT_PROMPT
public static final int LINUX_PROMPT
public static final int SUNOS_PROMPT
public static final java.lang.String[] DEFAULT_PROMPTS
public java.awt.Color errorColor
public java.awt.Color promptColor
public java.awt.Color outputColor
public java.awt.Color infoColor
Constructor Detail |
public Console(JextFrame parent)
parent
- Jext
parentpublic Console(JextFrame parent, boolean display)
JScrollPane
.
By default console help is displayed.
parent
- Jext
parentdisplay
- If set on true, prompt is displayedMethod Detail |
public JextFrame getParentFrame()
public javax.swing.text.Document getOutputDocument()
Document
in which output is performed.
public void addCommand(Command command)
public void setBgColor(java.awt.Color color)
color
- Color
to be usedpublic void setErrorColor(java.awt.Color color)
color
- Color
to be usedpublic void setPromptColor(java.awt.Color color)
color
- Color
to be usedpublic void setOutputColor(java.awt.Color color)
color
- Color
to be usedpublic void setInfoColor(java.awt.Color color)
color
- Color
to be usedpublic void setSelectionColor(java.awt.Color color)
color
- Color
to be usedpublic void save()
public void load()
public void setPromptPattern(java.lang.String prompt)
public java.lang.String getPromptPattern()
public void displayPrompt()
public void append(java.lang.String text, java.awt.Color color)
text
- The text to append in the text areapublic void addHistory(java.lang.String command)
command
- Command to add in the historypublic void removeChar()
public void deleteChar()
public void add(java.lang.String add)
String
to the current command line.
add
- String
to be addedpublic int getUserLimit()
public int getTypingLocation()
public void doCompletion()
public void doBackwardSearch()
public void historyPrevious()
public void historyNext()
public void setText(java.lang.String text)
text
- Text to be put on command line.public java.lang.String getText()
public void output(java.lang.String display)
display
- String
to be displayedpublic void help()
public void help(java.lang.String display)
display
- String
to be displayedpublic void error(java.lang.String display)
display
- String
to be displayedpublic void stop()
public java.lang.String parseCommand(java.lang.String command)
command
- Command to be parsedpublic void execute(java.lang.String command)
command
- Command to be executepublic java.io.Writer getStdOut()
String
to make them being displayed in the
console as standard output.
public java.io.Writer getStdErr()
String
to make them being displayed in the
console as error output.
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |