File Source: InputField.java

         /* 
    P/P   *  Method: com.dmdirc.ui.interfaces.InputField__static_init
          */
     1  /*
     2   * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
     3   *
     4   * Permission is hereby granted, free of charge, to any person obtaining a copy
     5   * of this software and associated documentation files (the "Software"), to deal
     6   * in the Software without restriction, including without limitation the rights
     7   * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     8   * copies of the Software, and to permit persons to whom the Software is
     9   * furnished to do so, subject to the following conditions:
    10   *
    11   * The above copyright notice and this permission notice shall be included in
    12   * all copies or substantial portions of the Software.
    13   *
    14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    20   * SOFTWARE.
    21   */
    22  
    23  package com.dmdirc.ui.interfaces;
    24  
    25  import java.awt.event.ActionListener;
    26  import java.awt.event.KeyListener;
    27  
    28  /**
    29   * Input field interface.
    30   */
    31  public interface InputField {
    32  
    33      /**
    34       * Adds an action listener to this input field.
    35       * 
    36       * @param listener ActionListener to add
    37       */
    38      void addActionListener(final ActionListener listener);
    39  
    40      /**
    41       * Adds a keylistener to this input field.
    42       * 
    43       * @param listener KeyListener to add
    44       */
    45      void addKeyListener(final KeyListener listener);
    46  
    47      /**
    48       * Does this input field have focus?
    49       * 
    50       * @return true iif the input field has focus
    51       */
    52      boolean hasFocus();
    53      
    54      /**
    55       * Removes an action listener to this input field.
    56       * 
    57       * @param listener ActionListener to remove
    58       */
    59      void removeActionListener(final ActionListener listener);
    60  
    61      /**
    62       * Removes a keylistener to this input field.
    63       * 
    64       * @param listener KeyListener to remove
    65       */
    66      void removeKeyListener(final KeyListener listener);
    67  
    68      /**
    69       * Returns the selected text in the input field.
    70       * 
    71       * @return Selected text
    72       */
    73      String getSelectedText();
    74  
    75      /**
    76       * Returns the end of the selection.
    77       * 
    78       * @return Selection end
    79       */
    80      int getSelectionEnd();
    81  
    82      /**
    83       * Returns the start of the selection.
    84       * 
    85       * @return Selection start
    86       */
    87      int getSelectionStart();
    88  
    89      /**
    90       * Returns the text in the input field.
    91       * 
    92       * @return Input field text
    93       */
    94      String getText();
    95  
    96      /**
    97       * Sets the text in the input field to the specified text.
    98       * 
    99       * @param text New text for the input field
   100       */
   101      void setText(final String text);
   102  
   103      /**
   104       * Returns the caret position.
   105       * 
   106       * @return Caret position
   107       */
   108      int getCaretPosition();
   109  
   110      /**
   111       * Sets the caret position.
   112       * 
   113       * @param position Caret position
   114       */
   115      void setCaretPosition(final int position);
   116  
   117      /**
   118       * Shows a colour picker for this input field.
   119       * 
   120       * @param irc Show irc colours?
   121       * @param hex Show hex colours?
   122       */
   123      void showColourPicker(final boolean irc, final boolean hex);
   124  
   125      /**
   126       * Hides the colour picker for this input field.
   127       */
   128      void hideColourPicker();
   129  }








SofCheck Inspector Build Version : 2.17854
InputField.java 2009-Jun-25 01:54:24
InputField.class 2009-Sep-02 17:04:12