org.springframework.richclient.text
Class TextCaretFormComponentInterceptorFactory

Show UML class diagram
java.lang.Object
  extended by org.springframework.richclient.text.TextCaretFormComponentInterceptorFactory
All Implemented Interfaces:
FormComponentInterceptorFactory

public class TextCaretFormComponentInterceptorFactory
extends Object
implements FormComponentInterceptorFactory

If the text is set in a text component, the caret position is set to the end of the text.

This means the beginning of the text will not be visible if the text is too long to fit in the text component.

This FormComponentInterceptor "fixes" this behaviour by listening to Document updates, and setting the caret position to 0 (i.e. the beginning of the text) if the text is updated when the text component doesn't have the focus (i.e. the text is not changed by the user).

Author:
Peter De Bruycker

Nested Class Summary
 class TextCaretFormComponentInterceptorFactory.TextCaretComponentInterceptor
          The FormComponentInterceptor implementation.
 
Constructor Summary
TextCaretFormComponentInterceptorFactory()
           
 
Method Summary
 FormComponentInterceptor getInterceptor(FormModel formModel)
          Create a new TextCaretFixerComponentInterceptor instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextCaretFormComponentInterceptorFactory

public TextCaretFormComponentInterceptorFactory()
Method Detail

getInterceptor

public FormComponentInterceptor getInterceptor(FormModel formModel)
Create a new TextCaretFixerComponentInterceptor instance

Specified by:
getInterceptor in interface FormComponentInterceptorFactory
Returns:
the interceptor


Copyright © 2004-2009 The Spring Framework. All Rights Reserved.