javax.rad.application.genui
Class Application

java.lang.Object
  extended by javax.rad.genui.UIResource<C>
      extended by javax.rad.genui.UIComponent<C>
          extended by javax.rad.genui.UIContainer<IPanel>
              extended by javax.rad.genui.container.UIPanel
                  extended by javax.rad.application.genui.Content
                      extended by javax.rad.application.genui.ControllerContent
                          extended by javax.rad.application.genui.Application
All Implemented Interfaces:
IApplication, IContent, IMessageConstants, IControl, IControllable, IController, ITranslatable, IPanel, IComponent, IContainer, IResource, INamedObject, ITranslator
Direct Known Subclasses:
RemoteApplication

public abstract class Application
extends ControllerContent
implements IApplication

The Application is an abstract implementation of IApplication. It only implements the methods for loading and creating classes.


Field Summary
static java.lang.String PARAM_SETUP_CLASS
          the parameter name for the setup class.
 
Fields inherited from class javax.rad.genui.container.UIPanel
imgBack
 
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.IMessageConstants
MESSAGE_BUTTON_OK, MESSAGE_BUTTON_OK_CANCEL, MESSAGE_BUTTON_YES_NO, MESSAGE_BUTTON_YES_NO_CANCEL, MESSAGE_ICON_ERROR, MESSAGE_ICON_INFO, MESSAGE_ICON_QUESTION, MESSAGE_ICON_WARNING
 
Fields inherited from interface javax.rad.model.ui.IController
PROPERTY_SEARCH_VISIBLE
 
Fields inherited from interface javax.rad.model.ui.IControllable
COMMAND_DELETE, COMMAND_DUPLICATE, COMMAND_EDIT, COMMAND_EXPORT, COMMAND_FIRST, COMMAND_INSERT, COMMAND_INSERT_SUB, COMMAND_LAST, COMMAND_NEXT, COMMAND_PREVIOUS, COMMAND_RESTORE, COMMAND_SEARCH
 
Constructor Summary
Application(UILauncher pLauncher)
          Creates a new instance of Application with a desired launcher.
 
Method Summary
protected  void applySetup(IApplicationSetup pSetup)
          Applies the given application setup.
 IContainer getApplicationPane()
          Gets the standard application pane where the content will be added.
 IContainer getContentPane()
          Gets the content pane for the application.
 java.lang.Object getControllerProperty(java.lang.String pName)
          Gets the current value of the given controller property.
 ICursor getCursor()
          Gets the cursor from the launcher.
 UILauncher getLauncher()
          Returns the platform independent launcher which is associated with this factory.
protected  IApplicationSetup getSetup()
          Gets the application setup, if used.
 void notifyDestroy()
          Cancels all pending launcher threads.
 void setCursor(ICursor pCursor)
          Sets the cursor of the launcher.
protected  void setLauncher(UILauncher pLauncher)
          Sets the launcher.
<OP> IContent
showError(OP pOpener, java.lang.String pMessage)
          Shows a message with the IMessageConstants.MESSAGE_ICON_ERROR icon and the IMessageConstants.MESSAGE_BUTTON_OK button.
<OP> IContent
showError(OP pOpener, java.lang.String pMessage, java.lang.String pOkAction)
          Shows a message with the IMessageConstants.MESSAGE_ICON_ERROR icon and the IMessageConstants.MESSAGE_BUTTON_OK button.
<OP> IContent
showInformation(OP pOpener, java.lang.String pMessage)
          Shows a message with the IMessageConstants.MESSAGE_ICON_INFO icon and the IMessageConstants.MESSAGE_BUTTON_OK button.
<OP> IContent
showInformation(OP pOpener, java.lang.String pMessage, java.lang.String pOkAction)
          Shows a message with the IMessageConstants.MESSAGE_ICON_INFO icon and the IMessageConstants.MESSAGE_BUTTON_OK button.
<OP> IContent
showMessage(OP pOpener, int pIconType, int pButtonType, java.lang.String pMessage, java.lang.String pOkAction, java.lang.String pCancelAction)
          Shows a message.
