javax.rad.application.genui
Class WorkScreen

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.WorkScreen
All Implemented Interfaces:
IContent, IMessageConstants, IWorkScreen, IControl, IControllable, IController, ITranslatable, IPanel, IComponent, IContainer, IResource, INamedObject, ITranslator
Direct Known Subclasses:
RemoteWorkScreen

public class WorkScreen
extends ControllerContent
implements IWorkScreen

The WorkScreen is a default implementation of IWorkScreen.


Field Summary
protected  IWorkScreenApplication application
          the parent application.
 
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
WorkScreen()
          Creates a new instance of WorkScreen.
WorkScreen(IWorkScreenApplication pApplication)
          Creates a new instance of WorkScreen for a parent application.
WorkScreen(IWorkScreenApplication pApplication, java.util.Map<java.lang.String,java.lang.Object> pParameter)
          Creates a new instance of WorkScreen for a parent application and specific parameters.
 
Method Summary
protected  java.lang.String createComponentName()
          Creates a name for this UIComponent.
protected static java.lang.String createName(java.lang.String pSimpleClassName)
          Creates a name from the given simple class name.
 WorkScreenHandler<IParameterChangedListener> eventParameterChanged()
          Gets the event handler for the parameter changed event.
 WorkScreenHandler<IParameterChangedListener> eventParameterChanged(java.lang.String pName)
          Gets the event handler for the changed event of a specific parameter.
protected  void fireParameterChanged(java.lang.String pName, java.lang.Object pOld, java.lang.Object pNew)
          Notifies all parameter changed listeners about a change.
 IWorkScreenApplication getApplication()
          Gets the main application of this work-screen.
 java.lang.Object getParameter(java.lang.String pName)
          Gets the value of an additional parameter from the work-screen.
 boolean isModal()
          Returns the modal state of this workscreen.
 boolean isParameterSet(java.lang.String pName)
          Gets whether the given parameter is set.
 void notifyActivate()
          Notifies the IWorkScreen, that it will be "visible again".
 void reload()
          Reloads the workscreen and discard changes.
 java.lang.Object removeParameter(java.lang.String pName)
          Removes the parameter from the parameter list.
 void save()
          Saves the workscreen changes.
 void setModal(boolean pModal)
          Sets whether this workscreen should be modal.
 void setParameter(Parameter pParameter)
          Sets the given parameter.
 java.lang.Object setParameter(java.lang.String pName, java.lang.Object pValue)
          Sets additional parameters for the work-screen.
<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
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.
 
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, getControllerProperty, 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
getOpener, isDestroyed, notifyDestroy, 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, 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, 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, notifyDestroy, 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, 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
 
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

application

protected IWorkScreenApplication application
the parent application.

Constructor Detail

WorkScreen

public WorkScreen()
Creates a new instance of WorkScreen.


WorkScreen

public WorkScreen(IWorkScreenApplication pApplication)
Creates a new instance of WorkScreen for a parent application.

Parameters:
pApplication - the parent application

WorkScreen

public WorkScreen(IWorkScreenApplication pApplication,
                  java.util.Map<java.lang.String,java.lang.Object> pParameter)
Creates a new instance of WorkScreen for a parent application and specific parameters.

Parameters:
pApplication - the parent application
pParameter - additional screen parameters
Method Detail

notifyActivate

public void notifyActivate()
Notifies the IWorkScreen, that it will be "visible again".

Specified by:
notifyActivate in interface IWorkScreen

getApplication

public IWorkScreenApplication getApplication()
Gets the main application of this work-screen.

Specified by:
getApplication in interface IWorkScreen
Returns:
the main application base

save

public void save()
          throws java.lang.Exception
Saves the workscreen changes.

Specified by:
save in interface IWorkScreen
Throws:
java.lang.Exception

reload

public void reload()
            throws java.lang.Exception
Reloads the workscreen and discard changes.

Specified by:
reload in interface IWorkScreen
Throws:
java.lang.Exception

isModal

public boolean isModal()
Returns the modal state of this workscreen.

Specified by:
isModal in interface IWorkScreen
Returns:
true if this workscreen should be modal, otherwise false

setModal

public void setModal(boolean pModal)
Sets whether this workscreen should be modal.

Specified by:
setModal in interface IWorkScreen
Parameters:
pModal - true if this workscreen should be modal, otherwise false

setParameter

public java.lang.Object setParameter(java.lang.String pName,
                                     java.lang.Object pValue)
Sets additional parameters for the work-screen. This method should be used for additional configuration steps.

Specified by:
setParameter in interface IWorkScreen
Parameters:
pName - the parameter name
pValue - the parameter
Returns:
the previous value for the parameter name or null if the parameter was not set before

getParameter

public java.lang.Object getParameter(java.lang.String pName)
Gets the value of an additional parameter from the work-screen.

Specified by:
getParameter in interface IWorkScreen
Parameters:
pName - the parameter name
Returns:
the parameter

isParameterSet

public boolean isParameterSet(java.lang.String pName)
Gets whether the given parameter is set.

Specified by:
isParameterSet in interface IWorkScreen
Parameters:
pName - the parameter name
Returns:
true if the parameter is set, false otherwise

removeParameter

public java.lang.Object removeParameter(java.lang.String pName)
Removes the parameter from the parameter list.

Specified by:
removeParameter in interface IWorkScreen
Parameters:
pName - the parameter name
Returns:
the old object

createComponentName

protected java.lang.String createComponentName()
Creates a name for this UIComponent. The returned name needs to be unique in the current root/workscreen and is ideally, but not necessarily, prefixed with the UIComponent.sRootName, if there is any. Overriding classes should be aware that this method will be called in UIComponent.addNotify() and the returned name will only be assigned to the UIComponent if there isn't already a name set. Also UIComponent.stExistingNames can be used to find out if a name has already been assigned, and UIComponent.sRootName to get the root name. In rare cases UIComponent.stExistingNames and/or UIComponent.sRootName might be null when this method is called.

Overrides:
createComponentName in class Content
Returns:
a unique name for this UIComponent.
See Also:
UIComponent.getExistingNames(), UIComponent.getRootName(), UIComponent.incrementNameIfExists(String, Set, boolean)

setParameter

public void setParameter(Parameter pParameter)
Sets the given parameter.

Parameters:
pParameter - the parameter

createName

protected static java.lang.String createName(java.lang.String pSimpleClassName)
Creates a name from the given simple class name. The created name is in the form that a following "WorkScreen" is removed, the first three letters of all words are combined with a two digit checksum (A-Z0-9) at the end. Examples:
 NewTestingWorkScreen           NewTes-XX
 CreateInputWorkScreen  CreInp-XX
 

Parameters:
pSimpleClassName - the simple class name.
Returns:
the name.

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 yex 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 yex 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

eventParameterChanged

public WorkScreenHandler<IParameterChangedListener> eventParameterChanged()
Gets the event handler for the parameter changed event.

Returns:
the event handler

eventParameterChanged

public WorkScreenHandler<IParameterChangedListener> eventParameterChanged(java.lang.String pName)
Gets the event handler for the changed event of a specific parameter.

Parameters:
pName - the connected parameter name
Returns:
the event handler

fireParameterChanged

protected void fireParameterChanged(java.lang.String pName,
                                    java.lang.Object pOld,
                                    java.lang.Object pNew)
Notifies all parameter changed listeners about a change.

Parameters:
pName - the parameter name
pOld - the old value
pNew - the new value


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.