Class AbstractWidget

    • Constructor Detail

      • AbstractWidget

        public AbstractWidget()
    • Method Detail

      • getName

        public abstract String getName()
        Returns the name of the widget.
        Returns:
        the name
      • getWidget

        public abstract Component getWidget()
        Returns the widget.
        Returns:
        the widget
      • update

        public abstract void update()
        Updates the widget.
      • toString

        public String toString()
        Returns the name of the widget.
        Overrides:
        toString in class Object
        Returns:
        the name
      • assign

        public abstract void assign​(AbstractWidget other)
        Retrieves the values from the other widget, if possible.
        Parameters:
        other - the other widget to get the values from
      • serialize

        public abstract Object serialize()
        Serializes the setup from the widget.
        Returns:
        the generated setup representation
      • deserialize

        public abstract void deserialize​(Object data,
                                         MessageCollection errors)
        Deserializes the setup and maps it onto the widget.
        Parameters:
        data - the setup representation to use
        errors - for collecting errors
      • notifyOwner

        protected void notifyOwner​(SpreadSheetProcessorEvent.EventType type,
                                   String message)
        Notifies the owner.
        Parameters:
        type - the type of event
        message - the optional message, can be null
      • compareTo

        public int compareTo​(AbstractWidget o)
        Compares the two widgets using their name.
        Specified by:
        compareTo in interface Comparable<AbstractWidget>
        Parameters:
        o - the other widget
        Returns:
        the result of the name comparison
      • equals

        public boolean equals​(Object obj)
        Compares equality based on the widget name.
        Overrides:
        equals in class Object
        Parameters:
        obj - the other widget to compare with
        Returns:
        true if the same name