public class BasicPopupMenuUI extends PopupMenuUI
Modifier and Type | Field and Description |
---|---|
protected JPopupMenu |
popupMenu |
Constructor and Description |
---|
BasicPopupMenuUI()
Creates a new BasicPopupMenuUI object.
|
Modifier and Type | Method and Description |
---|---|
static ComponentUI |
createUI(JComponent x)
Factory method to create a BasicPopupMenuUI for the given
JComponent , which should be a JMenuItem . |
Dimension |
getMaximumSize(JComponent c)
This method returns the minimum size of the JPopupMenu.
|
Dimension |
getMinimumSize(JComponent c)
This method returns the minimum size of the JPopupMenu.
|
Dimension |
getPreferredSize(JComponent c)
This method returns the preferred size of the JPopupMenu.
|
void |
installDefaults()
This method installs the defaults that are defined in the Basic look
and feel for this
JPopupMenu . |
protected void |
installKeyboardActions()
This method installs the keyboard actions for this
JPopupMenu . |
protected void |
installListeners()
This method installs the listeners for the
JMenuItem . |
void |
installUI(JComponent c)
Installs and initializes all fields for this UI delegate.
|
boolean |
isPopupTrigger(MouseEvent e)
Return true if given mouse event is a platform popup trigger, and false
otherwise
|
protected void |
uninstallDefaults()
This method uninstalls the defaults and sets any objects created during
install to null
|
protected void |
uninstallKeyboardActions()
Uninstalls any keyboard actions.
|
protected void |
uninstallListeners()
Unregisters all the listeners that this UI delegate was using.
|
void |
uninstallUI(JComponent c)
Performs the opposite of installUI.
|
getPopup
contains, getAccessibleChild, getAccessibleChildrenCount, paint, update
protected JPopupMenu popupMenu
public BasicPopupMenuUI()
public static ComponentUI createUI(JComponent x)
JComponent
, which should be a JMenuItem
.x
- The JComponent
a UI is being created for.JComponent
.public void installUI(JComponent c)
installUI
in class ComponentUI
c
- The JComponent
that is having this UI installed.ComponentUI.uninstallUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
public void installDefaults()
JPopupMenu
.protected void installListeners()
JMenuItem
.protected void installKeyboardActions()
JPopupMenu
.public void uninstallUI(JComponent c)
uninstallUI
in class ComponentUI
c
- The JComponent
that is having this UI uninstalled.ComponentUI.installUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
protected void uninstallDefaults()
protected void uninstallListeners()
protected void uninstallKeyboardActions()
public Dimension getMinimumSize(JComponent c)
getMinimumSize
in class ComponentUI
c
- The JComponent to find a size for.public Dimension getPreferredSize(JComponent c)
getPreferredSize
in class ComponentUI
c
- The JComponent to find a size for.public Dimension getMaximumSize(JComponent c)
getMaximumSize
in class ComponentUI
c
- The JComponent to find a size for.public boolean isPopupTrigger(MouseEvent e)
isPopupTrigger
in class PopupMenuUI
e
- MouseEvent that is to be checked for popup trigger event