MainApplication(Hashtable params)
MainApplication configuration parameters:
parameter
value
title
Main application window title.
-
Method Summary
Methods
| Modifier and Type |
Method and Description |
void |
addApplicationListener(ApplicationListener applicationListener)
Adds an ApplicationListener to the application.
|
void |
addMouseListenerToStatusIcon(String iconId,
MouseListener mouseListener)
Adds a mouse listener to the component with the specified icon.
|
void |
addStatusBarIcon(String iconId,
ImageIcon icon)
Adds a status bar.
|
protected void |
buildTray() |
void |
centerOnScreen()
Centers the frame in the screen
|
static boolean |
checkApplicationPermission(String permissionName)
Check an ApplicationPermission using the ClientSecurityManager.
|
protected EJFrame |
createFrame(String idPanel,
ResourceBundle resourceBundle) |
protected ILoginDialog |
createLoginDialog()
Creates the login dialog
|
protected PopupMenu |
createTrayContextualMenu(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()
|
String |
getActiveFMName()
Returns the form manager name that is active(shown)
|
Form |
getActiveForm() |
String |
getDatabaseBundleName() |
IFormManager |
getFormManager(String idPanel)
Provides a reference to a FormManager.
|
Frame |
getFrame()
Returns the frame in which the application is placed.
|
String |
getIcon() |
Locale |
getLocale()
Returns the current application locale.
|
JMenuBar |
getMenu()
Provides a reference to the application menu bar.
|
MenuListener |
getMenuListener()
Provides a reference to the class that listens the menu events.
|
String |
getName()
Return the application name.
|
ApplicationPreferences |
getPreferences()
Returns the application preferences.
|
protected KeyStroke |
getPreferredKeyStroke(ApplicationPreferences preferences,
String user,
String keyName,
KeyStroke defaultKeyStroke) |
EntityReferenceLocator |
getReferenceLocator()
Get the client application reference locator
|
ResourceBundle |
getResourceBundle()
Returns the current application resource bundle.
|
String |
getResourcesFileName() |
protected String |
getSizePreferenceKey(String idPanel) |
MainApplication.StatusBar |
getStatusBar() |
int |
getStatusBarPercentComplete()
Get the current value in the component that shows the complete action
percent value in the status bar
|
Vector |
getTextsToTranslate()
Returns all the texts in the element suitable for being translated.
|
JToolBar |
getToolBar()
Provides a reference to the tool bar
|
ToolBarListener |
getToolBarListener()
Provides a reference to the buttons bar listener.
|
protected String |
getUser()
Returns the login name of the application user.
|
protected void |
hideSplash()
Hides the splash (loading application window).
|
protected void |
init(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(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(String message,
int type) |
protected void |
processKeyEvent(KeyEvent e) |
protected void |
processWindowEvent(WindowEvent e) |
void |
registerExtOpThreadsMonitor(ApplicationManager.ExtOpThreadsMonitor op)
Sets a ExtOpThreadsMonitor to the application.
|
void |
registerFormManager(String formManagerName,
IFormManager formManager)
Adds a FormManager to the application.
|
protected void |
registerKeyBindings()
Registers the key strokes for the application.
|
void |
registerStatusComponent(StatusComponent statusComponent)
|
void |
removeApplicationListener(ApplicationListener applicationListener)
Removes the specified ApplicationListener
|
IFormManager |
removeFormManagerComponent(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(String iconId,
MouseListener mouseListener)
Removes the mouse listener from the specified icon
|
void |
removeStatusBarIcon(String iconId)
Removes an icon from the status bar
|
void |
saveTextsToTranslate(String file,
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(Font font)
Changes the application font.
|
protected void |
setApplicationFont(Font font,
boolean savePrefs)
Sets an application font and saves that configuration in the preferences.
|
void |
setComponentLocale(Locale l) |
void |
setInitialSize()
Sets the initial application window size to its preferred size.
|
void |
setInitialState()
Sets the initial application state.
|
void |
setKeyBinding(String key,
KeyStroke keyStroke,
Action action,
InputMap inMap,
ActionMap actMap,
boolean isConfigurable) |
void |
setMenu(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(ResourceBundle resources)
Sets the language resource bundle.
|
void |
setStatusBarIconToolTip(String iconId,
String tip)
Sets the tool tip for the status bar icon identified by 'iconId'.
|
void |
setStatusBarIconToolTip(String iconId,
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(String text)
Sets the status bar progress text
|
void |
setStatusBarProgressText(String text,
boolean translate)
Sets the status bar progress text, optionally translated.
|
void |
setStatusBarText(String statusBarText)
Sets the status bar text, translated.
|
void |
setStatusBarVisible(boolean visible)
Sets the visibility of the status bar, if any.
|
void |
setTitle(String title) |
void |
setTitleKey(String titleKey)
Sets the title key for this frame.
|
void |
setToolBar(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(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, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
-
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setUndecorated
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, 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, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
Field Detail
-
timeSplash
protected int timeSplash
-
locale
protected Locale locale
-
helpSet
protected String helpSet
-
tLogin
protected long tLogin
-
stateFrame
protected int stateFrame
-
Method Detail
-
removeFormManagerComponent
public IFormManager removeFormManagerComponent(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(String formManagerName,
IFormManager formManager)
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
-
getIcon
public String getIcon()
-
saveTextsToTranslate
public void saveTextsToTranslate(String file,
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(ResourceBundle resources)
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.
-
endSession
public void endSession()
Ends the user session.
- Specified by:
endSession in interface Application
-
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(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
-
setInitialState
public void setInitialState()
Sets the initial application state. In this case, the main application
preferences will be also loaded.
-
setStatusBarIconToolTip
public void setStatusBarIconToolTip(String iconId,
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(String iconId,
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
-
setStatusBarProgressPosition
@Deprecated
public void setStatusBarProgressPosition(int p,
boolean paintImmediately)
Deprecated.
Sets the progress bar current value
- Parameters:
p - paintImmediately - .
-
setStatusBarProgressText
public void setStatusBarProgressText(String text,
boolean translate)
Sets the status bar progress text, optionally translated.
- Parameters:
text - translate - if true, the text will be translated
-
addMouseListenerToStatusIcon
public void addMouseListenerToStatusIcon(String iconId,
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(String iconId,
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 -
-
checkApplicationPermission
public static boolean checkApplicationPermission(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(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
-
maximize
public void maximize()
-
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.
-
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
Copyright © 2016 Imatia Innovation S.L.. All rights reserved.
|