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;
14 private static final long serialVersionUID = 8319750643667219000L;
16 protected Group (String label) { super(label); }
17 protected Group (String label, String icon, String url) { super(label, icon, url); }
19 public boolean isOpen () { return open; }
20 public void open () { open = true; }
22 protected static class SubItem extends MenuItem {
23 // -----------------------------------------------
27 private static final long serialVersionUID = -4793172296421132566L;
29 protected SubItem (String label) { super(label); }
30 protected SubItem (String label, String icon, String url) { super(label, icon, url); }
33 // ==============================================================================================================================
35 // ==============================================================================================================================
37 public MenuItem (String label) {
38 // ------------------------------
41 public MenuItem (String label, String icon, String url) {
42 // -------------------------------------------------------
46 public MenuItem action (String url) {
47 // -----------------------------------
51 public MenuItem icon (String icon) {
52 // ----------------------------------
57 // ==============================================================================================================================
59 // ==============================================================================================================================
61 public boolean isGroup () {
62 // -------------------------
63 return (this instanceof Group);
66 public boolean isOpen () {
67 // ------------------------
68 return false; // Redefined in the Group subclass
71 public boolean isSubItem () {
72 // ---------------------------
73 return (this instanceof SubItem);