Class ChoiceCriterionElement


  • public class ChoiceCriterionElement
    extends StringCriterionElement
    A choice element for a criterion.
    Since:
    Ptolemy II 8.0
    Version:
    $Id$
    Author:
    Thomas Huining Feng
    Pt.AcceptedRating:
    Red (tfeng)
    Pt.ProposedRating:
    Yellow (tfeng)
    • Constructor Summary

      Constructors 
      Constructor Description
      ChoiceCriterionElement​(java.lang.String name, boolean canDisable)
      Construct a choice element for a criterion.
      ChoiceCriterionElement​(java.lang.String name, boolean canDisable, boolean acceptRegularExpression, boolean acceptPtolemyExpression, boolean editable)
      Construct a choice element for a criterion.
    • Constructor Detail

      • ChoiceCriterionElement

        public ChoiceCriterionElement​(java.lang.String name,
                                      boolean canDisable)
        Construct a choice element for a criterion.
        Parameters:
        name - The name of the element.
        canDisable - Whether the element can be disabled.
      • ChoiceCriterionElement

        public ChoiceCriterionElement​(java.lang.String name,
                                      boolean canDisable,
                                      boolean acceptRegularExpression,
                                      boolean acceptPtolemyExpression,
                                      boolean editable)
        Construct a choice element for a criterion.
        Parameters:
        name - The name of the element.
        canDisable - Whether the element can be disabled.
        acceptRegularExpression - Whether regular expression is accepted.
        acceptPtolemyExpression - Whether Ptolemy expression is accepted.
        editable - Whether a new value can be input in the edit box.
    • Method Detail

      • addChoice

        public void addChoice​(java.lang.Object choice)
        Add a choice to the end of choices.
        Parameters:
        choice - The new choice.
      • addChoices

        public void addChoices​(java.util.Collection<?> choices)
        Add choices to the end of choices.
        Parameters:
        choices - The new choices.
      • getChoices

        public java.util.List<java.lang.Object> getChoices()
        Get an unmodifiable list of all the choices.
        Returns:
        The list.
      • isEditable

        public boolean isEditable()
        Return whether a new value can be input in the edit box.
        Returns:
        true if a new value can be input in the edit box.
      • removeChoice

        public void removeChoice​(java.lang.Object choice)
        Remove a choice from the list of choices.
        Parameters:
        choice - The choice to be removed.
      • removeChoices

        public void removeChoices​(java.util.Collection<?> choices)
        Remove choices from the list of choices.
        Parameters:
        choices - The choices to be removed.