Class AbstractOptionDialogFrame<O>

    • Constructor Detail

      • AbstractOptionDialogFrame

        public AbstractOptionDialogFrame​(ValueModel<O> valueModel,
                                         Component component,
                                         O... options)
        Value model, component, and options constructor. Duplicate options are ignored.
        Parameters:
        valueModel - The frame value model.
        component - The component representing the content of the option dialog frame, or null if there is no content component.
        options - The available options.
        Throws:
        java.lang.NullPointerException - if the given value model and/or options is null.
    • Method Detail

      • getContentContainer

        protected Container getContentContainer()
        Returns:
        The container component used to hold content, including the option child component.
      • getOptionContent

        public Component getOptionContent()
        Specified by:
        getOptionContent in interface OptionDialogFrame<O>
        Returns:
        The component representing option contents, or null if this frame does not have an option contents component.
      • setOptionContent

        public void setOptionContent​(Component newOptionContent)
        Sets the component representing option contents.

        This implementation adds the option content component to the center region of the child container.

        Specified by:
        setOptionContent in interface OptionDialogFrame<O>
        Parameters:
        newOptionContent - The single option contents component, or null if this frame does not have an option contents component.
      • getOptions

        public java.util.List<O> getOptions()
        Specified by:
        getOptions in interface OptionDialogFrame<O>
        Returns:
        The read-only list of available options in order.
      • getOptionComponent

        public Component getOptionComponent​(O option)
        Description copied from interface: OptionDialogFrame
        Returns the component that represents the specified option.
        Specified by:
        getOptionComponent in interface OptionDialogFrame<O>
        Parameters:
        option - The option for which a component should be returned.
        Returns:
        The component, such as a button, that represents the given option, or null if there is no component that represents the given option.
      • createOptionContainer

        protected Container createOptionContainer()
        Creates a container for holding the options. This implementation creates a horizontal arrange panel.
        Returns:
        a container for holding the options.
        See Also:
        ArrangePanel
      • initializeOptionContainer

        protected void initializeOptionContainer​(Container optionContainer,
                                                 java.util.List<O> options)
        Initializes the option container with the available options. Each component is added to the option container and to the map of option components.
        Parameters:
        optionContainer - The container to the options.
        options - The available options.
      • createOptionComponent

        protected abstract Component createOptionComponent​(O option)
        Creates a component to represent the given option.
        Parameters:
        option - The option for which a component should be created.
        Returns:
        A component to represents the given option.