com.levigo.util.swing.componentdecorator
Class SelectAllOnFocusGain

java.lang.Object
  extended by com.levigo.util.swing.componentdecorator.SelectAllOnFocusGain

public class SelectAllOnFocusGain
extends Object

A decorator to make a JTextComponent select all of its text upon gaining focus. This is fairly efficient and very cheap, even if a large number of components are decorated.

Author:
hennejg

Method Summary
static SelectAllOnFocusGain decorate(JTextComponent comp)
          Install SelectTextOnFocusGain behaviour on a component.
 void undecorate()
          Undecorate the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

decorate

public static SelectAllOnFocusGain decorate(JTextComponent comp)
Install SelectTextOnFocusGain behaviour on a component.

Parameters:
comp - the component to decorate.
Returns:
a handle to uninstall the behaviour again.

undecorate

public void undecorate()
Undecorate the component.



Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.