org.jminor.framework.client.ui
Class EntityApplicationPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.jminor.framework.client.ui.EntityApplicationPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, ExceptionHandler, MasterDetailPanel

public abstract class EntityApplicationPanel
extends JPanel
implements ExceptionHandler, MasterDetailPanel

A central application panel class.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String TIPS_AND_TRICKS_FILE
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
EntityApplicationPanel()
           
 
Method Summary
 void activatePanel()
          Activates this panel, showing it and preparing it for input
 void addAlwaysOnTopListener(ActionListener listener)
           
 void addApplicationStartedListener(ActionListener listener)
           
 EntityApplicationPanel addMainApplicationPanelProvider(EntityPanelProvider panelProvider)
          Adds a main application panel, displayed on application start
 EntityApplicationPanel addMainApplicationPanelProviders(EntityPanelProvider... panelProviders)
          Adds main application panels, displayed on application start
 void addSelectedPanelListener(ActionListener listener)
           
 EntityApplicationPanel addSupportPanelProvider(EntityPanelProvider panelProvider)
          Adds a support application panel, available via a support panel manu
 EntityApplicationPanel addSupportPanelProviders(EntityPanelProvider... panelProviders)
          Adds support application panels, available via a support panel manu
protected  void bindEvents()
          Override to add event bindings after initialization
protected  JMenuBar createMenuBar()
           
 void exit()
          Exists this application
protected  JPanel getAboutPanel()
           
protected  List<ControlSet> getAdditionalMenuControlSet()
           
 MasterDetailPanel getCurrentDetailPanel()
          
protected  String getDefaultLookAndFeelClassName()
           
 List<? extends MasterDetailPanel> getDetailPanels()
          
protected  EntityPanel getEntityPanel(Class<? extends EntityPanel> entityPanelClass)
           
protected  EntityPanel getEntityPanel(String entityID)
           
protected  ControlSet getFileControlSet()
           
protected  String getFrameTitle(String frameCaption, User user)
           
protected  ControlSet getHelpControlSet()
           
protected  JPanel getHelpPanel()
           
protected  String getHelpText()
           
 EntityPanel getMainApplicationPanel(String entityID)
           
 List<EntityPanel> getMainApplicationPanels()
           
protected  ControlSet getMainMenuControlSet()
           
 MasterDetailPanel getMasterPanel()
          
 EntityApplicationModel getModel()
           
 MasterDetailPanel getNextPanel()
          
protected  JToolBar getNorthToolBar()
           
 MasterDetailPanel getPreviousPanel()
          
protected  ControlSet getSettingsControlSet()
           
protected  ControlSet getSupportTableControlSet()
           
protected  ControlSet getToolsControlSet()
           
protected  User getUser(String frameCaption, User defaultUser, String applicationIdentifier, ImageIcon applicationIcon)
          Returns the user, either via a login dialog or via override, called during startup
protected  ControlSet getViewControlSet()
           
 void handleException(Throwable exception, JComponent dialogParent)
          Handle the given exception and display it to the user.
 void initialize(EntityConnectionProvider connectionProvider)
          Initializes this application panel
protected abstract  EntityApplicationModel initializeApplicationModel(EntityConnectionProvider connectionProvider)
          Initializes the application model
protected  EntityConnectionProvider initializeConnectionProvider(User user, String clientTypeID)
          Initializes the entity db provider
protected  JPanel initializeSouthPanel()
          Initializes a panel to show in the SOUTH position of this application frame, override to provide a south panel.
protected  JDialog initializeStartupDialog(Icon icon, String startupMessage)
          Initializes the startup dialog
protected  JPanel initializeStartupProgressPanel(Icon icon)
          Initializes the progress panel to show in the startup dialog
protected  void initializeUI()
          Initializes this EntityApplicationPanel
 boolean isAlwaysOnTop()
           
protected  boolean isLoginRequired()
           
protected  boolean isShowStartupDialog()
           
 void login()
          Performs a login, fetching user information via getUser
 void logout()
          Performs a logout
