com.tensegrity.gui.swing.control.attributeeditor
Class SwingAttributeEditorUtil.InitTextFieldRunnable

java.lang.Object
  extended bycom.tensegrity.gui.swing.control.attributeeditor.SwingAttributeEditorUtil.InitTextFieldRunnable
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
SwingAttributeEditorUtil

public static class SwingAttributeEditorUtil.InitTextFieldRunnable
extends java.lang.Object
implements java.lang.Runnable

Runnable to use with SwingUtilities.invokeLater() to prepare a text cell for editing. The textfield will get the focus and all text is selected (depending on the configuration).

Author:
BurkhardWick

Constructor Summary
SwingAttributeEditorUtil.InitTextFieldRunnable(javax.swing.text.JTextComponent txtComp, boolean selectAll, boolean getFocus)
          Constructor
 
Method Summary
 void run()
          Will be executed by the event that is placed in the event queue by calling SwingUtilities.invokeLater().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingAttributeEditorUtil.InitTextFieldRunnable

public SwingAttributeEditorUtil.InitTextFieldRunnable(javax.swing.text.JTextComponent txtComp,
                                                      boolean selectAll,
                                                      boolean getFocus)
Constructor

Parameters:
txtComp - The component to set the selection for
selectAll - True to select all text of the textfield on execution
getFocus - True to set the focus to the textfield on execution
Method Detail

run

public void run()
Will be executed by the event that is placed in the event queue by calling SwingUtilities.invokeLater(). Depending on the configuration (see constructor!) it will select the text in the textfield and sets the focus. Remark: The text will only be selected here if it didn't change in the meantime (the time between construction and execution of this class). This prevents a misbehavior when the cell editing is started by typing. In this case the typed character will be added to the text before executing this and so the added character would be selected as well and the next typed character would erase the whole text. Therefore the text is selected at construction time and not afterwards.

Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.