|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.livescribe.penlet.PenletPlugin
com.livescribe.penlet.AbstractPenletPlugin
com.livescribe.ext.ui.MenuBookmarkHandlerPlugin
public class MenuBookmarkHandlerPlugin
A plugin that handles menu bookmark activation. This does not consume any events.
When the user taps on a bookmarked region, the following things happen:
A usage example:
MenuBookmarkHandlerPlugin mbh = new MenuBookmarkHandlerPlugin(this);
context.installPlugin(mbh);
mbh.activate();
…
myMenu.add("Info");
mbh.registerLast(myMenu, new BookmarkInfo(4, "INFO"));
myMenu.add("About");
mbh.registerLast(myMenu, new BookmarkInfo(5, "ABOUT"));
setForwardAPM(String),
setSelectAPM(String),
PenletContext.installPlugin(PenletPlugin)| Field Summary |
|---|
| Fields inherited from class com.livescribe.penlet.AbstractPenletPlugin |
|---|
active, listeners |
| Constructor Summary | |
|---|---|
MenuBookmarkHandlerPlugin(Penlet penlet)
Creates a new handler for activating menu bookmarks. |
|
| Method Summary | |
|---|---|
boolean |
onPenTipEvent(PenTipEvent ev)
This processes pen-down events but does not consume them. |
void |
register(Menu menu,
int index,
Bookmarkable b,
boolean doSelect)
Registers a menu item with this plugin so that when it is activated with a button tap, it is displayed properly. |
void |
registerLast(Menu menu,
Bookmarkable b,
boolean doSelect)
Registers the last item in the menu. |
void |
setForwardAPM(String clip)
Sets the sound to play when a menu item's submenu is followed. |
void |
setParentHoldTime(long time)
Sets the amount of time to pause at the parent menu when following into submenus. |
void |
setSelectAPM(String clip)
Sets the sound to play when a menu item is selected. |
| Methods inherited from class com.livescribe.penlet.AbstractPenletPlugin |
|---|
activate, addPluginListener, deactivate, fireActivated, fireDeactivated, isActive, onCoordinateEvent, onDocumentEvent, onMenuEvent, onRegionEvent, onStrokeEvent, removePluginListener, scheduleDeactivation, setConsumeAllEvents |
| Methods inherited from class com.livescribe.penlet.PenletPlugin |
|---|
getDisplay, getPenlet, restoreDisplay, saveDisplay |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MenuBookmarkHandlerPlugin(Penlet penlet)
penlet - the associated penlet| Method Detail |
|---|
public void register(Menu menu,
int index,
Bookmarkable b,
boolean doSelect)
If the doSelect parameter is true, then the
menu item will be selected when it is activated. This means
that it will be as if the user tapped right on the NavPlus
when the menu is showing. It also means that if the item has a submenu
then it will be followed after showing the item for a small period of
time.
This makes use of the Menu.setBookmarkable(int, Bookmarkable)
method so it is not necessary to call this yourself.
menu - register this menuindex - the menu item indexb - the Bookmarkable informationdoSelect - whether to select the item when it's activatedMenu.setBookmarkable(int, Bookmarkable)
public void registerLast(Menu menu,
Bookmarkable b,
boolean doSelect)
register(Menu, int, Bookmarkable, boolean) for more details.
menu - register the last item in this menub - the Bookmarkable informationdoSelect - whether to select the item when it's activatedregister(Menu, int, Bookmarkable, boolean)public void setParentHoldTime(long time)
Note that if there is no submenu then there is no pause.
The default is 1000 ms.
time - the pause time, in millisecondspublic void setSelectAPM(String clip)
null by default.
This sound will play instead of any sound configured on the menu, even
if this is set to null.
clip - the new select sound clip, null to
unsetMenu.setSelectAPM(String)public void setForwardAPM(String clip)
null by default.
This sound will play instead of any sound configured on the menu, even
if this is set to null.
clip - the new follow sound clip, null to
unsetMenu.setForwardAPM(String)public boolean onPenTipEvent(PenTipEvent ev)
Menus are selected before the event is passed to the application.
onPenTipEvent in class AbstractPenletPluginev - the pen tip event
false indicating that the events will be passed
to the application.AbstractPenletPlugin.setConsumeAllEvents(boolean)
|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||