|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.event.MouseAdapter
com.jidesoft.list.ListPopupMenuInstaller
public class ListPopupMenuInstaller
ListPopupMenuInstaller allows you to add a popup menu to a JList and customize it. To use it, you just need to call
ListPopupMenuInstaller installer = new ListPopupMenuInstaller(list);
Or if you want to uninstall it, call
ListPopupMenuInstaller.getListPopupMenuCustomizers(list).uninstallListeners();
However ListPopupMenuInstaller has no menu items. You need create your own ListPopupMenuCustomizer to do it.
| Field Summary | |
|---|---|
static String |
CLIENT_PROPERTY_POPUP_MENU_INSTALLER
Client property used by JList to provide its own ListPopupMenuCustomizer. |
| Constructor Summary | |
|---|---|
ListPopupMenuInstaller(JList list)
Creates a ListPopupMenuInstaller. |
|
| Method Summary | |
|---|---|
void |
addListPopupMenuCustomizer(ListPopupMenuCustomizer customizer)
Add a list popup menu customizer. |
static void |
addSeparatorIfNecessary(JPopupMenu popup)
Adds a separator to the popup menu if there are menu items on it already. |
protected JPopupMenu |
createPopupMenu()
Create the popup menu. |
protected void |
customizeMenuItems(JList list,
JPopupMenu popup,
int[] indices)
Customizes the menu items for the popup menu. |
ListPopupMenuCustomizer[] |
getListPopupMenuCustomizers()
Get the installed popup menu customizer. |
static ListPopupMenuInstaller |
getListPopupMenuInstaller(JList list)
Gets the ListPopupMenuInstaller installed on the JList. |
protected int[] |
getTargetListItems(JList list,
Point p)
Finds the target list items the menu will install on. |
void |
installListeners()
Installs the listeners needed in order to show the popup menu for the JList. |
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
void |
removeListPopupMenuCustomizer(ListPopupMenuCustomizer customizer)
Remove a list popup menu customizer. |
void |
uninstallListeners()
Uninstalls the listeners needed in order to show the popup menu for the JList. |
| Methods inherited from class java.awt.event.MouseAdapter |
|---|
mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseWheelMoved |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CLIENT_PROPERTY_POPUP_MENU_INSTALLER
| Constructor Detail |
|---|
public ListPopupMenuInstaller(JList list)
list - the JList.| Method Detail |
|---|
public void addListPopupMenuCustomizer(ListPopupMenuCustomizer customizer)
customizer - the customizerpublic void removeListPopupMenuCustomizer(ListPopupMenuCustomizer customizer)
customizer - the customizerpublic ListPopupMenuCustomizer[] getListPopupMenuCustomizers()
public void mousePressed(MouseEvent e)
mousePressed in interface MouseListenermousePressed in class MouseAdapterpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenermouseReleased in class MouseAdapterprotected JPopupMenu createPopupMenu()
protected void customizeMenuItems(JList list,
JPopupMenu popup,
int[] indices)
list - the JList.popup - the popup menu.indices - the target list items.public void installListeners()
public void uninstallListeners()
public static ListPopupMenuInstaller getListPopupMenuInstaller(JList list)
list - the JList
protected int[] getTargetListItems(JList list,
Point p)
list - the JListp - the point
nullpublic static void addSeparatorIfNecessary(JPopupMenu popup)
popup - the popup menu.
|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||