Class TextEditorConfigureFactory

  • All Implemented Interfaces:
    java.lang.Cloneable, Editable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable, TextEditorFactory

    public class TextEditorConfigureFactory
    extends EditorFactory
    implements TextEditorFactory
    If this class is contained by a actor, then double clicking on that actor will invoke a text editor that edits the value of a specified string attribute. The string attribute must be contained by the same container as this factory; its name is given by the attributeName attribute of this factory. The number of rows and columns displayed are given by the rowsDisplayed and columnsDisplayed parameters. The default is 80 columns and 40 rows.

    This attribute is similar to TextEditorTableauFactory, except that it opens the text editor when the containing actor is configured (edit parameters), whereas TextEditorTableauFactory opens the text editor when the user looks inside.

    Since:
    Ptolemy II 4.0
    Version:
    $Id$
    Author:
    Edward A. Lee, contributor: Daniel Crawl
    See Also:
    TextEditorTableauFactory
    Pt.AcceptedRating:
    Red (ptolemy)
    Pt.ProposedRating:
    Yellow (eal)
    • Field Detail

      • attributeName

        public StringAttribute attributeName
        The name of the string attribute that is to be edited.
      • columnsDisplayed

        public Parameter columnsDisplayed
        The horizontal size of the display, in columns. This contains an integer, and defaults to 40.
      • rowsDisplayed

        public Parameter rowsDisplayed
        The vertical size of the display, in rows. This contains an integer, and defaults to 10.
      • syntaxStyle

        public StringAttribute syntaxStyle
        The style of the text to be edited. This may or may not be supported. If the package "org.fife.ui.rsyntaxtextarea" is found in the classpath, then the supported styles include "text/plain", "text/c", "text/clojure", "text/cpp", "text/cs", "text/css", "text/dtd", "text/fortran", "text/groovy", "text/html", "text/java", "text/javascript", "text/json", "text/jsp", "text/latex", "text/makefile", "text/perl", "text/php", "text/properties", "text/python", "text/ruby", "text/sas", "text/scala", "text/sql", "text/tcl", "text/unix", "text/vb", "text/bat", and "text/xml".
    • Constructor Detail

    • Method Detail

      • clear

        public void clear()
        Remove any editor that may have been associated with this object by a previous call to createEditor().
        Specified by:
        clear in interface TextEditorFactory
      • createEditor

        public void createEditor​(NamedObj object,
                                 java.awt.Frame parent)
        Create an editor for editing the string attribute specified by the attributeName parameter.
        Specified by:
        createEditor in interface Editable
        Specified by:
        createEditor in class EditorFactory
        Parameters:
        object - The object to configure (which is expected to be the same as the container of this attribute).
        parent - The frame with respect to which to define the editor.
      • getText

        public java.lang.String getText()
        Return the current text of the text editor.
        Specified by:
        getText in interface TextEditorFactory
        Returns:
        The current text of the text editor, or null if there is none.