protected  JFrame prepareFrame(String title, boolean maximize, boolean showMenuBar, Dimension size, ImageIcon applicationIcon, boolean setVisible)
          Initializes a JFrame according to the given parameters, containing this EntityApplicationPanel
 void removeAlwaysOnTopListener(ActionListener listener)
           
 void removeApplicationStartedListener(ActionListener listener)
           
 void removeSelectedPanelListener(ActionListener listener)
           
protected  void saveDefaultUser(User user)
          Saves the user info so that it can be used as default the next time this application is started.
protected  void savePreferences()
          Called during the exit() method, override to save user preferences on program exit
 void setAlwaysOnTop(boolean value)
          fires: evtAlwaysOnTopChanged
 void setLoggingLevel()
          Shows a dialog for setting the logging level
protected  void setLoginRequired(boolean loginRequired)
          Sets wheteher or not this application requires a login dialog
protected  void setShowStartupDialog(boolean startupDialog)
           
protected  void setUncaughtExceptionHandler()
          Sets the uncaught exception handler, override to add specific uncaught exception handling
 void showAbout()
          Shows an about dialog
 void showDetailPanel(MasterDetailPanel detailPanel)
          Shows the given detail panel
protected  void showEntityPanelDialog(EntityPanelProvider panelProvider)
          Shows a dialog containing the entity panel provided by the given panel provider
protected  void showEntityPanelDialog(EntityPanelProvider panelProvider, boolean modalDialog)
          Shows a dialog containing the entity panel provided by the given panel provider
 void showHelp()
          Shows a help dialog
 void startApplication(String frameCaption, String iconName, boolean maximize, Dimension frameSize)
          Starts this application.
 void startApplication(String frameCaption, String iconName, boolean maximize, Dimension frameSize, User defaultUser)
          Starts this application.
 void startApplication(String frameCaption, String iconName, boolean maximize, Dimension frameSize, User defaultUser, boolean showFrame)
          Starts this application.
 void viewApplicationTree()
           
 void viewDependencyTree()
          Shows a dialog containing a dependency tree view of all defined entities
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TIPS_AND_TRICKS_FILE

public static final String TIPS_AND_TRICKS_FILE
See Also:
Constant Field Values
Constructor Detail

EntityApplicationPanel

public EntityApplicationPanel()
Method Detail

handleException

public final void handleException(Throwable exception,
                                  JComponent dialogParent)
Handle the given exception and display it to the user.

Specified by:
handleException in interface ExceptionHandler
Parameters:
exception - the exception
dialogParent - the component to use as parent to the exception dialog

getModel

public final EntityApplicationModel getModel()
Returns:
the application model this application panel is based on

addMainApplicationPanelProviders

public final EntityApplicationPanel addMainApplicationPanelProviders(EntityPanelProvider... panelProviders)
Adds main application panels, displayed on application start

Parameters:
panelProviders - the main application panel providers
Returns:
this application panel instance

addMainApplicationPanelProvider

public final EntityApplicationPanel addMainApplicationPanelProvider(EntityPanelProvider panelProvider)
Adds a main application panel, displayed on application start

Parameters:
panelProvider - the main application panel provider
Returns:
this application panel instance

addSupportPanelProviders

public final EntityApplicationPanel addSupportPanelProviders(EntityPanelProvider... panelProviders)
Adds support application panels, available via a support panel manu

Parameters:
panelProviders - the support application panel providers
Returns:
this application panel instance

addSupportPanelProvider

public final EntityApplicationPanel addSupportPanelProvider(EntityPanelProvider panelProvider)
Adds a support application panel, available via a support panel manu

Parameters:
panelProvider - the support application panel provider
Returns:
this application panel instance

getMainApplicationPanel

public final EntityPanel getMainApplicationPanel(String entityID)
Parameters:
entityID - the entity ID
Returns:
the main entity panel based on the given entity type, null if none is found

getMainApplicationPanels

