Class BaseTextFieldWithButtons

    • Field Detail

      • m_Component

        protected BaseTextField m_Component
        the underlying text field.
      • m_LayoutButtons

        protected GridLayout m_LayoutButtons
        the layout for the buttons.
      • m_PanelButtons

        protected BasePanel m_PanelButtons
        the panel with the buttons (on the right).
    • Constructor Detail

      • BaseTextFieldWithButtons

        public BaseTextFieldWithButtons()
        The default constructor.
      • BaseTextFieldWithButtons

        public BaseTextFieldWithButtons​(String text)
        Initializes the list with the given text.
        Parameters:
        text - the text to use
      • BaseTextFieldWithButtons

        public BaseTextFieldWithButtons​(int columns)
        Constructs a new empty TextField with the specified number of columns. A default model is created and the initial string is set to null.
        Parameters:
        columns - the number of columns to use to calculate the preferred width; if columns is set to zero, the preferred width will be whatever naturally results from the component implementation
      • BaseTextFieldWithButtons

        public BaseTextFieldWithButtons​(String text,
                                        int columns)
        Constructs a new TextField initialized with the specified text and columns. A default model is created.
        Parameters:
        text - the text to be displayed, or null
        columns - the number of columns to use to calculate the preferred width; if columns is set to zero, the preferred width will be whatever naturally results from the component implementation
    • Method Detail

      • initGUI

        protected void initGUI()
        Initializes the widgets.
        Overrides:
        initGUI in class BasePanel
      • addToButtonsPanel

        public void addToButtonsPanel​(Component comp)
        Adds the component to the panel with the buttons.
        Parameters:
        comp - the component to add
      • removeFromButtonsPanel

        public void removeFromButtonsPanel​(Component comp)
        Removes the component from the panel with the buttons.
        Parameters:
        comp - the component to remove
      • getComponent

        public BaseTextField getComponent()
        Returns the underlying text field.
        Returns:
        the text field
      • getDocument

        public Document getDocument()
        Returns the underlying document.
        Returns:
        the document
      • setText

        public void setText​(String value)
        Sets the text.
        Specified by:
        setText in interface BaseTextComponent
        Parameters:
        value - the text to display
      • getSelectedText

        public String getSelectedText()
        Returns the underlying text.
        Returns:
        the underlying text
      • setColumns

        public void setColumns​(int value)
        Sets the number of columns in this TextField, and then invalidate the layout.
        Parameters:
        value - the number of columns >= 0
        Throws:
        IllegalArgumentException - if columns is less than 0
      • getColumns

        public int getColumns()
        Returns the number of columns in this TextField.
        Returns:
        the number of columns >= 0
      • setEditable

        public void setEditable​(boolean value)
        Sets whether the text area is editable or not.
        Parameters:
        value - if true the text area is editable
      • isEditable

        public boolean isEditable()
        Returns whether the text area is editable or not.
        Returns:
        true if the text area is editable
      • setTextFont

        public void setTextFont​(Font value)
        Sets the text font.
        Parameters:
        value - the font
      • getTextFont

        public Font getTextFont()
        Returns the text font in use.
        Returns:
        the font
      • setCaretPosition

        public void setCaretPosition​(int pos)
        Sets the caret position.
        Parameters:
        pos - the position (0-based)
      • getCaretPosition

        public int getCaretPosition()
        Returns the current caret position.
        Returns:
        the position (0-based)