javax.rad.application.genui
Class UILauncher

java.lang.Object
  extended by javax.rad.genui.UIResource<C>
      extended by javax.rad.genui.UIComponent<C>
          extended by javax.rad.genui.UIContainer<C>
              extended by javax.rad.genui.container.AbstractWindow<C>
                  extended by javax.rad.genui.container.AbstractFrame<ILauncher>
                      extended by javax.rad.application.genui.UILauncher
All Implemented Interfaces:
ILauncher, ITranslatable, IFrame, IToolBarPanel, IWindow, IComponent, IContainer, IResource, IExceptionListener, INamedObject, ITranslator

public class UILauncher
extends AbstractFrame<ILauncher>
implements ILauncher

The UILauncher is an AbstractFrame extension. It will be used for platform and technology dependent ILauncher implementations.


Field Summary
 
Fields inherited from class javax.rad.genui.container.AbstractFrame
iconImage, menuBar
 
Fields inherited from class javax.rad.genui.UIContainer
allComponents, components
 
Fields inherited from class javax.rad.genui.UIComponent
bTranslate, lLastTranslationModified, parent, popupMenu
 
Fields inherited from class javax.rad.genui.UIResource
uiResource
 
Fields inherited from interface javax.rad.application.ILauncher
ENVIRONMENT_DESKTOP, ENVIRONMENT_HEADLESS, ENVIRONMENT_MOBILE, ENVIRONMENT_WEB, PARAM_APPLICATIONLANGUAGE, PARAM_APPLICATIONNAME, PARAM_CODEBASE, PARAM_ENVIRONMENT, PARAM_LOGFACTORY, PARAM_SERVERBASE, PARAM_UIFACTORY
 
Fields inherited from interface javax.rad.ui.container.IFrame
ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, NORMAL
 
Fields inherited from interface javax.rad.ui.container.IToolBarPanel
AREA_BOTTOM, AREA_LEFT, AREA_RIGHT, AREA_TOP
 
Constructor Summary
UILauncher(ILauncher pLauncher)
          Creates a new instance of UILauncher with an ILauncher implementation.
 
Method Summary
 void cancelPendingThreads()
          Cancel/Interrupts all pending threads.
static IFileHandleReceiver createFileHandleReceiver(java.lang.Object pFileHandleReceiver, java.lang.String pMethodName)
          Creates a file handle receiver instance with the given object and method name.
 java.lang.String getEnvironmentName()
          Gets the name of the environment for this launcher.
 void getFileHandle(IFileHandleReceiver pFileHandleReceiver)
          Technology independent getFileHandle.
 void getFileHandle(IFileHandleReceiver pFileHandleReceiver, java.lang.String pTitle)
          Technology independent getFileHandle.
 void getFileHandle(java.lang.Object pFileHandleReceiver, java.lang.String pMethodName)
          Technology independent getFileHandle.
 void getFileHandle(java.lang.Object pFileHandleReceiver, java.lang.String pMethodName, java.lang.String pTitle)
          Technology independent getFileHandle.
 java.lang.String getParameter(java.lang.String pName)
          Gets a configuration parameter of the application.
 boolean getParameterAsBoolean(java.lang.String pParameterName, boolean pDefault)
          Gets the value for the given application parameter as boolean value.
 java.lang.String getRegistryKey(java.lang.String pKey)
          Gets the value for a specific key from the applications registry.
 java.lang.String getSimpleEnvironmentName()
          Gets the environment name without additional information.
 void handleException(java.lang.Throwable pThrowable)
          Notification for the listener to handle an exception occured in another part of the program.
 boolean isDesktopEnvironment()
          Gets whether the launcher was started in a desktop environment.
 boolean isHeadlessEnvironment()
          Gets whether the launcher was started in a headless (without GUI) environment.
 boolean isMobileEnvironment()
          Gets whether the launcher was started in a mobile environment.
 boolean isWebEnvironment()
          Gets whether the launcher was started in a web environment.
 void saveFileHandle(IFileHandle pFileHandle)
          Technology independent saveFileHandle.
 void saveFileHandle(IFileHandle pFileHandle, java.lang.String pTitle)
          Technology independent saveFileHandle.
 void setParameter(java.lang.String pName, java.lang.String pValue)
          Sets a configuration parameter of the application.
 void setRegistryKey(java.lang.String pKey, java.lang.String pValue)
          Sets the value for a specific key to the applications registry.
 void showDocument(java.lang.String pDocumentName, IRectangle pBounds, java.lang.String pTarget)
          Requests that external application shows a document indicated by the pDocumentname argument.
 void showFileHandle(IFileHandle pFileHandle)
          Technology independent showFileHandle.
 void showFileHandle(IFileHandle pFileHandle, IRectangle pBounds, java.lang.String pTarget)
          Technology independent showFileHandle.
 
