swingwtx.swing
Class JMenu

java.lang.Object
  extended byswingwt.awt.Component
      extended byswingwt.awt.Container
          extended byswingwtx.swing.JComponent
              extended byswingwtx.swing.AbstractButton
                  extended byswingwtx.swing.JSWTMenuComponent
                      extended byswingwtx.swing.JMenu
All Implemented Interfaces:
ImageObserver, MenuContainer, SwingConstants

public class JMenu
extends JSWTMenuComponent


Nested Class Summary
 
Nested classes inherited from class swingwtx.swing.JComponent
JComponent.InternalFrameSelectionListener
 
Field Summary
 
Fields inherited from class swingwtx.swing.JSWTMenuComponent
actionCommand, actionListeners, CANCELED, DESELECTED, menuAction, menuListeners, pAccelerator, peer, pEnabled, pImage, pMnemonic, pNamedAccelerator, pText, SELECTED
 
Fields inherited from class swingwtx.swing.AbstractButton
changeListeners, itemListeners, pAction, pGroup, pHAlign, pHTextPosition, pIcon, pModel, ppeer, pSelection, pVAlign, pVTextPosition
 
Fields inherited from class swingwtx.swing.JComponent
accessibleContext, actionMap, ancestorInputMap, border, clientProperties, descendantHasPeer, focusInputMap, internalFrameAdapter, internalFrameParent, opaque, propertyChangeListeners, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW, windowInputMap
 
Fields inherited from class swingwt.awt.Container
composite, comps, containerListeners, layout, queuedValidateRequest
 
Fields inherited from class swingwt.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListeners, componentName, consumeAvailableHeight, consumeAvailableWidth, focusable, focusListeners, graphicsConfig, inputMethodListeners, isUserSetFont, keyListeners, layoutModifier, LEFT_ALIGNMENT, LOCK, mouseListeners, mouseMotionListeners, mouseWheelListeners, parent, pBackground, pCursor, pDoubleBuffered, pFont, pForeground, pLayoutData, pLocation, pMaxSize, pMinSize, pPrefSize, pSize, pToolTipText, pVisible, RIGHT_ALIGNMENT, swingWTDefaultActionEventAdapter, swingWTEventAdapter, TOP_ALIGNMENT
 
Fields inherited from interface swingwtx.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface swingwt.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JMenu()
           
JMenu(Action a)
           
JMenu(java.lang.String text)
           
JMenu(java.lang.String text, boolean isTearOff)
           
 
Method Summary
 JMenuItem add(Action a)
          Adds an action to the container
 Component add(Component c)
          Adds a component to the menu.
 Component add(Component c, int index)
          Adds a component to the menu at the index specified.
 JMenu add(JMenu c)
           
 JMenuItem add(JMenuItem c)
           
 JMenuItem add(JMenuItem c, java.lang.String name)
           
 JMenu add(JMenu c, java.lang.String name)
           
 JSWTMenuComponent add(JSWTMenuComponent c)
          Adds a component to the container
 JSWTMenuComponent add(JSWTMenuComponent c, java.lang.String name)
           
 JMenuItem add(java.lang.String text)
          Adds a new menu item with the specified text
 void addSeparator()
           
 JMenuItem getItem(int index)
           
 int getItemCount()
           
 JPopupMenu getPopupMenu()
          Generates a new JPopupMenu with references to the same child components as this JMenu.
 boolean isSelected()
           
 boolean isTearOff()
           
 void remove(Component c)
          Removes a component from the menu
 void remove(int index)
          Removes the menu item with the specified index from the list
 void remove(JSWTMenuComponent c)
           
 void removeAll()
           
 void setSelected(boolean b)
           
 void setSwingWTParent(org.eclipse.swt.widgets.Menu parent, org.eclipse.swt.widgets.Shell shell)
           
 
Methods inherited from class swingwtx.swing.JSWTMenuComponent
addActionListener, addMenuListener, dispose, getActionCommand, getLabel, getMenuPeer, getMnemonic, getText, getToolTipText, isEnabled, processActionEvent, processMenuEvent, registerEvents, removeActionListener, removeMenuListener, requestFocus, setAccelerator, setActionCommand, setCachedProperties, setEnabled, setIcon, setLabel, setMnemonic, setMnemonic, setText, setToolTipText, showMnemonic
 
Methods inherited from class swingwtx.swing.AbstractButton
addChangeListener, addItemListener, getAction, getHorizontalAlignment, getHorizontalTextPosition, getModel, getVerticalAlignment, getVerticalTextPosition, processItemEvent, registerActionEvents, removeChangeListener, removeItemListener, setAction, setAction, setBorderPainted, setContentAreaFilled, setDisabledIcon, setFocusPainted, setGroup, setHorizontalAlignment, setHorizontalTextPosition, setModel, setPressedIcon, setRolloverIcon, setRolloverSelectedIcon, setSelectedIcon, setVerticalAlignment, setVerticalTextPosition
 
