Class AbstractGutterComponent

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
FoldIndicator, IconRowHeader, LineNumberList

abstract class AbstractGutterComponent extends JPanel
A component that can be displayed in a Gutter.
Version:
1.0
  • Field Details

    • textArea

      protected RTextArea textArea
      The text area whose lines we are marking with icons.
    • currentLineCount

      protected int currentLineCount
      The number of lines in the text area.
    • listener

      private static AbstractGutterComponent.Listener listener
  • Constructor Details

    • AbstractGutterComponent

      AbstractGutterComponent(RTextArea textArea)
      Constructor.
      Parameters:
      textArea - The text area.
  • Method Details

    • addNotify

      public void addNotify()
      Overrides:
      addNotify in class JComponent
    • getChildViewBounds

      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.
      Parameters:
      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.
      Returns:
      The child view's bounds.
    • getGutter

      protected Gutter getGutter()
      Returns the parent Gutter component.
      Returns:
      The parent Gutter.
    • getListener

      private static AbstractGutterComponent.Listener getListener()
      Returns the singleton instance of the listener for all gutter components.
      Returns:
      The singleton instance.
    • handleDocumentEvent

      abstract void handleDocumentEvent(DocumentEvent e)
      Called when text is inserted to or removed from the text area. Implementations can take this opportunity to repaint, revalidate, etc.
      Parameters:
      e - The document event.
    • init

      protected void init()
      Called by the constructor before the text area is set. This is a hook to allow subclasses to do any needed initialization. The default implementation does nothing.
    • lineHeightsChanged

      abstract void lineHeightsChanged()
      Called when the line heights of the text area change. This is usually the result of one or more of the fonts in the editor changing.
    • removeNotify

      public void removeNotify()
      Overrides:
      removeNotify in class JComponent
    • setTextArea

      public void setTextArea(RTextArea textArea)
      Sets the text area being displayed. Subclasses can override, but should call the super implementation.
      Parameters:
      textArea - The text area.