Methods inherited from class javax.rad.genui.container.AbstractFrame
addNotify, addToolBar, addToolBar, beforeAddNotify, getIconImage, getMenuBar, getState, getTitle, getToolBar, getToolBarArea, getToolBarCount, indexOfToolBar, isResizable, isToolBarMovable, removeAllToolBars, removeNotify, removeToolBar, removeToolBar, setIconImage, setMenuBar, setResizable, setState, setTitle, setToolBarArea, setToolBarMovable, updateTranslation
 
Methods inherited from class javax.rad.genui.container.AbstractWindow
centerRelativeTo, dispose, eventWindowActivated, eventWindowClosed, eventWindowClosing, eventWindowDeactivated, eventWindowDeiconified, eventWindowIconified, eventWindowOpened, isActive, isDisposed, pack, setVisible, toBack, toFront, topLevelAddNotify
 
Methods inherited from class javax.rad.genui.UIContainer
add, add, add, add, addInternal, checkAdd, contains, getComponent, getComponentCount, getComponents, getInsets, getLayout, getUIResourceContainer, indexOf, remove, remove, removeAll, removeInternal, setLayout, setUIResourceContainer, setZOrder
 
Methods inherited from class javax.rad.genui.UIComponent
capture, createComponentName, createComponentNamePrefix, debug, doEventKey, doTriggerPopMenu, equals, error, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKey, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getComponentUIResource, getCurrentTranslation, getCursor, getDefaultName, getEventSource, getExistingNames, getFactory, getFont, getForeground, getLocation, getLocationOffset, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPopupMenu, getPreferredSize, getResource, getRootName, getSize, getStyle, getTabIndex, getToolTipText, getTranslation, getUIComponent, hashCode, incrementNameIfExists, info, invokeAndWait, invokeAndWait, invokeInThread, invokeInThread, invokeLater, invokeLater, isBackgroundSet, isBeforeNotified, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isNotified, isPreferredSizeSet, isTranslationChanged, isTranslationEnabled, isVisible, requestFocus, setBackground, setBounds, setBounds, setCursor, setDefaultName, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocation, setLocationRelativeTo, setMaximumSize, setMaximumSize, setMinimumSize, setMinimumSize, setName, setParent, setPopupMenu, setPreferredSize, setPreferredSize, setRootName, setSize, setSize, setStyle, setTabIndex, setToolTipText, setTranslation, setTranslationEnabled, setUIComponent, translate
 
Methods inherited from class javax.rad.genui.UIResource
eventResourceChanged, eventResourceChanged, fireResourceChanged, getObject, getObjectNames, getUIResource, hasResourceHandler, putObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.container.IFrame
getIconImage, getMenuBar, getState, getTitle, isResizable, setIconImage, setMenuBar, setResizable, setState, setTitle
 
Methods inherited from interface javax.rad.ui.container.IWindow
centerRelativeTo, dispose, eventWindowActivated, eventWindowClosed, eventWindowClosing, eventWindowDeactivated, eventWindowDeiconified, eventWindowIconified, eventWindowOpened, getTranslation, isActive, isDisposed, pack, setTranslation, toBack, toFront
 
Methods inherited from interface javax.rad.ui.container.IToolBarPanel
addToolBar, addToolBar, getToolBar, getToolBarArea, getToolBarCount, indexOfToolBar, removeAllToolBars, removeToolBar, removeToolBar, setToolBarArea
 
