Class MatchedBracketPopup

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer

public class MatchedBracketPopup extends JWindow
A tool tip-like popup that shows the line of code containing the bracket matched to that at the caret position, if it is scrolled out of the user's viewport.
Version:
1.0
See Also:
  • Field Details

    • PROPERTY_CONSIDER_TEXTAREA_BACKGROUND

      public static final String PROPERTY_CONSIDER_TEXTAREA_BACKGROUND
      If this system property is defined and set to true, matched bracket popups may render with the text area's background color if necessary to facilitate contrast between their text content (typically code) and their backgrounds. This is necessary for good looking popups when a text area's background may be drastically different than the Look and Feel's tool tip color (e.g. dark editor embedded in a "light" themed application, or vice versa). If this is omitted or does NOT evaluate to true, matched bracket popups will always render like "native" tool tips according to the current Look and Feel. Users typically don't need to set this to true unless their application allows users to select a theme or color scheme for RSyntaxTextArea instances separately from the Look and Feel. For applications that instead only have one Look and Feel/RSTA theme combo, or allow toggling between fixed light and dark themes, the default of false is fine.
      See Also:
    • textArea

      private RSyntaxTextArea textArea
    • listener

      private transient MatchedBracketPopup.Listener listener
    • LEFT_EMPTY_BORDER

      private static final int LEFT_EMPTY_BORDER
      See Also:
    • CONSIDER_TEXTAREA_BG

      private static final boolean CONSIDER_TEXTAREA_BG
  • Constructor Details

  • Method Details

    • getPreferredSize

      public Dimension getPreferredSize()
      Overridden to ensure this popup stays in a specific size range.
      Overrides:
      getPreferredSize in class Container
    • getText

      private String getText(int offsToRender)
    • installKeyBindings

      private void installKeyBindings()
      Adds key bindings to this popup.
    • setLocation

      private void setLocation()
      Positions this popup to be in the top right-hand corner of the parent editor.