1 package org.splat.wapp;
4 public class MenuItem extends Item {
6 private static final long serialVersionUID = 1002251657309138413L;
8 protected static class Group extends MenuItem {
9 // ---------------------------------------------
10 private boolean open = false;
11 private static final long serialVersionUID = 8319750643667219000L;
13 protected Group (String label) { super(label); }
14 protected Group (String label, String icon, String url) { super(label, icon, url); }
16 public boolean isOpen () { return open; }
17 public void open () { open = true; }
19 protected static class SubItem extends MenuItem {
20 // -----------------------------------------------
21 private static final long serialVersionUID = -4793172296421132566L;
23 protected SubItem (String label) { super(label); }
24 protected SubItem (String label, String icon, String url) { super(label, icon, url); }
27 // ==============================================================================================================================
29 // ==============================================================================================================================
31 public MenuItem (String label) {
32 // ------------------------------
35 public MenuItem (String label, String icon, String url) {
36 // -------------------------------------------------------
40 public MenuItem action (String url) {
41 // -----------------------------------
45 public MenuItem icon (String icon) {
46 // ----------------------------------
51 // ==============================================================================================================================
53 // ==============================================================================================================================
55 public boolean isGroup () {
56 // -------------------------
57 return (this instanceof Group);
60 public boolean isOpen () {
61 // ------------------------
62 return false; // Redefined in the Group subclass
65 public boolean isSubItem () {
66 // ---------------------------
67 return (this instanceof SubItem);