Interface SwingConfiguratorInterface

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default boolean canClose()
      Is the SWI ready to be closed?
      default int compareTo​(SwingConfiguratorInterface swi)
      MaleSocket createNewObject​(java.lang.String systemName, java.lang.String userName)
      Create a new object with the data entered.This method must also register the object in its manager.
      void dispose()
      Dispose the panel and remove all the listeners that this class may have registered.
      void executeEvaluate​(Base object)
      Execute or evaluate an item that this object configures.
      java.lang.String getAutoSystemName()
      Create a new system name.
      javax.swing.JPanel getConfigPanel​(javax.swing.JPanel buttonPanel)
      Get a configuration panel when a new object is to be created and we don't have it yet.
      javax.swing.JPanel getConfigPanel​(Base object, javax.swing.JPanel buttonPanel)
      Get a configuration panel for an object.
      java.lang.String getExampleSystemName()
      Get an example of a system name
      java.lang.String getExecuteEvaluateMenuText()
      Get the menu text for execute/evaluate.
      javax.swing.JDialog getJDialog()
      Set the dialog of this SWI.
      BaseManager<? extends NamedBean> getManager()
      Get the manager that handles the beans for the new object.
      static java.util.List<javax.swing.JComponent> parseMessage​(java.lang.String message, javax.swing.JComponent[] components)
      Parses the message and creates a list of components there the given components are separated by JLabel components from the message.
      default void setDefaultValues()
      Set default values for this dialog.
      void setJDialog​(javax.swing.JDialog dialog)
      Set the dialog of this SWI.
      java.lang.String toString()
      Returns the name of the class that this class configures.
      void updateObject​(Base object)
      Updates the object with the data in the form.
      boolean validate​(java.util.List<java.lang.String> errorMessages)
      Validate the form.
    • Method Detail

      • setJDialog

        void setJDialog​(javax.swing.JDialog dialog)
        Set the dialog of this SWI.
        Parameters:
        dialog - the dialog
      • getJDialog

        javax.swing.JDialog getJDialog()
        Set the dialog of this SWI.
        Returns:
        the dialog
      • getExecuteEvaluateMenuText

        java.lang.String getExecuteEvaluateMenuText()
        Get the menu text for execute/evaluate.
        Returns:
        the menu text
      • executeEvaluate

        void executeEvaluate​(@Nonnull
                             Base object)
        Execute or evaluate an item that this object configures.
        Parameters:
        object - the object to execute or evaluate
      • getManager

        BaseManager<? extends NamedBeangetManager()
        Get the manager that handles the beans for the new object. This is used for validation of the system name for the bean that this class creates.
        Returns:
        the manager
      • getConfigPanel

        javax.swing.JPanel getConfigPanel​(javax.swing.JPanel buttonPanel)
                                   throws java.lang.IllegalArgumentException
        Get a configuration panel when a new object is to be created and we don't have it yet. This method initializes the panel with an empty configuration.
        Parameters:
        buttonPanel - panel with the buttons
        Returns:
        a panel that configures this object
        Throws:
        java.lang.IllegalArgumentException - if this class does not support the class with the name given in parameter 'className'
      • getConfigPanel

        javax.swing.JPanel getConfigPanel​(@Nonnull
                                          Base object,
                                          javax.swing.JPanel buttonPanel)
                                   throws java.lang.IllegalArgumentException
        Get a configuration panel for an object. This method initializes the panel with the configuration of the object.
        Parameters:
        object - the object for which to return a configuration panel
        buttonPanel - panel with the buttons
        Returns:
        a panel that configures this object
        Throws:
        java.lang.IllegalArgumentException
      • validate

        boolean validate​(@Nonnull
                         java.util.List<java.lang.String> errorMessages)
        Validate the form.

        The parameter errorMessage is used to give the error message in case of an error. If there are errors, the error messages is added to the list errorMessage.

        Parameters:
        errorMessages - the error messages in case of an error
        Returns:
        true if data in the form is valid, false otherwise
      • getExampleSystemName

        java.lang.String getExampleSystemName()
        Get an example of a system name
        Returns:
        the system name
      • getAutoSystemName

        java.lang.String getAutoSystemName()
        Create a new system name.
        Returns:
        a new system name
      • updateObject

        void updateObject​(@Nonnull
                          Base object)
        Updates the object with the data in the form.
        Parameters:
        object - the object to update
      • toString

        java.lang.String toString()
        Returns the name of the class that this class configures.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the name of the class this class configures.
      • setDefaultValues

        default void setDefaultValues()
        Set default values for this dialog. This method is used by tests to be able to run validation without knowing which data that needs to be entered for the validation to pass.
      • canClose

        default boolean canClose()
        Is the SWI ready to be closed?
        Returns:
        true if the SWI is ready to be closed, false otherwise.
      • dispose

        void dispose()
        Dispose the panel and remove all the listeners that this class may have registered.
      • parseMessage

        static java.util.List<javax.swing.JComponent> parseMessage​(java.lang.String message,
                                                                   javax.swing.JComponent[] components)
        Parses the message and creates a list of components there the given components are separated by JLabel components from the message.
        Parameters:
        message - the message to be parsed
        components - the components
        Returns:
        the components separated with JLabel components