Class EditableChoiceStyle

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

    public class EditableChoiceStyle
    extends ChoiceStyle
    This attribute annotates user settable attributes to specify an editable combobox style for configuring the containing attribute. An editable combobox allows an arbitrary value to be entered in the combobox. For an uneditable combobox, use ChoiceStyle instead. The choices that are presented in the combobox are given by a set of attributes implementing the Settable interface, such as StringAttribute, contained by this style.

    This class extends ChoiceStyle only for the purpose of eliminating code duplication.

    Since:
    Ptolemy II 1.0
    Version:
    $Id$
    Author:
    Steve Neuendorffer
    See Also:
    ChoiceStyle, EditorPaneFactory, ParameterEditorStyle, StringAttribute
    Pt.AcceptedRating:
    Yellow (neuendor)
    Pt.ProposedRating:
    Green (neuendor)
    • Constructor Detail

      • EditableChoiceStyle

        public EditableChoiceStyle()
        Construct an attribute in the default workspace with an empty string as its name. The object is added to the directory of the workspace. Increment the version number of the workspace.
      • EditableChoiceStyle

        public EditableChoiceStyle​(NamedObj container,
                                   java.lang.String name)
                            throws IllegalActionException,
                                   NameDuplicationException
        Construct an attribute with the specified container and name.
        Parameters:
        container - The container.
        name - The name of the attribute.
        Throws:
        IllegalActionException - If the attribute is not of an acceptable attribute for the container, or if the container is not an instance of Settable.
        NameDuplicationException - If the name coincides with an attribute already in the container.
    • Method Detail

      • addEntry

        public void addEntry​(PtolemyQuery query)
                      throws IllegalActionException
        Create a new editable combo box entry in the given query associated with the attribute containing this style. The name of the entry is the name of the attribute. Attach the attribute to the created entry.
        Overrides:
        addEntry in class ChoiceStyle
        Parameters:
        query - The query into which to add the entry.
        Throws:
        IllegalActionException - If the containing attribute has a value that cannot be edited using this style.