Interface EntityApplicationPanel.Builder<M extends SwingEntityApplicationModel,P extends EntityApplicationPanel<M>>

Type Parameters:
M - the application model type
P - the application panel type
Enclosing class:
EntityApplicationPanel<M extends SwingEntityApplicationModel>

public static interface EntityApplicationPanel.Builder<M extends SwingEntityApplicationModel,P extends EntityApplicationPanel<M>>
Builds a EntityApplicationPanel and starts the application.
See Also:
  • Method Details

    • domainType

      EntityApplicationPanel.Builder<M,P> domainType(DomainType domainType)
      Parameters:
      domainType - the domain type
      Returns:
      this Builder instance
    • applicationName

      EntityApplicationPanel.Builder<M,P> applicationName(String applicationName)
      Parameters:
      applicationName - the application name
      Returns:
      this Builder instance
    • applicationIcon

      EntityApplicationPanel.Builder<M,P> applicationIcon(ImageIcon applicationIcon)
      Parameters:
      applicationIcon - the application icon
      Returns:
      this Builder instance
    • applicationVersion

      EntityApplicationPanel.Builder<M,P> applicationVersion(Version applicationVersion)
      Parameters:
      applicationVersion - the application version
      Returns:
      this Builder instance
    • defaultLookAndFeel

      EntityApplicationPanel.Builder<M,P> defaultLookAndFeel(Class<? extends LookAndFeel> defaultLookAndFeelClass)
      Sets the default look and feel class, used in case no look and feel settings are found in user preferences.
      Parameters:
      defaultLookAndFeelClass - the default look and feel class
      Returns:
      this Builder instance
      See Also:
    • defaultLookAndFeel

      EntityApplicationPanel.Builder<M,P> defaultLookAndFeel(String defaultLookAndFeelClassName)
      Sets the default look and feel classname, used in case no look and feel settings are found in user preferences.
      Parameters:
      defaultLookAndFeelClassName - the default look and feel classname
      Returns:
      this Builder instance
      See Also:
    • lookAndFeel

      EntityApplicationPanel.Builder<M,P> lookAndFeel(Class<? extends LookAndFeel> lookAndFeelClass)
      Sets the look and feel class, overrides any look and feel settings found in user preferences.
      Parameters:
      lookAndFeelClass - the look and feel class
      Returns:
      this Builder instance
      See Also:
    • lookAndFeel

      EntityApplicationPanel.Builder<M,P> lookAndFeel(String lookAndFeelClassName)
      Sets the look and feel classname, overrides any look and feel settings found in user preferences.
      Parameters:
      lookAndFeelClassName - the look and feel classname
      Returns:
      this Builder instance
      See Also:
    • connectionProviderFactory

      EntityApplicationPanel.Builder<M,P> connectionProviderFactory(EntityApplicationPanel.Builder.ConnectionProviderFactory connectionProviderFactory)
      Parameters:
      connectionProviderFactory - the connection provider factory
      Returns:
      this Builder instance
    • applicationModelFactory

      EntityApplicationPanel.Builder<M,P> applicationModelFactory(Function<EntityConnectionProvider,M> applicationModelFactory)
      Parameters:
      applicationModelFactory - the application model factory
      Returns:
      this Builder instance
    • applicationPanelFactory

      EntityApplicationPanel.Builder<M,P> applicationPanelFactory(Function<M,P> applicationPanelFactory)
      Parameters:
      applicationPanelFactory - the application panel factory
      Returns:
      this Builder instance
    • loginProvider

      Parameters:
      loginProvider - provides a way for a user to login
      Returns:
      this Builder instance
    • defaultLoginUser

      EntityApplicationPanel.Builder<M,P> defaultLoginUser(User defaultLoginUser)
      Parameters:
      defaultLoginUser - the default user credentials to display in the login dialog
      Returns:
      this Builder instance
    • automaticLoginUser

      EntityApplicationPanel.Builder<M,P> automaticLoginUser(User automaticLoginUser)
      Parameters:
      automaticLoginUser - if specified the application is started automatically with the given user, instead of displaying a login dialog
      Returns:
      this Builder instance
    • saveDefaultUsername

      EntityApplicationPanel.Builder<M,P> saveDefaultUsername(boolean saveDefaultUsername)
      Parameters:
      saveDefaultUsername - true if the username should be saved in user preferences after a successful login
      Returns:
      this Builder instance
    • loginPanelSouthComponent

      EntityApplicationPanel.Builder<M,P> loginPanelSouthComponent(Supplier<JComponent> loginPanelSouthComponentSupplier)
      Note that this does not apply when a custom EntityApplicationPanel.Builder.LoginProvider has been specified.
      Parameters:
      loginPanelSouthComponentSupplier - supplies the component to add to the BorderLayout.SOUTH position of the default login panel
      Returns:
      this Builder instance
    • beforeApplicationStarted

      EntityApplicationPanel.Builder<M,P> beforeApplicationStarted(Runnable beforeApplicationStarted)
      Runs before the application is started, but after Look and Feel initialization. Throw CancelException in order to cancel the application startup.
      Parameters:
      beforeApplicationStarted - run before the application is started
      Returns:
      this Builder instance
    • onApplicationStarted

      EntityApplicationPanel.Builder<M,P> onApplicationStarted(Consumer<P> onApplicationStarted)
      Parameters:
      onApplicationStarted - called after a successful application start
      Returns:
      this Builder instance
    • frameSupplier

      EntityApplicationPanel.Builder<M,P> frameSupplier(Supplier<JFrame> frameSupplier)
      Parameters:
      frameSupplier - the frame supplier
      Returns:
      this Builder instance
    • frameTitle

      EntityApplicationPanel.Builder<M,P> frameTitle(String frameTitle)
      Parameters:
      frameTitle - the frame title
      Returns:
      this Builder instance
    • frameTitle

      For a dynamic frame title.
      Parameters:
      frameTitle - the observable controlling the frame title
      Returns:
      this Builder instance
    • includeMainMenu

      EntityApplicationPanel.Builder<M,P> includeMainMenu(boolean includeMainMenu)
      Parameters:
      includeMainMenu - if true then a main menu is included
      Returns:
      this Builder instance
    • maximizeFrame

      EntityApplicationPanel.Builder<M,P> maximizeFrame(boolean maximizeFrame)
      Parameters:
      maximizeFrame - specifies whether the frame should be maximized or use it's preferred size
      Returns:
      this Builder instance
    • displayFrame

      EntityApplicationPanel.Builder<M,P> displayFrame(boolean displayFrame)
      Parameters:
      displayFrame - specifies whether the frame should be displayed or left invisible
      Returns:
      this Builder instance
    • setUncaughtExceptionHandler

      EntityApplicationPanel.Builder<M,P> setUncaughtExceptionHandler(boolean setUncaughtExceptionHandler)
      Specifies whether or not to set the default uncaught exception handler when starting the application, true by default.
      Parameters:
      setUncaughtExceptionHandler - if true the default uncaught exception handler is set on application start
      Returns:
      this Builder instance
      See Also:
    • displayStartupDialog

      EntityApplicationPanel.Builder<M,P> displayStartupDialog(boolean displayStartupDialog)
      Parameters:
      displayStartupDialog - if true then a progress dialog is displayed while the application is being initialized
      Returns:
      this Builder instance
    • frameSize

      Parameters:
      frameSize - the frame size when not maximized
      Returns:
      this Builder instance
    • defaultFrameSize

      EntityApplicationPanel.Builder<M,P> defaultFrameSize(Dimension defaultFrameSize)
      Parameters:
      defaultFrameSize - the default frame size when no previous size is available in user preferences
      Returns:
      this Builder instance
    • loginRequired

      EntityApplicationPanel.Builder<M,P> loginRequired(boolean loginRequired)
      If this is set to false, the connectionProviderFactory(ConnectionProviderFactory) User argument will be null.
      Parameters:
      loginRequired - true if a user login is required for this application, false if the user is supplied differently
      Returns:
      this Builder instance
    • start

      void start()
      Starts the application on the Event Dispatch Thread.
    • start

      void start(boolean onEventDispatchThread)
      Starts the application.
      Parameters:
      onEventDispatchThread - if true then startup is performed on the EDT