com.sibvisions.rad.application
Class Dialog

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 com.sibvisions.rad.application.Dialog
All Implemented Interfaces:
IContent, ITranslatable, IPanel, IComponent, IContainer, IResource, INamedObject

public class Dialog
extends Content

The Dialog class is a dialog content that shows a component and allows configuration of available buttons. The layout is always the same. There's the custom component in the center area and buttons in the south area.


Nested Class Summary
static class Dialog.ButtonMode
          the possible button modes.
 
Field Summary
 
Fields inherited from class javax.rad.genui.container.UIPanel
imgBack
 
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
 
Constructor Summary
Dialog(IComponent pComponent)
          Creates a new instance of Dialog with the given component to show.
 
Method Summary
 void addCenterButton(IButton pButton)
          Adds a button to the center area.
 void addLeftButton(IButton pButton)
          Adds a button to the left area.
 void addRightButton(IButton pButton)
          Adds a button to the right area.
protected  void configureButtons()
          Shows the Buttons dependent of the button mode.
 void doCancel()
          Invoked if cancel was pressed or window is destroyed.
 void doOk()
          Invoked if ok was pressed.
 DialogHandler eventCancel()
          Gets the handler for cancel event.
 DialogHandler eventOk()
          Gets the handler for ok event.
 Dialog.ButtonMode getButtonMode()
          Gets the current button mode.
protected  UIPanel getButtonPanel()
          Gets the panel that contains all button panels.
 IButton getCancelButton()
          Gets the default Cancel button.
protected  UIPanel getCenterButtonPanel()
          Gets the panel that contains all "center" buttons.
protected  UIPanel getLeftButtonPanel()
          Gets the panel that contains all "left" buttons.
 IButton getOkButton()
          Gets the default OK button.
protected  UIPanel getRightButtonPanel()
          Gets the panel that contains all "right" buttons.
 void notifyVisible()
          Notifies the IContent, that it is now positioned and showing.
static UIInternalFrame openInternalFrame(Application pApplication, String pTitle, boolean pModal, IComponent pContent)
          Opens the dialog as internal frame.
 void removeButton(IButton pButton)
          Removes a button.
 void setButtonMode(Dialog.ButtonMode pMode)
          Sets the button mode.
 
Methods inherited from class javax.rad.application.genui.Content
getOpener, notifyDestroy, setOpener
 
Methods inherited from class javax.rad.genui.container.UIPanel
getBackgroundImage, setBackgroundImage
 
Methods inherited from class javax.rad.genui.UIContainer
add, add, add, add, addNotify, beforeAddNotify, checkAdd, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, removeNotify, setLayout, setZOrder, updateTranslation
 
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, setVisible, 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.IContainer
add, add, add, add, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, setLayout
 

Constructor Detail

Dialog

public Dialog(IComponent pComponent)
Creates a new instance of Dialog with the given component to show.

Parameters:
pComponent - the dialog component
Method Detail

notifyVisible

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

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

setButtonMode

public void setButtonMode(Dialog.ButtonMode pMode)
Sets the button mode.

Parameters:
pMode - the mode

getButtonMode

public Dialog.ButtonMode getButtonMode()
Gets the current button mode.

Returns:
the mode

doCancel

public void doCancel()
Invoked if cancel was pressed or window is destroyed.


doOk

public void doOk()
Invoked if ok was pressed.


configureButtons

protected void configureButtons()
Shows the Buttons dependent of the button mode.

See Also:
setButtonMode(ButtonMode)

addLeftButton

public void addLeftButton(IButton pButton)
Adds a button to the left area.

Parameters:
pButton - the button

addCenterButton

public void addCenterButton(IButton pButton)
Adds a button to the center area.

Parameters:
pButton - the button

addRightButton

public void addRightButton(IButton pButton)
Adds a button to the right area.

Parameters:
pButton - the button

removeButton

public void removeButton(IButton pButton)
Removes a button.

Parameters:
pButton - the button

eventOk

public DialogHandler eventOk()
Gets the handler for ok event.

Returns:
the event handler

eventCancel

public DialogHandler eventCancel()
Gets the handler for cancel event.

Returns:
the event handler

openInternalFrame

public static UIInternalFrame openInternalFrame(Application pApplication,
                                                String pTitle,
                                                boolean pModal,
                                                IComponent pContent)
Opens the dialog as internal frame.

Parameters:
pApplication - the application
pTitle - the title
pModal - true if the frame sould be modal
pContent - the content to show
Returns:
the opened frame

getOkButton

public IButton getOkButton()
Gets the default OK button.

Returns:
the OK button

getCancelButton

public IButton getCancelButton()
Gets the default Cancel button.

Returns:
the Cancel button

getButtonPanel

protected UIPanel getButtonPanel()
Gets the panel that contains all button panels.

Returns:
the panel

getLeftButtonPanel

protected UIPanel getLeftButtonPanel()
Gets the panel that contains all "left" buttons.

Returns:
the panel

getCenterButtonPanel

protected UIPanel getCenterButtonPanel()
Gets the panel that contains all "center" buttons.

Returns:
the panel

getRightButtonPanel

protected UIPanel getRightButtonPanel()
Gets the panel that contains all "right" buttons.

Returns:
the panel


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.