com.sibvisions.rad.application
Class Message

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<IInternalFrame>
                      extended by javax.rad.genui.container.UIInternalFrame
                          extended by com.sibvisions.rad.application.Message
All Implemented Interfaces:
IContent, IMessageConstants, ITranslatable, IFrame, IInternalFrame, IToolBarPanel, IWindow, IComponent, IContainer, IResource, INamedObject

public class Message
extends UIInternalFrame
implements IContent, IMessageConstants

The Message class is an UIInternalFrame to display messages on the screen. The message contains an icon, the message and message dependent buttons.


Field Summary
 
Fields inherited from class javax.rad.genui.container.AbstractFrame
iconImage, menuBar
 
Fields inherited from class javax.rad.genui.UIContainer
components
 
Fields inherited from class javax.rad.genui.UIComponent
lLastTranslationModified, parent
 
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_ICON_ERROR, MESSAGE_ICON_INFO, MESSAGE_ICON_QUESTION, MESSAGE_ICON_WARNING
 
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
Message(UIDesktopPanel pDesktop, int pIconType, int pButtonType, String pMessage, String pOkAction, String pCancelAction)
          Creates a new instance of Message.
 
Method Summary
protected  UIButton createButton(String pText, String pAction)
          Creates an action button for this message.
 void doCancel(UIActionEvent pEvent)
          Closes the message when the Cancel/No button was clicked and redispatches the event to the getOpener(), if an action is defined for the Cancel/No button.
 void doClose(UIWindowEvent pEvent)
          Closes the message when the x button in the title was clicked.
 void doOk(UIActionEvent pEvent)
          Closes the message when the OK/Yes button was clicked and redispatches the event to the getOpener(), if an action is defined for the OK/Yes button.
<OP> OP
getOpener()
          Gets the opener of the content.
protected  void init()
          Initializes the UI components.
 void notifyDestroy()
          Notifies the IContent, that it will be destroyed.
 void notifyVisible()
          Notifies the IContent, that it is now positioned and showing.
<OP> void
setOpener(OP pOpener)
          Sets the opener of the content.
 
Methods inherited from class javax.rad.genui.container.UIInternalFrame
close, dispose, isClosable, isClosed, isIconifiable, isMaximizable, isModal, setClosable, setIconifiable, setMaximizable, setModal, toBack, toFront, topLevelAddNotify
 
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, eventWindowActivated, eventWindowClosed, eventWindowClosing, eventWindowDeactivated, eventWindowDeiconified, eventWindowIconified, eventWindowOpened, isActive, isDisposed, pack, setVisible
 
Methods inherited from class javax.rad.genui.UIContainer
add, add, add, add, checkAdd, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, setLayout, setZOrder
 
Methods inherited from class javax.rad.genui.UIComponent
capture, createCellFormatter, createNodeFormatter, debug, error, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getComponentUIResource, getCurrentTranslation, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getResource, getSize, getToolTipText, getTranslation, 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, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocation, setLocationRelativeTo, setMaximumSize, setMaximumSize, setMinimumSize, setMinimumSize, setName, setParent, setPreferredSize, setPreferredSize, setSize, setSize, setToolTipText, setTranslation, setTranslationEnabled, translate
 
Methods inherited from class javax.rad.genui.UIResource
equals, getUIResource, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.IComponent
capture, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, 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, setToolTipText, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 
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, eventWindowActivated, eventWindowClosed, eventWindowClosing, eventWindowDeactivated, eventWindowDeiconified, eventWindowIconified, eventWindowOpened, isActive, isDisposed, pack
 
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
 

Constructor Detail

Message

public Message(UIDesktopPanel pDesktop,
               int pIconType,
               int pButtonType,
               String pMessage,
               String pOkAction,
               String pCancelAction)
Creates a new instance of Message.

Parameters:
pDesktop - the desktop for showing the frame
pIconType - the message type
pButtonType - the type for the visible buttons
pMessage - the message
pOkAction - the action to call when ok or yes was clicked
pCancelAction - the action to call when cancel or close was clicked
Method Detail

init

protected void init()
Initializes the UI components.


notifyDestroy

public void notifyDestroy()
Notifies the IContent, that it will be destroyed.

Specified by:
notifyDestroy in interface IContent

notifyVisible

public void notifyVisible()
Notifies the IContent, that it is now positioned and showing.

Specified by:
notifyVisible in interface IContent

setOpener

public <OP> void setOpener(OP pOpener)
Sets the opener of the content.

Specified by:
setOpener in interface IContent
Type Parameters:
OP - the opener type
Parameters:
pOpener - the opener component or null if the component is unknown

getOpener

public <OP> OP getOpener()
Gets the opener of the content.

Specified by:
getOpener in interface IContent
Type Parameters:
OP - the opener type
Returns:
the opener component or null if the opener is unknown

createButton

protected UIButton createButton(String pText,
                                String pAction)
Creates an action button for this message.

Parameters:
pText - the button text
pAction - the redispatch action
Returns:
the created button

doOk

public void doOk(UIActionEvent pEvent)
          throws Throwable
Closes the message when the OK/Yes button was clicked and redispatches the event to the getOpener(), if an action is defined for the OK/Yes button.

Parameters:
pEvent - the event from the button
Throws:
Throwable - if the an action is configured but the call throws an error

doCancel

public void doCancel(UIActionEvent pEvent)
              throws Throwable
Closes the message when the Cancel/No button was clicked and redispatches the event to the getOpener(), if an action is defined for the Cancel/No button.

Parameters:
pEvent - the event from the button
Throws:
Throwable - if the a cancel action is configured but the call throws an error

doClose

public void doClose(UIWindowEvent pEvent)
             throws Throwable
Closes the message when the x button in the title was clicked. If a cancel action was defined, it will be called.

Parameters:
pEvent - the event from the frame
Throws:
Throwable - if the a cancel action is configured but the call throws an error


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.