public class SQLEditPane extends RSyntaxTextArea
RTextArea.RTextAreaMutableCaretEvent
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
BACKGROUND_IMAGE_PROPERTY |
static java.lang.String |
CURRENT_LINE_HIGHLIGHT_COLOR_PROPERTY |
static java.lang.String |
CURRENT_LINE_HIGHLIGHT_FADE_PROPERTY |
static java.lang.String |
HIGHLIGHT_CURRENT_LINE_PROPERTY |
static boolean |
REQUEST_DROPTARGET |
static java.lang.String |
ROUNDED_SELECTION_PROPERTY |
static boolean |
UNREQUEST_DROPTARGET |
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, 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
COPY_ACTION, CUT_ACTION, DELETE_ACTION, INSERT_MODE, MARK_ALL_COLOR_PROPERTY, MARK_ALL_OCCURRENCES_CHANGED_PROPERTY, OVERWRITE_MODE, PASTE_ACTION, REDO_ACTION, SELECT_ALL_ACTION, UNDO_ACTION
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
SYNTAX_STYLE_ACTIONSCRIPT, SYNTAX_STYLE_ASSEMBLER_X86, SYNTAX_STYLE_BBCODE, SYNTAX_STYLE_C, SYNTAX_STYLE_CLOJURE, SYNTAX_STYLE_CPLUSPLUS, SYNTAX_STYLE_CSHARP, SYNTAX_STYLE_CSS, SYNTAX_STYLE_DELPHI, SYNTAX_STYLE_DTD, SYNTAX_STYLE_FORMULA, SYNTAX_STYLE_FORTRAN, SYNTAX_STYLE_GROOVY, SYNTAX_STYLE_HTACCESS, SYNTAX_STYLE_HTML, SYNTAX_STYLE_JAVA, SYNTAX_STYLE_JAVASCRIPT, SYNTAX_STYLE_JSON, SYNTAX_STYLE_JSP, SYNTAX_STYLE_LATEX, SYNTAX_STYLE_LISP, SYNTAX_STYLE_LUA, SYNTAX_STYLE_MAKEFILE, SYNTAX_STYLE_MXML, SYNTAX_STYLE_NONE, SYNTAX_STYLE_NSIS, SYNTAX_STYLE_PERL, SYNTAX_STYLE_PHP, SYNTAX_STYLE_PROPERTIES_FILE, SYNTAX_STYLE_PYTHON, SYNTAX_STYLE_RUBY, SYNTAX_STYLE_SAS, SYNTAX_STYLE_SCALA, SYNTAX_STYLE_SQL, SYNTAX_STYLE_TCL, SYNTAX_STYLE_UNIX_SHELL, SYNTAX_STYLE_VISUAL_BASIC, SYNTAX_STYLE_WINDOWS_BATCH, SYNTAX_STYLE_XML
构造器和说明 |
---|
SQLEditPane() |
SQLEditPane(boolean requestDroptarget) |
限定符和类型 | 方法和说明 |
---|---|
void |
convertSpacesToTabs()
Converts all instances of a number of spaces equal to a tab size
into a tab in this text area.
|
void |
convertTabsToSpaces()
Converts all instances of a tab into a number of spaces equivalent
to a tab in this text area.
|
protected void |
forceCurrentLineHighlightRepaint()
Forces the current line highlight to be repainted.
|
java.awt.Color |
getBackground()
Returns the
java.awt.Color used as the background color for
this text area. |
java.awt.Image |
getBackgroundImage()
Returns the image currently used for the background.
|
java.lang.Object |
getBackgroundObject()
Returns the
Object representing the background for all
documents in this tabbed pane; either a java.awt.Color or a
java.lang.Image containing the image used as the background
for this text area. |
int |
getCaretLineNumber()
Gets the line number that the caret is on.
|
int |
getCaretOffsetFromLineStart()
Gets the position from the beginning of the current line that the caret
is on.
|
java.awt.Color |
getCurrentLineHighlightColor()
Returns the color being used to highlight the current line.
|
static java.awt.Color |
getDefaultCaretColor()
Returns the default caret color.
|
static java.awt.Color |
getDefaultCurrentLineHighlightColor()
Returns the "default" color for highlighting the current line.
|
static java.awt.Font |
getDefaultFont()
Returns the default font for text areas.
|
static java.awt.Color |
getDefaultForeground()
Returns the default foreground color for text in this text area.
|
static java.awt.Color |
getDefaultMarginLineColor()
Returns the default color for the margin line.
|
static int |
getDefaultMarginLinePosition()
Returns the default margin line position.
|
static int |
getDefaultTabSize()
Returns the default tab size, in spaces.
|
boolean |
getFadeCurrentLineHighlight()
Returns whether the current line highlight is faded.
|
boolean |
getHighlightCurrentLine()
Returns whether or not the current line is highlighted.
|
int |
getLineEndOffsetOfCurrentLine()
Returns the offset of the last character of the line that the caret is
on.
|
int |
getLineStartOffsetOfCurrentLine()
Returns the offset of the first character of the line that the caret is
on.
|
java.awt.Color |
getMarginLineColor()
Returns the color used to paint the margin line.
|
int |
getMarginLinePixelLocation()
Returns the margin line position (in pixels) from the left-hand side of
the text area.
|
int |
getMarginLinePosition()
Returns the margin line position (which is the number of 'm' widths in
the current font the margin line is over).
|
boolean |
getRoundedSelectionEdges()
Returns whether selection edges are rounded in this text area.
|
boolean |
getTabsEmulated()
Returns whether or not tabs are emulated with spaces (i.e., "soft"
tabs).
|
boolean |
isMarginLineEnabled()
Returns whether or not the margin line is being painted.
|
static boolean |
isOSX()
Returns whether the OS we're running on is OS X.
|
protected void |
possiblyUpdateCurrentLineHighlightLocation()
Updates the current line highlight location.
|
protected void |
processComponentEvent(java.awt.event.ComponentEvent e)
Overridden so we can tell when the text area is resized and update the
current-line highlight, if necessary (i.e., if it is enabled and if
lineWrap is enabled.
|
void |
setBackground(java.awt.Color bg)
Sets the background color of this text editor.
|
void |
setBackgroundImage(java.awt.Image image)
Sets this image as the background image.
|
void |
setBackgroundObject(java.lang.Object newBackground)
Makes the background into this
Object . |
void |
setCurrentLineHighlightColor(java.awt.Color color)
Sets the color to use to highlight the current line.
|
void |
setFadeCurrentLineHighlight(boolean fade)
Sets whether the current line highlight should have a "fade" effect.
|
void |
setHighlightCurrentLine(boolean highlight)
Sets whether or not the current line is highlighted.
|
void |
setLineWrap(boolean wrap)
Sets whether or not word wrap is enabled.
|
void |
setMargin(java.awt.Insets insets)
Overridden to update the current line highlight location.
|
void |
setMarginLineColor(java.awt.Color color)
Sets the color used to paint the margin line.
|
void |
setMarginLineEnabled(boolean enabled)
Enables or disables the margin line.
|
void |
setMarginLinePosition(int size)
Sets the number of 'm' widths the margin line is over.
|
protected void |
setRTextAreaUI(RTextAreaUI ui)
Sets the UI for this
RTextArea . |
void |
setTabsEmulated(boolean areEmulated)
Changes whether or not tabs should be emulated with spaces (i.e., soft
tabs).
|
void |
setTabSize(int size)
Workaround, since in JDK1.4 it appears that
setTabSize()
doesn't work for a JTextArea unless you use the constructor
specifying the number of rows and columns... |
protected void |
updateMarginLineX()
This is here so subclasses such as
RSyntaxTextArea that
have multiple fonts can define exactly what it means, for example, for
the margin line to be "80 characters" over. |
int |
yForLine(int line)
Returns the y-coordinate of the specified line.
|
int |
yForLineContaining(int offs)
Returns the y-coordinate of the line containing an offset.
|
addActiveLineRangeListener, addHyperlinkListener, addNotify, addParser, appendFoldingMenu, clearParsers, configurePopupMenu, copyAsRtf, createDefaultModel, createMouseListener, createPopupMenu, createRTextAreaUI, doBracketMatching, fireCaretUpdate, foldToggled, forceReparsing, forceReparsing, getAnimateBracketMatching, getAntiAliasingEnabled, getBackgroundForToken, getCloseCurlyBraces, getCloseMarkupTags, getCodeTemplateManager, getDefaultBracketMatchBGColor, getDefaultBracketMatchBorderColor, getDefaultSelectionColor, getDefaultSyntaxScheme, getEOLMarkersVisible, getFoldManager, getFontForTokenType, getFontMetricsForTokenType, getForegroundForToken, getForegroundForTokenType, getFractionalFontMetricsEnabled, getHighlightSecondaryLanguages, getHyperlinkForeground, getHyperlinksEnabled, getLastVisibleOffset, getLineHeight, getLinkGenerator, getMarkAllHighlightRanges, getMarkedOccurrences, getMarkOccurrences, getMarkOccurrencesColor, getMatchedBracketBGColor, getMatchedBracketBorderColor, getMaxAscent, getPaintMarkOccurrencesBorder, getPaintMatchedBracketPair, getPaintTabLines, getParser, getParserCount, getParserNotices, getRightHandSideCorrection, getSecondaryLanguageBackground, getSecondaryLanguageCount, getShouldIndentNextLine, getSyntaxEditingStyle, getSyntaxScheme, getTabLineColor, getTemplatesEnabled, getTokenListForLine, getToolTipText, getUnderlineForToken, getUseFocusableTips, getUseSelectedTextColor, init, isAutoIndentEnabled, isBracketMatchingEnabled, isClearWhitespaceLinesEnabled, isCodeFoldingEnabled, isWhitespaceVisible, modelToToken, paintComponent, removeActiveLineRangeListener, removeHyperlinkListener, removeNotify, removeParser, restoreDefaultSyntaxScheme, saveTemplates, setActiveLineRange, setAnimateBracketMatching, setAntiAliasingEnabled, setAutoIndentEnabled, setBracketMatchingEnabled, setClearWhitespaceLinesEnabled, setCloseCurlyBraces, setCloseMarkupTags, setCodeFoldingEnabled, setDocument, setEOLMarkersVisible, setFont, setFractionalFontMetricsEnabled, setHighlighter, setHighlightSecondaryLanguages, setHyperlinkForeground, setHyperlinksEnabled, setLinkGenerator, setLinkScanningMask, setMarkOccurrences, setMarkOccurrencesColor, setMatchedBracketBGColor, setMatchedBracketBorderColor, setPaintMarkOccurrencesBorder, setPaintMatchedBracketPair, setPaintTabLines, setRightHandSideCorrection, setSecondaryLanguageBackground, setSyntaxEditingStyle, setSyntaxScheme, setTabLineColor, setTemplateDirectory, setTemplatesEnabled, setUseFocusableTips, setUseSelectedTextColor, setWhitespaceVisible, viewToToken
addLineHighlight, beginAtomicEdit, beginRecordingMacro, canRedo, canUndo, createPopupMenuItem, createUndoManager, discardAllEdits, endAtomicEdit, endRecordingMacro, getAction, getCurrentMacro, getDefaultMarkAllHighlightColor, getIconGroup, getMarkAllHighlightColor, getPopupMenu, getSelectedOccurrenceText, getTextMode, getToolTipSupplier, handleReplaceSelection, isRecordingMacro, loadMacro, paste, playbackLastMacro, print, read, redoLastAction, removeAllLineHighlights, removeLineHighlight, replaceRange, replaceSelection, setActionProperties, setActionProperties, setCaret, setCaretStyle, setIconGroup, setMarkAllHighlightColor, setPopupMenu, setRoundedSelectionEdges, setSelectedOccurrenceText, setTextMode, setToolTipSupplier, setUI, undoLastAction
append, getAccessibleContext, getColumns, getColumnWidth, getLineCount, getLineEndOffset, getLineOfOffset, getLineStartOffset, getLineWrap, getPreferredScrollableViewportSize, getPreferredSize, getRowHeight, getRows, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getTabSize, getUIClassID, getWrapStyleWord, insert, paramString, setColumns, setRows, setWrapStyleWord
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, 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, write
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, processMouseEvent, 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
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, 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, 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, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final boolean REQUEST_DROPTARGET
public static final boolean UNREQUEST_DROPTARGET
public static final java.lang.String BACKGROUND_IMAGE_PROPERTY
public static final java.lang.String CURRENT_LINE_HIGHLIGHT_COLOR_PROPERTY
public static final java.lang.String CURRENT_LINE_HIGHLIGHT_FADE_PROPERTY
public static final java.lang.String HIGHLIGHT_CURRENT_LINE_PROPERTY
public static final java.lang.String ROUNDED_SELECTION_PROPERTY
public void convertSpacesToTabs()
public void convertTabsToSpaces()
protected void forceCurrentLineHighlightRepaint()
RSyntaxTextArea
.public final java.awt.Color getBackground()
java.awt.Color
used as the background color for
this text area. If a java.awt.Image
image is currently
being used instead, null
is returned.getBackground
在类中 java.awt.Component
null
if an image
is currently the background.public final java.awt.Image getBackgroundImage()
java.awt.Color
and
not a java.awt.Image
, then null
is returned.java.awt.Image
used for the background, or
null
if the background is not an image.setBackgroundImage(java.awt.Image)
public final java.lang.Object getBackgroundObject()
Object
representing the background for all
documents in this tabbed pane; either a java.awt.Color
or a
java.lang.Image
containing the image used as the background
for this text area.Object
used for the background.setBackgroundObject(Object newBackground)
public final int getCaretLineNumber()
public final int getCaretOffsetFromLineStart()
public java.awt.Color getCurrentLineHighlightColor()
getHighlightCurrentLine()
,
setHighlightCurrentLine(boolean)
,
setCurrentLineHighlightColor(java.awt.Color)
public static final java.awt.Color getDefaultCaretColor()
public static final java.awt.Color getDefaultCurrentLineHighlightColor()
public static final java.awt.Font getDefaultFont()
public static final java.awt.Color getDefaultForeground()
public static final java.awt.Color getDefaultMarginLineColor()
getMarginLineColor()
,
setMarginLineColor(Color)
public static final int getDefaultMarginLinePosition()
getMarginLinePosition()
,
setMarginLinePosition(int)
public static final int getDefaultTabSize()
public boolean getFadeCurrentLineHighlight()
setFadeCurrentLineHighlight(boolean)
public boolean getHighlightCurrentLine()
setHighlightCurrentLine(boolean)
,
getCurrentLineHighlightColor()
,
setCurrentLineHighlightColor(java.awt.Color)
public final int getLineEndOffsetOfCurrentLine()
public final int getLineStartOffsetOfCurrentLine()
public java.awt.Color getMarginLineColor()
setMarginLineColor(Color)
public int getMarginLinePixelLocation()
getDefaultMarginLinePosition()
,
setMarginLinePosition(int)
public int getMarginLinePosition()
getDefaultMarginLinePosition()
,
setMarginLinePosition(int)
public boolean getRoundedSelectionEdges()
setRoundedSelectionEdges(boolean)
public boolean getTabsEmulated()
true
if tabs are emulated with spaces;
false
if they aren't.setTabsEmulated(boolean)
public boolean isMarginLineEnabled()
setMarginLineEnabled(boolean)
public static boolean isOSX()
protected void possiblyUpdateCurrentLineHighlightLocation()
protected void processComponentEvent(java.awt.event.ComponentEvent e)
processComponentEvent
在类中 java.awt.Component
e
- The component event about to be sent to all registered
ComponentListener
s.public void setBackground(java.awt.Color bg)
setBackgroundObject(bg)
.
NOTE: the opaque property is set to true
when the
background is set to a color (by this method). When an image is used
for the background, opaque is set to false. This is because
we perform better when setOpaque is true, but if we use an
image for the background when opaque is true, we get on-screen
garbage when the user scrolls via the arrow keys. Thus we
need setOpaque to be false in that case.You never have to change the opaque property yourself; it is always done for you.
setBackground
在类中 javax.swing.JComponent
bg
- The color to use as the background color.public void setBackgroundImage(java.awt.Image image)
BACKGROUND_IMAGE_PROPERTY
.
NOTE: the opaque property is set to true
when the
background is set to a color. When an image is used for the
background (by this method), opaque is set to false. This is because
we perform better when setOpaque is true, but if we use an
image for the background when opaque is true, we get on-screen
garbage when the user scrolls via the arrow keys. Thus we
need setOpaque to be false in that case.
You never have to change the opaque property yourself; it is always done for you.
image
- The image to use as this text area's background.getBackgroundImage()
public void setBackgroundObject(java.lang.Object newBackground)
Object
.newBackground
- The java.awt.Color
or
java.awt.Image
object. If newBackground
is not either of these, the background is set to plain white.public void setCurrentLineHighlightColor(java.awt.Color color)
CURRENT_LINE_HIGHLIGHT_COLOR_PROPERTY
.color
- The color to use to highlight the current line.java.lang.NullPointerException
- if color
is null
.getHighlightCurrentLine()
,
setHighlightCurrentLine(boolean)
,
getCurrentLineHighlightColor()
public void setFadeCurrentLineHighlight(boolean fade)
CURRENT_LINE_HIGHLIGHT_FADE_PROPERTY
.fade
- Whether the fade effect should be enabled.getFadeCurrentLineHighlight()
public void setHighlightCurrentLine(boolean highlight)
HIGHLIGHT_CURRENT_LINE_PROPERTY
.highlight
- Whether or not to highlight the current line.getHighlightCurrentLine()
,
getCurrentLineHighlightColor()
,
setCurrentLineHighlightColor(java.awt.Color)
public void setLineWrap(boolean wrap)
setLineWrap
在类中 javax.swing.JTextArea
wrap
- Whether or not word wrap should be enabled.public void setMargin(java.awt.Insets insets)
setMargin
在类中 javax.swing.text.JTextComponent
insets
- The new insets.public void setMarginLineColor(java.awt.Color color)
color
- The new margin line color.getDefaultMarginLineColor()
,
getMarginLineColor()
public void setMarginLineEnabled(boolean enabled)
enabled
- Whether or not the margin line should be enabled.isMarginLineEnabled()
public void setMarginLinePosition(int size)
size
- The margin size.
#see #getDefaultMarginLinePositiongetMarginLinePosition()
protected void setRTextAreaUI(RTextAreaUI ui)
RTextArea
. Note that, for instances
of RTextArea
, setUI
only updates the popup
menu; this is because RTextArea
s' look and feels are
independent of the Java Look and Feel. This method is here so
subclasses can set a UI (subclass of RTextAreaUI
) if they
have to.ui
- The new UI.JTextComponent.setUI(javax.swing.plaf.TextUI)
public void setTabsEmulated(boolean areEmulated)
convertTabsToSpaces()
and convertSpacesToTabs()
.areEmulated
- Whether or not tabs should be emulated with spaces.convertSpacesToTabs()
,
convertTabsToSpaces()
,
getTabsEmulated()
public void setTabSize(int size)
setTabSize()
doesn't work for a JTextArea
unless you use the constructor
specifying the number of rows and columns...Sets the number of characters to expand tabs to. This will be multiplied by the maximum advance for variable width fonts. A PropertyChange event ("tabSize") is fired when the tab size changes.
setTabSize
在类中 javax.swing.JTextArea
size
- Number of characters to expand to.protected void updateMarginLineX()
RSyntaxTextArea
that
have multiple fonts can define exactly what it means, for example, for
the margin line to be "80 characters" over.public int yForLine(int line) throws javax.swing.text.BadLocationException
line
- The line number.-1
if
this text area doesn't yet have a positive size or the line is
hidden (i.e. from folding).javax.swing.text.BadLocationException
- If line
isn't a valid line
number for this document.public int yForLineContaining(int offs) throws javax.swing.text.BadLocationException
offs
- The offset info the document.-1
if
this text area doesn't yet have a positive size or the line is
hidden (i.e. from folding).javax.swing.text.BadLocationException
- If offs
isn't a valid offset
into the document.