public final List<EntityPanel> getMainApplicationPanels()
Returns:
an unmodifiable view of the main application panels

isAlwaysOnTop

public final boolean isAlwaysOnTop()
Returns:
true if the frame this application panel is shown in should be 'alwaysOnTop'

setAlwaysOnTop

public final void setAlwaysOnTop(boolean value)
fires: evtAlwaysOnTopChanged

Parameters:
value - the new value

login

public final void login()
                 throws CancelException
Performs a login, fetching user information via getUser

Throws:
CancelException - in case the login is cancelled
See Also:
getUser(String, org.jminor.common.model.User, String, javax.swing.ImageIcon)

logout

public final void logout()
Performs a logout


setLoggingLevel

public final void setLoggingLevel()
Shows a dialog for setting the logging level


viewApplicationTree

public final void viewApplicationTree()

viewDependencyTree

public final void viewDependencyTree()
Shows a dialog containing a dependency tree view of all defined entities


startApplication

public final void startApplication(String frameCaption,
                                   String iconName,
                                   boolean maximize,
                                   Dimension frameSize)
Starts this application.

Parameters:
frameCaption - the caption to display on the frame
iconName - the name of the icon to use
maximize - if true the application frame is maximized on startup
frameSize - the frame size when unmaximized

startApplication

public final void startApplication(String frameCaption,
                                   String iconName,
                                   boolean maximize,
                                   Dimension frameSize,
                                   User defaultUser)
Starts this application.

Parameters:
frameCaption - the caption to display on the frame
iconName - the name of the icon to use
maximize - if true the application frame is maximized on startup
frameSize - the frame size when unmaximized
defaultUser - the default user to display in the login dialog

startApplication

public final void startApplication(String frameCaption,
                                   String iconName,
                                   boolean maximize,
                                   Dimension frameSize,
                                   User defaultUser,
                                   boolean showFrame)
Starts this application.

Parameters:
frameCaption - the caption to display on the frame
iconName - the name of the icon to use
maximize - if true the application frame is maximized on startup
frameSize - the frame size when unmaximized
defaultUser - the default user to display in the login dialog
showFrame - if true the frame is set visible

initialize

public final void initialize(EntityConnectionProvider connectionProvider)
                      throws CancelException
Initializes this application panel

Parameters:
connectionProvider - the connection provider
Throws:
IllegalStateException - if the application model has not been set
CancelException - in case the initialization is cancelled

getMasterPanel

public final MasterDetailPanel getMasterPanel()

Specified by:
getMasterPanel in interface MasterDetailPanel
Returns:
the parent master panel, if one exists

getCurrentDetailPanel

public final MasterDetailPanel getCurrentDetailPanel()

Specified by:
getCurrentDetailPanel in interface MasterDetailPanel
Returns:
a detail panel, if one exists, which child panel exactly is up the implementation

getPreviousPanel

public final MasterDetailPanel getPreviousPanel()

Specified by:
getPreviousPanel in interface MasterDetailPanel
Returns:
the previous detail panel, if one exists, with wrap around

getNextPanel

public final MasterDetailPanel getNextPanel()

Specified by:
getNextPanel in interface MasterDetailPanel
Returns:
the nex detail panel, if one exists, with wrap around

getDetailPanels

public final List<? extends MasterDetailPanel> getDetailPanels()

Specified by:
getDetailPanels in interface MasterDetailPanel
Returns:
the detail panels, an empty list if no detail panels exist

showDetailPanel

public final void showDetailPanel(MasterDetailPanel detailPanel)
Shows the given detail panel

Specified by:
showDetailPanel in interface MasterDetailPanel
Parameters:
detailPanel - the detail panel to show

activatePanel

public final void activatePanel()
Activates this panel, showing it and preparing it for input

Specified by:
activatePanel in interface MasterDetailPanel

exit

public final void exit()
                throws CancelException
Exists this application

Throws:
CancelException - if the exit is cancelled

showHelp

public final void showHelp()
Shows a help dialog

