|
void | add (String parent, String name, int id) |
|
void | add (String parent, String name, int id, String value, String desc) |
|
void | actionPerformed (ActionEvent e) |
|
void | show (Component Invoker, int x, int y) |
|
The SVPopupMenu class provides the functionality to add a popup menu to ScrollView. Each popup menu item gets associated with a (client-defined) command-id, which SVPopupMenu will return upon clicking it.
- Author
- wanke.nosp@m.@goo.nosp@m.gle.c.nosp@m.om
Definition at line 34 of file SVPopupMenu.java.
void com.google.scrollview.ui.SVPopupMenu.actionPerformed |
( |
ActionEvent |
e | ) |
|
|
inline |
A click on one of the items in our menubar has occured. Forward it to the item itself to let it decide what happens.
Definition at line 129 of file SVPopupMenu.java.
132 SVAbstractMenuItem svm = items.get(e.getActionCommand());
134 svm.performAction(svWindow,
SVEventType.SVET_POPUP);
void com.google.scrollview.ui.SVPopupMenu.add |
( |
String |
parent, |
|
|
String |
name, |
|
|
int |
id |
|
) |
| |
|
inline |
Add a new entry to the menubar. For these items, the server will poll the client to ask what to do.
- Parameters
-
parent | The menu we add our new entry to (should have been defined before). If the parent is "", we will add the entry to the root (top-level) |
name | The caption of the new entry. |
id | The Id of the new entry. If it is -1, the entry will be treated as a menu. |
Definition at line 64 of file SVPopupMenu.java.
66 if (items.get(
name) != null) {
return; }
68 if (parent.equals(
"")) {
69 JMenu jli =
new JMenu(
name);
70 SVAbstractMenuItem mli =
new SVSubMenuItem(
name, jli);
76 SVAbstractMenuItem jmi = items.get(parent);
77 JMenu jli =
new JMenu(
name);
78 SVAbstractMenuItem mli =
new SVSubMenuItem(
name, jli);
84 SVAbstractMenuItem jmi = items.get(parent);
86 System.out.println(
"ERROR: Unknown parent " + parent);
89 SVAbstractMenuItem mli =
new SVEmptyMenuItem(
id,
name);
90 mli.mi.addActionListener(
this);
void com.google.scrollview.ui.SVPopupMenu.add |
( |
String |
parent, |
|
|
String |
name, |
|
|
int |
id, |
|
|
String |
value, |
|
|
String |
desc |
|
) |
| |
|
inline |
Add a new entry to the menubar. In this case, we also know its value and possibly even have a description. For these items, the server will not poll the client to ask what to do, but just show an input dialog and send a message with the new value.
- Parameters
-
parent | The menu we add our new entry to (should have been defined before). If the parent is "", we will add the entry to the root (top-level) |
name | The caption of the new entry. |
id | The Id of the new entry. If it is -1, the entry will be treated as a menu. |
value | The value of the new entry. |
desc | The description of the new entry. |
Definition at line 111 of file SVPopupMenu.java.
112 SVAbstractMenuItem jmi = items.get(parent);
113 SVMenuItem mli =
new SVMenuItem(
id,
name, value, desc);
114 mli.mi.addActionListener(
this);
115 items.put(
name, mli);
void com.google.scrollview.ui.SVPopupMenu.show |
( |
Component |
Invoker, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
|
inline |
Gets called by the SVEventHandler of the window to actually show the content of the popup menu.
Definition at line 141 of file SVPopupMenu.java.
142 root.show(Invoker, x, y);
The documentation for this class was generated from the following file: