Class ExternalTextEffigy

    • Constructor Detail

      • ExternalTextEffigy

        public ExternalTextEffigy​(Workspace workspace)
        Create a new effigy in the specified workspace with an empty string for its name.
        Parameters:
        workspace - The workspace for this effigy.
    • Method Detail

      • attributeChanged

        public void attributeChanged​(Attribute attribute)
                              throws IllegalActionException
        If the argument is the identifier parameter, then tell the external editor to finally open the file specified by the identifier (as opposed to at newTextEffigy(container, text) time at which the document file is not yet specified. This greatly simplifies the interaction with the external text editor: instead of first telling it to create a text buffer with some name and no file attached, the buffer, its associated file name, and any text saved by newTextEffigy(container, text) is given to the text editor in one transaction. NOTE: This depends on TextEditorTableau.createTableau(effigy) setting the identifier expression after newTextEffigy(container, text).
        Overrides:
        attributeChanged in class Effigy
        Parameters:
        attribute - The attribute that changed.
        Throws:
        IllegalActionException - If the base class throws it.
      • newTextEffigy

        public static TextEffigy newTextEffigy​(CompositeEntity container,
                                               java.lang.String text)
                                        throws java.lang.Exception
        Create a new effigy in the given container containing the specified text. The new effigy will have a new instance of DefaultStyledDocument associated with it.
        Parameters:
        container - The container for the effigy.
        text - The text to insert in the effigy.
        Returns:
        A new instance of TextEffigy.
        Throws:
        java.lang.Exception - If the text effigy cannot be contained by the specified container, or if the specified text cannot be inserted into the document.
      • newTextEffigy

        public static TextEffigy newTextEffigy​(CompositeEntity container,
                                               java.net.URL base,
                                               java.net.URL in)
                                        throws java.lang.Exception
        Create a new ExternalTextEffigy.
        Parameters:
        container - The container for the effigy.
        base - The base for relative file references, or null if there are no relative file references. This is ignored in this class.
        in - The input URL, or null if there is none.
        Returns:
        A new instance of TextEffigy.
        Throws:
        java.lang.Exception - If the URL cannot be read, or if the data is malformed in some way.
      • show

        public void show()
        Signal the external text editor to (re)display its buffer associated with this effigy.