Methods inherited from interface javax.rad.ui.IContainer
add, add, add, add, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, setLayout
 
Methods inherited from interface javax.rad.ui.IComponent
capture, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getStyle, getTabIndex, getToolTipText, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBackground, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setStyle, setTabIndex, setToolTipText, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Constructor Detail

UILauncher

public UILauncher(ILauncher pLauncher)
Creates a new instance of UILauncher with an ILauncher implementation.

Parameters:
pLauncher - the ILauncher
Method Detail

getFileHandle

public void getFileHandle(IFileHandleReceiver pFileHandleReceiver,
                          java.lang.String pTitle)
                   throws java.lang.Throwable
Technology independent getFileHandle. A file chooser dialog should occur, and as result this function informs the IFileHandle receiver.

Specified by:
getFileHandle in interface ILauncher
Parameters:
pFileHandleReceiver - the IFileHandle receiver that should receive the file.
pTitle - the title for the dialog or null to set a default title
Throws:
java.lang.Throwable - if an error occurs during getting the file.

getParameter

public java.lang.String getParameter(java.lang.String pName)
Gets a configuration parameter of the application.

Specified by:
getParameter in interface ILauncher
Parameters:
pName - the parameter name
Returns:
the value of the parameter or null if the parameter does not exist

saveFileHandle

public void saveFileHandle(IFileHandle pFileHandle,
                           java.lang.String pTitle)
                    throws java.lang.Throwable
Technology independent saveFileHandle. A file chooser dialog should occur. This Function returns immediate.

Specified by:
saveFileHandle in interface ILauncher
Parameters:
pFileHandle - the IFileHandle to save.
pTitle - the title for the dialog or null to set a default title
Throws:
java.lang.Throwable - if an error occurs during saving the file.

setParameter

public void setParameter(java.lang.String pName,
                         java.lang.String pValue)
Sets a configuration parameter of the application.

Specified by:
setParameter in interface ILauncher
Parameters:
pName - the parameter name
pValue - the value for the parameter or null to delete the parameter

showDocument

public void showDocument(java.lang.String pDocumentName,
                         IRectangle pBounds,
                         java.lang.String pTarget)
                  throws java.lang.Throwable
Requests that external application shows a document indicated by the pDocumentname argument. The target argument indicates where the document should be displayed. Applications can also ignore the target information.

Specified by:
showDocument in interface ILauncher
Parameters:
pDocumentName - the location/filename of the document. (local or network adress)
pBounds - the bounds for the document, if supported from the implementation
pTarget - a String indicating where to display the document.
Throws:
java.lang.Throwable - if the document couldn't opened/shown

showFileHandle

public void showFileHandle(IFileHandle pFileHandle,
                           IRectangle pBounds,
                           java.lang.String pTarget)
                    throws java.lang.Throwable
Technology independent showFileHandle. A file chooser dialog should occur. This Function returns immediate.

Specified by:
showFileHandle in interface ILauncher
Parameters:
pFileHandle - the IFileHandle to save.
pBounds - the bounds for the document, if supported from the implementation
pTarget - a String indicating where to display the document.
Throws:
java.lang.Throwable - if an error occurs during saving the file.

showFileHandle

public void showFileHandle(IFileHandle pFileHandle)
                    throws java.lang.Throwable
Technology independent showFileHandle. A file chooser dialog should occur. This Function returns immediate.

Specified by:
showFileHandle in interface ILauncher
Parameters:
pFileHandle - the IFileHandle to save.
Throws:
java.lang.Throwable - if an error occurs during saving the file.

cancelPendingThreads

public void cancelPendingThreads()
Cancel/Interrupts all pending threads.

Specified by:
cancelPendingThreads in interface ILauncher

handleException

public void handleException(java.lang.Throwable pThrowable)
Notification for the listener to handle an exception occured in another part of the program.

Specified by:
handleException in interface IExceptionListener
Parameters:
pThrowable - the occured exception

setRegistryKey

public void setRegistryKey(java.lang.String pKey,
                           java.lang.String pValue)
Sets the value for a specific key to the applications registry. The registry is a local store for persistent values.

