public class GConsole extends GContainer implements GDisplay, GClear, GTextAreaInterface
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation
NAME_ATTRIBUTE
Constructor and Description |
---|
GConsole()
Constructor.
|
GConsole(String widgetId)
Constructor.
|
GConsole(String widgetId,
GTextAreaInterface textAreaInterface)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
appendLine(String line)
Adds the text to the text area with adding a carriage return at the end.
|
void |
clear()
Called when the element is to be cleared, so it can perform the actions required to return to the last
saved/loaded values.
|
void |
display()
Called when the element is to be displayed, so it can perform the actions required for its display, and
the display of its inmmediate descendants.
|
void |
generic()
The prototype of the generic function that shall exist in all the descendants.
|
JTextArea |
getJTextArea()
Get the JTextArea associated with the component.
|
void |
redirectSystemStreams(boolean redirectStdout,
boolean redirectStderr)
Redirect the standard output and/or the standard error streams to the GConsole object, using the UTF-8
encoding.
|
void |
redirectSystemStreams(boolean redirectStdout,
boolean redirectStderr,
String encoding)
Redirect the standard output and/or the standard error streams to the GConsole object.
|
void |
reset()
Called when the element is to be reset, so it can perform the actions required to return to inital
state.
|
void |
setConstraint(GConstraint constraint)
Set the constraint for the component.
|
void |
setCursorPositionAtBottom(boolean flag)
Set if the cursor shall be always at the bottom.
|
void |
setEditable(boolean b)
Sets the specified boolean to indicate whether or not this TextComponent should be editable.
|
void |
setInnerDescendantConstraint(GConstraint constraint,
Integer... positionList)
Set the constraint of the inner subcomponent.
|
void |
setLineWrap(boolean flag)
Sets the specified boolean to indicate whether the lines are wrapped in the widget or not.
|
put
activateConstraintsByType, attachCopyPasteMenu, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, clearAllInnerDescendantConstraint, clearConstraint, clearInnerDescendantContraint, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getComponent, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGClassName, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getPathInConfigFile, getSimpleWidgetId, getStatus, getStringConstraint, getSubComponent, getWidgetId, handleCopyPasteEvent, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, isEnabled, isForcedStatus, isModified, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, processMouseWheelEvent, setBusyCursor, setCommentInConfigFile, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDefaultConstraints, setDisplayIsModifiedIndicator, setElement, setEnabled, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setStringConstraint, setToolTipText, setWidgetId, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem
public GConsole()
public GConsole(String widgetId)
widgetId
- widget identifier.public GConsole(String widgetId, GTextAreaInterface textAreaInterface)
widgetId
- widget identifier.textAreaInterface
- GTextAreaInterface to which the output and error will be sent, it can be null, in that case
a GTextArea is created automatically. The objet shall extend GComponent if not a
GRuntimeException will be launched.public void redirectSystemStreams(boolean redirectStdout, boolean redirectStderr, String encoding) throws UnsupportedEncodingException
redirectStdout
- true if the stdout shall be redirected.redirectStderr
- true if the stderr shall be redirected.encoding
- to use for the redirection.UnsupportedEncodingException
- if the encoding is not supported.public void redirectSystemStreams(boolean redirectStdout, boolean redirectStderr) throws UnsupportedEncodingException
redirectStdout
- true if the stdout shall be redirected.redirectStderr
- true if the stderr shall be redirected.UnsupportedEncodingException
- if the UTF-8 encoding is not supported.public void generic() throws GException
generic
in class GContainer
GException
- In case of problem.public void display() throws GException
display
in interface GDisplay
GException
- in case of problem while reading the value from file.public void appendLine(String line) throws GException
appendLine
in interface GTextAreaInterface
line
- to be appended to the text area.GException
- in case of problem appending the line.public void reset() throws GException
reset
in interface GTextAreaInterface
GException
- in case of problem while reseting the values.public JTextArea getJTextArea()
getJTextArea
in interface GTextAreaInterface
public void setEditable(boolean b)
setEditable
in interface GTextAreaInterface
b
- the boolean to be setpublic void setCursorPositionAtBottom(boolean flag)
setCursorPositionAtBottom
in interface GTextAreaInterface
flag
- true it the cursor shall always be at the bottom of the text view, false otherwise.public void setConstraint(GConstraint constraint)
setConstraint
in class GComponent
constraint
- constraint to set for the component.public void setInnerDescendantConstraint(GConstraint constraint, Integer... positionList)
setInnerDescendantConstraint
in class GComponent
constraint
- constraint to set.positionList
- the ordered subcomponent index.public void setLineWrap(boolean flag)
setLineWrap
in interface GTextAreaInterface
flag
- true if the lines shall be wrapped, false otherwise.public void clear() throws GException
clear
in interface GClear
GException
- in case of problem while clearing the values.Copyright © 2024. All rights reserved.