Class DocumentUtil.PassthroughDocument

  • All Implemented Interfaces:
    javax.swing.text.Document
    Direct Known Subclasses:
    DocumentUtil.LengthLimitedDocument
    Enclosing class:
    DocumentUtil

    private abstract static class DocumentUtil.PassthroughDocument
    extends java.lang.Object
    implements javax.swing.text.Document
    A document that merely passes all requests through to another document. This is used as the base class for the custom documents provided here.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.swing.text.Document delegate_  
      • Fields inherited from interface javax.swing.text.Document

        StreamDescriptionProperty, TitleProperty
    • Constructor Summary

      Constructors 
      Constructor Description
      PassthroughDocument​(javax.swing.text.Document delegate)
      Create an instance
    • Field Detail

      • delegate_

        private final javax.swing.text.Document delegate_
    • Constructor Detail

      • PassthroughDocument

        public PassthroughDocument​(javax.swing.text.Document delegate)
        Create an instance
        Parameters:
        delegate - The document to wrap.
    • Method Detail

      • getLength

        public int getLength()
        Specified by:
        getLength in interface javax.swing.text.Document
      • addDocumentListener

        public void addDocumentListener​(javax.swing.event.DocumentListener listener)
        Specified by:
        addDocumentListener in interface javax.swing.text.Document
      • removeDocumentListener

        public void removeDocumentListener​(javax.swing.event.DocumentListener listener)
        Specified by:
        removeDocumentListener in interface javax.swing.text.Document
      • addUndoableEditListener

        public void addUndoableEditListener​(javax.swing.event.UndoableEditListener listener)
        Specified by:
        addUndoableEditListener in interface javax.swing.text.Document
      • removeUndoableEditListener

        public void removeUndoableEditListener​(javax.swing.event.UndoableEditListener listener)
        Specified by:
        removeUndoableEditListener in interface javax.swing.text.Document
      • getProperty

        public java.lang.Object getProperty​(java.lang.Object key)
        Specified by:
        getProperty in interface javax.swing.text.Document
      • putProperty

        public void putProperty​(java.lang.Object key,
                                java.lang.Object value)
        Specified by:
        putProperty in interface javax.swing.text.Document
      • remove

        public void remove​(int offs,
                           int len)
                    throws javax.swing.text.BadLocationException
        Specified by:
        remove in interface javax.swing.text.Document
        Throws:
        javax.swing.text.BadLocationException
      • insertString

        public void insertString​(int offset,
                                 java.lang.String str,
                                 javax.swing.text.AttributeSet a)
                          throws javax.swing.text.BadLocationException
        Specified by:
        insertString in interface javax.swing.text.Document
        Throws:
        javax.swing.text.BadLocationException
      • getText

        public java.lang.String getText​(int offset,
                                        int length)
                                 throws javax.swing.text.BadLocationException
        Specified by:
        getText in interface javax.swing.text.Document
        Throws:
        javax.swing.text.BadLocationException
      • getText

        public void getText​(int offset,
                            int length,
                            javax.swing.text.Segment txt)
                     throws javax.swing.text.BadLocationException
        Specified by:
        getText in interface javax.swing.text.Document
        Throws:
        javax.swing.text.BadLocationException
      • getStartPosition

        public javax.swing.text.Position getStartPosition()
        Specified by:
        getStartPosition in interface javax.swing.text.Document
      • getEndPosition

        public javax.swing.text.Position getEndPosition()
        Specified by:
        getEndPosition in interface javax.swing.text.Document
      • createPosition

        public javax.swing.text.Position createPosition​(int offs)
                                                 throws javax.swing.text.BadLocationException
        Specified by:
        createPosition in interface javax.swing.text.Document
        Throws:
        javax.swing.text.BadLocationException
      • getRootElements

        public javax.swing.text.Element[] getRootElements()
        Specified by:
        getRootElements in interface javax.swing.text.Document
      • getDefaultRootElement

        public javax.swing.text.Element getDefaultRootElement()
        Specified by:
        getDefaultRootElement in interface javax.swing.text.Document
      • render

        public void render​(java.lang.Runnable r)
        Specified by:
        render in interface javax.swing.text.Document