Module jEdit

Class HistoryTextField

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, SwingConstants
Direct Known Subclasses:
VFSFileNameField

public class HistoryTextField extends JTextField
Text field with an arrow-key + drop-down accessable history.
Version:
$Id: HistoryTextField.java 25051 2020-03-28 17:27:53Z kpouer $
Author:
Slava Pestov
See Also:
  • Constructor Details

    • HistoryTextField

      public HistoryTextField()
      Creates a new history text field.
      Since:
      jEdit 3.2pre5
    • HistoryTextField

      public HistoryTextField(String name)
      Creates a new history text field.
      Parameters:
      name - The history model name
    • HistoryTextField

      public HistoryTextField(String name, boolean instantPopups)
      Creates a new history text field.
      Parameters:
      name - The history model name
      instantPopups - If true, selecting a value from the history popup will immediately fire an ActionEvent. If false, the user will have to press 'Enter' first
      Since:
      jEdit 2.2pre5
    • HistoryTextField

      public HistoryTextField(String name, boolean instantPopups, boolean enterAddsToHistory)
      Creates a new history text field.
      Parameters:
      name - The history model name
      instantPopups - If true, selecting a value from the history popup will immediately fire an ActionEvent. If false, the user will have to press 'Enter' first
      enterAddsToHistory - If true, pressing the Enter key will automatically add the currently entered text to the history.
      Since:
      jEdit 2.6pre5
  • Method Details

    • setInstantPopups

      public void setInstantPopups(boolean instantPopups)
      Sets if selecting a value from the popup should immediately fire an ActionEvent.
      Since:
      jEdit 4.0pre3
    • getInstantPopups

      public boolean getInstantPopups()
      Returns if selecting a value from the popup should immediately fire an ActionEvent.
      Since:
      jEdit 4.0pre3
    • setEnterAddsToHistory

      public void setEnterAddsToHistory(boolean enterAddsToHistory)
      Sets if pressing Enter should automatically add the currently entered text to the history.
      Since:
      jEdit 4.0pre3
    • setEnterAddsToHistory

      public boolean setEnterAddsToHistory()
      Returns if pressing Enter should automatically add the currently entered text to the history.
      Since:
      jEdit 4.0pre3
    • setSelectAllOnFocus

      public void setSelectAllOnFocus(boolean selectAllOnFocus)
      Sets if all text should be selected when the field gets focus.
      Since:
      jEdit 4.0pre3
    • setSelectAllOnFocus

      public boolean setSelectAllOnFocus()
      Returns if all text should be selected when the field gets focus.
      Since:
      jEdit 4.0pre3
    • getModel

      public HistoryModel getModel()
      Returns the underlying history model.
    • setModel

      public void setModel(String name)
      Sets the history list model.
      Parameters:
      name - The model name
      Since:
      jEdit 2.3pre3
    • addCurrentToHistory

      public void addCurrentToHistory()
      Adds the currently entered item to the history.
    • setText

      public void setText(String text)
      Sets the displayed text.
      Overrides:
      setText in class JTextComponent
    • fireActionPerformed

      public void fireActionPerformed()
      Make it public.
      Overrides:
      fireActionPerformed in class JTextField
    • processKeyEvent

      protected void processKeyEvent(KeyEvent evt)
      Overrides:
      processKeyEvent in class JComponent
    • processMouseEvent

      protected void processMouseEvent(MouseEvent evt)
      Overrides:
      processMouseEvent in class JComponent