javax.rad.genui.component
Class UIPopupMenuButton

java.lang.Object
  extended by javax.rad.genui.UIResource<C>
      extended by javax.rad.genui.UIComponent<C>
          extended by javax.rad.genui.component.AbstractUILabeledIcon<IPopupMenuButton>
              extended by javax.rad.genui.component.UIPopupMenuButton
All Implemented Interfaces:
ITranslatable, IIcon, ILabel, ILabeledIcon, IPopupMenuButton, IAlignmentConstants, IComponent, IResource, INamedObject, ITranslator

public class UIPopupMenuButton
extends AbstractUILabeledIcon<IPopupMenuButton>
implements IPopupMenuButton

Platform and technology independent popup menu button. It is designed for use with AWT, Swing, SWT, JSP, JSF, ... .


Field Summary
 
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.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
  UIPopupMenuButton()
          Creates a new instance of UIPopupMenuButton.
protected UIPopupMenuButton(IPopupMenuButton pButton)
          Creates a new instance of UIPopupMenuButton with the given button.
  UIPopupMenuButton(String pText)
          Creates a new instance of UIPopupMenuButton.
  UIPopupMenuButton(String pText, IImage pImage)
          Creates a new instance of UIPopupMenuButton.
 
Method Summary
 void addNotify()
          Makes this UIComponent displayable by adding it to an UIContainer.
 void doTriggerPopMenu(UIMouseEvent pMouseEvent)
          Triggers popup menu to be shown.
 IMenuItem getDefaultMenuItem()
          Gets the default menu item.
 void removeNotify()
          Makes this UIComponent undisplayable by removing it to an UIContainer.
 void setDefaultMenuItem(IMenuItem pItem)
          Sets the default menu item.
 void setPopupMenu(IPopupMenu pMenu)
          Sets the popup menu that should be displayed by this component.
 
Methods inherited from class javax.rad.genui.component.AbstractUILabeledIcon
getHorizontalAlignment, getImage, getText, getVerticalAlignment, isPreserveAspectRatio, setHorizontalAlignment, setImage, setPreserveAspectRatio, setText, setVerticalAlignment, updateTranslation
 
Methods inherited from class javax.rad.genui.UIComponent
beforeAddNotify, capture, createComponentName, createComponentNamePrefix, createSimplifiedClassName, debug, doEventKey, 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, 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.ui.component.IPopupMenuButton
getPopupMenu
 
Methods inherited from interface javax.rad.ui.component.IIcon
getImage, isPreserveAspectRatio, setImage, setPreserveAspectRatio
 
Methods inherited from interface javax.rad.ui.component.ILabel
getText, setText
 
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.IAlignmentConstants
getHorizontalAlignment, getVerticalAlignment, setHorizontalAlignment, setVerticalAlignment
 

Constructor Detail

UIPopupMenuButton

public UIPopupMenuButton()
Creates a new instance of UIPopupMenuButton.

See Also:
IPopupMenuButton

UIPopupMenuButton

protected UIPopupMenuButton(IPopupMenuButton pButton)
Creates a new instance of UIPopupMenuButton with the given button.

Parameters:
pButton - the button
See Also:
IPopupMenuButton

UIPopupMenuButton

public UIPopupMenuButton(String pText)
Creates a new instance of UIPopupMenuButton.

Parameters:
pText - the label of the button.
See Also:
IPopupMenuButton

UIPopupMenuButton

public UIPopupMenuButton(String pText,
                         IImage pImage)
Creates a new instance of UIPopupMenuButton.

Parameters:
pText - the text.
pImage - the image.
See Also:
AbstractUILabeledIcon.setImage(IImage), AbstractUILabeledIcon.setText(String)
Method Detail

setDefaultMenuItem

public void setDefaultMenuItem(IMenuItem pItem)
Sets the default menu item. The default menu item will be used as action for this button. The menu item should be an item of the configured menu. If no default menu item is set, the full menu will be shown in case of button click.

Specified by:
setDefaultMenuItem in interface IPopupMenuButton
Parameters:
pItem - the item to use as action item
See Also:
IPopupMenuButton.setPopupMenu(IPopupMenu)

getDefaultMenuItem

public IMenuItem getDefaultMenuItem()
Gets the default menu item.

Specified by:
getDefaultMenuItem in interface IPopupMenuButton
Returns:
the menu item
See Also:
IPopupMenuButton.setDefaultMenuItem(IMenuItem)

setPopupMenu

public void setPopupMenu(IPopupMenu pMenu)
Sets the popup menu that should be displayed by this component.

Specified by:
setPopupMenu in interface IPopupMenuButton
Overrides:
setPopupMenu in class UIComponent<IPopupMenuButton>
Parameters:
pMenu - the popup menu.

doTriggerPopMenu

public void doTriggerPopMenu(UIMouseEvent pMouseEvent)
Triggers popup menu to be shown.

Overrides:
doTriggerPopMenu in class UIComponent<IPopupMenuButton>
Parameters:
pMouseEvent - the mouse event.

addNotify

public void addNotify()
Makes this UIComponent displayable by adding it to an UIContainer. This method is called internally by the genui and should not be called directly.

Overrides:
addNotify in class UIComponent<IPopupMenuButton>
See Also:
UIComponent.removeNotify(), UIComponent.isNotified()

removeNotify

public void removeNotify()
Makes this UIComponent undisplayable by removing it to an UIContainer.

This method is called by the genui internally and should not be called directly. Code overriding this method should call super.removeNotify as the first line of the overriding method.

Overrides:
removeNotify in class UIComponent<IPopupMenuButton>
See Also:
UIComponent.addNotify(), UIComponent.isNotified()


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.