Class AbstractTextDepictContext

    • Field Summary

      • Fields inherited from class com.globalmentor.beans.BoundPropertyObject

        NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clearDepictText()
      Clears all data collected for depiction.
      protected java.lang.String encode​(java.lang.String string)
      Encodes text information for writing.
      java.lang.StringBuilder getDepictStringBuilder()
      The string builder that holds the current content being collected, though not necessarily all the content collected.
      java.lang.String getDepictText()  
      int getIndentLevel()  
      void indent()
      Increments the indent level.
      void indent​(int indentDelta)
      Changes the indent level by the given amount.
      boolean isFormatted()
      void setIndentLevel​(int newIndentLevel)
      Sets the level of text indentation.
      void unindent()
      Decrements the indent level.
      void write​(char character)
      Writes a character, encoding it as necessary.
      void write​(java.lang.String text)
      Writes text, encoding it as necessary.
      void writeIndent()
      Writes an indention at the current indention level.
      void writeLiteral​(java.lang.String text)
      Writes literal text with no encoding.
      • Methods inherited from class com.globalmentor.beans.BoundPropertyObject

        addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.globalmentor.beans.PropertyBindable

        addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
    • Constructor Detail

      • AbstractTextDepictContext

        public AbstractTextDepictContext​(GuiseSession session,
                                         Destination destination)
                                  throws java.io.IOException
        Guise session constructor.
        Parameters:
        session - The Guise user session of which this context is a part.
        destination - The destination with which this context is associated.
        Throws:
        java.lang.NullPointerException - if the given session and/or destination is null.
        java.io.IOException - If there was an I/O error loading a needed resource.
    • Method Detail

      • getDepictStringBuilder

        public java.lang.StringBuilder getDepictStringBuilder()
        Description copied from interface: TextDepictContext
        The string builder that holds the current content being collected, though not necessarily all the content collected. The string builder returned is appropriate for adding content, but may not be a complete representation of all the text collected.
        Specified by:
        getDepictStringBuilder in interface TextDepictContext
        Returns:
        The string builder that holds the current content being collected for depiction.
      • getDepictText

        public java.lang.String getDepictText()
        Specified by:
        getDepictText in interface TextDepictContext
        Returns:
        The string that holds the current content being collected for depiction.
      • isFormatted

        public boolean isFormatted()

        This version returns true.

        Specified by:
        isFormatted in interface TextDepictContext
        Returns:
        Whether output should be formatted. This version returns true.
      • getIndentLevel

        public int getIndentLevel()
        Specified by:
        getIndentLevel in interface TextDepictContext
        Returns:
        The zero-based level of text indentation.
      • setIndentLevel

        public void setIndentLevel​(int newIndentLevel)
        Description copied from interface: TextDepictContext
        Sets the level of text indentation.
        Specified by:
        setIndentLevel in interface TextDepictContext
        Parameters:
        newIndentLevel - The new zero-based level of text indention.
      • writeLiteral

        public void writeLiteral​(java.lang.String text)
                          throws java.io.IOException
        Description copied from interface: TextDepictContext
        Writes literal text with no encoding. All writing by the controller should use this method.
        Specified by:
        writeLiteral in interface TextDepictContext
        Parameters:
        text - The literal text to write.
        Throws:
        java.io.IOException - if there is an error writing the information.
      • write

        public void write​(char character)
                   throws java.io.IOException
        Description copied from interface: TextDepictContext
        Writes a character, encoding it as necessary. This method calls TextDepictContext.writeLiteral(String).
        Specified by:
        write in interface TextDepictContext
        Parameters:
        character - The character to write.
        Throws:
        java.io.IOException - if there is an error writing the information.
      • write

        public void write​(java.lang.String text)
                   throws java.io.IOException
        Description copied from interface: TextDepictContext
        Writes text, encoding it as necessary. This method calls TextDepictContext.writeLiteral(String).
        Specified by:
        write in interface TextDepictContext
        Parameters:
        text - The text to write.
        Throws:
        java.io.IOException - if there is an error writing the information.
      • encode

        protected java.lang.String encode​(java.lang.String string)
        Encodes text information for writing. This method uses a string parameter so that no processing need occur if no characters need encoded. This version does no processing of the text.
        Parameters:
        string - The text information to encode.
        Returns:
        The encoded text.