Class SpecificCaretPositionListeners

java.lang.Object
org.gvsig.gui.awt.event.specificCaretPosition.SpecificCaretPositionListeners

public class SpecificCaretPositionListeners extends Object
This class has a method which adds the necessary listeners for convert a JTextComponent to another which can be configurated its 'text visible positions when isn't edited' behaviour: left positions, right positions or like JTextComponent (doesn't change text visible positions)
Author:
Pablo Piqueras Bartolomé (p_queras@hotmail.com)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Adds three listeners to a JTextComponent component: - A FocusListener -> if this component loses its focus -> set caret position to 0 - A DocumentListener -> if this component doesn't have the focus and its caret position has changed -> set caret position to 0 - A CaretListener -> sometimes DocumentListener doesn't take effect, but this listener does

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SpecificCaretPositionListeners

      public SpecificCaretPositionListeners()
  • Method Details

    • setListeners

      public static void setListeners(JTextComponent component)
      Adds three listeners to a JTextComponent component: - A FocusListener -> if this component loses its focus -> set caret position to 0 - A DocumentListener -> if this component doesn't have the focus and its caret position has changed -> set caret position to 0 - A CaretListener -> sometimes DocumentListener doesn't take effect, but this listener does
      Parameters:
      component -