See Also:
getHelpPanel()

showAbout

public final void showAbout()
Shows an about dialog

See Also:
getAboutPanel()

addAlwaysOnTopListener

public final void addAlwaysOnTopListener(ActionListener listener)
Parameters:
listener - a listener notified each time the always on top status changes

removeAlwaysOnTopListener

public final void removeAlwaysOnTopListener(ActionListener listener)
Parameters:
listener - the listener to remove

addApplicationStartedListener

public final void addApplicationStartedListener(ActionListener listener)
Parameters:
listener - a listener notified when to application has been successfully started

removeApplicationStartedListener

public final void removeApplicationStartedListener(ActionListener listener)
Parameters:
listener - the listener to remove

addSelectedPanelListener

public final void addSelectedPanelListener(ActionListener listener)
Parameters:
listener - a listener notified each time the selected main panel changes

removeSelectedPanelListener

public final void removeSelectedPanelListener(ActionListener listener)
Parameters:
listener - the listener to remove

getMainMenuControlSet

protected ControlSet getMainMenuControlSet()
Returns:
the control set on which to base the main menu
See Also:
getFileControlSet(), getSettingsControlSet(), getViewControlSet(), getToolsControlSet(), getHelpControlSet()

getFileControlSet

protected ControlSet getFileControlSet()
Returns:
the ControlSet specifying the items in the 'File' menu

getSettingsControlSet

protected ControlSet getSettingsControlSet()
Returns:
the ControlSet specifying the items in the 'Settings' menu

getToolsControlSet

protected ControlSet getToolsControlSet()
Returns:
the ControlSet specifying the items in the 'Tools' menu

getViewControlSet

protected ControlSet getViewControlSet()
Returns:
the ControlSet specifying the items in the 'View' menu

getHelpControlSet

protected ControlSet getHelpControlSet()
Returns:
the ControlSet specifying the items in the 'Help' menu

getHelpPanel

protected JPanel getHelpPanel()
Returns:
the panel shown when Help -> Help is selected

getHelpText

protected String getHelpText()
                      throws IOException
Returns:
the text to show in the help panel
Throws:
IOException - in case of an IO exception

getAboutPanel

protected JPanel getAboutPanel()
Returns:
the panel shown when Help -> About is selected

getEntityPanel

protected final EntityPanel getEntityPanel(Class<? extends EntityPanel> entityPanelClass)
Parameters:
entityPanelClass - the entity panel class
Returns:
the main entity panel of the given type, null if none is found

getEntityPanel

protected final EntityPanel getEntityPanel(String entityID)
Parameters:
entityID - the entity ID
Returns:
the main entity panel of the given entity type, null if none is found

initializeConnectionProvider

protected EntityConnectionProvider initializeConnectionProvider(User user,
                                                                String clientTypeID)
                                                         throws CancelException
Initializes the entity db provider

Parameters:
user - the user
clientTypeID - a string specifying the client type
Returns:
an initialized EntityConnectionProvider
Throws:
CancelException - in case the initialization is cancelled

bindEvents

protected void bindEvents()
Override to add event bindings after initialization

See Also:
initialize(org.jminor.framework.db.provider.EntityConnectionProvider)

getAdditionalMenuControlSet

protected List<ControlSet> getAdditionalMenuControlSet()
Returns:
a List of ControlSet objects which are to be added to the main menu bar

getSupportTableControlSet

protected ControlSet getSupportTableControlSet()
Returns:
the ControlSet on which the Support Tables menu item is based on

showEntityPanelDialog

protected final void showEntityPanelDialog(EntityPanelProvider panelProvider)
Shows a dialog containing the entity panel provided by the given panel provider

Parameters:
panelProvider - the entity panel provider

showEntityPanelDialog

protected final void showEntityPanelDialog(EntityPanelProvider panelProvider,
                                           boolean modalDialog)
Shows a dialog containing the entity panel provided by the given panel provider

Parameters:
panelProvider - the entity panel provider
modalDialog - if true the dialog is made modal

getNorthToolBar

protected JToolBar getNorthToolBar()
Returns:
a JToolBar instance to show in the NORTH position

initializeUI

protected void initializeUI()
Initializes this EntityApplicationPanel


isLoginRequired

protected final boolean isLoginRequired()
Returns:
true if a login dialog is required for this application, false if the user is supplied differently

setLoginRequired

protected final void setLoginRequired(boolean loginRequired)
Sets wheteher or not this application requires a login dialog

Parameters:
loginRequired - the login required status

isShowStartupDialog

protected final boolean isShowStartupDialog()
Returns:
true if a startup dialog should be shown

setShowStartupDialog

protected final void setShowStartupDialog(boolean startupDialog)
Parameters:
startupDialog - true if a startup dialog should be shown

getDefaultLookAndFeelClassName

protected String getDefaultLookAndFeelClassName()
Returns:
the look and feel class name to use
See Also:
Configuration.DEFAULT_LOOK_AND_FEEL_CLASSNAME

initializeSouthPanel

protected JPanel initializeSouthPanel()
Initializes a panel to show in the SOUTH position of this application frame, override to provide a south panel.

Returns:
a panel for the SOUTH position

initializeStartupDialog

protected final JDialog initializeStartupDialog(Icon icon,
                                                String startupMessage)
Initializes the startup dialog

Parameters:
icon - the icon
startupMessage - the startup message
Returns:
the startup dialog
See Also:
initializeStartupProgressPanel(javax.swing.Icon)

initializeStartupProgressPanel

protected JPanel initializeStartupProgressPanel(Icon icon)
Initializes the progress panel to show in the startup dialog

Parameters:
icon - the icon
Returns:
an initialized startup progress panel

getFrameTitle

protected String getFrameTitle(String frameCaption,
                               User user)
Parameters:
frameCaption - the caption for the frame
user - the user
Returns:
a frame title based on the caption and user information

prepareFrame

protected final JFrame prepareFrame(String title,
                                    boolean maximize,
                                    boolean showMenuBar,
                                    Dimension size,
                                    ImageIcon applicationIcon,
                                    boolean setVisible)
Initializes a JFrame according to the given parameters, containing this EntityApplicationPanel

Parameters:
title - the title string for the JFrame
maximize - if true then the JFrame is maximized, overrides the prefSeizeAsRatioOfScreen parameter
showMenuBar - true if a menubar should be created
size - if the JFrame is not maximized then it's preferredSize is set to this value
applicationIcon - the application icon
setVisible - if true then the JFrame is set visible
Returns:
an initialized, but non-visible JFrame
See Also:
getNorthToolBar()

createMenuBar

protected final JMenuBar createMenuBar()
Returns:
a JMenuBar based on the main menu control set
See Also:
getMainMenuControlSet()

setUncaughtExceptionHandler

protected void setUncaughtExceptionHandler()
Sets the uncaught exception handler, override to add specific uncaught exception handling


initializeApplicationModel

protected abstract EntityApplicationModel initializeApplicationModel(EntityConnectionProvider connectionProvider)
                                                              throws CancelException
Initializes the application model

Parameters:
connectionProvider - the db provider
Returns:
an initialized application model
Throws:
CancelException - in case the initialization is cancelled

getUser

protected User getUser(String frameCaption,
                       User defaultUser,
                       String applicationIdentifier,
                       ImageIcon applicationIcon)
                throws CancelException
Returns the user, either via a login dialog or via override, called during startup

Parameters:
frameCaption - the application frame caption
defaultUser - the default user
applicationIdentifier - the application identifier
applicationIcon - the application icon
Returns:
the application user
Throws:
CancelException - in case a login dialog is cancelled

saveDefaultUser

protected void saveDefaultUser(User user)
Saves the user info so that it can be used as default the next time this application is started. This default implementation saves the username in the user preferences.

Parameters:
user - the user

savePreferences

protected void savePreferences()
Called during the exit() method, override to save user preferences on program exit