Class FocusableTip

java.lang.Object
org.fife.ui.rsyntaxtextarea.focusabletip.FocusableTip

public class FocusableTip extends Object
A focusable tool tip, similar to those found in Eclipse. The user can click in the tip and it becomes a "real," resizable window.
Version:
1.0
  • Field Details

    • textArea

      private JTextArea textArea
    • tipWindow

      private TipWindow tipWindow
    • imageBase

      private URL imageBase
    • textAreaListener

      private FocusableTip.TextAreaListener textAreaListener
    • hyperlinkListener

      private HyperlinkListener hyperlinkListener
    • lastText

      private String lastText
    • maxSize

      private Dimension maxSize
    • tipVisibleBounds

      private Rectangle tipVisibleBounds
      The screen bounds in which the mouse has to stay for the currently displayed tip to stay visible.
    • X_MARGIN

      private static final int X_MARGIN
      Margin from mouse cursor at which to draw focusable tip.
      See Also:
    • Y_MARGIN

      private static final int Y_MARGIN
      Margin from mouse cursor at which to draw focusable tip.
      See Also:
    • MSG

      private static final ResourceBundle MSG
  • Constructor Details

  • Method Details

    • computeTipVisibleBounds

      private void computeTipVisibleBounds()
      Compute the bounds in which the user can move the mouse without the tip window disappearing.
    • createAndShowTipWindow

      private void createAndShowTipWindow(MouseEvent e, String text)
    • getImageBase

      public URL getImageBase()
      Returns the base URL to use when loading images in this focusable tip.
      Returns:
      The base URL to use.
      See Also:
    • getMaxSize

      public Dimension getMaxSize()
      The maximum size for unfocused tool tips.
      Returns:
      The maximum size for unfocused tool tips. A value of null will use a default size.
      See Also:
    • getString

      static String getString(String key)
      Returns localized text for the given key.
      Parameters:
      key - The key into the resource bundle.
      Returns:
      The localized text.
    • invokeLater

      protected void invokeLater(Runnable r)
    • possiblyDisposeOfTipWindow

      public void possiblyDisposeOfTipWindow()
      Disposes of the focusable tip currently displayed, if any.
    • removeListeners

      void removeListeners()
    • setImageBase

      public void setImageBase(URL url)
      Sets the base URL to use when loading images in this focusable tip.
      Parameters:
      url - The base URL to use.
      See Also:
    • setMaxSize

      public void setMaxSize(Dimension maxSize)
      Sets the maximum size for unfocused tool tips.
      Parameters:
      maxSize - The new maximum size. A value of null will cause a default size to be used.
      See Also:
    • setTextArea

      private void setTextArea(JTextArea textArea)
    • toolTipRequested

      public void toolTipRequested(MouseEvent e, String text)
      Callback called when this tool tip is requested.
      Parameters:
      e - The mouse event that is triggering the tool tip.
      text - The text to display.