<OP> IContent
showQuestion(OP pOpener, java.lang.String pMessage, java.lang.String pOkAction)
          Shows a message with the IMessageConstants.MESSAGE_ICON_QUESTION icon and the IMessageConstants.MESSAGE_BUTTON_YES_NO buttons.
<OP> IContent
showQuestion(OP pOpener, java.lang.String pMessage, java.lang.String pOkAction, java.lang.String pCancelAction)
          Shows a message with the IMessageConstants.MESSAGE_ICON_QUESTION icon and the IMessageConstants.MESSAGE_BUTTON_YES_NO buttons.
<OP> IContent
showWarning(OP pOpener, java.lang.String pMessage)
          Shows a warning with the IMessageConstants.MESSAGE_ICON_WARNING icon and the IMessageConstants.MESSAGE_BUTTON_OK button.
<OP> IContent
showWarning(OP pOpener, java.lang.String pMessage, java.lang.String pOkAction)
          Shows a warning with the IMessageConstants.MESSAGE_ICON_WARNING icon and the IMessageConstants.MESSAGE_BUTTON_OK buttons.
 
Methods inherited from class javax.rad.application.genui.ControllerContent
addNotify, cancelEditing, doActiveControlChanged, doActiveControllableChanged, doActiveDataBookChanged, doCommand, doConfigureCommandButtons, doDelete, doDuplicate, doEdit, doExport, doFirst, doInsert, doInsertSub, doLast, doNext, doNotifyController, doPrevious, doRestore, doSearch, getActiveControl, getActiveControllable, getActiveDataBook, getCommandButtons, getController, getRegisteredCommands, isCommandEnabled, isDeleteEnabled, isDuplicateEnabled, isEditEnabled, isExportEnabled, isFirstEnabled, isInsertEnabled, isInsertSubEnabled, isLastEnabled, isNextEnabled, isPreviousEnabled, isRestoreEnabled, isSearchEnabled, notifyRepaint, registerCommandButton, removeNotify, saveEditing, setActiveControllable, setController, setControllerProperty, unregisterAllCommandButtons, unregisterCommandButton, unregisterCommandButton
 
Methods inherited from class javax.rad.application.genui.Content
createComponentName, getOpener, isDestroyed, notifyVisible, setOpener
 
Methods inherited from class javax.rad.genui.container.UIPanel
getBackgroundImage, setBackgroundImage
 
Methods inherited from class javax.rad.genui.UIContainer
add, add, add, add, addInternal, beforeAddNotify, checkAdd, contains, getComponent, getComponentCount, getComponents, getInsets, getLayout, getUIResourceContainer, indexOf, remove, remove, removeAll, removeInternal, setLayout, setUIResourceContainer, setZOrder, updateTranslation
 
Methods inherited from class javax.rad.genui.UIComponent
capture, createComponentNamePrefix, debug, doEventKey, doTriggerPopMenu, equals, error, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKey, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getComponentUIResource, getCurrentTranslation, 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, 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, setVisible, 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.application.IContent
getOpener, isDestroyed, notifyVisible, setOpener
 
Methods inherited from interface javax.rad.ui.IComponent
capture, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, 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, 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
 
Methods inherited from interface javax.rad.model.ui.ITranslatable
getTranslation, isTranslationEnabled, setTranslation, setTranslationEnabled
 
Methods inherited from interface javax.rad.util.ITranslator
translate
 
Methods inherited from interface javax.rad.ui.IContainer
add, add, add, add, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, setLayout
 

Field Detail

PARAM_SETUP_CLASS

public static final java.lang.String PARAM_SETUP_CLASS
the parameter name for the setup class.

See Also:
Constant Field Values
Constructor Detail

Application

public Application(UILauncher pLauncher)
Creates a new instance of Application with a desired launcher.

Parameters:
pLauncher - the launcher of this application
Method Detail

getLauncher

public UILauncher getLauncher()
Returns the platform independent launcher which is associated with this factory.

