public final class JConsolePane
extends javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Modifier and Type | Method and Description |
---|---|
void |
clearBufferMessages()
Clears all the messages stored in the internal buffer from the beginning
of the
JConsolePane . |
void |
clearScreenMessages()
Clears only the messages that are displayed in the textarea.
|
void |
destroyConsole()
Destroys the console.
|
void |
dumpConsole(java.lang.String filename,
boolean append)
Dumps all the console messages (up to now) to a file (not only the
messages displayed in the textarea).
|
boolean |
getAppendFirstTime()
Gets append policy.
|
boolean |
getAutoSave()
Gets auto save status.
|
java.awt.Color |
getBackgroundColor()
Gets the background color of the textarea.
|
java.lang.String |
getClearButtonText()
Gets the text of the clear button.
|
java.lang.String |
getCloseButtonText()
Gets the text of the close button.
|
java.lang.String |
getConfimMessage()
Gets the text for the popup window that confirms file overwrite.
|
java.lang.String |
getConfimTitle()
Gets the title for the popup window that confirms file overwrite.
|
static JConsolePane |
getConsolePane()
Singleton constructor.
|
java.lang.String |
getFilechooserApproveButtonText()
Gets the filechooser approve button text.
|
java.lang.String |
getFilechooserTitle()
Gets the filechooser title.
|
java.awt.Color |
getForegroundColor()
Gets the foreground color of the textarea.
|
int |
getMaxChars()
If -1 no limit, else the messages will be flushed to 'traceFilename' and
cleared when this limit is reached.
|
java.lang.String |
getMessagesFilename()
Gets the default filename for the filechooser.
|
java.lang.String |
getSaveButtonText()
Gets the text of the save button.
|
java.awt.Color |
getSelectedTextColor()
Gets the selected text color of the textarea.
|
java.awt.Color |
getSelectionColor()
Gets the selection color of the textarea.
|
java.awt.Font |
getTextFont()
Gets the font of the textarea.
|
java.lang.String |
getTraceFilename()
Gets the file used by
dumpConsole() and
all auto save methods. |
void |
hideConsole()
Hides the console.
|
void |
hideControlButtons()
Hides the control buttons.
|
void |
setAppendFirstTime(boolean b)
Sets append policy.
|
void |
setAutoSave(boolean b)
Sets auto save status.
|
void |
setBackgroundColor(java.awt.Color c)
Sets the background color of the textarea.
|
void |
setClearButtonText(java.lang.String s)
Sets the text of the clear button.
|
void |
setCloseButtonText(java.lang.String s)
Sets the text of the close button.
|
void |
setConfimMessage(java.lang.String s)
Sets the text for the popup window that confirms file overwrite.
|
void |
setConfimTitle(java.lang.String s)
Sets the title for the popup window that confirms file overwrite.
|
void |
setFilechooserApproveButtonText(java.lang.String s)
Sets the filechooser approve button text.
|
void |
setFilechooserTitle(java.lang.String s)
Sets the filechooser title.
|
void |
setForegroundColor(java.awt.Color c)
Sets the foreground color of the textarea.
|
void |
setMaxChars(int i)
If -1 no limit, else the messages will be flushed to 'traceFilename' and
cleared when this limit is reached.
|
void |
setMessagesFilename(java.lang.String s)
Sets the default filename for the filechooser.
|
void |
setSaveButtonText(java.lang.String s)
Sets the text of the save button.
|
void |
setSelectedTextColor(java.awt.Color c)
Sets the selected text color of the textarea.
|
void |
setSelectionColor(java.awt.Color c)
Sets the selection color of the textarea.
|
void |
setTextFont(java.awt.Font f)
Sets the font of the textarea.
|
void |
setTraceFilename(java.lang.String s)
Sets the file used by
dumpConsole() and
all auto save methods. |
void |
showConsole()
Shows the console.
|
void |
showControlButtons()
Shows the control buttons.
|
void |
startConsole()
Attachs the new streams to stdout and stderr.
|
void |
stopConsole()
Attachs the original streams to stdout and stderr.
|
void |
updateLNF()
Updates the look and feel of the
JConsolePane and it's
components. |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static JConsolePane getConsolePane()
JConsolePane
.
java.lang.ExceptionInInitializerError
public void startConsole()
public void stopConsole()
public void showConsole()
public void hideConsole()
public void showControlButtons()
public void hideControlButtons()
public void clearBufferMessages()
JConsolePane
. Use this if you have printed too many
messages and you want to free up the memory used. Perhaps you should
invoke dumpConsole()
to store the messages first, unless
of course you already have enabled autosave.public void clearScreenMessages()
public void dumpConsole(java.lang.String filename, boolean append) throws java.io.IOException
clearBufferMessages()
for this.
filename
- The filename to store all console's messages.append
- If true
text is appended in the file,
else the file gets overwritten.
java.io.IOException
public void destroyConsole()
getConsole()
after this
method you will get a brand new console with no messages at all. This
method is not needed for simple applications that are about to invoke
System.exit() or normaly close.public void updateLNF()
JConsolePane
and it's
components. MUST be called AFTER invoking:
UIManager.setLookAndFeel()
in your application.public java.lang.String getConfimTitle()
public void setConfimTitle(java.lang.String s)
s
- The title.public java.lang.String getConfimMessage()
public void setConfimMessage(java.lang.String s)
s
- The message.public java.lang.String getMessagesFilename()
public void setMessagesFilename(java.lang.String s)
s
- The filename.public java.lang.String getTraceFilename()
dumpConsole()
and
all auto save methods.
public void setTraceFilename(java.lang.String s)
dumpConsole()
and
all auto save methods.
s
- The filename.public boolean getAppendFirstTime()
public void setAppendFirstTime(boolean b)
b
- true/falsepublic boolean getAutoSave()
public void setAutoSave(boolean b)
b
- true/falsepublic int getMaxChars()
public void setMaxChars(int i)
i
- The limit.public java.awt.Color getForegroundColor()
public void setForegroundColor(java.awt.Color c)
c
- The color.public java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color c)
c
- The color.public java.awt.Color getSelectedTextColor()
public void setSelectedTextColor(java.awt.Color c)
c
- The color.public java.awt.Color getSelectionColor()
public void setSelectionColor(java.awt.Color c)
c
- The color.public java.lang.String getClearButtonText()
public void setClearButtonText(java.lang.String s)
s
- The text.public java.lang.String getSaveButtonText()
public void setSaveButtonText(java.lang.String s)
s
- The text.public java.lang.String getCloseButtonText()
public void setCloseButtonText(java.lang.String s)
s
- The text.public java.lang.String getFilechooserTitle()
public void setFilechooserTitle(java.lang.String s)
s
- The title.public java.lang.String getFilechooserApproveButtonText()
public void setFilechooserApproveButtonText(java.lang.String s)
s
- The text.public java.awt.Font getTextFont()
public void setTextFont(java.awt.Font f)
f
- The font.