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.
        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.
        java.lang.NullPointerException - if the given value model and/or options is null.
    • Method Detail

      • getContentContainer

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

        public Component getOptionContent()
        Specified by:
        getOptionContent in interface OptionDialogFrame<O>
        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>
        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>
        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>
        option - The option for which a component should be returned.
        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.
        a container for holding the options.
        See Also:
      • 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.
        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.
        option - The option for which a component should be created.
        A component to represents the given option.