Specified by:
getLauncher in interface IApplication
Returns:
the associated launcher

showMessage

public <OP> IContent showMessage(OP pOpener,
                                 int pIconType,
                                 int pButtonType,
                                 java.lang.String pMessage,
                                 java.lang.String pOkAction,
                                 java.lang.String pCancelAction)
                     throws java.lang.Throwable
Shows a message.

Specified by:
showMessage in interface IApplication
Type Parameters:
OP - the opener type
Parameters:
pOpener - the opener/parent component which wants to display the message
pIconType - the icon type IMessageConstants.MESSAGE_ICON_INFO, IMessageConstants.MESSAGE_ICON_WARNING, IMessageConstants.MESSAGE_ICON_ERROR
pButtonType - the button type IMessageConstants.MESSAGE_BUTTON_OK_CANCEL, IMessageConstants.MESSAGE_BUTTON_YES_NO, IMessageConstants.MESSAGE_BUTTON_OK
pMessage - the message
pOkAction - the action name to call when ok or yes was clicked
pCancelAction - the action name to call when cancel or close was clicked
Returns:
the message content or null if the message has no content
Throws:
java.lang.Throwable - if the message could not be initialized

getApplicationPane

public IContainer getApplicationPane()
Gets the standard application pane where the content will be added.

Specified by:
getApplicationPane in interface IApplication
Returns:
the application pane

getContentPane

public IContainer getContentPane()
Gets the content pane for the application. The content pane will be used for the application UI.

Specified by:
getContentPane in interface IApplication
Returns:
the content pane

setCursor

public void setCursor(ICursor pCursor)
Sets the cursor of the launcher.

Specified by:
setCursor in interface IComponent
Overrides:
setCursor in class UIComponent<IPanel>
Parameters:
pCursor - the cursor
See Also:
IComponent.isEnabled(), IComponent.getCursor(), Toolkit.createCustomCursor(java.awt.Image, java.awt.Point, java.lang.String), ICursor

getCursor

public ICursor getCursor()
Gets the cursor from the launcher.

Specified by:
getCursor in interface IComponent
Overrides:
getCursor in class UIComponent<IPanel>
Returns:
the cursor of the launcher
See Also:
IComponent.setCursor(javax.rad.ui.ICursor)

notifyDestroy

public void notifyDestroy()
Cancels all pending launcher threads.

Specified by:
notifyDestroy in interface IContent
Overrides:
notifyDestroy in class Content

getControllerProperty

public java.lang.Object getControllerProperty(java.lang.String pName)
Gets the current value of the given controller property. If the property was not set, the launcher parameter will be checked for a name with the prefix Controller., e.g. Controller.name.

Specified by:
getControllerProperty in interface IController
Overrides:
getControllerProperty in class ControllerContent
Parameters:
pName - the name of the property
Returns:
the value or null if the property was not found

showInformation

public <OP> IContent showInformation(OP pOpener,
                                     java.lang.String pMessage)
                         throws java.lang.Throwable
Shows a message with the IMessageConstants.MESSAGE_ICON_INFO icon and the IMessageConstants.MESSAGE_BUTTON_OK button.

Type Parameters:
OP - the opener type
Parameters:
pOpener - the opener of the information
pMessage - the message/information to show
Returns:
the message content or null if the message has no content
Throws:
java.lang.Throwable - if the message could not be initialized

showInformation

public <OP> IContent showInformation(OP pOpener,
                                     java.lang.String pMessage,
                                     java.lang.String pOkAction)
                         throws java.lang.Throwable
Shows a message with the IMessageConstants.MESSAGE_ICON_INFO icon and the IMessageConstants.MESSAGE_BUTTON_OK button.

Type Parameters:
OP - the opener type
Parameters:
pOpener - the opener of the information
pMessage - the message/information to show
pOkAction - the action to call when OK was pressed
Returns:
the message content or null if the message has no content
Throws:
java.lang.Throwable - if the message could not be initialized

showError

