LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.text
Class LyJFormattedTextDocument

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.PlainDocument
          extended by leon.view.win.swing.text.LyJFormattedTextDocument
All Implemented Interfaces:
java.io.Serializable, javax.swing.text.Document

public class LyJFormattedTextDocument
extends javax.swing.text.PlainDocument

This class implements controls on its associated JTextComponent.

See Also:
LyJFormattedField, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument
javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement
 
Field Summary
static java.lang.String __VERSION
           
 
Fields inherited from class javax.swing.text.PlainDocument
lineLimitAttribute, tabSizeAttribute
 
Fields inherited from class javax.swing.text.AbstractDocument
BidiElementName, ContentElementName, ElementNameAttribute, ParagraphElementName, SectionElementName
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Constructor Summary
LyJFormattedTextDocument(LyJFormat format, LyJFormattedField comp)
          Constructor.
 
Method Summary
 void beep()
          Emit a beep.
 void insertString(int offset, java.lang.String str, javax.swing.text.AttributeSet a)
          Method overriden to control the user's insertions to allow only well-formed inputs.
 void remove(int offs, int len)
          Method overriden to control the user's deletion to allow only well-formed inputs.
 void replaceChar(int offset, char c, javax.swing.text.AttributeSet a)
          Replaces the character at pos offset by c.
 void setDisplayableString(java.lang.String text)
          Sets the new text contained by this document.
 
Methods inherited from class javax.swing.text.PlainDocument
getDefaultRootElement, getParagraphElement
 
Methods inherited from class javax.swing.text.AbstractDocument
addDocumentListener, addUndoableEditListener, createPosition, dump, getAsynchronousLoadPriority, getBidiRootElement, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, putProperty, readLock, readUnlock, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values
Constructor Detail

LyJFormattedTextDocument

public LyJFormattedTextDocument(LyJFormat format,
                                LyJFormattedField comp)
Constructor. Calls the super implementation and initializes class attributes with the given values.

Parameters:
format - the format to respect
comp - the associated JTextComponent
Method Detail

beep

public void beep()
Emit a beep.


insertString

public void insertString(int offset,
                         java.lang.String str,
                         javax.swing.text.AttributeSet a)
                  throws javax.swing.text.BadLocationException
Method overriden to control the user's insertions to allow only well-formed inputs.

Specified by:
insertString in interface javax.swing.text.Document
Overrides:
insertString in class javax.swing.text.PlainDocument
Throws:
javax.swing.text.BadLocationException

remove

public void remove(int offs,
                   int len)
            throws javax.swing.text.BadLocationException
Method overriden to control the user's deletion to allow only well-formed inputs.

Specified by:
remove in interface javax.swing.text.Document
Overrides:
remove in class javax.swing.text.AbstractDocument
Throws:
javax.swing.text.BadLocationException

replaceChar

public void replaceChar(int offset,
                        char c,
                        javax.swing.text.AttributeSet a)
                 throws javax.swing.text.BadLocationException
Replaces the character at pos offset by c.

Parameters:
offset - the position of the replacement
c - the new char
a - the AttibuteSet, not used here
Throws:
javax.swing.text.BadLocationException

setDisplayableString

public void setDisplayableString(java.lang.String text)
                          throws javax.swing.text.BadLocationException
Sets the new text contained by this document.

Parameters:
text - the new text
Throws:
javax.swing.text.BadLocationException

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com