Interface Configuration<E extends ServerEnvironment>


public interface Configuration<E extends ServerEnvironment>
Interface for configurable components. Could provide a configuration graphical user environment.
Since:
4.1
  • Method Details

    • hasGui

      boolean hasGui()
      Returns true if this component has a gui to show and change it's configuration.
      Returns:
      true if this component has a gui to show and change it's configuration.
      Since:
      4.1
    • getGui

      @Nullable JComponent getGui(Frame applicationFrame)
      Returns the configuration gui.

      Do not use the provided frame instance as parent when opening a new window or dialog, this will result in invalid parent hierarchy and unreachable windows. Get the active window instead, e.g. by requesting java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow().

      Parameters:
      applicationFrame - Do not use, provided for compatibility reasons.
      Returns:
      Configuration gui or null.
      Since:
      4.1
    • load

      void load()
      Loads the current configuration from appropriate conf directory. This should be done without any ui.
      Since:
      4.1
    • store

      void store()
      Stores the current configuration.
      Since:
      4.1
    • getParameterNames

      Set<String> getParameterNames()
      Returns all parameter names.
      Returns:
      all parameter names.
      Since:
      4.1
    • getParameter

      @Nullable String getParameter(String name)
      Returns a specific parameter or null if it's not available.
      Parameters:
      name - parameter name.
      Returns:
      parameter or null.
      Since:
      4.1
    • init

      void init(String moduleName, String componentName, E env)
      Initializes this component with the given environment. This method is called before the instance is used.
      Parameters:
      moduleName - module name
      componentName - component name
      env - useful environment information for this component.
      Since:
      4.1
    • getEnvironment

      E getEnvironment()
      Returns ComponentEnvironment
      Returns:
      ComponentEnvironment
      Since:
      4.1