Module platform

Class ParameterizedCompletionChoicesWindow

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
javax.swing.JWindow
de.grogra.pf.ui.autocomplete.impl.ParameterizedCompletionChoicesWindow
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer

public class ParameterizedCompletionChoicesWindow extends JWindow
A small popup window offering a list of likely choices for a parameter when the user has code-completed a parameterized completion. For example, if they have just code-completed the C function "fprintf", when entering the file name, this popup might display all local variables of type "char *".
Version:
1.0
Author:
Robert Futrell
See Also:
  • Constructor Details

    • ParameterizedCompletionChoicesWindow

      public ParameterizedCompletionChoicesWindow(Window parent, AbstractAutoCompletor ac, de.grogra.pf.ui.autocomplete.impl.ParameterizedCompletionContext context)
      Constructor.
      Parameters:
      parent - The parent window (hosting the text component).
      ac - The auto-completion instance.
      context - The completion context.
  • Method Details

    • getSelectedChoice

      public String getSelectedChoice()
      Returns the selected value.
      Returns:
      The selected value, or null if nothing is selected.
    • incSelection

      public void incSelection(int amount)
      Changes the selected index.
      Parameters:
      amount - The amount by which to change the selected index.
    • initialize

      public void initialize(ParameterizedCompletion pc)
      Initializes this window to offer suggestions for the parameters of a specific completion.
      Parameters:
      pc - The completion whose parameters we should offer suggestions for.
    • setLocationRelativeTo

      public void setLocationRelativeTo(Rectangle r)
      Sets the location of this window relative to the given rectangle.
      Parameters:
      r - The visual position of the caret (in screen coordinates).
    • setParameter

      public void setParameter(int param, String prefix)
      Displays the choices for the specified parameter matching the given text. This will display or hide this popup window as necessary.
      Parameters:
      param - The index of the parameter the caret is currently in. This may be -1 if not in a parameter (i.e., on the comma between parameters).
      prefix - Text in the parameter before the dot. This may be null to represent the empty string.
    • setVisible

      public void setVisible(boolean visible)
      Toggles the visibility of this popup window.
      Overrides:
      setVisible in class Window
      Parameters:
      visible - Whether this window should be visible.
    • updateUI

      public void updateUI()
      Updates the LookAndFeel of this window.