Package adams.gui.core
Class BaseRSyntaxTextArea
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.text.JTextComponent
-
- javax.swing.JTextArea
-
- org.fife.ui.rtextarea.RTextAreaBase
-
- org.fife.ui.rtextarea.RTextArea
-
- org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
-
- adams.gui.core.BaseRSyntaxTextArea
-
- All Implemented Interfaces:
AnyChangeListenerSupporter,AppendableTextAreaComponent,BaseTextComponent,TextAreaComponent,ImageObserver,MenuContainer,Printable,Serializable,Accessible,Scrollable,org.fife.ui.rsyntaxtextarea.SyntaxConstants
public class BaseRSyntaxTextArea extends org.fife.ui.rsyntaxtextarea.RSyntaxTextArea implements AppendableTextAreaComponent, AnyChangeListenerSupporter
A slightly extended version ofRSyntaxTextArea.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.fife.ui.rtextarea.RTextArea
org.fife.ui.rtextarea.RTextArea.RTextAreaMutableCaretEvent
-
Nested classes/interfaces inherited from class org.fife.ui.rtextarea.RTextAreaBase
org.fife.ui.rtextarea.RTextAreaBase.RTAMouseListener
-
Nested classes/interfaces inherited from class javax.swing.JTextArea
JTextArea.AccessibleJTextArea
-
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent
JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBinding
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<ChangeListener>m_AnyChangeListenersthe listeners for any changes to the text.-
Fields inherited from class org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
ANIMATE_BRACKET_MATCHING_PROPERTY, ANTIALIAS_PROPERTY, AUTO_INDENT_PROPERTY, BRACKET_MATCHING_PROPERTY, CLEAR_WHITESPACE_LINES_PROPERTY, CLOSE_CURLY_BRACES_PROPERTY, CLOSE_MARKUP_TAGS_PROPERTY, CODE_FOLDING_PROPERTY, EOL_VISIBLE_PROPERTY, FOCUSABLE_TIPS_PROPERTY, FRACTIONAL_FONTMETRICS_PROPERTY, HIGHLIGHT_SECONDARY_LANGUAGES_PROPERTY, HYPERLINKS_ENABLED_PROPERTY, INSERT_PAIRED_CHARS_PROPERTY, MARK_OCCURRENCES_PROPERTY, MARKED_OCCURRENCES_CHANGED_PROPERTY, PAINT_MATCHED_BRACKET_PAIR_PROPERTY, PARSER_NOTICES_PROPERTY, SYNTAX_SCHEME_PROPERTY, SYNTAX_STYLE_PROPERTY, TAB_LINE_COLOR_PROPERTY, TAB_LINES_PROPERTY, USE_SELECTED_TEXT_COLOR_PROPERTY, VISIBLE_WHITESPACE_PROPERTY
-
Fields inherited from class org.fife.ui.rtextarea.RTextArea
COPY_ACTION, copyAction, CUT_ACTION, cutAction, DELETE_ACTION, INSERT_MODE, MARK_ALL_COLOR_PROPERTY, MARK_ALL_OCCURRENCES_CHANGED_PROPERTY, MARK_ALL_ON_OCCURRENCE_SEARCHES_PROPERTY, OVERWRITE_MODE, PASTE_ACTION, REDO_ACTION, SELECT_ALL_ACTION, UNDO_ACTION
-
Fields inherited from class org.fife.ui.rtextarea.RTextAreaBase
BACKGROUND_IMAGE_PROPERTY, CURRENT_LINE_HIGHLIGHT_COLOR_PROPERTY, CURRENT_LINE_HIGHLIGHT_FADE_PROPERTY, HIGHLIGHT_CURRENT_LINE_PROPERTY, ROUNDED_SELECTION_PROPERTY
-
Fields inherited from class javax.swing.text.JTextComponent
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY
-
Fields inherited from class javax.swing.JComponent
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
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
-
Fields inherited from interface org.fife.ui.rsyntaxtextarea.SyntaxConstants
SYNTAX_STYLE_ACTIONSCRIPT, SYNTAX_STYLE_ASSEMBLER_6502, SYNTAX_STYLE_ASSEMBLER_X86, SYNTAX_STYLE_BBCODE, SYNTAX_STYLE_C, SYNTAX_STYLE_CLOJURE, SYNTAX_STYLE_CPLUSPLUS, SYNTAX_STYLE_CSHARP, SYNTAX_STYLE_CSS, SYNTAX_STYLE_CSV, SYNTAX_STYLE_D, SYNTAX_STYLE_DART, SYNTAX_STYLE_DELPHI, SYNTAX_STYLE_DOCKERFILE, SYNTAX_STYLE_DTD, SYNTAX_STYLE_FORTRAN, SYNTAX_STYLE_GO, SYNTAX_STYLE_GROOVY, SYNTAX_STYLE_HANDLEBARS, SYNTAX_STYLE_HOSTS, SYNTAX_STYLE_HTACCESS, SYNTAX_STYLE_HTML, SYNTAX_STYLE_INI, SYNTAX_STYLE_JAVA, SYNTAX_STYLE_JAVASCRIPT, SYNTAX_STYLE_JSON, SYNTAX_STYLE_JSON_WITH_COMMENTS, SYNTAX_STYLE_JSP, SYNTAX_STYLE_KOTLIN, SYNTAX_STYLE_LATEX, SYNTAX_STYLE_LESS, SYNTAX_STYLE_LISP, SYNTAX_STYLE_LUA, SYNTAX_STYLE_MAKEFILE, SYNTAX_STYLE_MARKDOWN, SYNTAX_STYLE_MXML, SYNTAX_STYLE_NONE, SYNTAX_STYLE_NSIS, SYNTAX_STYLE_PERL, SYNTAX_STYLE_PHP, SYNTAX_STYLE_PROPERTIES_FILE, SYNTAX_STYLE_PROTO, SYNTAX_STYLE_PYTHON, SYNTAX_STYLE_RUBY, SYNTAX_STYLE_RUST, SYNTAX_STYLE_SAS, SYNTAX_STYLE_SCALA, SYNTAX_STYLE_SQL, SYNTAX_STYLE_TCL, SYNTAX_STYLE_TYPESCRIPT, SYNTAX_STYLE_UNIX_SHELL, SYNTAX_STYLE_VHDL, SYNTAX_STYLE_VISUAL_BASIC, SYNTAX_STYLE_WINDOWS_BATCH, SYNTAX_STYLE_XML, SYNTAX_STYLE_YAML
-
-
Constructor Summary
Constructors Constructor Description BaseRSyntaxTextArea()Constructs a new TextArea.BaseRSyntaxTextArea(int rows, int columns)Constructs a new empty TextArea with the specified number of rows and columns.BaseRSyntaxTextArea(String text)Constructs a new TextArea with the specified text displayed.BaseRSyntaxTextArea(String text, int rows, int columns)Constructs a new TextArea with the specified text and number of rows and columns.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAnyChangeListener(ChangeListener l)Adds the listener for listening to any text changes.voidappend(String str, int limit)Appends the string at the end and keeps the number of lines to the given limit (discarding from the top).intcaretToLine(int position)Determines the line number for the caret position.intgetLineCount()Returns the number of lines in the document (= # of elements).DialoggetParentDialog()Tries to determine the dialog this panel is part of.FramegetParentFrame()Tries to determine the frame the container is part of.JInternalFramegetParentInternalFrame()Tries to determine the internal frame this panel is part of.FontgetTextFont()Returns the text font in use.booleangotoLine(int index)Jumps to the specified line.protected voidinitialize()Initializes the text area.protected voidnotifyAnyChangeListeners()Notifies all listeners that some change to the text occurred.voidprintText()Pops up a print dialog.voidremoveAnyChangeListener(ChangeListener l)Removes the listener from listening to any text changes.booleanremoveBeforeLine(int index)Removes all lines before the specified one.voidselectFont()Pops up a dialog for selecting the font.voidsetCaretPositionLast()Sets the position of the cursor at the end.voidsetTextFont(Font value)Sets the text font.-
Methods inherited from class org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
addActiveLineRangeListener, addHyperlinkListener, addNotify, addParser, appendFoldingMenu, appendFoldingMenu, clearParsers, configurePopupMenu, copyAsStyledText, copyAsStyledText, createDefaultModel, createMouseListener, createPopupMenu, createRTextAreaUI, createTokenPainter, doBracketMatching, fireCaretUpdate, fireHyperlinkUpdate, foldToggled, forceReparsing, forceReparsing, getAnimateBracketMatching, getAntiAliasingEnabled, getBackgroundForToken, getCloseCurlyBraces, getCloseMarkupTags, getCodeTemplateManager, getDefaultBracketMatchBGColor, getDefaultBracketMatchBorderColor, getDefaultSelectionColor, getDefaultSyntaxScheme, getEOLMarkersVisible, getFoldManager, getFontForToken, getFontForTokenType, getFontMetricsForToken, getFontMetricsForTokenType, getForegroundForToken, getForegroundForTokenType, getFractionalFontMetricsEnabled, getHighlightSecondaryLanguages, getHyperlinkForeground, getHyperlinksEnabled, getInsertPairedCharacters, getLastVisibleOffset, getLineHeight, getLinkGenerator, getMarkAllHighlightRanges, getMarkedOccurrences, getMarkOccurrences, getMarkOccurrencesColor, getMarkOccurrencesDelay, getMatchedBracketBGColor, getMatchedBracketBorderColor, getMaxAscent, getPaintMarkOccurrencesBorder, getPaintMatchedBracketPair, getPaintTabLines, getParser, getParserCount, getParserDelay, getParserNotices, getRightHandSideCorrection, getSecondaryLanguageBackground, getSecondaryLanguageCount, getShouldIndentNextLine, getShowMatchedBracketPopup, getSyntaxEditingStyle, getSyntaxScheme, getTabLineColor, getTemplatesEnabled, getTokenListFor, getTokenListForLine, getToolTipText, getToolTipTextImpl, getUnderlineForToken, getUseFocusableTips, getUseSelectedTextColor, init, isAutoIndentEnabled, isBracketMatchingEnabled, isClearWhitespaceLinesEnabled, isCodeFoldingEnabled, isWhitespaceVisible, modelToToken, paintComponent, redoLastAction, removeActiveLineRangeListener, removeHyperlinkListener, removeNotify, removeParser, restoreDefaultSyntaxScheme, saveTemplates, setActiveLineRange, setAnimateBracketMatching, setAntiAliasingEnabled, setAutoIndentEnabled, setBracketMatchingEnabled, setClearWhitespaceLinesEnabled, setCloseCurlyBraces, setCloseMarkupTags, setCodeFoldingEnabled, setDocument, setEOLMarkersVisible, setFont, setFractionalFontMetricsEnabled, setHighlighter, setHighlightSecondaryLanguages, setHyperlinkForeground, setHyperlinksEnabled, setInsertPairedCharacters, setLinkGenerator, setLinkScanningMask, setMarkOccurrences, setMarkOccurrencesColor, setMarkOccurrencesDelay, setMatchedBracketBGColor, setMatchedBracketBorderColor, setPaintMarkOccurrencesBorder, setPaintMatchedBracketPair, setPaintTabLines, setParserDelay, setRightHandSideCorrection, setSecondaryLanguageBackground, setShowMatchedBracketPopup, setSyntaxEditingStyle, setSyntaxScheme, setTabLineColor, setTemplateDirectory, setTemplatesEnabled, setTokenPainterFactory, setUseFocusableTips, setUseSelectedTextColor, setWhitespaceVisible, undoLastAction, viewToToken
-
Methods inherited from class org.fife.ui.rtextarea.RTextArea
addLineHighlight, beginAtomicEdit, beginRecordingMacro, canRedo, canUndo, clearMarkAllHighlights, createPopupMenuItem, createUndoManager, discardAllEdits, endAtomicEdit, endRecordingMacro, getAction, getCurrentMacro, getDefaultMarkAllHighlightColor, getDefaultModifier, getIconGroup, getMarkAllHighlightColor, getMarkAllOnOccurrenceSearches, getPopupMenu, getSelectedOccurrenceText, getTextMode, getToolTipSupplier, handleReplaceSelection, isRecordingMacro, loadMacro, markAll, paste, playbackLastMacro, print, processMouseEvent, read, removeAllLineHighlights, removeLineHighlight, replaceRange, replaceSelection, setActionProperties, setActionProperties, setCaret, setCaretStyle, setIconGroup, setMarkAllHighlightColor, setMarkAllOnOccurrenceSearches, setPopupMenu, setRoundedSelectionEdges, setSelectedOccurrenceText, setTextMode, setToolTipSupplier, setUI
-
Methods inherited from class org.fife.ui.rtextarea.RTextAreaBase
convertSpacesToTabs, convertTabsToSpaces, forceCurrentLineHighlightRepaint, getBackground, getBackgroundImage, getBackgroundObject, getCaretLineNumber, getCaretOffsetFromLineStart, getCurrentCaretY, getCurrentLineHighlightColor, getDefaultCaretColor, getDefaultCurrentLineHighlightColor, getDefaultFont, getDefaultForeground, getDefaultMarginLineColor, getDefaultMarginLinePosition, getDefaultTabSize, getFadeCurrentLineHighlight, getHighlightCurrentLine, getLineEndOffsetOfCurrentLine, getLineStartOffsetOfCurrentLine, getMarginLineColor, getMarginLinePixelLocation, getMarginLinePosition, getRoundedSelectionEdges, getTabsEmulated, isMarginLineEnabled, isOSX, possiblyUpdateCurrentLineHighlightLocation, processComponentEvent, setBackground, setBackgroundImage, setBackgroundObject, setCurrentLineHighlightColor, setFadeCurrentLineHighlight, setHighlightCurrentLine, setLineWrap, setMargin, setMarginLineColor, setMarginLineEnabled, setMarginLinePosition, setRTextAreaUI, setTabsEmulated, setTabSize, updateMarginLineX, yForLine, yForLineContaining
-
Methods inherited from class javax.swing.JTextArea
append, getAccessibleContext, getColumns, getColumnWidth, getLineEndOffset, getLineOfOffset, getLineStartOffset, getLineWrap, getPreferredScrollableViewportSize, getPreferredSize, getRowHeight, getRows, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getTabSize, getUIClassID, getWrapStyleWord, insert, paramString, setColumns, setRows, setWrapStyleWord
-
Methods inherited from class javax.swing.text.JTextComponent
addCaretListener, addInputMethodListener, addKeymap, copy, cut, getActions, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPrintable, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getUI, isEditable, loadKeymap, modelToView, modelToView2D, moveCaretPosition, print, print, print, processInputMethodEvent, removeCaretListener, removeKeymap, restoreComposedText, saveComposedText, select, selectAll, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setDropMode, setEditable, setFocusAccelerator, setKeymap, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, updateUI, viewToModel, viewToModel2D, write
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, 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, 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
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, 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, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.gui.core.AppendableTextAreaComponent
append
-
Methods inherited from interface adams.gui.core.TextAreaComponent
getCaretPosition, getColumns, getDocument, getLineWrap, getRows, getSelectedText, getText, getWrapStyleWord, isEditable, setCaretPosition, setColumns, setEditable, setLineWrap, setRows, setText, setWrapStyleWord
-
-
-
-
Field Detail
-
m_AnyChangeListeners
protected Set<ChangeListener> m_AnyChangeListeners
the listeners for any changes to the text.
-
-
Constructor Detail
-
BaseRSyntaxTextArea
public BaseRSyntaxTextArea()
Constructs a new TextArea. A default model is set, the initial string is null, and rows/columns are set to 0.
-
BaseRSyntaxTextArea
public BaseRSyntaxTextArea(String text)
Constructs a new TextArea with the specified text displayed. A default model is created and rows/columns are set to 0.- Parameters:
text- the text to be displayed, or null
-
BaseRSyntaxTextArea
public BaseRSyntaxTextArea(int rows, int columns)Constructs a new empty TextArea with the specified number of rows and columns. A default model is created, and the initial string is null.- Parameters:
rows- the number of rows >= 0columns- the number of columns >= 0
-
BaseRSyntaxTextArea
public BaseRSyntaxTextArea(String text, int rows, int columns)
Constructs a new TextArea with the specified text and number of rows and columns. A default model is created.- Parameters:
text- the text to be displayed, or nullrows- the number of rows >= 0columns- the number of columns >= 0
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the text area.
-
getParentFrame
public Frame getParentFrame()
Tries to determine the frame the container is part of.- Returns:
- the parent frame if one exists or null if not
-
getParentDialog
public Dialog getParentDialog()
Tries to determine the dialog this panel is part of.- Returns:
- the parent dialog if one exists or null if not
-
getParentInternalFrame
public JInternalFrame getParentInternalFrame()
Tries to determine the internal frame this panel is part of.- Returns:
- the parent internal frame if one exists or null if not
-
setTextFont
public void setTextFont(Font value)
Sets the text font.- Specified by:
setTextFontin interfaceTextAreaComponent- Parameters:
value- the font
-
getTextFont
public Font getTextFont()
Returns the text font in use.- Specified by:
getTextFontin interfaceTextAreaComponent- Returns:
- the font
-
setCaretPositionLast
public void setCaretPositionLast()
Sets the position of the cursor at the end.- Specified by:
setCaretPositionLastin interfaceTextAreaComponent
-
append
public void append(String str, int limit)
Appends the string at the end and keeps the number of lines to the given limit (discarding from the top).- Parameters:
str- the line to appendlimit- the maximum number of lines to keep, ignored if <= 0
-
printText
public void printText()
Pops up a print dialog.
-
selectFont
public void selectFont()
Pops up a dialog for selecting the font.
-
getLineCount
public int getLineCount()
Returns the number of lines in the document (= # of elements).- Overrides:
getLineCountin classJTextArea- Returns:
- the number of lines
-
gotoLine
public boolean gotoLine(int index)
Jumps to the specified line.- Parameters:
index- the 0-based index for the line- Returns:
- true if successfully jumped
-
caretToLine
public int caretToLine(int position)
Determines the line number for the caret position.- Parameters:
position- the caret position- Returns:
- the line number, -1 if failed to determine
-
removeBeforeLine
public boolean removeBeforeLine(int index)
Removes all lines before the specified one.- Parameters:
index- the 0-based index of the line to become the new first line- Returns:
- true if successful removed
-
addAnyChangeListener
public void addAnyChangeListener(ChangeListener l)
Adds the listener for listening to any text changes.- Specified by:
addAnyChangeListenerin interfaceAnyChangeListenerSupporter- Parameters:
l- the listener to add
-
removeAnyChangeListener
public void removeAnyChangeListener(ChangeListener l)
Removes the listener from listening to any text changes.- Specified by:
removeAnyChangeListenerin interfaceAnyChangeListenerSupporter- Parameters:
l- the listener to remove
-
notifyAnyChangeListeners
protected void notifyAnyChangeListeners()
Notifies all listeners that some change to the text occurred.
-
-