Methods inherited from class swingwtx.swing.JComponent
add, add, add, addPropertyChangeListener, addPropertyChangeListener, checkInternalFrameChild, getAccessibleContext, getActionMap, getAutoscrolls, getBorder, getClientProperty, getInputMap, getInsets, getToolTipLocation, getToolTipText, getTopLevelAncestor, getVisibleRect, isDoubleBuffered, isOpaque, isOptimizedDrawingEnabled, isValidateRoot, paint, paintBackground, paintChildren, paintComponent, paintImmediately, paintImmediately, putClientProperty, removePropertyChangeListener, removePropertyChangeListener, repaint, revalidate, scrollRectToVisible, setActionMap, setAutoscrolls, setBorder, setDoubleBuffered, setInputMap, setMargin, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setSwingWTParent
 
Methods inherited from class swingwt.awt.Container
addComponentToLayout, addContainerListener, debug_showContainmentTree, doAdd, doLayout, getComponent, getComponentCount, getComponentOrientation, getComponents, getComposite, getLayout, getMaximumSize, getMinimumSize, getParent, getPreferredSize, invalidate, minimumSize, preferredSize, processContainerEvent, processEvent, queuedValidate, removeComponentFromCache, removeContainerListener, setLayout, setLayoutImpl, validate
 
Methods inherited from class swingwt.awt.Component
add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, calculatePreferredSize, componentOnlyDispose, computePreferredSize, contains, contains, createImage, createListenerArrayFromVector, createVolatileImage, dispatchEvent, getAlignmentX, getAlignmentY, getBackground, getBounds, getCursor, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getListeners, getLocation, getLocationOnScreen, getName, getPeer, getPeerSize, getSize, getSize, getSWTPeer, getToolkit, getTreeLock, getWidth, getX, getY, grabFocus, hasFocus, hasSetFont, hide, imageUpdate, inside, isFocusable, isMinimumSizeSet, isShowing, isVisible, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, processTraverseEvent, registerComponentEvents, registerExtendedModifyEvents, registerFocusEvents, registerKeyEvents, registerModifyEvents, registerMouseEvents, registerPaintEvents, registerTraversalEvents, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, repaint, repaint, repaint, setAlignmentX, setAlignmentY, setBackground, setBounds, setBounds, setComponentOrientation, setComponentRemoved, setCursor, setFocusable, setFocusTraversalKeysEnabled, setFont, setForeground, setHeight, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setSize, setSize, setVisible, setWidth, show, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMenu

public JMenu()

JMenu

public JMenu(Action a)

JMenu

public JMenu(java.lang.String text)

JMenu

public JMenu(java.lang.String text,
             boolean isTearOff)
Method Detail

add

public JSWTMenuComponent add(JSWTMenuComponent c)
Adds a component to the container


add

public JSWTMenuComponent add(JSWTMenuComponent c,
                             java.lang.String name)

add

public JMenu add(JMenu c)

add

public JMenu add(JMenu c,
                 java.lang.String name)

add

public JMenuItem add(JMenuItem c)

add

public JMenuItem add(JMenuItem c,
                     java.lang.String name)

add

public JMenuItem add(Action a)
Adds an action to the container


add

public JMenuItem add(java.lang.String text)
Adds a new menu item with the specified text


add

public Component add(Component c)
Adds a component to the menu.

Overrides:
add in class JComponent
Throws:
java.lang.IllegalArgumentException - - SwingWT cannot support this.

add

public Component add(Component c,
                     int index)
Adds a component to the menu at the index specified.

Overrides:
add in class JComponent
Throws:
java.lang.IllegalArgumentException - - SwingWT cannot support this.

remove

public void remove(Component c)
Removes a component from the menu

Overrides:
remove in class JComponent
Throws:
java.lang.IllegalArgumentException - - SwingWT cannot support this.

remove

public void remove(JSWTMenuComponent c)

remove

public void remove(int index)
Removes the menu item with the specified index from the list

Overrides:
remove in class JComponent

removeAll

public void removeAll()
Overrides:
removeAll in class Container

addSeparator

public void addSeparator()

getPopupMenu

public JPopupMenu getPopupMenu()
Generates a new JPopupMenu with references to the same child components as this JMenu. Should work just like Swing in practice (and doesn't waste objects - aside from the JPopupMenu itself, the existing objects are reused


setSwingWTParent

public void setSwingWTParent(org.eclipse.swt.widgets.Menu parent,
                             org.eclipse.swt.widgets.Shell shell)
                      throws java.lang.Exception
Overrides:
setSwingWTParent in class JSWTMenuComponent
Throws:
java.lang.Exception

isSelected

public boolean isSelected()
Specified by:
isSelected in class AbstractButton

setSelected

public void setSelected(boolean b)
Specified by:
setSelected in class AbstractButton

getItem

public JMenuItem getItem(int index)

getItemCount

public int getItemCount()

isTearOff

public boolean isTearOff()