click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r792053 - /incubator/click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java
Date Wed, 08 Jul 2009 06:51:45 GMT
Author: sabob
Date: Wed Jul  8 06:51:45 2009
New Revision: 792053

URL: http://svn.apache.org/viewvc?rev=792053&view=rev
Log:
added menu example

Modified:
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java?rev=792053&r1=792052&r2=792053&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java Wed Jul
 8 06:51:45 2009
@@ -272,6 +272,8 @@
      * <p/>
      * Please ensure you have defined a menu {@link #accessController} if the
      * menu's {@link #isUserInRoles()} method is going to be called.
+     *
+     * @see #Menu(java.lang.String)
      */
     public Menu() {
     }
@@ -280,7 +282,35 @@
      * Create a new Menu instance with the given name.
      * <p/>
      * Please ensure you have defined a menu {@link #accessController} if the
-     * menu's {@link #isUserInRoles()} method is going to be called.
+     * menu's {@link #isUserInRoles()} method is going to be called. For example:
+     *
+     * <pre class="prettyprint">
+     * public class BorderPage extends Page {
+     *
+     *     ...
+     *
+     *     public void defineMenus() {
+     *
+     *         // Define an accessController
+     *         AccessController accessController = new RoleAccessController();
+     *
+     *         // Retrieve some user roles
+     *         List roles = securityService.getRoles();
+     *
+     *         Menu menu = new Menu("root");
+     *         menu.setAccessController(accessController);
+     *         menu.setRoles(roles);
+     *
+     *         Menu subMenu = new Menu("products");
+     *         subMenu.setLabel("Products");
+     *         subMenu.setAccessController(accessController);
+     *         subMenu.setRoles(roles);
+     *
+     *         menu.getChildren().add(subMenu);
+     *
+     *         ...
+     *     }
+     * } </pre>
      *
      * @param name the name of the menu
      */



Mime
View raw message