public <OP> IContent showError(OP pOpener,
                               java.lang.String pMessage)
                   throws java.lang.Throwable
Shows a message with the IMessageConstants.MESSAGE_ICON_ERROR icon and the IMessageConstants.MESSAGE_BUTTON_OK button.

Type Parameters:
OP - the opener type
Parameters:
pOpener - the opener of the information
pMessage - the message/error to show
Returns:
the message content or null if the message has no content
Throws:
java.lang.Throwable - if the message could not be initialized

showError

public <OP> IContent showError(OP pOpener,
                               java.lang.String pMessage,
                               java.lang.String pOkAction)
                   throws java.lang.Throwable
Shows a message with the IMessageConstants.MESSAGE_ICON_ERROR icon and the IMessageConstants.MESSAGE_BUTTON_OK button.

Type Parameters:
OP - the opener type
Parameters:
pOpener - the opener of the information
pMessage - the message/error to show
pOkAction - the action to call when OK was pressed
Returns:
the message content or null if the message has no content
Throws:
java.lang.Throwable - if the message could not be initialized

showQuestion

public <OP> IContent showQuestion(OP pOpener,
                                  java.lang.String pMessage,
                                  java.lang.String pOkAction)
                      throws java.lang.Throwable
Shows a message with the IMessageConstants.MESSAGE_ICON_QUESTION icon and the IMessageConstants.MESSAGE_BUTTON_YES_NO buttons.

Type Parameters:
OP - the opener type
Parameters:
pOpener - the opener of the information
pMessage - the message/question to show
pOkAction - the action to call when yes was pressed
Returns:
the message content or null if the message has no content
Throws:
java.lang.Throwable - if the message could not be initialized

showQuestion

public <OP> IContent showQuestion(OP pOpener,
                                  java.lang.String pMessage,
                                  java.lang.String pOkAction,
                                  java.lang.String pCancelAction)
                      throws java.lang.Throwable
Shows a message with the IMessageConstants.MESSAGE_ICON_QUESTION icon and the IMessageConstants.MESSAGE_BUTTON_YES_NO buttons.

Type Parameters:
OP - the opener type
Parameters:
pOpener - the opener of the information
pMessage - the message/question to show
pOkAction - the action to call when yes was pressed
pCancelAction - the action to call when no/x was pressed
Returns:
the message content or null if the message has no content
Throws:
java.lang.Throwable - if the message could not be initialized

showWarning

public <OP> IContent showWarning(OP pOpener,
                                 java.lang.String pMessage)
                     throws java.lang.Throwable
Shows a warning with the IMessageConstants.MESSAGE_ICON_WARNING icon and the IMessageConstants.MESSAGE_BUTTON_OK button.

Type Parameters:
OP - the opener type
Parameters:
pOpener - the opener of the warning
pMessage - the message/warning to show
Returns:
the message content or null if the message has no content
Throws:
java.lang.Throwable - if the message could not be initialized

showWarning

public <OP> IContent showWarning(OP pOpener,
                                 java.lang.String pMessage,
                                 java.lang.String pOkAction)
                     throws java.lang.Throwable
Shows a warning with the IMessageConstants.MESSAGE_ICON_WARNING icon and the IMessageConstants.MESSAGE_BUTTON_OK buttons.

Type Parameters:
OP - the opener type
Parameters:
pOpener - the opener of the warning
pMessage - the message/warning to show
pOkAction - the action to call when yes was pressed
Returns:
the message content or null if the warning has no content
Throws:
java.lang.Throwable - if the message could not be initialized

setLauncher

protected final void setLauncher(UILauncher pLauncher)
Sets the launcher. Be careful with this method because it changes the behaviour of the application if you use the wrong launcher.

Parameters:
pLauncher - the launcher

getSetup

protected IApplicationSetup getSetup()
Gets the application setup, if used.

Returns:
the application setup or null if no specific setup was used

applySetup

protected void applySetup(IApplicationSetup pSetup)
Applies the given application setup.

Parameters:
pSetup - the setup


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.