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, ITranslator

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
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_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, isGlobalActive, 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, addInternal, checkAdd, contains, getComponent, getComponentCount, getLayout, getUIResourceContainer, indexOf, remove, remove, removeAll, removeInternal, setLayout, setUIResourceContainer, setZOrder
 
Methods inherited from class javax.rad.genui.UIComponent
capture, createCellFormatter, createComponentName, createComponentNamePrefix, createNodeFormatter, 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.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.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, getTranslation, isActive, isDisposed, pack, setTranslation
 
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.