com.sibvisions.rad.ui.swing.impl.menu
Class SwingPopupMenu

java.lang.Object
  extended by com.sibvisions.rad.ui.awt.impl.AwtResource<C>
      extended by com.sibvisions.rad.ui.awt.impl.AwtComponent<C>
          extended by com.sibvisions.rad.ui.awt.impl.AwtContainer<C>
              extended by com.sibvisions.rad.ui.swing.impl.SwingComponent<javax.swing.JPopupMenu>
                  extended by com.sibvisions.rad.ui.swing.impl.menu.SwingPopupMenu
All Implemented Interfaces:
java.awt.event.ComponentListener, java.awt.event.FocusListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.util.EventListener, IAlignmentConstants, IComponent, IContainer, IResource, IPopupMenu, INamedObject, javax.swing.event.PopupMenuListener

public class SwingPopupMenu
extends SwingComponent<javax.swing.JPopupMenu>
implements IPopupMenu, javax.swing.event.PopupMenuListener

The SwingPopupMenu is the IPopupMenu implementation for swing.

See Also:
JPopupMenu, IPopupMenu

Field Summary
protected  boolean bPopupMenuListener
          whether the popup menu listener was added.
 
Fields inherited from class com.sibvisions.rad.ui.awt.impl.AwtComponent
bComponentListener, bFocusListener, bKeyListener, bMouseListener, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, eventSource, factory, parent
 
Fields inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource
resource
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
SwingPopupMenu()
          Creates a new instance of SwingPopupMenu.
 
Method Summary
protected  void addPopupMenuListener()
          Adds a component listener for this component, if not already added.
 void addSeparator()
          Appends a new separator at the end of the menu.
 void addSeparator(int pIndex)
          Inserts a separator at the specified position.
 PopupMenuHandler<IPopupMenuCanceledListener> eventPopupMenuCanceled()
          The PopupMenuHandler for the popup menu canceled event.
 PopupMenuHandler<IPopupMenuWillBecomeInvisibleListener> eventPopupMenuWillBecomeInvisible()
          The PopupMenuHandler for the popup menu will become invisible event.
 PopupMenuHandler<IPopupMenuWillBecomeVisibleListener> eventPopupMenuWillBecomeVisible()
          The PopupMenuHandler for the popup menu will become visible event.
 void popupMenuCanceled(javax.swing.event.PopupMenuEvent e)
          
 void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent e)
          
 void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent e)
          
 void show(IComponent pOrigin, int pX, int pY)
          Shows the popup menu at the x, y position relative to an origin component.
 
Methods inherited from class com.sibvisions.rad.ui.swing.impl.SwingComponent
capture, getToolTipText, setBackground, setTabIndex, setToolTipText
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtContainer
add, add, add, add, addIntern, checkAdd, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, removeIntern, setLayout, setLayoutIntern
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtComponent
addComponentListener, addFocusListener, addKeyListener, addMouseListener, componentHidden, componentMoved, componentResized, componentShown, createImage, createMouseEvent, equals, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, focusGained, focusLost, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getHorizontalAlignment, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getStyle, getTabIndex, getVerticalAlignment, hashCode, invalidateLayout, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, requestFocus, setBounds, setCursor, setEnabled, setEventSource, setFactory, setFocusable, setFont, setForeground, setHorizontalAlignment, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setStyle, setVerticalAlignment, setVisible, validate
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource
getResource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.IContainer
add, add, add, add, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, setLayout
 
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
 

Field Detail

bPopupMenuListener

protected boolean bPopupMenuListener
whether the popup menu listener was added.

Constructor Detail

SwingPopupMenu

public SwingPopupMenu()
Creates a new instance of SwingPopupMenu.

Method Detail

addSeparator

public void addSeparator()
Appends a new separator at the end of the menu.

Specified by:
addSeparator in interface IPopupMenu

addSeparator

public void addSeparator(int pIndex)
Inserts a separator at the specified position.

Specified by:
addSeparator in interface IPopupMenu
Parameters:
pIndex - an integer specifying the position at which to insert the menu separator

show

public void show(IComponent pOrigin,
                 int pX,
                 int pY)
Shows the popup menu at the x, y position relative to an origin component. The origin component must be contained within the component hierarchy of the popup menu's parent. Both the origin and the parent must be showing on the screen for this method to be valid.

If this PopupMenu is being used as a Menu (i.e., it has a non-Component parent), then you cannot call this method on the PopupMenu.

Specified by:
show in interface IPopupMenu
Parameters:
pOrigin - the component which defines the coordinate space
pX - the x coordinate position to popup the menu
pY - the y coordinate position to popup the menu

eventPopupMenuWillBecomeVisible

public PopupMenuHandler<IPopupMenuWillBecomeVisibleListener> eventPopupMenuWillBecomeVisible()
The PopupMenuHandler for the popup menu will become visible event.

Specified by:
eventPopupMenuWillBecomeVisible in interface IPopupMenu
Returns:
the PopupMenuHandler for the focus gained event.

eventPopupMenuWillBecomeInvisible

public PopupMenuHandler<IPopupMenuWillBecomeInvisibleListener> eventPopupMenuWillBecomeInvisible()
The PopupMenuHandler for the popup menu will become invisible event.

Specified by:
eventPopupMenuWillBecomeInvisible in interface IPopupMenu
Returns:
the PopupMenuHandler for the popup menu will become invisible event.

eventPopupMenuCanceled

public PopupMenuHandler<IPopupMenuCanceledListener> eventPopupMenuCanceled()
The PopupMenuHandler for the popup menu canceled event.

Specified by:
eventPopupMenuCanceled in interface IPopupMenu
Returns:
the PopupMenuHandler for the popup menu canceled event.

popupMenuWillBecomeVisible

public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent e)

Specified by:
popupMenuWillBecomeVisible in interface javax.swing.event.PopupMenuListener

popupMenuWillBecomeInvisible

public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent e)

Specified by:
popupMenuWillBecomeInvisible in interface javax.swing.event.PopupMenuListener

popupMenuCanceled

public void popupMenuCanceled(javax.swing.event.PopupMenuEvent e)

Specified by:
popupMenuCanceled in interface javax.swing.event.PopupMenuListener

addPopupMenuListener

protected void addPopupMenuListener()
Adds a component listener for this component, if not already added.



Copyright © 2009 SIB Visions GmbH. All Rights Reserved.