You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by an...@apache.org on 2006/05/17 09:59:17 UTC
svn commit: r407196 - in
/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry:
Framework.library dojo/html/DojoDebugConsole.jwc
dojo/html/DojoDebugConsole.script dojo/html/TitlePane.java
dojo/html/TitlePane.jwc dojo/html/TitlePane.script
Author: andyhot
Date: Wed May 17 00:59:17 2006
New Revision: 407196
URL: http://svn.apache.org/viewcvs?rev=407196&view=rev
Log:
DojoDebugConsole and TitlePane
Added:
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/DojoDebugConsole.jwc
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/DojoDebugConsole.script
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/TitlePane.java
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/TitlePane.jwc
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/TitlePane.script
Modified:
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/Framework.library
Modified: tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/Framework.library
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/Framework.library?rev=407196&r1=407195&r2=407196&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/Framework.library (original)
+++ tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/Framework.library Wed May 17 00:59:17 2006
@@ -80,7 +80,9 @@
<component-type type="ValidField" specification-path="valid/ValidField.jwc"/>
<component-type type="FloatingPane" specification-path="dojo/html/FloatingPane.jwc"/>
+ <component-type type="DojoDebugConsole" specification-path="dojo/html/DojoDebugConsole.jwc"/>
<component-type type="TaskBar" specification-path="dojo/html/TaskBar.jwc"/>
+ <component-type type="TitlePane" specification-path="dojo/html/TitlePane.jwc"/>
<page name="StaleLink" specification-path="pages/StaleLink.page"/>
<page name="StaleSession" specification-path="pages/StaleSession.page"/>
Added: tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/DojoDebugConsole.jwc
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/DojoDebugConsole.jwc?rev=407196&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/DojoDebugConsole.jwc (added)
+++ tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/DojoDebugConsole.jwc Wed May 17 00:59:17 2006
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2004, 2005, 2006 The Apache Software Foundation
+
+ Licensed 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.
+-->
+
+<!DOCTYPE component-specification PUBLIC
+ "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+ "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
+
+<component-specification class="org.apache.tapestry.dojo.html.FloatingPane"
+ allow-body="yes" allow-informal-parameters="yes">
+
+ <description>
+ Creates a floating pane that captures all debugging output
+ (from dojo.debug() statements) in it.
+ </description>
+
+ <parameter name="minHeight" default-value="literal:100"/>
+ <parameter name="minWidth" default-value="literal:200"/>
+ <parameter name="hasToolbar" default-value="ognl:true"/>
+ <parameter name="persistPosition" default-value="ognl:true">
+ <description>If true, the position and size of the pane are persisted with cookies.</description>
+ </parameter>
+
+ <parameter name="href">
+ <description>
+ The location of the pane's contents. If not specified, the pane
+ will simply show its body.
+ </description>
+ </parameter>
+
+ <parameter name="hasShadow" default-value="ognl:true">
+ <description>Add shadow to the pane.</description>
+ </parameter>
+ <parameter name="icon">
+ <description>The icon of the pane.</description>
+ </parameter>
+ <parameter name="title" default-value="literal:Dojo Debug Console">
+ <description>The title of the pane.</description>
+ </parameter>
+ <parameter name="constrainToContainer">
+ <description>If true, the pane cannot be moved outside its container.</description>
+ </parameter>
+ <parameter name="resizable" default-value="ognl:true">
+ <description>If true, a resize handle appears at the lower right of the pane.</description>
+ </parameter>
+ <parameter name="displayCloseAction" default-value="ognl:true">
+ <description>If true, displays icon for close action.</description>
+ </parameter>
+ <parameter name="displayMinimizeAction" default-value="ognl:true">
+ <description>If true, displays icon for minimize action.</description>
+ </parameter>
+ <parameter name="displayMaximizeAction" default-value="ognl:true">
+ <description>If true, displays icon for maximize action.</description>
+ </parameter>
+ <parameter name="taskBar">
+ <description>
+ The taskbar this pane belongs to. If specified, this can either be
+ the html id of the TaskBar or the FloatingPane instance representing
+ the TaskBar.
+ </description>
+ </parameter>
+
+ <parameter name="id" property="idParameter" default-value="id">
+ <description>
+ The html id of the div created by the pane.
+ </description>
+ </parameter>
+
+ <parameter name="options">
+ <description>Additional javascript options. Use JSON notation.</description>
+ </parameter>
+
+ <property name="isTaskBar" initial-value="false"/>
+
+ <inject property="script" type="script" object="DojoDebugConsole.script"/>
+
+</component-specification>
Added: tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/DojoDebugConsole.script
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/DojoDebugConsole.script?rev=407196&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/DojoDebugConsole.script (added)
+++ tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/DojoDebugConsole.script Wed May 17 00:59:17 2006
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<!DOCTYPE script PUBLIC
+ "-//Apache Software Foundation//Tapestry Script Specification 3.0//EN"
+ "http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd">
+<script>
+ <include-script resource-path="/org/apache/tapestry/dojo/Widget.js"/>
+ <input-symbol key="id" required="yes" />
+ <input-symbol key="props" required="yes" />
+ <body>
+ <unique>
+ dojo.require("dojo.widget.DebugConsole");
+ </unique>
+ </body>
+
+ <initialization>
+ tapestry.widget.synchronizeWidgetState("${id}", "DebugConsole", ${props});
+ </initialization>
+</script>
\ No newline at end of file
Added: tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/TitlePane.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/TitlePane.java?rev=407196&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/TitlePane.java (added)
+++ tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/TitlePane.java Wed May 17 00:59:17 2006
@@ -0,0 +1,82 @@
+// Copyright May 16, 2006 The Apache Software Foundation
+//
+// Licensed 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.tapestry.dojo.html;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.tapestry.AbstractComponent;
+import org.apache.tapestry.IMarkupWriter;
+import org.apache.tapestry.IRequestCycle;
+import org.apache.tapestry.IScript;
+import org.apache.tapestry.PageRenderSupport;
+import org.apache.tapestry.TapestryUtils;
+import org.apache.tapestry.dojo.DojoUtils;
+import org.apache.tapestry.dojo.IWidget;
+import org.apache.tapestry.json.JSONObject;
+
+/**
+ * Implementation of dojo's FloatingPane.
+ *
+ * @author andyhot
+ * @since 4.1
+ */
+public abstract class TitlePane extends AbstractComponent implements IWidget, IDojoTitlePane
+{
+ /** id. */
+ public abstract String getIdParameter();
+
+ /** More js options - JSON style. */
+ public abstract String getOptions();
+
+ /** Injected script. */
+ public abstract IScript getScript();
+
+ /**
+ * {@inheritDoc}
+ */
+ public void renderWidget(IMarkupWriter writer, IRequestCycle cycle)
+ {
+ renderComponent(writer, cycle);
+ }
+
+ /**
+ * @see org.apache.tapestry.AbstractComponent#renderComponent(org.apache.tapestry.IMarkupWriter,
+ * org.apache.tapestry.IRequestCycle)
+ */
+ protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
+ {
+ writer.begin("div");
+ writer.attribute("id", getIdParameter());
+
+ renderInformalParameters(writer, cycle);
+ renderBody(writer, cycle);
+
+ writer.end();
+
+ JSONObject obj = DojoUtils.parseJSONParameter(this, "options");
+
+ obj.put("labelNode", getLabelNode());
+ obj.put("labelNodeClass", getLabelNodeClass());
+ obj.put("label", getLabel());
+ obj.put("containerNodeClass", getContainerNodeClass());
+
+ //Setup our script includes
+ Map scriptParms = new HashMap();
+ scriptParms.put("id", getIdParameter());
+ scriptParms.put("props", obj.toString());
+ PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle, this);
+ getScript().execute(cycle, pageRenderSupport, scriptParms);
+ }
+}
Added: tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/TitlePane.jwc
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/TitlePane.jwc?rev=407196&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/TitlePane.jwc (added)
+++ tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/TitlePane.jwc Wed May 17 00:59:17 2006
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2004, 2005, 2006 The Apache Software Foundation
+
+ Licensed 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.
+-->
+
+<!DOCTYPE component-specification PUBLIC
+ "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+ "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
+
+<component-specification class="org.apache.tapestry.dojo.html.TitlePane"
+ allow-body="yes" allow-informal-parameters="yes">
+
+ <description>
+ Creates a TitlePane - a widget that contains a title section and a
+ content section. By default, clicking the title section will wipe
+ in/out the content section.
+ </description>
+
+ <parameter name="label">
+ <description>Label text.</description>
+ </parameter>
+ <parameter name="labelNode">
+ <description>Dom node of the label.</description>
+ </parameter>
+ <parameter name="labelNodeClass">
+ <description>Class of dom node of the label.</description>
+ </parameter>
+ <parameter name="containerNodeClass">
+ <description>Class of dom node of container.</description>
+ </parameter>
+
+ <parameter name="id" property="idParameter" default-value="id">
+ <description>
+ The html id of the div created by the pane.
+ </description>
+ </parameter>
+
+ <parameter name="options">
+ <description>Additional javascript options. Use JSON notation.</description>
+ </parameter>
+
+ <inject property="script" type="script" object="TitlePane.script"/>
+
+</component-specification>
Added: tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/TitlePane.script
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/TitlePane.script?rev=407196&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/TitlePane.script (added)
+++ tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/dojo/html/TitlePane.script Wed May 17 00:59:17 2006
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<!DOCTYPE script PUBLIC
+ "-//Apache Software Foundation//Tapestry Script Specification 3.0//EN"
+ "http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd">
+<script>
+ <include-script resource-path="/org/apache/tapestry/dojo/Widget.js"/>
+ <input-symbol key="id" required="yes" />
+ <input-symbol key="props" required="yes" />
+ <body>
+ <unique>
+ dojo.require("dojo.widget.TitlePane");
+ </unique>
+ </body>
+
+ <initialization>
+ tapestry.widget.synchronizeWidgetState("${id}", "TitlePane", ${props});
+ </initialization>
+</script>
\ No newline at end of file