public class nUIPopupMenuBuilder
extends java.lang.Object
Constructor and Description |
---|
nUIPopupMenuBuilder() |
Modifier and Type | Method and Description |
---|---|
nUIPopupMenuBuilder |
addItem(java.lang.String item_title,
java.lang.Runnable action)
Add an item and its associated action to the menu.
|
nUIPopupMenuBuilder |
addItem(java.lang.String item_title,
java.lang.Runnable action,
java.lang.String identifier)
Add an item and its associated action to the menu.
|
java.lang.String |
getCancelButtonTitle()
Get the String representing the title of the cancel button.
|
java.util.Vector |
getItemActions()
Get a
Vector of the Runnable s associated with the buttons in this popup menu. |
java.util.Vector |
getItemTitles()
Get a
Vector of String s representing the titles of the buttons in this popup menu. |
void |
setCancelButtonTitle(java.lang.String cancel_title)
Set the title for the "Cancel" or "Dismiss" button.
|
void |
show(nUIElementDisplay anchorElement)
Opens the pop-up menu, anchoring it to the specified NativeUI Element.
|
public nUIPopupMenuBuilder addItem(java.lang.String item_title, java.lang.Runnable action)
item_title
- the String
to use as a button label for this item.
If a null
String is passed, then the button will automatically have a name assigned to it
based on the number of items that already exist.action
- the Runnable
that will be executed when the button is pressed. If the Runnable
is null, then no action is performed when the corresponding button is pressed.this
to allow for fluent-style method chaining.public nUIPopupMenuBuilder addItem(java.lang.String item_title, java.lang.Runnable action, java.lang.String identifier)
item_title
- the String
to use as a button label for this item.action
- the Runnable
that will be executed when the button is pressed.identifier
- the String
to use as an element identifier (in the same way as setElementIdentifier(String)
)this
to allow for fluent-style method chaining.public void show(nUIElementDisplay anchorElement)
anchorElement
is null, then
the element will not be shown.anchorElement
- the UI element that the pop-up should be associated with.public java.util.Vector getItemTitles()
Vector
of String
s representing the titles of the buttons in this popup menu.public java.util.Vector getItemActions()
Vector
of the Runnable
s associated with the buttons in this popup menu.public java.lang.String getCancelButtonTitle()
public void setCancelButtonTitle(java.lang.String cancel_title)
cancel_title
-