MainApplication(java.util.Hashtable params)
MainApplication configuration parameters:
parameter value
title
Main application window title.
|
Method Summary |
void |
addApplicationListener(ApplicationListener applicationListener)
Adds an ApplicationListener to the application. |
void |
addMouseListenerToStatusIcon(java.lang.String iconId,
java.awt.event.MouseListener mouseListener)
Adds a mouse listener to the component with the specified icon. |
void |
addStatusBarIcon(java.lang.String iconId,
javax.swing.ImageIcon icon)
Adds a status bar. |
protected void |
buildTray()
|
void |
centerOnScreen()
Centers the frame in the screen |
static boolean |
checkApplicationPermission(java.lang.String permissionName)
Check an ApplicationPermission using the ClientSecurityManager. |
protected ILoginDialog |
createLoginDialog()
Creates the login dialog |
protected java.awt.PopupMenu |
createTrayContextualMenu(java.lang.String sTitle)
|
void |
deactivatedRememberLastPassword()
Turns off the feature of remembering the last password, so the next time
the application is launched, it will ask for a new password. |
void |
endSession()
Ends the user session. |
void |
exit()
Closes the client application. |
protected boolean |
fireApplicationExiting()
Notifies all the ApplicationListener that the application will be
closed. |
java.lang.String |
getActiveFMName()
Returns the form manager name that is active(shown) |
Form |
getActiveForm()
|
java.lang.String |
getDatabaseBundleName()
|
FormManager |
getFormManager(java.lang.String idPanel)
Provides a reference to a FormManager. |
java.awt.Frame |
getFrame()
Returns the frame in which the application is placed. |
java.lang.String |
getIcon()
|
java.util.Locale |
getLocale()
Returns the current application locale. |
javax.swing.JMenuBar |
getMenu()
Provides a reference to the application menu bar. |
MenuListener |
getMenuListener()
Provides a reference to the class that listens the
menu events. |
java.lang.String |
getName()
Return the application name. |
ApplicationPreferences |
getPreferences()
Returns the application preferences. |
protected javax.swing.KeyStroke |
getPreferredKeyStroke(ApplicationPreferences preferences,
java.lang.String user,
java.lang.String keyName,
javax.swing.KeyStroke defaultKeyStroke)
|
EntityReferenceLocator |
getReferenceLocator()
Get the client application reference locator |
java.util.ResourceBundle |
getResourceBundle()
Returns the current application resource bundle. |
java.lang.String |
getResourcesFileName()
|
MainApplication.StatusBar |
getStatusBar()
|
int |
getStatusBarPercentComplete()
Get the current value in the component that shows the complete action
percent value in the status bar |
java.util.Vector |
getTextsToTranslate()
Returns all the texts in the element suitable for being translated. |
javax.swing.JToolBar |
getToolBar()
Provides a reference to the tool bar |
ToolBarListener |
getToolBarListener()
Provides a reference to the buttons bar listener. |
protected java.lang.String |
getUser()
Returns the login name of the application user. |
protected void |
hideSplash()
Hides the splash (loading application window). |
protected void |
init(java.util.Hashtable params)
Configure the parameters of the xml file |
protected void |
initPreloginPreferences()
Start the preferences before showing the login window. |
protected void |
initStaticPreferences()
Starts the static preferences, just like the font size, the application
look and feel and the language. |
void |
installJGoodiesTheme(java.lang.String theme)
Deprecated. |
boolean |
isActiveApplication()
Return true if the application frame is active |
boolean |
isLocked()
|
boolean |
isRememberLastPasswordEnabled()
Determines weather the feature of remembering the password between sessions
is enabled in the local machine. |
boolean |
isStatusBarVisible()
Returns the status bar visibility. |
boolean |
isToolBarVisible()
Returns the buttons bar visibility status |
ApplicationPreferences |
loadApplicationPreferences()
Loads the application preferences. |
void |
lock()
Locks the application without closing it. |
boolean |
login()
Shows the login dialog. |
void |
maximize()
|
void |
message(java.lang.String message,
int type)
|
protected void |
processKeyEvent(java.awt.event.KeyEvent e)
|
protected void |
processWindowEvent(java.awt.event.WindowEvent e)
|
void |
registerExtOpThreadsMonitor(ApplicationManager.ExtOpThreadsMonitor op)
Sets a ExtOpThreadsMonitor to the application. |
void |
registerFormManager(java.lang.String formManagerName,
FormManager formManager)
Adds a FormManager to the application. |
protected void |
registerKeyBindings()
Registers the key strokes for the application.
|
void |
registerStatusComponent(StatusComponent statusComponent)
Registers the StatusComponent. |
void |
removeApplicationListener(ApplicationListener applicationListener)
Removes the specified ApplicationListener |
FormManager |
removeFormManagerComponent(java.lang.String formManager)
Removes the specified FormManager from the window hierarchy, but maintains
the FormManager reference. |
protected void |
removeFromTray()
Removes the application short cut from the system tray (windows). |
protected void |
removeIconFromSystemTray()
|
void |
removeMouseListenerFromStatusIcon(java.lang.String iconId,
java.awt.event.MouseListener mouseListener)
Removes the mouse listener from the specified icon |
void |
removeStatusBarIcon(java.lang.String iconId)
Removes an icon from the status bar |
void |
saveTextsToTranslate(java.lang.String file,
java.util.Properties importProp)
Creates a file with all the text in the application that must be
translated |
boolean |
sendToTray()
Minimizes the application and sends it to the tray bar. |
protected boolean |
sendToTrayUsingSysTrayLibrary()
|
void |
setApplicationFont(java.awt.Font font)
Changes the application font. |
protected void |
setApplicationFont(java.awt.Font font,
boolean savePrefs)
Sets an application font and saves that configuration in the preferences. |
void |
setComponentLocale(java.util.Locale l)
|
void |
setInitialSize()
Sets the initial application window size to its preferred size. |
void |
setInitialState()
Sets the initial application state. |
void |
setKeyBinding(java.lang.String key,
javax.swing.KeyStroke keyStroke,
javax.swing.Action action,
javax.swing.InputMap inMap,
javax.swing.ActionMap actMap,
boolean isConfigurable)
|
void |
setLookAndFeel(java.lang.String className)
Sets the application look and feel. |
void |
setMenu(javax.swing.JMenuBar jMenuBar)
Sets a menu bar to the application. |
void |
setMenuListener(MenuListener l)
Sets the application menu listener |
protected void |
setPermission()
Sets the client permissions. |
void |
setReferencesLocator(EntityReferenceLocator locator)
Sets the application references locator. |
void |
setResourceBundle(java.util.ResourceBundle resources)
Sets the language resource bundle. |
void |
setStatusBarIconToolTip(java.lang.String iconId,
java.lang.String tip)
Sets the tool tip for the status bar icon identified by 'iconId'. |
void |
setStatusBarIconToolTip(java.lang.String iconId,
java.lang.String tip,
boolean translate)
Sets the tool tip for the status bar icon identified by 'iconId'. |
void |
setStatusBarProgressMaximum(int maximum)
Sets the maximum value for the progress bar. |
void |
setStatusBarProgressPosition(int currentPosition)
Sets the progress bar current value |
void |
setStatusBarProgressPosition(int p,
boolean paintImmediately)
Deprecated. |
void |
setStatusBarProgressText(java.lang.String text)
Sets the status bar progress text |
void |
setStatusBarProgressText(java.lang.String text,
boolean translate)
Sets the status bar progress text, optionally translated. |
void |
setStatusBarText(java.lang.String statusBarText)
Sets the status bar text, translated. |
void |
setStatusBarVisible(boolean visible)
Sets the visibility of the status bar, if any. |
void |
setTitle(java.lang.String title)
|
void |
setTitleKey(java.lang.String titleKey)
Sets the title key for this frame. |
void |
setToolBar(javax.swing.JToolBar applicationToolBar)
Sets the application tool bar. |
void |
setToolBarListener(ToolBarListener toolBarListener)
Sets the buttons bar listener. |
void |
setToolBarVisible(boolean visible)
Determines the visibility status of the application buttons bar. |
void |
setVisible(boolean vis)
Sets the application window visible, only once the login has been done
successfully. |
void |
show()
Sets the application window visible, only once the login has been done
successfully. |
void |
show(boolean show)
Sets the application window visible, only once the login has been done
successfully. |
void |
showApplication()
Sets the application window visible, only once the login has been done
successfully. |
void |
showFormManagerContainer(java.lang.String idPanel)
Shows a form manager. |
protected void |
showSplash()
Shows the loading application window (splash). |
void |
unregisterStatusComponent(StatusComponent statusComponent)
Unregister the status component. |
| Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
| Methods inherited from class java.awt.Frame |
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setUndecorated |
| Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
DATABASE_BUNDLE_MANAGER
public static final java.lang.String DATABASE_BUNDLE_MANAGER
- See Also:
- Constant Field Values
APP_LOCALE
public static final java.lang.String APP_LOCALE
- See Also:
- Constant Field Values
APP_CONNECT_TO
public static final java.lang.String APP_CONNECT_TO
- See Also:
- Constant Field Values
APP_WINDOW_POSITION
public static final java.lang.String APP_WINDOW_POSITION
- See Also:
- Constant Field Values
APP_WINDOW_STATE
public static final java.lang.String APP_WINDOW_STATE
- See Also:
- Constant Field Values
APP_WINDOW_SIZE
public static final java.lang.String APP_WINDOW_SIZE
- See Also:
- Constant Field Values
APP_STATUS_BAR_VISIBLE
public static final java.lang.String APP_STATUS_BAR_VISIBLE
- See Also:
- Constant Field Values
APP_TOOL_BAR_VISIBLE
public static final java.lang.String APP_TOOL_BAR_VISIBLE
- See Also:
- Constant Field Values
APP_FONTSIZE
public static final java.lang.String APP_FONTSIZE
- See Also:
- Constant Field Values
APP_REMEMBER_LAST_LOGIN
public static final java.lang.String APP_REMEMBER_LAST_LOGIN
- See Also:
- Constant Field Values
APP_LAST_LOGIN
public static final java.lang.String APP_LAST_LOGIN
- See Also:
- Constant Field Values
APP_REMEMBER_LAST_PASSWORD
public static final java.lang.String APP_REMEMBER_LAST_PASSWORD
- See Also:
- Constant Field Values
APP_LAST_PASSWORD
public static final java.lang.String APP_LAST_PASSWORD
- See Also:
- Constant Field Values
APP_USER_DIR
public static final java.lang.String APP_USER_DIR
- See Also:
- Constant Field Values
LOOK_AND_FEEL_CLASS_NAME
public static final java.lang.String LOOK_AND_FEEL_CLASS_NAME
- See Also:
- Constant Field Values
THEME_CLASS_NAME
public static final java.lang.String THEME_CLASS_NAME
- See Also:
- Constant Field Values
M_SYSTEM_HAS_NOT_CONNECTION_NETWORK
public static final java.lang.String M_SYSTEM_HAS_NOT_CONNECTION_NETWORK
- See Also:
- Constant Field Values
M_SYSTEM_HAS_NOT_CONNECTION_NETWORK_es_ES
public static final java.lang.String M_SYSTEM_HAS_NOT_CONNECTION_NETWORK_es_ES
- See Also:
- Constant Field Values
APP_TOOLBAR_LOCATION
public static final java.lang.String APP_TOOLBAR_LOCATION
- See Also:
- Constant Field Values
APP_FONTNAME
public static final java.lang.String APP_FONTNAME
- See Also:
- Constant Field Values
LOGIN_DIALOG_CLASS
public static final java.lang.String LOGIN_DIALOG_CLASS
- See Also:
- Constant Field Values
loginDialogClass
protected java.lang.String loginDialogClass
windowListener
protected java.awt.event.WindowAdapter windowListener
BEGIN_SESSION_CORRECTLY
public static java.lang.String BEGIN_SESSION_CORRECTLY
FORMS_MANAGER_CREATED
public static java.lang.String FORMS_MANAGER_CREATED
REGISTER_FORMS_MANAGER
public static java.lang.String REGISTER_FORMS_MANAGER
APPLICATION_MENU_SET
public static java.lang.String APPLICATION_MENU_SET
APPLICATION_MENU_CONFIGURED
public static java.lang.String APPLICATION_MENU_CONFIGURED
BEGIN_SESSION_CORRECTLY_es_ES
public static java.lang.String BEGIN_SESSION_CORRECTLY_es_ES
FORMS_MANAGER_CREATED_es_ES
public static java.lang.String FORMS_MANAGER_CREATED_es_ES
REGISTER_FORMS_MANAGER_es_ES
public static java.lang.String REGISTER_FORMS_MANAGER_es_ES
APPLICATION_MENU_SET_es_ES
public static java.lang.String APPLICATION_MENU_SET_es_ES
APPLICATION_MENU_CONFIGURED_es_ES
public static java.lang.String APPLICATION_MENU_CONFIGURED_es_ES
cardLayout
protected java.awt.CardLayout cardLayout
- From managers layout
panelIds
protected java.util.Vector panelIds
formsManagers
protected java.util.Hashtable formsManagers
locator
protected EntityReferenceLocator locator
resources
protected java.util.ResourceBundle resources
loggedIn
protected boolean loggedIn
keyTitle
protected java.lang.String keyTitle
menu
protected javax.swing.JMenuBar menu
splashImage
protected javax.swing.ImageIcon splashImage
splashImage2
protected javax.swing.ImageIcon splashImage2
timeSplash
protected int timeSplash
frameNumber
protected int frameNumber
currentPassword
protected java.lang.String currentPassword
locale
protected java.util.Locale locale
menuListener
protected MenuListener menuListener
iconString
protected java.lang.String iconString
toolBarListener
protected ToolBarListener toolBarListener
toolBar
protected javax.swing.JToolBar toolBar
helpSet
protected java.lang.String helpSet
rememberLastLogin
protected boolean rememberLastLogin
rememberLastPassword
protected boolean rememberLastPassword
allowRememberPassword
protected boolean allowRememberPassword
databaseBundleManagerName
protected java.lang.String databaseBundleManagerName
lastLogin
protected java.lang.String lastLogin
lastPassword
protected java.lang.String lastPassword
loginIcon
protected java.lang.String loginIcon
loginText
protected java.lang.String loginText
panelCardLayout
protected javax.swing.JPanel panelCardLayout
panelAuxCardLayout
protected javax.swing.JPanel panelAuxCardLayout
connectTo
protected java.lang.String connectTo
informWhenOffline
protected boolean informWhenOffline
showDNSOptions
protected boolean showDNSOptions
statusListener
protected MainApplication.StatusListener statusListener
preferenceFile
protected java.lang.String preferenceFile
preferences
protected ApplicationPreferences preferences
loadRemotePreferences
protected boolean loadRemotePreferences
formsManagerActive
protected java.lang.String formsManagerActive
tLogin
protected long tLogin
resourcesFileName
protected java.lang.String resourcesFileName
exitListeners
protected java.util.Vector exitListeners
statusBar
protected MainApplication.StatusBar statusBar
labelFileURI
protected java.lang.String labelFileURI
packageName
protected java.lang.String packageName
toolBarIcon
protected java.lang.Object toolBarIcon
trayIcon
protected java.lang.Object trayIcon
name
protected java.lang.String name
NORMAL_VIEW
protected static final java.lang.String NORMAL_VIEW
- See Also:
- Constant Field Values
MAXIMIZE_VIEW
protected static final java.lang.String MAXIMIZE_VIEW
- See Also:
- Constant Field Values
centerPanel
protected javax.swing.JPanel centerPanel
stateFrame
protected int stateFrame
formMaximize
protected Form formMaximize
maximize
protected boolean maximize
defaultApplicationKeyBindings
protected java.util.List defaultApplicationKeyBindings
MainApplication
public MainApplication(java.util.Hashtable params)
- MainApplication configuration parameters:
| parameter | value |
| title |
Main application window title. The value will be the
key of the text, which will be translated using the application bundle.
|
| databasebundlemanager |
The name of registered remote object that manages functionality of database bundle.
|
| locale |
initial application locale |
| resources | resource bundle. Package pointing to the file which
contains the application bundle resources. It is the name of the file with
no locale information, that is, with no locale sufix. For example,
com.business.project.client.i18n.bundle |
| splash | Image or images to show during the login process. The
image path must be passed, for example,
com/business/project/client/images/login.png. Up to two images can be
shown, separated t milliseconds, configuring the splash value as follows:
'pathimage1;pathimage2;t' |
| icon | Application windows icon |
| loginicon | login window image |
| logindialogclass | Class that will be used for creating the login dialog. Not required. |
| logintext | login window header text |
| encrypt | determines whether the password is encrypted in the
login window or not. Possible values 'yes'/'no? The default value is 'no'.
The password is used afterwards in the login process. |
| preferences | Application preferences file name, only the name
without complete path. The file will be created in the user home path.
Example, 'application:name.conf' |
| helpset | Helpset file package path, for example,
com.business.product.client.gui.help. This file will be merged with the
one that contains the basic components help. |
| showdnsoptions | Indicates whether the connection selection
combo must be shown, when a name conversion is defined (FQDN) and the
client is in the private network. The default value is 'yes' |
| allowrememberpassword | Show the option of remembering the
password between session starts. |
| status | Indicates whether the application has status bar or
not. By default, 'yes' |
| name | Application name |
- Parameters:
params - the configuration parameters
isActiveApplication
public boolean isActiveApplication()
- Return true if the application frame is active
- Returns:
getStatusBar
public MainApplication.StatusBar getStatusBar()
getDatabaseBundleName
public java.lang.String getDatabaseBundleName()
processKeyEvent
protected void processKeyEvent(java.awt.event.KeyEvent e)
init
protected void init(java.util.Hashtable params)
- Configure the parameters of the xml file
- Parameters:
params -
setReferencesLocator
public void setReferencesLocator(EntityReferenceLocator locator)
- Sets the application references locator. This method calls
initPreloginPreferences() and after that the login()
method. If case the login is successful, the
initStaticPreferences() and the setPermission() are also
called and in the specified order. Finally, the loading application window
is shown. This method must be called only once.
- Specified by:
setReferencesLocator in interface Application
- Parameters:
locator - the EntityReferenceLocator for the application.
setMenu
public void setMenu(javax.swing.JMenuBar jMenuBar)
- Description copied from interface:
Application
- Sets a menu bar to the application.
- Specified by:
setMenu in interface Application
- Parameters:
jMenuBar - the menu bar- See Also:
ApplicationMenuBar
showFormManagerContainer
public void showFormManagerContainer(java.lang.String idPanel)
- Description copied from interface:
Application
- Shows a form manager.
- Specified by:
showFormManagerContainer in interface Application
- Parameters:
idPanel - the name of the FormManager to show.
getFormManager
public FormManager getFormManager(java.lang.String idPanel)
- Description copied from interface:
Application
- Provides a reference to a FormManager.
- Specified by:
getFormManager in interface Application
- Parameters:
idPanel - the name of the FormManager
- Returns:
- the FormManager or null in case that FormManager does not exist.
removeFormManagerComponent
public FormManager removeFormManagerComponent(java.lang.String formManager)
- Removes the specified FormManager from the window hierarchy, but maintains
the FormManager reference. In that way, the form manager can be added to
other container.
- Parameters:
formManager -
- Returns:
- the removed form manager or null in case no form manager found
registerFormManager
public void registerFormManager(java.lang.String formManagerName,
FormManager formManager)
- Description copied from interface:
Application
- Adds a FormManager to the application.
- Specified by:
registerFormManager in interface Application
- Parameters:
formManagerName - the FormManager classformManager - the name that will be use to register and reference the FormManager
centerOnScreen
public void centerOnScreen()
- Centers the frame in the screen
getFrame
public java.awt.Frame getFrame()
- Description copied from interface:
Application
- Returns the frame in which the application is placed.
- Specified by:
getFrame in interface Application
getIcon
public java.lang.String getIcon()
show
public void show()
- Sets the application window visible, only once the login has been done
successfully. In any other case, this method will do nothing. The
following calls are also done:
- setInitialSize()
- centerOnScreen()
- setInitialState()
- hideSplash()
- Specified by:
show in interface Application
setInitialSize
public void setInitialSize()
- Sets the initial application window size to its preferred size.
show
public void show(boolean show)
- Sets the application window visible, only once the login has been done
successfully. In any other case, this method will do nothing. The
following calls are also done:
- setInitialSize()
- centerOnScreen()
- setInitialState()
- hideSplash()
- Parameters:
show - if true the application is shown; hidden if false.
setVisible
public void setVisible(boolean vis)
- Sets the application window visible, only once the login has been done
successfully. In any other case, this method will do nothing. The
following calls are also done:
- setInitialSize()
- centerOnScreen()
- setInitialState()
- hideSplash()
createLoginDialog
protected ILoginDialog createLoginDialog()
- Creates the login dialog
- Returns:
- the login dialog
login
public boolean login()
- Shows the login dialog. If user is already log in then this method does
nothing
- Specified by:
login in interface Application
exit
public void exit()
- Closes the client application. Notifies all the listeners and then close it.
If some listener does not validate the exit action then application does not finish.
Saves the user preferences and close the remote session
- Specified by:
exit in interface Application
processWindowEvent
protected void processWindowEvent(java.awt.event.WindowEvent e)
getTextsToTranslate
public java.util.Vector getTextsToTranslate()
- Description copied from interface:
Internationalization
- Returns all the texts in the element suitable for being translated.
- Specified by:
getTextsToTranslate in interface Internationalization
- Returns:
- all the texts in the element suitable for being translated.
saveTextsToTranslate
public void saveTextsToTranslate(java.lang.String file,
java.util.Properties importProp)
- Creates a file with all the text in the application that must be
translated
- Parameters:
file - the destiny fileimportProp -
setResourceBundle
public void setResourceBundle(java.util.ResourceBundle resources)
- Description copied from interface:
Internationalization
- Sets the language resource bundle. When the application changes the
configured language, for all the objects that implement this interface
this method must be called with the new file.
The method must translate all the elements that have texts in the GUI
- Specified by:
setResourceBundle in interface Internationalization
- Parameters:
resources - the new language bundle.
getUser
protected java.lang.String getUser()
- Returns the login name of the application user.
- Returns:
- the user name
setComponentLocale
public void setComponentLocale(java.util.Locale l)
- Specified by:
setComponentLocale in interface Internationalization
showSplash
protected void showSplash()
- Shows the loading application window (splash).
hideSplash
protected void hideSplash()
- Hides the splash (loading application window).
showApplication
public void showApplication()
- Sets the application window visible, only once the login has been done
successfully. In any other case, this method will do nothing. The
following calls are also done:
- setInitialSize()
- centerOnScreen()
- setInitialState()
- hideSplash()
lock
public void lock()
- Description copied from interface:
Application
- Locks the application without closing it.
- Specified by:
lock in interface Application
isLocked
public boolean isLocked()
getReferenceLocator
public EntityReferenceLocator getReferenceLocator()
- Get the client application reference locator
- Specified by:
getReferenceLocator in interface Application
- Returns:
endSession
public void endSession()
- Description copied from interface:
Application
- Ends the user session.
- Specified by:
endSession in interface Application
setPermission
protected void setPermission()
throws java.lang.Exception
- Sets the client permissions. To do that calls the
ClientPermissionManager.installClientPermissions(Hashtable, int)
with the current user and the current password.
- Throws:
java.lang.Exception
getLocale
public java.util.Locale getLocale()
- Description copied from interface:
Application
- Returns the current application locale.
- Specified by:
getLocale in interface Application
getResourceBundle
public java.util.ResourceBundle getResourceBundle()
- Description copied from interface:
Application
- Returns the current application resource bundle.
- Specified by:
getResourceBundle in interface Application
- Returns:
- the current application resource bundle
message
public void message(java.lang.String message,
int type)
addApplicationListener
public void addApplicationListener(ApplicationListener applicationListener)
- Adds an ApplicationListener to the application.
- Parameters:
applicationListener - a new application listener
removeApplicationListener
public void removeApplicationListener(ApplicationListener applicationListener)
- Removes the specified ApplicationListener
- Parameters:
applicationListener -
fireApplicationExiting
protected boolean fireApplicationExiting()
- Notifies all the
ApplicationListener that the application will be
closed.
- Returns:
getActiveFMName
public java.lang.String getActiveFMName()
- Returns the form manager name that is active(shown)
- Returns:
getActiveForm
public Form getActiveForm()
getMenu
public javax.swing.JMenuBar getMenu()
- Description copied from interface:
Application
- Provides a reference to the application menu bar.
- Specified by:
getMenu in interface Application
- Returns:
- the application menu bar
setMenuListener
public void setMenuListener(MenuListener l)
- Description copied from interface:
Application
- Sets the application menu listener
- Specified by:
setMenuListener in interface Application
- Parameters:
l - the application menu listener
getMenuListener
public MenuListener getMenuListener()
- Description copied from interface:
Application
- Provides a reference to the class that listens the
menu events.
- Specified by:
getMenuListener in interface Application
- Returns:
- the application menu listener
getResourcesFileName
public java.lang.String getResourcesFileName()
getPreferences
public ApplicationPreferences getPreferences()
- Description copied from interface:
Application
- Returns the application preferences.
- Specified by:
getPreferences in interface Application
- Returns:
- the preferences for the application
loadApplicationPreferences
public ApplicationPreferences loadApplicationPreferences()
- Loads the application preferences.
- Returns:
- Application preferences or null if 'preferences' parameter is not
specified
initPreloginPreferences
protected void initPreloginPreferences()
- Start the preferences before showing the login window. These preferences
are:
-Remember last login
-Remember password
initStaticPreferences
protected void initStaticPreferences()
- Starts the static preferences, just like the font size, the application
look and feel and the language.
setApplicationFont
protected void setApplicationFont(java.awt.Font font,
boolean savePrefs)
- Sets an application font and saves that configuration in the preferences.
- Parameters:
font - savePrefs - if true, the new font configuration will be saved to preferences
setApplicationFont
public void setApplicationFont(java.awt.Font font)
- Changes the application font.
- Parameters:
font -
setInitialState
public void setInitialState()
- Sets the initial application state. In this case, the main application
preferences will be also loaded.
setStatusBarText
public void setStatusBarText(java.lang.String statusBarText)
- Sets the status bar text, translated.
- Specified by:
setStatusBarText in interface Application
- Parameters:
statusBarText -
addStatusBarIcon
public void addStatusBarIcon(java.lang.String iconId,
javax.swing.ImageIcon icon)
- Adds a status bar.
- Parameters:
iconId - the name that the icon will have for the applicationicon - the image to be displayed
removeStatusBarIcon
public void removeStatusBarIcon(java.lang.String iconId)
- Removes an icon from the status bar
- Parameters:
iconId - the icon identifier
setStatusBarIconToolTip
public void setStatusBarIconToolTip(java.lang.String iconId,
java.lang.String tip)
- Sets the tool tip for the status bar icon identified by 'iconId'. The text
is not translated.
- Parameters:
iconId - tip -
setStatusBarIconToolTip
public void setStatusBarIconToolTip(java.lang.String iconId,
java.lang.String tip,
boolean translate)
- Sets the tool tip for the status bar icon identified by 'iconId'.
- Parameters:
iconId - tip - translate - if true, the text is translated
getStatusBarPercentComplete
public int getStatusBarPercentComplete()
- Get the current value in the component that shows the complete action
percent value in the status bar
- Returns:
setStatusBarProgressMaximum
public void setStatusBarProgressMaximum(int maximum)
- Sets the maximum value for the progress bar.
- Parameters:
maximum -
setStatusBarProgressPosition
public void setStatusBarProgressPosition(int currentPosition)
- Sets the progress bar current value
- Parameters:
currentPosition -
setStatusBarProgressPosition
public void setStatusBarProgressPosition(int p,
boolean paintImmediately)
- Deprecated.
- Sets the progress bar current value
- Parameters:
p - paintImmediately - .
setStatusBarProgressText
public void setStatusBarProgressText(java.lang.String text)
- Sets the status bar progress text
- Parameters:
text -
setStatusBarProgressText
public void setStatusBarProgressText(java.lang.String text,
boolean translate)
- Sets the status bar progress text, optionally translated.
- Parameters:
text - translate - if true, the text will be translated
registerStatusComponent
public void registerStatusComponent(StatusComponent statusComponent)
- Registers the
StatusComponent. A mouse listener is added to the
component so the component help text can be shown in the status bar when
the mouse passes over it.
- Specified by:
registerStatusComponent in interface Application
- Parameters:
statusComponent - the component
unregisterStatusComponent
public void unregisterStatusComponent(StatusComponent statusComponent)
- Unregister the status component. The mouse listener added when the
registration process is removed as well.
- Specified by:
unregisterStatusComponent in interface Application
- Parameters:
statusComponent - the component
addMouseListenerToStatusIcon
public void addMouseListenerToStatusIcon(java.lang.String iconId,
java.awt.event.MouseListener mouseListener)
- Adds a mouse listener to the component with the specified icon.
- Parameters:
iconId - the identification of the component to be added an iconmouseListener -
removeMouseListenerFromStatusIcon
public void removeMouseListenerFromStatusIcon(java.lang.String iconId,
java.awt.event.MouseListener mouseListener)
- Removes the mouse listener from the specified icon
- Parameters:
iconId - the identification of the component of which the listener will
be removedmouseListener -
setStatusBarVisible
public void setStatusBarVisible(boolean visible)
- Sets the visibility of the status bar, if any. In case a preferences file
has been established to the application, the status bar preference will be
set.
- Parameters:
visible -
isStatusBarVisible
public boolean isStatusBarVisible()
- Returns the status bar visibility.
- Returns:
- true when the status bar exists and is visible
setToolBarVisible
public void setToolBarVisible(boolean visible)
- Determines the visibility status of the application buttons bar.
- Parameters:
visible -
isToolBarVisible
public boolean isToolBarVisible()
- Returns the buttons bar visibility status
- Returns:
- true when the buttons bar exists and is visible
setToolBarListener
public void setToolBarListener(ToolBarListener toolBarListener)
- Sets the buttons bar listener.
- Specified by:
setToolBarListener in interface Application
- Parameters:
toolBarListener -
getToolBarListener
public ToolBarListener getToolBarListener()
- Provides a reference to the buttons bar listener.
- Specified by:
getToolBarListener in interface Application
- Returns:
- the buttons bar listener or null if it does not exist
getToolBar
public javax.swing.JToolBar getToolBar()
- Provides a reference to the tool bar
- Specified by:
getToolBar in interface Application
- Returns:
- the toll bar or null if it does not exist
setTitle
public void setTitle(java.lang.String title)
checkApplicationPermission
public static boolean checkApplicationPermission(java.lang.String permissionName)
- Check an ApplicationPermission using the ClientSecurityManager.
Permissions can be specified like the following examples:
<APPLICATION>
<ToolbarPermission restricted="yes" />
<StatusbarPermission restricted="yes" />
</APPLICATION>
- Parameters:
permissionName - The permission name like ToolbarPermission or StatusbarPermission
- Returns:
setToolBar
public void setToolBar(javax.swing.JToolBar applicationToolBar)
- Sets the application tool bar. The tool bar is placed by default in the
north part of the window, or under the preferences values for the tool
bar.
- Specified by:
setToolBar in interface Application
- Parameters:
applicationToolBar - the application tool bar- See Also:
ApplicationToolBar
setTitleKey
public void setTitleKey(java.lang.String titleKey)
- Sets the title key for this frame. The value in the client application
will be the translation of the key according to the application locale.
- Parameters:
titleKey -
registerKeyBindings
protected void registerKeyBindings()
- Registers the key strokes for the application.
| keystroke | function |
| space bar + meta + control + shift | Show the client help
windows |
| F12 + meta + control + shift | saves the language file |
| return + meta + control + shift | shows system information |
| p + control + shift | application preferences |
| l + control + shift | license server |
| v + control + shift | ontimize version |
| t + control + shift | license text |
| '+' + control | maximize / minimize when maximized |
| 'c' + control + shift | shows the form cache viewer |
maximize
public void maximize()
getPreferredKeyStroke
protected javax.swing.KeyStroke getPreferredKeyStroke(ApplicationPreferences preferences,
java.lang.String user,
java.lang.String keyName,
javax.swing.KeyStroke defaultKeyStroke)
setKeyBinding
public void setKeyBinding(java.lang.String key,
javax.swing.KeyStroke keyStroke,
javax.swing.Action action,
javax.swing.InputMap inMap,
javax.swing.ActionMap actMap,
boolean isConfigurable)
setLookAndFeel
public void setLookAndFeel(java.lang.String className)
- Sets the application look and feel. In case look and feel preferences
exist, the corresponding preference will be updated.
- Parameters:
className - the application look and feel class- See Also:
ApplicationManager.setLookAndFeel(com.ontimize.gui.Application, javax.swing.LookAndFeel)
registerExtOpThreadsMonitor
public void registerExtOpThreadsMonitor(ApplicationManager.ExtOpThreadsMonitor op)
- Sets a ExtOpThreadsMonitor to the application. Users can see this monitor
using the status bar icon on the right.
- Parameters:
op - the operation thread monitor
deactivatedRememberLastPassword
public void deactivatedRememberLastPassword()
- Turns off the feature of remembering the last password, so the next time
the application is launched, it will ask for a new password.
isRememberLastPasswordEnabled
public boolean isRememberLastPasswordEnabled()
- Determines weather the feature of remembering the password between sessions
is enabled in the local machine.
- Returns:
- true if the password is being remembered
sendToTray
public boolean sendToTray()
- Minimizes the application and sends it to the tray bar. In windows
machines and with a version of java previous to 1.6 in order to work
properly, the systray java library and also the dll that perform the
minimization must be in the application's path.
- Returns:
- true if the application was minimized successfully
buildTray
protected void buildTray()
createTrayContextualMenu
protected java.awt.PopupMenu createTrayContextualMenu(java.lang.String sTitle)
removeIconFromSystemTray
protected void removeIconFromSystemTray()
throws java.lang.Throwable
- Throws:
java.lang.Throwable
sendToTrayUsingSysTrayLibrary
protected boolean sendToTrayUsingSysTrayLibrary()
removeFromTray
protected void removeFromTray()
- Removes the application short cut from the system tray (windows).
installJGoodiesTheme
public void installJGoodiesTheme(java.lang.String theme)
- Deprecated.
- Installs the JGoodies theme.
- Parameters:
theme -
getName
public java.lang.String getName()
- Return the application name.
- Specified by:
getName in interface Application
|