click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r949395 - in /click/trunk/click/examples: src/org/apache/click/examples/page/general/PageAction.java webapp/WEB-INF/menu.xml webapp/assets/images/lightning.png webapp/general/page-action.htm
Date Sat, 29 May 2010 14:25:15 GMT
Author: sabob
Date: Sat May 29 14:25:15 2010
New Revision: 949395

URL: http://svn.apache.org/viewvc?rev=949395&view=rev
Log:
Page Action example. CLK-677

Added:
    click/trunk/click/examples/src/org/apache/click/examples/page/general/PageAction.java
    click/trunk/click/examples/webapp/assets/images/lightning.png   (with props)
    click/trunk/click/examples/webapp/general/page-action.htm
Modified:
    click/trunk/click/examples/webapp/WEB-INF/menu.xml

Added: click/trunk/click/examples/src/org/apache/click/examples/page/general/PageAction.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/general/PageAction.java?rev=949395&view=auto
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/general/PageAction.java
(added)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/general/PageAction.java
Sat May 29 14:25:15 2010
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.click.examples.page.general;
+
+import org.apache.click.Partial;
+import org.apache.click.control.PageLink;
+import org.apache.click.examples.page.BorderPage;
+
+/**
+ * Provides an Page action demo.
+ */
+public class PageAction extends BorderPage {
+
+    private static final long serialVersionUID = 1L;
+
+    private PageLink link = new PageLink("link", PageAction.class);
+
+    public PageAction() {
+        addControl(link);
+
+        // We set a PAGE_ACTION to invoke the getDate method below
+        link.setParameter(PAGE_ACTION, "getDate");
+    }
+
+    /**
+     * This method will be invoked when the link is clicked.
+     */
+    public Partial getDate() {
+        return new Partial(format.currentDate());
+    }
+}

Modified: click/trunk/click/examples/webapp/WEB-INF/menu.xml
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/WEB-INF/menu.xml?rev=949395&r1=949394&r2=949395&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/WEB-INF/menu.xml (original)
+++ click/trunk/click/examples/webapp/WEB-INF/menu.xml Sat May 29 14:25:15 2010
@@ -46,14 +46,10 @@
     <menu label="Direct Page" path="general/direct-page.htm" target="_blank"/>
     <menu label="Exception Demo" path="general/exception.htm"/>
     <menu label="Flash Attribute" path="general/flash.htm"/>
+    <menu label="Page Action" path="general/page-action.htm"/>
     <menu label="Page Imports" path="general/page-imports-example.htm"/>
     <menu label="Page Security" path="security/secure.htm"/>
     <menu separator="true"/>
-    <menu label="AJAX Accordion" path="ajax/ajax-accordion.htm"/>
-    <menu label="AJAX Auto Complete Field" path="ajax/auto-complete.htm"/>
-    <menu label="AJAX Live Scroller " path="ajax/ajax-live-scroller.htm"/>
-    <menu label="AJAX Select" path="ajax/ajax-select.htm"/>
-    <menu separator="true"/>
     <menu label="JSP Hello World" path="jsp/hello-world.htm"/>
     <menu label="JSP Customer Table" path="jsp/customer-table.htm"/>
     <menu label="JSP Form Demo" path="jsp/edit-customer.htm"/>
@@ -125,20 +121,25 @@
     <menu label="Large Dataset Demo" path="table/large-dataset-demo.htm"/>
   </menu>
 
-  <menu label=" Tree" path="#" imageSrc="/assets/images/tree.png">
-    <menu label="Tree" path="tree/tree-page.htm"/>
-    <menu label="Advanced Tree" path="tree/advanced-tree-page.htm"/>
-    <menu label="Checkbox Tree" path="tree/checkbox-tree-page.htm"/>
-    <menu label="Page Link Tree" path="tree/page-link-tree-page.htm"/>
-  </menu>
-
-  <menu label=" Panel" path="#" imageSrc="/assets/images/panel.png">
+  <menu label=" Panels &amp; Trees " path="#" imageSrc="/assets/images/tree.png">
     <menu label="Simple Panel" path="panel/simple-panel-demo.htm"/>
     <menu label="List Panel" path="panel/list-panel-demo.htm"/>
     <menu label="Tabbed Panel" path="panel/tabbed-panel-demo.htm"/>
     <menu label="Filter Panel" path="panel/filter-panel-demo.htm"/>
     <menu label="Column Panel" path="panel/panel-column-demo.htm"/>
     <menu label="Reusable Panel" path="panel/reusable-panel-demo.htm"/>
+    <menu separator="true"/>
+    <menu label="Tree" path="tree/tree-page.htm"/>
+    <menu label="Advanced Tree" path="tree/advanced-tree-page.htm"/>
+    <menu label="Checkbox Tree" path="tree/checkbox-tree-page.htm"/>
+    <menu label="Page Link Tree" path="tree/page-link-tree-page.htm"/>
+  </menu>
+
+  <menu label="Ajax" path="#" imageSrc="/assets/images/lightning.png">
+    <menu label="AJAX Accordion" path="ajax/ajax-accordion.htm"/>
+    <menu label="AJAX Auto Complete Field" path="ajax/auto-complete.htm"/>
+    <menu label="AJAX Live Scroller " path="ajax/ajax-live-scroller.htm"/>
+    <menu label="AJAX Select" path="ajax/ajax-select.htm"/>
   </menu>
 
   <menu label=" Integration" path="#" imageSrc="/assets/images/cayenne.png">

Added: click/trunk/click/examples/webapp/assets/images/lightning.png
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/assets/images/lightning.png?rev=949395&view=auto
==============================================================================
Binary file - no diff available.

Propchange: click/trunk/click/examples/webapp/assets/images/lightning.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: click/trunk/click/examples/webapp/general/page-action.htm
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/general/page-action.htm?rev=949395&view=auto
==============================================================================
--- click/trunk/click/examples/webapp/general/page-action.htm (added)
+++ click/trunk/click/examples/webapp/general/page-action.htm Sat May 29 14:25:15 2010
@@ -0,0 +1 @@
+$link
\ No newline at end of file



Mime
View raw message