|
||||||||||
| 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.JPanel
org.fife.ui.rtextarea.FoldIndicator
public class FoldIndicator
Component in the gutter that displays +/- icons to expand and collapse fold regions in the editor.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| 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 | |
|---|---|
protected int |
currentLineCount
The number of lines in the text area. |
protected RTextArea |
textArea
The text area whose lines we are marking with icons. |
| 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 java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS |
| Constructor Summary | |
|---|---|
FoldIndicator(RTextArea textArea)
|
|
| Method Summary | |
|---|---|
JToolTip |
createToolTip()
Overridden to use the editor's background if it's detected that the user isn't using white as the editor bg, but the system's tool tip background is yellow-ish. |
protected static Rectangle |
getChildViewBounds(View parent,
int line,
Rectangle editorRect)
Returns the bounds of a child view as a rectangle, since Views tend to use Shape. |
Color |
getFoldIconBackground()
Returns the color to use for the "background" of fold icons. |
protected Gutter |
getGutter()
Returns the parent Gutter component. |
Dimension |
getPreferredSize()
|
boolean |
getShowCollapsedRegionToolTips()
Returns whether tool tips are displayed showing the contents of collapsed fold regions when the mouse hovers over a +/- icon. |
Point |
getToolTipLocation(MouseEvent e)
Positions tool tips to be aligned in the text component, so that the displayed content is shown (almost) exactly where it would be in the editor. |
String |
getToolTipText(MouseEvent e)
Overridden to show the content of a collapsed fold on mouse-overs. |
protected void |
paintComponent(Graphics g)
|
void |
setFoldIconBackground(Color bg)
Sets the color to use for the "background" of fold icons. |
void |
setFoldIcons(Icon collapsedIcon,
Icon expandedIcon)
Sets the icons to use to represent collapsed and expanded folds. |
void |
setShowCollapsedRegionToolTips(boolean show)
Toggles whether tool tips should be displayed showing the contents of collapsed fold regions when the mouse hovers over a +/- icon. |
void |
setTextArea(RTextArea textArea)
Overridden so we can track when code folding is enabled/disabled. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected RTextArea textArea
protected int currentLineCount
| Constructor Detail |
|---|
public FoldIndicator(RTextArea textArea)
| Method Detail |
|---|
public JToolTip createToolTip()
createToolTip in class JComponentpublic Color getFoldIconBackground()
setFoldIconBackground(Color)public Dimension getPreferredSize()
getPreferredSize in class JComponentpublic boolean getShowCollapsedRegionToolTips()
setShowCollapsedRegionToolTips(boolean)public Point getToolTipLocation(MouseEvent e)
getToolTipLocation in class JComponente - The mouse location.public String getToolTipText(MouseEvent e)
getToolTipText in class JComponente - The mouse location.protected void paintComponent(Graphics g)
paintComponent in class JComponentpublic void setFoldIconBackground(Color bg)
bg - The new background color.getFoldIconBackground()
public void setFoldIcons(Icon collapsedIcon,
Icon expandedIcon)
collapsedIcon - The collapsed fold icon. This cannot be
null.expandedIcon - The expanded fold icon. This cannot be
null.public void setShowCollapsedRegionToolTips(boolean show)
show - Whether to show these tool tips.getShowCollapsedRegionToolTips()public void setTextArea(RTextArea textArea)
textArea - The text area.
protected static final Rectangle getChildViewBounds(View parent,
int line,
Rectangle editorRect)
Views tend to use Shape.
parent - The parent view of the child whose bounds we're getting.line - The index of the child view.editorRect - Returned from the text area's
getVisibleEditorRect method.
protected Gutter getGutter()
Gutter component.
Gutter.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||