Interface semper.tinguin.MenuHandler
All Packages Class Hierarchy This Package Previous Next Index
Interface semper.tinguin.MenuHandler
- public interface MenuHandler
- extends Object
This class provides a way to handle custom menus that should be added
to the TINGUIN. Each manager that would like to use there own menus
have to generate them, add them to the TINGUIN and give the TINGUIN
also and implementation of such a MenuHandler
class ABCMenuHandler implements MenuHandler {
public ABCMenuHandler() {
.....
Menu myMenu = new Menu("My Menu");
myMenu.add(new MenuItem("Bla Bla");
.....
TinguinManager.registerMenu(this, myMenu);
...
}
public void menuAction(Menuitem m) {
....
if (m.getLabel().equals("Bla Bla"))
ABCManager.doSomething();
}
}
class ABCManager {
private static ABCMenuHandler __handler = new ABCMenuHandler();
static public void doSomething() ...
Classes that implement this interface only have to provide an
implementation for the method menuAction. This method is invoked in
case that the user selects an item of that specific custom menu. The
menuAction method should then invoke specific action depending on the
actual item.
- Version:
- 0.1
- Author:
- Abraham Lincoln
- See Also:
- TinguinManager
-
menuAction(MenuItem)
- This method is invoked if the custom menu of this handle was selected.
menuAction
public abstract void menuAction(MenuItem item)
- This method is invoked if the custom menu of this handle was selected.
- Parameters:
- item - - The menu item of the custom item which was selected
All Packages Class Hierarchy This Package Previous Next Index