You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2007/04/16 12:34:15 UTC

svn commit: r529189 - in /myfaces/tobago/trunk/example/addressbook/src/main/webapp: WEB-INF/tags/ WEB-INF/tags/layout/ WEB-INF/tags/layout/basic.tag application/admin/admin.jsp application/editor.jsp application/list.jsp

Author: lofwyr
Date: Mon Apr 16 03:34:13 2007
New Revision: 529189

URL: http://svn.apache.org/viewvc?view=rev&rev=529189
Log:
add tag file for page layout

Added:
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/tags/
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/tags/layout/
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/tags/layout/basic.tag
Modified:
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/application/admin/admin.jsp
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/application/editor.jsp
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/application/list.jsp

Added: myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/tags/layout/basic.tag
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/tags/layout/basic.tag?view=auto&rev=529189
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/tags/layout/basic.tag (added)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/tags/layout/basic.tag Mon Apr 16 03:34:13 2007
@@ -0,0 +1,70 @@
+<%--
+ * 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.
+--%>
+
+<%@ attribute name="title" %>
+
+<%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="tc" %>
+<%@ taglib uri="http://myfaces.apache.org/tobago/extension" prefix="tx" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+
+<f:view locale="#{controller.language}">
+  <tc:loadBundle basename="resource" var="bundle"/>
+
+  <tc:page label="${title}" state="#{layout}" width="#{layout.width}" height="#{layout.height}">
+    <f:facet name="menuBar">
+      <tc:menuBar>
+        <tc:form>
+          <tc:menu label="#{bundle.menuFile}">
+            <tc:menuItem label="#{bundle.menuFileNew}" action="#{controller.createAddress}" immediate="true"
+                         image="image/org/tango-project/tango-icon-theme/16x16/actions/contact-new.png"/>
+            <tc:menuItem label="Add Dummy Addresses" action="#{controller.addDummyAddresses}" immediate="true"/>
+            <tc:menuSeparator/>
+            <tc:menuItem label="Logout" action="#{controller.logout}"
+                         image="image/org/tango-project/tango-icon-theme/16x16/actions/system-log-out.png"/>
+          </tc:menu>
+
+          <tc:menu label="#{bundle.menuSettings}">
+            <tc:menu label="#{bundle.menuSettingsLanguage}" >
+              <tx:menuRadio action="#{controller.languageChanged}"
+                            value="#{controller.language}">
+                <f:selectItems value="#{controller.languages}" />
+              </tx:menuRadio>
+            </tc:menu>
+            <tc:menu label="#{bundle.menuSettingsTheme}" >
+              <tx:menuRadio action="#{controller.themeChanged}"
+                            value="#{controller.theme}">
+                <f:selectItems value="#{controller.themeItems}" />
+              </tx:menuRadio>
+            </tc:menu>
+            <tc:menuCheckbox label="#{bundle.menuSettingsMode}" value="#{controller.simple}"/>
+          </tc:menu>
+
+          <tc:menu label="#{bundle.menuHelp}">
+            <tc:menuItem label="#{bundle.menuHelpAbout}"
+                         action="alert('#{bundle.aboutMessage}')"
+                         type="script" image="image/org/tango-project/tango-icon-theme/16x16/apps/help-browser.png"/>
+          </tc:menu>
+        </tc:form>
+      </tc:menuBar>
+    </f:facet>
+
+    <tc:cell>
+      <jsp:doBody/>
+    </tc:cell>
+
+  </tc:page>
+</f:view>

Modified: myfaces/tobago/trunk/example/addressbook/src/main/webapp/application/admin/admin.jsp
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/application/admin/admin.jsp?view=diff&rev=529189&r1=529188&r2=529189
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/application/admin/admin.jsp (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/application/admin/admin.jsp Mon Apr 16 03:34:13 2007
@@ -18,12 +18,11 @@
 <%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="tc" %>
 <%@ taglib uri="http://myfaces.apache.org/tobago/extension" prefix="tx" %>
 <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib tagdir="/WEB-INF/tags/layout" prefix="layout" %>
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 
-<f:view locale="#{controller.language}">
-  <tc:loadBundle basename="resource" var="bundle" />
-
-  <tc:page label="#{bundle.editorTitle}" state="#{layout}" width="#{layout.width}" height="#{layout.height}" id="page">
+<layout:basic title="Administration">
+  <jsp:body>
     <f:facet name="layout">
       <tc:gridLayout margin="10px" rows="*;fixed"/>
     </f:facet>
@@ -43,5 +42,5 @@
       <tc:cell/>
       <tc:button label="Back" action="list"/>
     </tc:panel>
-  </tc:page>
-</f:view>
\ No newline at end of file
+  </jsp:body>
+</layout:basic>

Modified: myfaces/tobago/trunk/example/addressbook/src/main/webapp/application/editor.jsp
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/application/editor.jsp?view=diff&rev=529189&r1=529188&r2=529189
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/application/editor.jsp (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/application/editor.jsp Mon Apr 16 03:34:13 2007
@@ -17,12 +17,10 @@
 <%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="tc" %>
 <%@ taglib uri="http://myfaces.apache.org/tobago/extension" prefix="tx" %>
 <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib tagdir="/WEB-INF/tags/layout" prefix="layout" %>
 
-<f:view locale="#{controller.language}">
-  <tc:loadBundle basename="resource" var="bundle" />
-
-  <tc:page label="#{bundle.editorTitle}" state="#{layout}" width="#{layout.width}" height="#{layout.height}">
-
+<layout:basic title="#{bundle.editorTitle}">
+  <jsp:body>
     <tc:panel>
       <f:facet name="layout">
         <tc:gridLayout margin="10px"/>
@@ -64,5 +62,5 @@
       </tc:box>
 
     </tc:panel>
-  </tc:page>
-</f:view>
+  </jsp:body>
+</layout:basic>

Modified: myfaces/tobago/trunk/example/addressbook/src/main/webapp/application/list.jsp
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/application/list.jsp?view=diff&rev=529189&r1=529188&r2=529189
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/application/list.jsp (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/application/list.jsp Mon Apr 16 03:34:13 2007
@@ -17,48 +17,11 @@
 <%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="tc" %>
 <%@ taglib uri="http://myfaces.apache.org/tobago/extension" prefix="tx" %>
 <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-<f:view locale="#{controller.language}">
-  <tc:loadBundle basename="resource" var="bundle"/>
+<%@ taglib tagdir="/WEB-INF/tags/layout" prefix="layout" %>
 
-  <tc:page label="#{bundle.listPageTitle}" state="#{layout}" width="#{layout.width}" height="#{layout.height}">
-    <f:facet name="menuBar">
-      <tc:menuBar>
-        <tc:form>
-          <tc:menu label="#{bundle.menuFile}">
-            <tc:menuItem label="#{bundle.menuFileNew}" action="#{controller.createAddress}" immediate="true"
-                         image="image/org/tango-project/tango-icon-theme/16x16/actions/contact-new.png"/>
-            <tc:menuItem label="Add Dummy Addresses" action="#{controller.addDummyAddresses}" immediate="true"/>
-            <tc:menuSeparator/>
-            <tc:menuItem label="Logout" action="#{controller.logout}" 
-                         image="image/org/tango-project/tango-icon-theme/16x16/actions/system-log-out.png"/>
-          </tc:menu>
-
-          <tc:menu label="#{bundle.menuSettings}">
-            <tc:menu label="#{bundle.menuSettingsLanguage}" >
-              <tx:menuRadio action="#{controller.languageChanged}"
-                            value="#{controller.language}">
-                <f:selectItems value="#{controller.languages}" />
-              </tx:menuRadio>
-            </tc:menu>
-            <tc:menu label="#{bundle.menuSettingsTheme}" >
-              <tx:menuRadio action="#{controller.themeChanged}"
-                            value="#{controller.theme}">
-                <f:selectItems value="#{controller.themeItems}" />
-              </tx:menuRadio>
-            </tc:menu>
-            <tc:menuCheckbox label="#{bundle.menuSettingsMode}" value="#{controller.simple}"/>
-          </tc:menu>
-
-          <tc:menu label="#{bundle.menuHelp}">
-            <tc:menuItem label="#{bundle.menuHelpAbout}"
-                         action="alert('#{bundle.aboutMessage}')"
-                         type="script" image="image/org/tango-project/tango-icon-theme/16x16/apps/help-browser.png"/>
-          </tc:menu>
-        </tc:form>
-      </tc:menuBar>
-    </f:facet>
-
-  <tc:panel>
+<layout:basic title="#{bundle.listPageTitle}">
+  <jsp:body>
+    <tc:panel>
       <f:facet name="layout">
         <tc:gridLayout margin="10px" rows="fixed;1*;20px"/>
       </f:facet>
@@ -142,29 +105,29 @@
 
       </tc:box>
       <tc:panel>
-      <f:facet name="layout">
-        <tc:gridLayout columns="*;20px;*"/>
-      </f:facet>
-      <tc:form>
-        <tx:selectOneChoice label="#{bundle.footerLanguage}"
-               value="#{controller.language}">
-          <f:selectItems value="#{controller.languages}" />
-          <f:facet name="change">
-            <tc:command action="#{controller.languageChangedList}"/>
-          </f:facet>
-        </tx:selectOneChoice>
-      </tc:form>
-      <tc:image alt="#{bundle.footerFlag}" width="16" height="11"
-                value="#{bundle.footerFlagIcon}"/>
-      <tc:form>
-        <tx:selectOneChoice label="#{bundle.footerTheme}" value="#{controller.theme}">
-          <f:selectItems value="#{controller.themeItems}" />
-          <f:facet name="change">
-            <tc:command action="#{controller.themeChanged}"/>
-          </f:facet>
-        </tx:selectOneChoice>
-      </tc:form>
-    </tc:panel>
+        <f:facet name="layout">
+          <tc:gridLayout columns="*;20px;*"/>
+        </f:facet>
+        <tc:form>
+          <tx:selectOneChoice label="#{bundle.footerLanguage}"
+                 value="#{controller.language}">
+            <f:selectItems value="#{controller.languages}" />
+            <f:facet name="change">
+              <tc:command action="#{controller.languageChangedList}"/>
+            </f:facet>
+          </tx:selectOneChoice>
+        </tc:form>
+        <tc:image alt="#{bundle.footerFlag}" width="16" height="11"
+                  value="#{bundle.footerFlagIcon}"/>
+        <tc:form>
+          <tx:selectOneChoice label="#{bundle.footerTheme}" value="#{controller.theme}">
+            <f:selectItems value="#{controller.themeItems}" />
+            <f:facet name="change">
+              <tc:command action="#{controller.themeChanged}"/>
+            </f:facet>
+          </tx:selectOneChoice>
+        </tc:form>
+      </tc:panel>
     </tc:panel>
-  </tc:page>
-</f:view>
+  </jsp:body>
+</layout:basic>