Specified by:
setRegistryKey in interface ILauncher
Parameters:
pKey - the key to set
pValue - the value to set or null to remove the key from the registry

getRegistryKey

public java.lang.String getRegistryKey(java.lang.String pKey)
Gets the value for a specific key from the applications registry.

Specified by:
getRegistryKey in interface ILauncher
Parameters:
pKey - the key to get
Returns:
the value for the key or null if the key is not available

getEnvironmentName

public java.lang.String getEnvironmentName()
Gets the name of the environment for this launcher. The environment could be used to en-/disable features.

Specified by:
getEnvironmentName in interface ILauncher
Returns:
the name of the environment, e.g. ILauncher.ENVIRONMENT_HEADLESS, ILauncher.ENVIRONMENT_DESKTOP

saveFileHandle

public void saveFileHandle(IFileHandle pFileHandle)
                    throws java.lang.Throwable
Technology independent saveFileHandle. A file chooser dialog should occur. This Function returns immediate.

Parameters:
pFileHandle - the IFileHandle to save.
Throws:
java.lang.Throwable - if an error occurs during saving the file.

getFileHandle

public void getFileHandle(IFileHandleReceiver pFileHandleReceiver)
                   throws java.lang.Throwable
Technology independent getFileHandle. A file chooser dialog should occur, and as result this function informs the IFileHandle receiver.

Parameters:
pFileHandleReceiver - the IFileHandle receiver that should receive the file.
Throws:
java.lang.Throwable - if an error occurs during getting the file.

getFileHandle

public void getFileHandle(java.lang.Object pFileHandleReceiver,
                          java.lang.String pMethodName,
                          java.lang.String pTitle)
                   throws java.lang.Throwable
Technology independent getFileHandle. A file chooser dialog should occur, and as result this function informs the IFileHandle receiver.

Parameters:
pFileHandleReceiver - the IFileHandle receiver that should receive the file.
pMethodName - the method that is invoked.
pTitle - the title.
Throws:
java.lang.Throwable - if an error occurs during getting the file.

getFileHandle

public void getFileHandle(java.lang.Object pFileHandleReceiver,
                          java.lang.String pMethodName)
                   throws java.lang.Throwable
Technology independent getFileHandle. A file chooser dialog should occur, and as result this function informs the IFileHandle receiver.

Parameters:
pFileHandleReceiver - the IFileHandle receiver that should receive the file.
pMethodName - the method that is invoked.
Throws:
java.lang.Throwable - if an error occurs during getting the file.

createFileHandleReceiver

public static IFileHandleReceiver createFileHandleReceiver(java.lang.Object pFileHandleReceiver,
                                                           java.lang.String pMethodName)
Creates a file handle receiver instance with the given object and method name.

Parameters:
pFileHandleReceiver - the object.
pMethodName - the method name.
Returns:
the file handle receiver.

isMobileEnvironment

public boolean isMobileEnvironment()
Gets whether the launcher was started in a mobile environment.

Returns:
true if the launcher runs in a mobile environment

isWebEnvironment

public boolean isWebEnvironment()
Gets whether the launcher was started in a web environment.

Returns:
true if the launcher runs in a web environment

isDesktopEnvironment

public boolean isDesktopEnvironment()
Gets whether the launcher was started in a desktop environment.

Returns:
true if the launcher runs in a desktop environment

isHeadlessEnvironment

public boolean isHeadlessEnvironment()
Gets whether the launcher was started in a headless (without GUI) environment.

Returns:
true if the launcher runs in a headless (without GUI) environment

getParameterAsBoolean

public boolean getParameterAsBoolean(java.lang.String pParameterName,
                                     boolean pDefault)
Gets the value for the given application parameter as boolean value.

Parameters:
pParameterName - the name of the parameter
pDefault - the default value if parameter was not set
Returns:
pDefault if the parameter was not set, otherwise the boolean representation of the value

getSimpleEnvironmentName

public java.lang.String getSimpleEnvironmentName()
Gets the environment name without additional information. The environment could contain additional information, separated by :, e.g. NAME:PLATFORM -> NAME will be returned.

Returns:
the simple environment name


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.