|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cosylab.gui.components.util.PopupManager
public class PopupManager
PopupManager
helps simple GUI widget to handle popup menu
in transparent and extensible way.
Constructor Summary | |
---|---|
PopupManager(javax.swing.JComponent owner)
Constructs a new PopupManager which belongs to the given component. |
|
PopupManager(javax.swing.JComponent owner,
boolean auto)
Creates manager, which can automatically show a popup menu. |
Method Summary | |
---|---|
int |
actionCount()
Returns the number of actions. |
void |
addAction(javax.swing.Action a)
Adds action to this manager. |
void |
addActions(javax.swing.Action[] a)
Adds action to this manager. |
boolean |
containsAction(javax.swing.Action a)
Checks in the manager contains the specified action. |
boolean |
containsActionForName(java.lang.String name)
Checks if the manager containes action with the specified name. |
int |
firstIndexOf(javax.swing.Action a)
Returns the first index of the action in the manager. |
int |
firstIndexOfName(java.lang.String name)
Returns the first index of the action with the given name. |
javax.swing.Action |
getAction(int index)
Returns the action at the given index. |
javax.swing.Action[] |
getActions()
Returns an array of all action in the manager. |
javax.swing.JPopupMenu |
getJPopupMenu()
Returns popup menu constructed from actions registered at the manager. |
com.cosylab.gui.components.util.PopupManager.MouseHook |
getMouseHook()
|
javax.swing.JComponent |
getOwner()
Returns owner of this manager. |
boolean |
isEnabled()
Returns true if popup manager is enabled and shows popup menu. |
void |
removeAction(javax.swing.Action a)
Removes the specified action from the manager. |
javax.swing.Action |
removeAction(int index)
Removes the action under the index. |
void |
removeActions(javax.swing.Action[] a)
Removes the specified actions from the manager |
javax.swing.Action[] |
removeAllActions()
Removes all actions from the manager. |
void |
setEnabled(boolean b)
Enambes or disables popup manager. |
void |
showPopup(java.awt.Component c,
int x,
int y)
Shows popup menu at given location. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PopupManager(javax.swing.JComponent owner)
public PopupManager(javax.swing.JComponent owner, boolean auto)
owner
- owner, for which manager manages popup menuauto
- true
if menu popups automaticallyMethod Detail |
---|
public javax.swing.JComponent getOwner()
public void addAction(javax.swing.Action a)
a
- action to be added, if null, action is translateed to manu separator.public void addActions(javax.swing.Action[] a)
a
- action to be added, if null, action is translateed to manu separator.public boolean containsAction(javax.swing.Action a)
a
-
public boolean containsActionForName(java.lang.String name)
name
- the name of the action
public int firstIndexOf(javax.swing.Action a)
a
-
public int firstIndexOfName(java.lang.String name)
name
- the name of the action
public javax.swing.Action getAction(int index)
index
- index of action
public void removeAction(javax.swing.Action a)
a
- the action to be removedpublic javax.swing.Action removeAction(int index)
index
- index at which the action should be removed
public void removeActions(javax.swing.Action[] a)
a
- actions to be removedpublic javax.swing.Action[] removeAllActions()
public int actionCount()
public javax.swing.Action[] getActions()
public javax.swing.JPopupMenu getJPopupMenu()
public void showPopup(java.awt.Component c, int x, int y)
x
- y
- c
- public com.cosylab.gui.components.util.PopupManager.MouseHook getMouseHook()
public boolean isEnabled()
true
if popup manager is enabled and shows popup menu.
public void setEnabled(boolean b)
b
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |