Author: alexsmirnov
Date: 2010-10-28 13:05:33 -0400 (Thu, 28 Oct 2010)
New Revision: 19740
Added:
branches/RF-8742/examples/output-demo/src/main/webapp/examples/tooltip.xhtml
branches/RF-8742/examples/output-demo/src/main/webapp/qunit/tooltip.xhtml
branches/RF-8742/examples/output-demo/src/main/webapp/resources/tests/richfaces-tooltip-qunit.js
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceInput.xhtml
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/inplaceSelect.xhtml
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/samples/
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/samples/inplaceSelect-sample.xhtml
branches/RF-8742/ui/output/api/src/main/java/org/richfaces/TooltipDirection.java
branches/RF-8742/ui/output/api/src/main/java/org/richfaces/TooltipLayout.java
branches/RF-8742/ui/output/api/src/main/java/org/richfaces/TooltipMode.java
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/UITooltip.java
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTooltip.java
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip.js
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.ecss
branches/RF-8742/ui/output/ui/src/test/java/org/richfaces/component/UITooltipTest.java
branches/RF-8742/ui/output/ui/src/test/java/org/richfaces/renderkit/html/TooltipRendererTest.java
branches/RF-8742/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/tooltip.xhtml
branches/RF-8742/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/tooltip.xmlunit.xml
Removed:
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceSelect.xhtml
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceSelect-sample.xhtml
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/inplaceSelect.xhtml
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/samples/
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/samples/inplaceSelect-sample.xhtml
Modified:
branches/RF-8742/
branches/RF-8742/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
branches/RF-8742/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-item-qunit.js
branches/RF-8742/examples/output-demo/src/main/webapp/templates/template.xhtml
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/select/samples/select-sample.xhtml
branches/RF-8742/ui/common/ui/src/main/java/org/richfaces/renderkit/RenderKitUtils.java
branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
branches/RF-8742/ui/input/ui/src/main/templates/inplaceSelect.template.xml
branches/RF-8742/ui/input/ui/src/main/templates/select.template.xml
branches/RF-8742/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestDefault.xmlunit.xml
branches/RF-8742/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestEdit.xmlunit.xml
branches/RF-8742/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestWithControls.xmlunit.xml
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
branches/RF-8742/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java
Log:
Merged revisions 19721-19730,19739 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
.......
r19721 | abelevich | 2010-10-28 01:16:52 -0700 (Thu, 28 Oct 2010) | 1 line
add 'mouseover', 'click' handlers which was removed from popup base
class
.......
r19722 | abelevich | 2010-10-28 03:51:49 -0700 (Thu, 28 Oct 2010) | 1 line
add scroll support for the selects
.......
r19723 | abelevich | 2010-10-28 03:59:38 -0700 (Thu, 28 Oct 2010) | 1 line
remove debug info
.......
r19724 | abelevich | 2010-10-28 05:08:05 -0700 (Thu, 28 Oct 2010) | 1 line
fix test, add styles for fonts
.......
r19725 | ilya_shaikovsky | 2010-10-28 05:34:46 -0700 (Thu, 28 Oct 2010) | 1 line
reverted back erroneous commit and made corrections(both inplaces). Previously commited
select folder rewritten input one because of SVN plugin error.
.......
r19726 | abelevich | 2010-10-28 06:55:25 -0700 (Thu, 28 Oct 2010) | 1 line
add help method to get resource requestPath
.......
r19727 | amarkhel | 2010-10-28 06:58:50 -0700 (Thu, 28 Oct 2010) | 1 line
RF-9474 Tooltip component
.......
r19728 | abelevich | 2010-10-28 07:15:26 -0700 (Thu, 28 Oct 2010) | 1 line
add name attributes to the inputs
.......
r19729 | amarkhel | 2010-10-28 07:30:03 -0700 (Thu, 28 Oct 2010) | 2 lines
RF-9474 Tooltip component
small fixes
.......
r19730 | ilya_shaikovsky | 2010-10-28 07:52:37 -0700 (Thu, 28 Oct 2010) | 1 line
https://jira.jboss.org/browse/RF-9208
.......
r19739 | ilya_shaikovsky | 2010-10-28 09:13:23 -0700 (Thu, 28 Oct 2010) | 1 line
https://jira.jboss.org/browse/RF-9243
.......
Property changes on: branches/RF-8742
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-19713
+ /trunk:1-19739
Modified: branches/RF-8742/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
branches/RF-8742/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -9,7 +9,20 @@
</managed-bean>
<navigation-rule>
- <!-- Examples -->
+ <navigation-case>
+ <from-outcome>panel</from-outcome>
+ <to-view-id>/examples/panel.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>popup</from-outcome>
+ <to-view-id>/examples/popupPanel.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>progressbar</from-outcome>
+ <to-view-id>/examples/progressbar.xhtml</to-view-id>
+ </navigation-case>
+
+ <!-- TogglePanel navigation -->
<navigation-case>
<from-outcome>togglePanel</from-outcome>
<to-view-id>/examples/togglePanel.xhtml</to-view-id>
@@ -31,32 +44,6 @@
<to-view-id>/examples/togglePanel-mixed.xhtml</to-view-id>
</navigation-case>
<navigation-case>
- <from-outcome>accordion</from-outcome>
- <to-view-id>/examples/accordion.xhtml</to-view-id>
- </navigation-case>
- <navigation-case>
- <from-outcome>collapsiblePanel</from-outcome>
- <to-view-id>/examples/collapsiblePanel.xhtml</to-view-id>
- </navigation-case>
- <navigation-case>
- <from-outcome>tabPanel</from-outcome>
- <to-view-id>/examples/tabPanel.xhtml</to-view-id>
- </navigation-case>
- <navigation-case>
- <from-outcome>panel</from-outcome>
- <to-view-id>/examples/panel.xhtml</to-view-id>
- </navigation-case>
- <navigation-case>
- <from-outcome>popup</from-outcome>
- <to-view-id>/examples/popupPanel.xhtml</to-view-id>
- </navigation-case>
- <navigation-case>
- <from-outcome>progressbar</from-outcome>
- <to-view-id>/examples/progressbar.xhtml</to-view-id>
- </navigation-case>
-
- <!-- QUnit -->
- <navigation-case>
<from-outcome>qunit/togglePanel</from-outcome>
<to-view-id>/qunit/togglePanel.xhtml</to-view-id>
</navigation-case>
@@ -64,7 +51,13 @@
<from-outcome>qunit/togglePanelItem</from-outcome>
<to-view-id>/qunit/togglePanelItem.xhtml</to-view-id>
</navigation-case>
+
+ <!-- Accordion navigation -->
<navigation-case>
+ <from-outcome>accordion</from-outcome>
+ <to-view-id>/examples/accordion.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
<from-outcome>qunit/accordion</from-outcome>
<to-view-id>/qunit/accordion.xhtml</to-view-id>
</navigation-case>
@@ -72,13 +65,35 @@
<from-outcome>qunit/accordionHeaders</from-outcome>
<to-view-id>/qunit/accordionHeaders.xhtml</to-view-id>
</navigation-case>
+
+ <!-- CollapsiblePanel navigation -->
<navigation-case>
+ <from-outcome>collapsiblePanel</from-outcome>
+ <to-view-id>/examples/collapsiblePanel.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
<from-outcome>qunit/collapsiblePanel</from-outcome>
<to-view-id>/qunit/collapsiblePanel.xhtml</to-view-id>
</navigation-case>
+
+ <!-- TabPanel navigation -->
<navigation-case>
+ <from-outcome>tabPanel</from-outcome>
+ <to-view-id>/examples/tabPanel.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
<from-outcome>qunit/tabPanel</from-outcome>
<to-view-id>/qunit/tabPanel.xhtml</to-view-id>
</navigation-case>
+
+ <!-- Tooltip navigation -->
+ <navigation-case>
+ <from-outcome>tooltip</from-outcome>
+ <to-view-id>/examples/tooltip.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>qunit/tooltip</from-outcome>
+ <to-view-id>/qunit/tooltip.xhtml</to-view-id>
+ </navigation-case>
</navigation-rule>
</faces-config>
Copied: branches/RF-8742/examples/output-demo/src/main/webapp/examples/tooltip.xhtml (from
rev 19739, trunk/examples/output-demo/src/main/webapp/examples/tooltip.xhtml)
===================================================================
--- branches/RF-8742/examples/output-demo/src/main/webapp/examples/tooltip.xhtml
(rev 0)
+++
branches/RF-8742/examples/output-demo/src/main/webapp/examples/tooltip.xhtml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,51 @@
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright ${year}, Red Hat, Inc. and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:pn="http://richfaces.org/output">
+
+<body>
+<ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="scripts">
+ <h:outputScript name="Tooltip.js" />
+ </ui:define>
+
+ <ui:define name="title">TOOLTIP JS Development</ui:define>
+ <ui:define name="body_head">TOOLTIP JS Development</ui:define>
+
+ <ui:define name="body">
+ <h:form id="f" style="border:blue solid thin;">
+ <pn:tooltip id="tooltip">
+ <!-- TODO -->
+ </pn:tooltip>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</body>
+</html>
+
Copied: branches/RF-8742/examples/output-demo/src/main/webapp/qunit/tooltip.xhtml (from
rev 19739, trunk/examples/output-demo/src/main/webapp/qunit/tooltip.xhtml)
===================================================================
--- branches/RF-8742/examples/output-demo/src/main/webapp/qunit/tooltip.xhtml
(rev 0)
+++ branches/RF-8742/examples/output-demo/src/main/webapp/qunit/tooltip.xhtml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,71 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+JBoss, Home of Professional Open Source
+Copyright ${year}, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+
+
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:pn="http://richfaces.org/output">
+
+<body>
+<ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="scripts">
+ <h:outputScript name="qunit/qunit.js"/>
+ <h:outputScript name="qunit/richfaces-qunit.js"/>
+
+ <h:outputStylesheet name="qunit/qunit.css"/>
+ </ui:define>
+
+ <ui:define name="title">Tooltip Example</ui:define>
+ <ui:define name="body_head">Tooltip Example</ui:define>
+
+ <ui:define name="body">
+ <p>Page</p>
+
+ <h:form id="f" style="border:blue solid thin;">
+ <div id="div" style="border: 2px solid red;
background-color: #adff2f; width:300px; height:300px">
+ Hello
+
+ <pn:tooltip id="tooltip" target="div">
+ ToolTip Yo!!!
+ </pn:tooltip>
+ </div>
+
+
+ </h:form>
+ <p>Result</p>
+
+ <div>
+ <ol id="qunit-tests"></ol>
+
+ <div id="testDiv" style="margin-top:10px; border:1px solid
#a0a0a0">Main Test Div</div>
+ </div>
+ <!--<h:outputScript name="tests/richfaces-tooltip-qunit.js"
/>-->
+ </ui:define>
+</ui:composition>
+</body>
+</html>
+
Modified:
branches/RF-8742/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-item-qunit.js
===================================================================
---
branches/RF-8742/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-item-qunit.js 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-item-qunit.js 2010-10-28
17:05:33 UTC (rev 19740)
@@ -41,7 +41,7 @@
for (i in PUBLIC_API) {
var funcName = PUBLIC_API[i];
- ok(c.[funcName], funcName + "present in component")
+ ok(c[funcName], funcName + "present in component")
// TODO check other functions + check is it function
}
});
Copied:
branches/RF-8742/examples/output-demo/src/main/webapp/resources/tests/richfaces-tooltip-qunit.js
(from rev 19739,
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-tooltip-qunit.js)
===================================================================
---
branches/RF-8742/examples/output-demo/src/main/webapp/resources/tests/richfaces-tooltip-qunit.js
(rev 0)
+++
branches/RF-8742/examples/output-demo/src/main/webapp/resources/tests/richfaces-tooltip-qunit.js 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,134 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+RichFaces.QUnit.run(function() {
+ module("richfaces-tooltip");
+
+ var TOOLTIP_ID = "f:tooltip";
+
+ function handler (msg, returnValue) {
+ return function () {
+ ok(true, msg);
+
+ if (returnValue != undefined) {
+ return returnValue;
+ }
+ };
+ }
+
+ test("RichFaces.ui.Tooltip test constructor", function () {
+ var c = RichFaces.$(TOOLTIP_ID);
+
+ ok(c instanceof RichFaces.ui.Tooltip, "instance of
RichFaces.ui.Tooltip");
+ equals(c.id, TOOLTIP_ID, "id");
+
+ // test default options
+ same(c.options.direction, RichFaces.ui.TooltipDirection.DEFAULT,
"Direction");
+ same(c.options.attached, true, "Attached");
+ same(c.options.offset, {}, "Offset");
+ same(c.options.mode, RichFaces.ui.TooltipMode.DEFAULT, "Mode");
+ same(c.options.disabled, false, "Disabled");
+ same(c.options.hideDelay, 0, "Hide Delay");
+ same(c.options.hideEvent, "leave", "Hide Event");
+ same(c.options.showDelay, 0, "Show Delay");
+ same(c.options.showEvent, "enter", "Show Event");
+ same(c.options.followMouse, true, "Follow Mouse");
+
+ });
+
+ test("RichFaces.ui.Tooltip test public api", function () {
+ var c = RichFaces.$(TOOLTIP_ID);
+
+ var PUBLIC_API = ["hide", "show"];
+
+ for (var i in PUBLIC_API) {
+ var funcName = PUBLIC_API[i];
+ ok(c[funcName], funcName + "present in component");
+ equals(typeof c[funcName], "function", funcName + " is
function");
+ }
+ });
+
+ function testHideEvents(cancelEvent) {
+ var c = RichFaces.$(TOOLTIP_ID);
+
+ expect(cancelEvent ? 2 : 3);
+ var beforeHideHandler = function (event, comp, data) {
+ ok(true, "beforehide handler invoked");
+ same(data.id, TOOLTIP_ID, "Component Id");
+
+ return !cancelEvent;
+ };
+ var beforeHideHandlerWrapper = RichFaces.Event.bindById(TOOLTIP_ID,
"beforehide", beforeHideHandler);
+
+ var hideHandler = handler("hide handler invoked", undefined);
+ var hideHandlerWrapper = RichFaces.Event.bindById(TOOLTIP_ID, "hide",
hideHandler);
+
+ c.hide();
+
+ RichFaces.Event.unbindById(TOOLTIP_ID, "beforehide",
beforeHideHandlerWrapper);
+ RichFaces.Event.unbindById(TOOLTIP_ID, "hide", hideHandlerWrapper);
+
+ // TODO undo changes
+ }
+
+ test("RichFaces.ui.Tooltip.hide test", function () {
+ testHideEvents(false);
+ });
+
+ test("RichFaces.ui.Tooltip.hide test cancelable event", function () {
+ testHideEvents(true);
+ });
+
+ function testShowEvents(cancelEvent) {
+ var c = RichFaces.$(TOOLTIP_ID);
+
+ expect(cancelEvent ? 2 : 3);
+ var beforeShowHandler = function (event, comp, data) {
+ ok(true, "beforeshow handler invoked");
+ same(data.id, TOOLTIP_ID, "Component Id");
+
+ return !cancelEvent;
+ };
+ var beforeShowHandlerWrapper = RichFaces.Event.bindById(TOOLTIP_ID,
"beforeshow", beforeShowHandler);
+
+ var showHandler = handler("show handler invoked", undefined);
+ var showHandlerWrapper = RichFaces.Event.bindById(TOOLTIP_ID, "show",
showHandler);
+
+ c.show();
+
+ RichFaces.Event.unbindById(TOOLTIP_ID, "beforeshow",
beforeShowHandlerWrapper);
+ RichFaces.Event.unbindById(TOOLTIP_ID, "show", showHandlerWrapper);
+
+ // TODO undo changes
+ }
+
+ test("RichFaces.ui.Tooltip.show test", function () {
+ testShowEvents(false);
+ });
+
+ test("RichFaces.ui.Tooltip.show test cancelable event", function () {
+ testShowEvents(true);
+ });
+
+
+});
Modified: branches/RF-8742/examples/output-demo/src/main/webapp/templates/template.xhtml
===================================================================
---
branches/RF-8742/examples/output-demo/src/main/webapp/templates/template.xhtml 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/examples/output-demo/src/main/webapp/templates/template.xhtml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -77,6 +77,25 @@
<li><h:commandLink value="Tab
Panel" action="tabPanel" /></li>
</ul>
</li>
+ <li>
+ <p>Tooltip</p>
+ <ul>
+ <li>
+ <p>Examples</p>
+ <ul>
+ <li>
+ <h:commandLink
value="Tooltip" action="tooltip"/>
+ </li>
+ </ul>
+ <p>QUnit</p>
+ <ul>
+ <li>
+ <h:commandLink
value="Tooltip" action="qunit/tooltip"/>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </li>
</ul>
<p>QUnit</p>
<ul>
Copied:
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceInput.xhtml
(from rev 19739,
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceInput.xhtml)
===================================================================
---
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceInput.xhtml
(rev 0)
+++
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceInput.xhtml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition>
+ <p>InplaceInput is a simple input component which displays the current value as
outputText and switches to inputText based representation after a defined event to allow
editing this value.
+You could use simplest examples below. For the first demo, just click on a label to edit
the value and click somewhere outside the component to store this value(Or just press
ENTER button).</p>
+
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}"
/>
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+</ui:composition>
+
+</html>
\ No newline at end of file
Deleted:
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceSelect.xhtml
===================================================================
---
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceSelect.xhtml 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceSelect.xhtml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -1,21 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ui="http://java.sun.com/jsf/facelets">
-
-<ui:composition>
- <p><b>Inplace</b> Select is a simple input component which displays
current
- value as outputText and switches to Select based representation after a
- defined event to allow editing this value.</p>
-
- <ui:include src="#{demoNavigator.sampleIncludeURI}" />
- <ui:include src="/templates/includes/source-view.xhtml">
- <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}"
/>
- <ui:param name="sourceType" value="xhtml" />
- <ui:param name="openLabel" value="View Source" />
- <ui:param name="hideLabel" value="Hide Source" />
- </ui:include>
-</ui:composition>
-
-</html>
\ No newline at end of file
Copied:
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml
(from rev 19739,
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml)
===================================================================
---
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml
(rev 0)
+++
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+ <rich:panel style="width:220px;">
+ <f:facet name="header">
+ <h:outputText value="Person Info"></h:outputText>
+ </f:facet>
+ <h:panelGrid columns="2">
+ <h:outputText value="Name: " />
+ <rich:inplaceInput value="click to enter your name" />
+ <h:outputText value="Email:" />
+ <rich:inplaceInput value="click to enter your email" />
+ </h:panelGrid>
+ </rich:panel>
+</ui:composition>
\ No newline at end of file
Deleted:
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceSelect-sample.xhtml
===================================================================
---
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceSelect-sample.xhtml 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceSelect-sample.xhtml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -1,44 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:rich="http://richfaces.org/rich">
- <h:form>
- <p>Try the simplest example below. Just click on a label to edit
- the value and click somewhere outside the component to store this
- value(Or just press ENTER button).</p>
- <rich:panel style="width:220px;">
- <f:facet name="header">
- <h:outputText value="Simples select"></h:outputText>
- </f:facet>
- <rich:inplaceSelect defaultLabel="Click here to edit"
- openOnEdit="true" saveOnBlur="false">
- <f:selectItem itemValue="0" itemLabel="Option 1" />
- <f:selectItem itemValue="1" itemLabel="Option 2" />
- <f:selectItem itemValue="2" itemLabel="Option 3" />
- <f:selectItem itemValue="3" itemLabel="Option 4" />
- <f:selectItem itemValue="4" itemLabel="Option 5" />
- </rich:inplaceSelect>
- </rich:panel>
- <p>In that sample component customized in next way:
- </p>
- <ul>
- <li><b>f:selectItems</b> tag is used to define a list of items to
use.</li>
- <li>Controls "save" and "cancel" are turned on with
<b>showControls</b> attribute</li>
- <li><b>editEvent</b> set to dblclick and used to switch to edit
state.</li>
- </ul>
- <rich:panel style="width:220px;">
- <f:facet name="header">
- <h:outputText value="Select customization"></h:outputText>
- </f:facet>
- <rich:inplaceSelect editEvent="dblclick" id="inplaceSelect"
- showControls="true" saveOnBlur="true"
- value="#{inplaceSelectBean.value}" defaultLabel="Double click to edit
value"
- openOnEdit="true">
- <f:selectItems value="#{inplaceSelectBean.capitalsOptions}" />
- </rich:inplaceSelect>
- </rich:panel>
- </h:form>
-</ui:composition>
\ No newline at end of file
Copied:
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect (from
rev 19739, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect)
Deleted:
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/inplaceSelect.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/inplaceSelect.xhtml 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/inplaceSelect.xhtml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -1,21 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ui="http://java.sun.com/jsf/facelets">
-
-<ui:composition>
- <p><b>Inplace</b> Select is a simple input component which displays
current
- value as outputText and switches to Select based representation after a
- defined event to allow editing this value.</p>
-
- <ui:include src="#{demoNavigator.sampleIncludeURI}" />
- <ui:include src="/templates/includes/source-view.xhtml">
- <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}"
/>
- <ui:param name="sourceType" value="xhtml" />
- <ui:param name="openLabel" value="View Source" />
- <ui:param name="hideLabel" value="Hide Source" />
- </ui:include>
-</ui:composition>
-
-</html>
\ No newline at end of file
Copied:
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/inplaceSelect.xhtml
(from rev 19739,
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/inplaceSelect.xhtml)
===================================================================
---
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/inplaceSelect.xhtml
(rev 0)
+++
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/inplaceSelect.xhtml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition>
+ <p><b>Inplace</b> Select is a simple input component which displays
current
+ value as outputText and switches to Select based representation after a
+ defined event to allow editing this value.</p>
+
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}"
/>
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+</ui:composition>
+
+</html>
\ No newline at end of file
Copied:
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/samples
(from rev 19739,
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/samples)
Deleted:
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/samples/inplaceSelect-sample.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/samples/inplaceSelect-sample.xhtml 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/samples/inplaceSelect-sample.xhtml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -1,56 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:rich="http://richfaces.org/rich">
- <h:form>
- <p>Try the simplest example below. Just click on a label to edit
- the value and click somewhere outside the component to store this
- value(Or just press ENTER button).</p>
- <rich:panel style="width:220px;">
- <f:facet name="header">
- <h:outputText value="Simples select"></h:outputText>
- </f:facet>
- <rich:inplaceSelect defaultLabel="Click here to edit"
- openOnEdit="true" saveOnBlur="false"
oninputchange="alert('10')"
- onchange="alert('1')"
oninputkeydown="alert('kdown')">
- <f:selectItem itemValue="0" itemLabel="Option 1" />
- <f:selectItem itemValue="1" itemLabel="Option 2" />
- <f:selectItem itemValue="2" itemLabel="Option 3" />
- <f:selectItem itemValue="3" itemLabel="Option 4" />
- <f:selectItem itemValue="4" itemLabel="Option 5" />
- </rich:inplaceSelect>
- </rich:panel>
- <p>In that sample component customized in next way:</p>
- <ul>
- <li><b>f:selectItems</b> tag is used to define a list of items
- to use.</li>
- <li>Controls "save" and "cancel" are turned on with
<b>showControls</b>
- attribute</li>
- <li><b>editEvent</b> set to dblclick and used to switch to edit
- state.</li>
- <li><b>saveOnSelect</b> defined as false causes component not to
store
- value right after choosing but wait till buttons will be used or
- focus lost.</li>
- <li><b>saveOnBlur</b> defined as false causes component to cancel
new
- value if it was chosen and focus was lost without save button
- activation. That could be useful on interfaces where every change
- causes long processing. And if use true value - it will works like in
- spreadsheets where leaving the changed field causes new value to be
- applied.</li>
- </ul>
- <rich:panel style="width:220px;">
- <f:facet name="header">
- <h:outputText value="Select customization"></h:outputText>
- </f:facet>
- <rich:inplaceSelect editEvent="dblclick" id="inplaceSelect"
- showControls="true" saveOnSelect="false"
saveOnBlur="false"
- value="#{inplaceSelectBean.value}"
- defaultLabel="Double click to edit value">
- <f:selectItems value="#{inplaceSelectBean.capitalsOptions}" />
- </rich:inplaceSelect>
- </rich:panel>
- </h:form>
-</ui:composition>
\ No newline at end of file
Copied:
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/samples/inplaceSelect-sample.xhtml
(from rev 19739,
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/samples/inplaceSelect-sample.xhtml)
===================================================================
---
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/samples/inplaceSelect-sample.xhtml
(rev 0)
+++
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceSelect/samples/inplaceSelect-sample.xhtml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,56 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+ <h:form>
+ <p>Try the simplest example below. Just click on a label to edit
+ the value and click somewhere outside the component to store this
+ value(Or just press ENTER button).</p>
+ <rich:panel style="width:220px;">
+ <f:facet name="header">
+ <h:outputText value="Simples select"></h:outputText>
+ </f:facet>
+ <rich:inplaceSelect defaultLabel="Click here to edit"
+ openOnEdit="true" saveOnBlur="false"
oninputchange="alert('10')"
+ onchange="alert('1')"
oninputkeydown="alert('kdown')">
+ <f:selectItem itemValue="0" itemLabel="Option 1" />
+ <f:selectItem itemValue="1" itemLabel="Option 2" />
+ <f:selectItem itemValue="2" itemLabel="Option 3" />
+ <f:selectItem itemValue="3" itemLabel="Option 4" />
+ <f:selectItem itemValue="4" itemLabel="Option 5" />
+ </rich:inplaceSelect>
+ </rich:panel>
+ <p>In that sample component customized in next way:</p>
+ <ul>
+ <li><b>f:selectItems</b> tag is used to define a list of items
+ to use.</li>
+ <li>Controls "save" and "cancel" are turned on with
<b>showControls</b>
+ attribute</li>
+ <li><b>editEvent</b> set to dblclick and used to switch to edit
+ state.</li>
+ <li><b>saveOnSelect</b> defined as false causes component not to
store
+ value right after choosing but wait till buttons will be used or
+ focus lost.</li>
+ <li><b>saveOnBlur</b> defined as false causes component to cancel
new
+ value if it was chosen and focus was lost without save button
+ activation. That could be useful on interfaces where every change
+ causes long processing. And if use true value - it will works like in
+ spreadsheets where leaving the changed field causes new value to be
+ applied.</li>
+ </ul>
+ <rich:panel style="width:220px;">
+ <f:facet name="header">
+ <h:outputText value="Select customization"></h:outputText>
+ </f:facet>
+ <rich:inplaceSelect editEvent="dblclick" id="inplaceSelect"
+ showControls="true" saveOnSelect="false"
saveOnBlur="false"
+ value="#{inplaceSelectBean.value}"
+ defaultLabel="Double click to edit value">
+ <f:selectItems value="#{inplaceSelectBean.capitalsOptions}" />
+ </rich:inplaceSelect>
+ </rich:panel>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Modified:
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/select/samples/select-sample.xhtml
===================================================================
---
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/select/samples/select-sample.xhtml 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/examples/richfaces-showcase/src/main/webapp/richfaces/select/samples/select-sample.xhtml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -19,5 +19,14 @@
<f:selectItem itemValue="4" itemLabel="Option 5" />
</rich:select>
</rich:panel>
+ <p>DESC</p>
+ <rich:panel style="width:220px;">
+ <f:facet name="header">
+ <h:outputText value="Select with manual input"></h:outputText>
+ </f:facet>
+ <rich:select enableManualInput="true" defaultLabel="start typing for
select" >
+ <f:selectItems value="#{inplaceSelectBean.capitalsOptions}"/>
+ </rich:select>
+ </rich:panel>
</h:form>
</ui:composition>
\ No newline at end of file
Modified:
branches/RF-8742/ui/common/ui/src/main/java/org/richfaces/renderkit/RenderKitUtils.java
===================================================================
---
branches/RF-8742/ui/common/ui/src/main/java/org/richfaces/renderkit/RenderKitUtils.java 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/ui/common/ui/src/main/java/org/richfaces/renderkit/RenderKitUtils.java 2010-10-28
17:05:33 UTC (rev 19740)
@@ -33,6 +33,8 @@
import java.util.Set;
import java.util.TreeSet;
+import javax.faces.application.Resource;
+import javax.faces.application.ResourceHandler;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.component.behavior.ClientBehavior;
@@ -685,6 +687,16 @@
return sb.toString();
}
+
+ public static String getResourcePath(FacesContext context, String resourceName) {
+ if (resourceName != null) {
+ ResourceHandler resourceHandler =
context.getApplication().getResourceHandler();
+ Resource resource = resourceHandler.createResource(resourceName);
+ return resource.getRequestPath();
+ }
+ return null;
+ }
+
@SuppressWarnings("serial")
public static final class Attributes extends TreeSet<ComponentAttribute> {
@@ -725,6 +737,8 @@
last.setDefaultValue(value);
return this;
}
+
+
}
Modified:
branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java
===================================================================
---
branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java 2010-10-28
17:05:33 UTC (rev 19740)
@@ -26,10 +26,8 @@
import java.util.HashMap;
import java.util.Map;
-import javax.faces.application.Resource;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
-import javax.faces.application.ResourceHandler;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
@@ -153,13 +151,7 @@
}
public String getResourcePath(FacesContext context, String resourceName) {
- if (resourceName != null) {
- ResourceHandler resourceHandler = context.getApplication()
- .getResourceHandler();
- Resource resource = resourceHandler.createResource(resourceName);
- return resource.getRequestPath();
- }
- return null;
+ return RenderKitUtils.getResourcePath(context, resourceName);
}
public String getStateStyleClass(UIComponent component, InplaceState inplaceState) {
Modified:
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss
===================================================================
---
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss 2010-10-28
17:05:33 UTC (rev 19740)
@@ -10,8 +10,9 @@
margin : 0px;
width : 100%;
height : 100%;
- font-family:inherit;
- font-size : inherit;
+ color: '#{richSkin.generalTextColor}';
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size : '#{richSkin.generalSizeFont}';
}
.rf-ii-edit {
@@ -27,6 +28,9 @@
.rf-ii-lbl {
white-space : nowrap;
+ color: '#{richSkin.generalTextColor}';
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size : '#{richSkin.generalSizeFont}';
}
.rf-ii-d-s {
@@ -62,6 +66,9 @@
margin : 0px;
width : 100%;
height : 100%
+ color: '#{richSkin.generalTextColor}';
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size : '#{richSkin.generalSizeFont}';
}
.rf-ii-strut {
Modified:
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss
===================================================================
---
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss 2010-10-28
17:05:33 UTC (rev 19740)
@@ -1,3 +1,9 @@
+.rf-is-fld, .rf-is-opt, .rf-is-lbl {
+ color: '#{richSkin.generalTextColor}';
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size : '#{richSkin.generalSizeFont}';
+}
+
input.rf-is-fld {
background : '#{richSkin.editBackgroundColor}';
padding : 0px 0px 0px 0px;
@@ -7,8 +13,9 @@
background-image:"url(#{resource['org.richfaces:mark_list.gif']})";
background-position : center right;
background-repeat : no-repeat;
- font-family:inherit;
- font-size : inherit;
+ color: '#{richSkin.generalTextColor}';
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size : '#{richSkin.generalSizeFont}';
}
.rf-is-none {
@@ -99,10 +106,10 @@
.rf-is-lst-cord {
display : block;
- /*font-size : 0px;*/
position : relative;
- font-family:inherit;
- font-size : inherit;
+ color: '#{richSkin.generalTextColor}';
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size : '#{richSkin.generalSizeFont}';
}
.rf-is-lst-pos {
Modified:
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
===================================================================
---
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-10-28
17:05:33 UTC (rev 19740)
@@ -4,8 +4,10 @@
rf.ui.InplaceSelect = function(id, options) {
var mergedOptions = $.extend({}, defaultOptions, options);
- $super.constructor.call(this, id, mergedOptions)
- mergedOptions['attachTo'] = id;
+ $super.constructor.call(this, id, mergedOptions)
+
+ mergedOptions['attachTo'] = id;
+ mergedOptions['scrollContainer'] = $(document.getElementById(id +
"Items")).parent()[0];
this.popupList = new rf.ui.PopupList(id+"List", this, mergedOptions);
this.items = mergedOptions.items;
this.selValueInput = $(document.getElementById(id+"selValue"));
Modified:
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
===================================================================
---
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2010-10-28
17:05:33 UTC (rev 19740)
@@ -5,11 +5,15 @@
rf.ui.PopupList = function(id, listener, options) {
var mergedOptions = $.extend({}, defaultOptions, options);
$super.constructor.call(this, id, mergedOptions);
- this.selectListener = listener;
+ this.selectListener = listener;
this.selectItemCss = mergedOptions.selectItemCss;
+ this.scrollContainer = $(mergedOptions.scrollContainer);
this.itemCss = mergedOptions.itemCss;
this.listCss = mergedOptions.listCss;
this.index = -1;
+ this.popup.bind("mouseover", $.proxy(this.__onMouseOver, this));
+ this.popup.bind("click", $.proxy(this.__onClick, this));
+
this.__updateItemsList();
};
@@ -41,6 +45,7 @@
} else {
item.addClass(this.selectItemCss);
}
+ this.__scrollToSelectedItem(this);
},
unselectItem: function(item) {
@@ -148,8 +153,27 @@
__setItems: function(items) {
this.items = items;
+ },
+
+ __scrollToSelectedItem : function() {
+ if(this.scrollContainer) {
+ var offset = 0;
+
+ this.items.slice(0, this.index).each(function() {
+ offset += this.offsetHeight;
+ });
+
+ var parentContainer = this.scrollContainer;
+ if(offset < parentContainer.scrollTop()) {
+ parentContainer.scrollTop(offset);
+ } else {
+ offset+=this.items.get(this.index).offsetHeight;
+ if(offset - parentContainer.scrollTop() >
parentContainer.get(0).clientHeight) {
+ parentContainer.scrollTop(offset - parentContainer.innerHeight());
+ }
+ }
+ }
}
-
}
})());
Modified:
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss
===================================================================
---
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss 2010-10-28
17:05:33 UTC (rev 19740)
@@ -1,5 +1,5 @@
-.rf-sel-inp.rf-s-fnt, .rf-sel-opt.rf-sel-fnt{
+.rf-sel-inp, .rf-sel-opt {
color: '#{richSkin.generalTextColor}';
font-size: '#{richSkin.generalSizeFont}';
font-family: '#{richSkin.generalFamilyFont}';
Modified:
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
===================================================================
---
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-10-28
17:05:33 UTC (rev 19740)
@@ -115,7 +115,8 @@
this.id = id;
var mergedOptions = $.extend({}, defaultOptions, options);
mergedOptions['attachTo'] = id;
-
+ mergedOptions['scrollContainer'] = $(document.getElementById(id +
"Items")).parent()[0];
+
this.defaultLabel = mergedOptions.defaultLabel;
var inputLabel = this.getValue() ;
this.initialValue = (inputLabel != this.defaultLabel) ? inputLabel :
"";
Modified: branches/RF-8742/ui/input/ui/src/main/templates/inplaceSelect.template.xml
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-10-28
16:13:23 UTC (rev 19739)
+++ branches/RF-8742/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -44,11 +44,11 @@
</span>
<c:if test="#{!isDisable(inplaceState)}">
- <input id="#{clientId}Focus" type="image"
style="position: absolute; top: 0px; left: 0px; outline-style: none;"
class="rf-is-none" />
+ <input id="#{clientId}Focus" type="image"
name="#{clientId}Focus" style="position: absolute; top: 0px; left: 0px;
outline-style: none;" class="rf-is-none" />
<span id="#{clientId}Edit" class="#{getEditStyleClass(component,
inplaceState)}">
- <input id="#{clientId}selValue" name="#{clientId}"
type="hidden" value="#{getValue(facesContext, component)}"/>
- <input id="#{clientId}Input" autocomplete="off"
+ <input id="#{clientId}selValue" name="#{clientId}"
type="hidden" value="#{getInputValue(facesContext, component)}"/>
+ <input id="#{clientId}Input" name="#{clientId}Input"
autocomplete="off"
type="text" value="#{getSelectInputLabel(facesContext,
component)}"
class="rf-is-fld" style="width:
#{component.attributes['inputWidth']};" readonly="readonly"
cdk:passThrough="tabIndex">
@@ -64,11 +64,11 @@
<span class="rf-is-shdw-b"></span>
<span id="#{clientId}Btn" style="position :
relative;">
- <input type="image" id="#{clientId}Okbtn"
+ <input type="image" name="#{clientId}Okbtn"
id="#{clientId}Okbtn"
src="#{getResourcePath(facesContext,
'org.richfaces/ico_ok.gif')}"
class="rf-is-btn"
onmousedown="this.className='rf-is-btn-press'"
onmouseout="this.className='rf-is-btn'"
onmouseup="this.className='rf-is-btn'" />
- <input type="image" id="#{clientId}Cancelbtn"
+ <input name="#{clientId}Okbtn" type="image"
id="#{clientId}Cancelbtn"
src="#{getResourcePath(facesContext,'org.richfaces/ico_cancel.gif')}"
class="rf-is-btn"
onmousedown="this.className='rf-is-btn-press'"
onmouseout="this.className='rf-is-btn'"
onmouseup="this.className='rf-is-btn'" />
@@ -87,8 +87,10 @@
<span class="rf-is-shdw-r"></span>
<span class="rf-is-shdw-b"></span>
<span class="rf-is-lst-dec">
- <span class="rf-is-lst-scrl" id="#{clientId}Items"
style="height: #{component.attributes['listHeight']}">
- <cdk:call expression="encodeItems(facesContext, component,
clientSelectItems);"/>
+ <span class="rf-is-lst-scrl" style="height:
#{component.attributes['listHeight']}">
+ <span id="#{clientId}Items">
+ <cdk:call expression="encodeItems(facesContext, component,
clientSelectItems);"/>
+ </span>
</span>
</span>
</span>
Modified: branches/RF-8742/ui/input/ui/src/main/templates/select.template.xml
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/templates/select.template.xml 2010-10-28
16:13:23 UTC (rev 19739)
+++ branches/RF-8742/ui/input/ui/src/main/templates/select.template.xml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -54,8 +54,10 @@
<div class="rf-sel-shdw-b"></div>
<div class="rf-sel-lst-dcrtn">
- <div class="rf-sel-lst-scrl"
id="#{clientId}Items" >
- <cdk:call expression="encodeItems(facesContext, component,
clientSelectItems);"/>
+ <div class="rf-sel-lst-scrl">
+ <div id="#{clientId}Items" >
+ <cdk:call expression="encodeItems(facesContext, component,
clientSelectItems);"/>
+ </div>
</div>
</div>
</div>
Modified:
branches/RF-8742/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestDefault.xmlunit.xml
===================================================================
---
branches/RF-8742/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestDefault.xmlunit.xml 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestDefault.xmlunit.xml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -1,39 +1,45 @@
<span class="rf-is-d-s" id="form:inplaceSelectDefault">
- <span class="rf-is-lbl"
id="form:inplaceSelectDefaultLabel">Edit Text</span>
- <input class="rf-is-none" id="form:inplaceSelectDefaultFocus"
- style="position: absolute; top: 0px; left: 0px; outline-style: none;"
- type="image" />
- <span class="rf-is-edit rf-is-none"
id="form:inplaceSelectDefaultEdit">
- <input id="form:inplaceSelectDefaultselValue"
name="form:inplaceSelectDefault"
- type="hidden" value="Edit Text" />
- <input autocomplete="off" class="rf-is-fld"
id="form:inplaceSelectDefaultInput"
- readonly="readonly" style="width: ;" type="text" />
- <span class="rf-is-lst-cord" id="form:inplaceSelectDefaultList"
- style="display: none">
- <span class="rf-is-lst-pos" style="width: 250px">
- <span class="rf-is-shdw">
- <span class="rf-is-shdw-t"></span>
- <span class="rf-is-shdw-l"></span>
- <span class="rf-is-shdw-r"></span>
- <span class="rf-is-shdw-b"></span>
- <span class="rf-is-lst-dec">
- <span class="rf-is-lst-scrl"
id="form:inplaceSelectDefaultItems"
- style="height: 100px">
- <span id="form:inplaceSelectDefaultItem0"
class="rf-is-opt">Label#1
- </span>
- <span id="form:inplaceSelectDefaultItem1"
class="rf-is-opt">Label#2
- </span>
- <span id="form:inplaceSelectDefaultItem2"
class="rf-is-opt">Label#3
- </span>
- <span id="form:inplaceSelectDefaultItem3"
class="rf-is-opt">Label#4
- </span>
- </span>
- </span>
- </span>
- </span>
- </span>
- </span>
- <script type="text/javascript">
- //ignored
- </script>
+ <span class="rf-is-lbl" id="form:inplaceSelectDefaultLabel">
+ Edit Text
+ </span>
+ <input class="rf-is-none" id="form:inplaceSelectDefaultFocus"
name="form:inplaceSelectDefaultFocus" style="position: absolute; top: 0px;
left: 0px; outline-style: none;" type="image"/>
+ <span class="rf-is-edit rf-is-none"
id="form:inplaceSelectDefaultEdit">
+ <input id="form:inplaceSelectDefaultselValue"
name="form:inplaceSelectDefault" type="hidden"/>
+ <input autocomplete="off" class="rf-is-fld"
id="form:inplaceSelectDefaultInput"
name="form:inplaceSelectDefaultInput" readonly="readonly"
style="width: ;" type="text"/>
+ <span class="rf-is-lst-cord"
id="form:inplaceSelectDefaultList" style="display: none">
+ <span class="rf-is-lst-pos" style="width: 250px">
+ <span class="rf-is-shdw">
+ <span class="rf-is-shdw-t">
+ </span>
+ <span class="rf-is-shdw-l">
+ </span>
+ <span class="rf-is-shdw-r">
+ </span>
+ <span class="rf-is-shdw-b">
+ </span>
+ <span class="rf-is-lst-dec">
+ <span class="rf-is-lst-scrl" style="height:
100px">
+ <span id="form:inplaceSelectDefaultItems">
+ <span id="form:inplaceSelectDefaultItem0"
class="rf-is-opt">
+ Label#1
+ </span>
+ <span id="form:inplaceSelectDefaultItem1"
class="rf-is-opt">
+ Label#2
+ </span>
+ <span id="form:inplaceSelectDefaultItem2"
class="rf-is-opt">
+ Label#3
+ </span>
+ <span id="form:inplaceSelectDefaultItem3"
class="rf-is-opt">
+ Label#4
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ <script type="text/javascript">
+ //ignored
+ </script>
</span>
Modified:
branches/RF-8742/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestEdit.xmlunit.xml
===================================================================
---
branches/RF-8742/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestEdit.xmlunit.xml 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestEdit.xmlunit.xml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -1,58 +1,64 @@
<span class="rf-is-d-s rf-is-e-s" id="form:inplaceSelectEdit">
- <span class="rf-is-lbl" id="form:inplaceSelectEditLabel">Edit
Text</span>
- <input class="rf-is-none" id="form:inplaceSelectEditFocus"
- style="position: absolute; top: 0px; left: 0px; outline-style: none;"
- type="image" />
- <span class="rf-is-edit" id="form:inplaceSelectEditEdit">
- <input id="form:inplaceSelectEditselValue"
name="form:inplaceSelectEdit"
- type="hidden" value="Edit Text" />
- <input autocomplete="off" class="rf-is-fld"
id="form:inplaceSelectEditInput"
- readonly="readonly" style="width: ;" type="text" />
- <span class="rf-is-btn-prepos">
- <span class="rf-is-btn-pos">
- <span class="rf-is-shdw"
id="form:inplaceSelectEditBtnshadow">
- <span class="rf-is-shdw-t"></span>
- <span class="rf-is-shdw-l"></span>
- <span class="rf-is-shdw-r"></span>
- <span class="rf-is-shdw-b"></span>
- <span id="form:inplaceSelectEditBtn" style="position :
relative;">
- <input class="rf-is-btn" id="form:inplaceSelectEditOkbtn"
- onmousedown="this.className='rf-is-btn-press'"
onmouseout="this.className='rf-is-btn'"
- onmouseup="this.className='rf-is-btn'"
- src="/javax.faces.resource/org.richfaces/ico_ok.gif.jsf"
- type="image" />
- <input class="rf-is-btn"
id="form:inplaceSelectEditCancelbtn"
- onmousedown="this.className='rf-is-btn-press'"
onmouseout="this.className='rf-is-btn'"
- onmouseup="this.className='rf-is-btn'"
- src="/javax.faces.resource/org.richfaces/ico_cancel.gif.jsf"
- type="image" />
- <br />
- </span>
- </span>
- </span>
- </span>
- <span class="rf-is-lst-cord" id="form:inplaceSelectEditList"
- style="display: none">
- <span class="rf-is-lst-pos" style="width: 250px">
- <span class="rf-is-shdw">
- <span class="rf-is-shdw-t"></span>
- <span class="rf-is-shdw-l"></span>
- <span class="rf-is-shdw-r"></span>
- <span class="rf-is-shdw-b"></span>
- <span class="rf-is-lst-dec">
- <span class="rf-is-lst-scrl"
id="form:inplaceSelectEditItems"
- style="height: 100px">
- <span id="form:inplaceSelectEditItem0"
class="rf-is-opt">Label#1</span>
- <span id="form:inplaceSelectEditItem1"
class="rf-is-opt">Label#2</span>
- <span id="form:inplaceSelectEditItem2"
class="rf-is-opt">Label#3</span>
- <span id="form:inplaceSelectEditItem3"
class="rf-is-opt">Label#4</span>
- </span>
- </span>
- </span>
- </span>
- </span>
- </span>
- <script type="text/javascript">
- //ignored
- </script>
+ <span class="rf-is-lbl" id="form:inplaceSelectEditLabel">
+ Edit Text
+ </span>
+ <input class="rf-is-none" id="form:inplaceSelectEditFocus"
name="form:inplaceSelectEditFocus" style="position: absolute; top: 0px;
left: 0px; outline-style: none;" type="image"/>
+ <span class="rf-is-edit" id="form:inplaceSelectEditEdit">
+ <input id="form:inplaceSelectEditselValue"
name="form:inplaceSelectEdit" type="hidden"/>
+ <input autocomplete="off" class="rf-is-fld"
id="form:inplaceSelectEditInput" name="form:inplaceSelectEditInput"
readonly="readonly" style="width: ;" type="text"/>
+ <span class="rf-is-btn-prepos">
+ <span class="rf-is-btn-pos">
+ <span class="rf-is-shdw"
id="form:inplaceSelectEditBtnshadow">
+ <span class="rf-is-shdw-t">
+ </span>
+ <span class="rf-is-shdw-l">
+ </span>
+ <span class="rf-is-shdw-r">
+ </span>
+ <span class="rf-is-shdw-b">
+ </span>
+ <span id="form:inplaceSelectEditBtn" style="position :
relative;">
+ <input class="rf-is-btn"
id="form:inplaceSelectEditOkbtn" name="form:inplaceSelectEditOkbtn"
onmousedown="this.className='rf-is-btn-press'"
onmouseout="this.className='rf-is-btn'"
onmouseup="this.className='rf-is-btn'"
src="/javax.faces.resource/org.richfaces/ico_ok.gif.jsf"
type="image"/>
+ <input class="rf-is-btn"
id="form:inplaceSelectEditCancelbtn"
name="form:inplaceSelectEditOkbtn"
onmousedown="this.className='rf-is-btn-press'"
onmouseout="this.className='rf-is-btn'"
onmouseup="this.className='rf-is-btn'"
src="/javax.faces.resource/org.richfaces/ico_cancel.gif.jsf"
type="image"/>
+ <br/>
+ </span>
+ </span>
+ </span>
+ </span>
+ <span class="rf-is-lst-cord" id="form:inplaceSelectEditList"
style="display: none">
+ <span class="rf-is-lst-pos" style="width: 250px">
+ <span class="rf-is-shdw">
+ <span class="rf-is-shdw-t">
+ </span>
+ <span class="rf-is-shdw-l">
+ </span>
+ <span class="rf-is-shdw-r">
+ </span>
+ <span class="rf-is-shdw-b">
+ </span>
+ <span class="rf-is-lst-dec">
+ <span class="rf-is-lst-scrl" style="height:
100px">
+ <span id="form:inplaceSelectEditItems">
+ <span id="form:inplaceSelectEditItem0"
class="rf-is-opt">
+ Label#1
+ </span>
+ <span id="form:inplaceSelectEditItem1"
class="rf-is-opt">
+ Label#2
+ </span>
+ <span id="form:inplaceSelectEditItem2"
class="rf-is-opt">
+ Label#3
+ </span>
+ <span id="form:inplaceSelectEditItem3"
class="rf-is-opt">
+ Label#4
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ <script type="text/javascript">
+ //ignored
+ </script>
</span>
Modified:
branches/RF-8742/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestWithControls.xmlunit.xml
===================================================================
---
branches/RF-8742/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestWithControls.xmlunit.xml 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestWithControls.xmlunit.xml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -1,63 +1,64 @@
<span class="rf-is-d-s" id="form:inplaceSelectWithControls">
- <span class="rf-is-lbl"
id="form:inplaceSelectWithControlsLabel">Edit Text</span>
- <input class="rf-is-none"
id="form:inplaceSelectWithControlsFocus"
- style="position: absolute; top: 0px; left: 0px; outline-style: none;"
- type="image" />
- <span class="rf-is-edit rf-is-none"
id="form:inplaceSelectWithControlsEdit">
- <input id="form:inplaceSelectWithControlsselValue"
name="form:inplaceSelectWithControls"
- type="hidden" value="Edit Text" />
- <input autocomplete="off" class="rf-is-fld"
- id="form:inplaceSelectWithControlsInput" readonly="readonly"
style="width: ;"
- type="text" />
- <span class="rf-is-btn-prepos">
- <span class="rf-is-btn-pos">
- <span class="rf-is-shdw"
id="form:inplaceSelectWithControlsBtnshadow">
- <span class="rf-is-shdw-t"></span>
- <span class="rf-is-shdw-l"></span>
- <span class="rf-is-shdw-r"></span>
- <span class="rf-is-shdw-b"></span>
- <span id="form:inplaceSelectWithControlsBtn" style="position :
relative;">
- <input class="rf-is-btn"
id="form:inplaceSelectWithControlsOkbtn"
- onmousedown="this.className='rf-is-btn-press'"
onmouseout="this.className='rf-is-btn'"
- onmouseup="this.className='rf-is-btn'"
- src="/javax.faces.resource/org.richfaces/ico_ok.gif.jsf"
- type="image" />
- <input class="rf-is-btn"
id="form:inplaceSelectWithControlsCancelbtn"
- onmousedown="this.className='rf-is-btn-press'"
onmouseout="this.className='rf-is-btn'"
- onmouseup="this.className='rf-is-btn'"
- src="/javax.faces.resource/org.richfaces/ico_cancel.gif.jsf"
- type="image" />
- <br />
- </span>
- </span>
- </span>
- </span>
- <span class="rf-is-lst-cord"
id="form:inplaceSelectWithControlsList"
- style="display: none">
- <span class="rf-is-lst-pos" style="width: 250px">
- <span class="rf-is-shdw">
- <span class="rf-is-shdw-t"></span>
- <span class="rf-is-shdw-l"></span>
- <span class="rf-is-shdw-r"></span>
- <span class="rf-is-shdw-b"></span>
- <span class="rf-is-lst-dec">
- <span class="rf-is-lst-scrl"
id="form:inplaceSelectWithControlsItems"
- style="height: 100px">
- <span id="form:inplaceSelectWithControlsItem0"
class="rf-is-opt">Label#1
- </span>
- <span id="form:inplaceSelectWithControlsItem1"
class="rf-is-opt">Label#2
- </span>
- <span id="form:inplaceSelectWithControlsItem2"
class="rf-is-opt">Label#3
- </span>
- <span id="form:inplaceSelectWithControlsItem3"
class="rf-is-opt">Label#4
- </span>
- </span>
- </span>
- </span>
- </span>
- </span>
- </span>
- <script type="text/javascript">
- // ignored
- </script>
+ <span class="rf-is-lbl"
id="form:inplaceSelectWithControlsLabel">
+ Edit Text
+ </span>
+ <input class="rf-is-none"
id="form:inplaceSelectWithControlsFocus"
name="form:inplaceSelectWithControlsFocus" style="position: absolute; top:
0px; left: 0px; outline-style: none;" type="image"/>
+ <span class="rf-is-edit rf-is-none"
id="form:inplaceSelectWithControlsEdit">
+ <input id="form:inplaceSelectWithControlsselValue"
name="form:inplaceSelectWithControls" type="hidden"/>
+ <input autocomplete="off" class="rf-is-fld"
id="form:inplaceSelectWithControlsInput"
name="form:inplaceSelectWithControlsInput" readonly="readonly"
style="width: ;" type="text"/>
+ <span class="rf-is-btn-prepos">
+ <span class="rf-is-btn-pos">
+ <span class="rf-is-shdw"
id="form:inplaceSelectWithControlsBtnshadow">
+ <span class="rf-is-shdw-t">
+ </span>
+ <span class="rf-is-shdw-l">
+ </span>
+ <span class="rf-is-shdw-r">
+ </span>
+ <span class="rf-is-shdw-b">
+ </span>
+ <span id="form:inplaceSelectWithControlsBtn" style="position
: relative;">
+ <input class="rf-is-btn"
id="form:inplaceSelectWithControlsOkbtn"
name="form:inplaceSelectWithControlsOkbtn"
onmousedown="this.className='rf-is-btn-press'"
onmouseout="this.className='rf-is-btn'"
onmouseup="this.className='rf-is-btn'"
src="/javax.faces.resource/org.richfaces/ico_ok.gif.jsf"
type="image"/>
+ <input class="rf-is-btn"
id="form:inplaceSelectWithControlsCancelbtn"
name="form:inplaceSelectWithControlsOkbtn"
onmousedown="this.className='rf-is-btn-press'"
onmouseout="this.className='rf-is-btn'"
onmouseup="this.className='rf-is-btn'"
src="/javax.faces.resource/org.richfaces/ico_cancel.gif.jsf"
type="image"/>
+ <br/>
+ </span>
+ </span>
+ </span>
+ </span>
+ <span class="rf-is-lst-cord"
id="form:inplaceSelectWithControlsList" style="display: none">
+ <span class="rf-is-lst-pos" style="width: 250px">
+ <span class="rf-is-shdw">
+ <span class="rf-is-shdw-t">
+ </span>
+ <span class="rf-is-shdw-l">
+ </span>
+ <span class="rf-is-shdw-r">
+ </span>
+ <span class="rf-is-shdw-b">
+ </span>
+ <span class="rf-is-lst-dec">
+ <span class="rf-is-lst-scrl" style="height:
100px">
+ <span id="form:inplaceSelectWithControlsItems">
+ <span id="form:inplaceSelectWithControlsItem0"
class="rf-is-opt">
+ Label#1
+ </span>
+ <span id="form:inplaceSelectWithControlsItem1"
class="rf-is-opt">
+ Label#2
+ </span>
+ <span id="form:inplaceSelectWithControlsItem2"
class="rf-is-opt">
+ Label#3
+ </span>
+ <span id="form:inplaceSelectWithControlsItem3"
class="rf-is-opt">
+ Label#4
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ <script type="text/javascript">
+ //ignored
+ </script>
</span>
\ No newline at end of file
Copied: branches/RF-8742/ui/output/api/src/main/java/org/richfaces/TooltipDirection.java
(from rev 19739, trunk/ui/output/api/src/main/java/org/richfaces/TooltipDirection.java)
===================================================================
--- branches/RF-8742/ui/output/api/src/main/java/org/richfaces/TooltipDirection.java
(rev 0)
+++
branches/RF-8742/ui/output/api/src/main/java/org/richfaces/TooltipDirection.java 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,10 @@
+package org.richfaces;
+
+/**
+ * @author amarkhel
+ */
+public enum TooltipDirection {
+ topRight, topLeft, bottomRight, bottomLeft, auto;
+
+ public static final TooltipDirection DEFAULT = bottomRight;
+}
Copied: branches/RF-8742/ui/output/api/src/main/java/org/richfaces/TooltipLayout.java
(from rev 19739, trunk/ui/output/api/src/main/java/org/richfaces/TooltipLayout.java)
===================================================================
--- branches/RF-8742/ui/output/api/src/main/java/org/richfaces/TooltipLayout.java
(rev 0)
+++
branches/RF-8742/ui/output/api/src/main/java/org/richfaces/TooltipLayout.java 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,10 @@
+package org.richfaces;
+
+/**
+ * @author amarkhel
+ */
+public enum TooltipLayout {
+ inline, block;
+
+ public static final TooltipLayout DEFAULT = TooltipLayout.inline;
+}
Copied: branches/RF-8742/ui/output/api/src/main/java/org/richfaces/TooltipMode.java (from
rev 19739, trunk/ui/output/api/src/main/java/org/richfaces/TooltipMode.java)
===================================================================
--- branches/RF-8742/ui/output/api/src/main/java/org/richfaces/TooltipMode.java
(rev 0)
+++ branches/RF-8742/ui/output/api/src/main/java/org/richfaces/TooltipMode.java 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,10 @@
+package org.richfaces;
+
+/**
+ * @author amarkhel
+ */
+public enum TooltipMode {
+ client, ajax;
+
+ public static final TooltipMode DEFAULT = TooltipMode.client;
+}
Copied:
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java
(from rev 19739,
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java)
===================================================================
---
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java
(rev 0)
+++
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,158 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.richfaces.component;
+
+import org.richfaces.TooltipLayout;
+import org.richfaces.TooltipDirection;
+import org.richfaces.TooltipMode;
+import org.richfaces.context.ExtendedVisitContext;
+import org.richfaces.context.ExtendedVisitContextMode;
+import org.richfaces.renderkit.MetaComponentRenderer;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.visit.VisitCallback;
+import javax.faces.component.visit.VisitContext;
+import javax.faces.component.visit.VisitResult;
+import javax.faces.context.FacesContext;
+import java.io.IOException;
+
+/**
+ * @author amarkhel
+ * @since 2010-10-24
+ */
+public abstract class AbstractTooltip extends AbstractDivPanel implements
MetaComponentResolver, MetaComponentEncoder {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.Tooltip";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.Tooltip";
+
+ public static final String CONTENT_META_COMPONENT_ID = "content";
+
+ protected AbstractTooltip() {
+ setRendererType("org.richfaces.Tooltip");
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ public abstract String getTarget();
+
+ public abstract String getValue();
+
+ public abstract TooltipLayout getLayout();
+
+ public abstract boolean isAttached();
+
+ public abstract TooltipDirection getDirection();
+
+ public abstract boolean isDisabled();
+
+ public abstract boolean isFollowMouse();
+
+ public abstract int getHideDelay();
+
+ public abstract String getHideEvent();
+
+ public abstract int getHorizontalOffset();
+
+ public abstract TooltipMode getMode();
+
+ public abstract int getShowDelay();
+
+ public abstract String getShowEvent();
+
+ public abstract int getVerticalOffset();
+
+ public abstract boolean isBypassUpdates();
+
+ public abstract boolean isLimitToList();
+
+ public abstract Object getData();
+
+ public abstract String getStatus();
+
+ public abstract Object getExecute();
+
+ public abstract Object getRender();
+
+ @Override
+ public void encodeAll(FacesContext context) throws IOException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
+
+ if (!isRendered()) {
+ return;
+ }
+
+ encodeBegin(context);
+ if (getMode() == TooltipMode.client) {
+ if (getRendersChildren()) {
+ encodeChildren(context);
+ } else if (this.getChildCount() > 0) {
+ for (UIComponent kid : getChildren()) {
+ kid.encodeAll(context);
+ }
+ }
+ }
+
+ encodeEnd(context);
+ }
+
+ @Override
+ public boolean visitTree(VisitContext context, VisitCallback callback) {
+ if (context instanceof ExtendedVisitContext) {
+ ExtendedVisitContext extendedVisitContext = (ExtendedVisitContext) context;
+ if (extendedVisitContext.getVisitMode() == ExtendedVisitContextMode.RENDER)
{
+
+ VisitResult result =
extendedVisitContext.invokeMetaComponentVisitCallback(this, callback,
+ CONTENT_META_COMPONENT_ID);
+ if (result == VisitResult.COMPLETE) {
+ return true;
+ } else if (result == VisitResult.REJECT) {
+ return false;
+ }
+ }
+ }
+
+ return super.visitTree(context, callback);
+ }
+
+ public void encodeMetaComponent(FacesContext context, String metaComponentId) throws
IOException {
+ ((MetaComponentRenderer) getRenderer(context)).encodeMetaComponent(context, this,
metaComponentId);
+ }
+
+ public String getContentClientId(FacesContext context) {
+ return getClientId(context) + MetaComponentResolver.META_COMPONENT_SEPARATOR_CHAR
+ CONTENT_META_COMPONENT_ID;
+ }
+
+ public String resolveClientId(FacesContext facesContext, UIComponent
contextComponent, String metaComponentId) {
+ if (CONTENT_META_COMPONENT_ID.equals(metaComponentId)) {
+ return ((AbstractTooltip)
contextComponent).getContentClientId(facesContext);
+ }
+
+ return null;
+ }
+}
Copied: branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/UITooltip.java
(from rev 19739, trunk/ui/output/ui/src/main/java/org/richfaces/component/UITooltip.java)
===================================================================
--- branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/UITooltip.java
(rev 0)
+++
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/UITooltip.java 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,220 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.component;
+
+import org.richfaces.TooltipLayout;
+import org.richfaces.TooltipDirection;
+import org.richfaces.TooltipMode;
+
+/**
+ * @author amarkhel
+ * @since 2010-10-24
+ */
+public class UITooltip extends AbstractTooltip {
+
+ public enum PropertyKeys {
+ target,
+ value,
+ layout,
+ attached,
+ direction,
+ disabled,
+ followMouse,
+ hideDelay,
+ hideEvent,
+ horizontalOffset,
+ mode,
+ showDelay,
+ showEvent,
+ verticalOffset,
+ bypassUpdates,
+ limitToList,
+ data,
+ status,
+ execute,
+ render
+ }
+
+ public String getTarget() {
+ return (String) getStateHelper().eval(PropertyKeys.target,
getParent().getClientId());
+ }
+
+ public void setTarget(String target) {
+ getStateHelper().put(PropertyKeys.target, target);
+ }
+
+ public String getValue() {
+ return (String) getStateHelper().eval(PropertyKeys.value);
+ }
+
+ public void setValue(String value) {
+ getStateHelper().put(PropertyKeys.value, value);
+ }
+
+ public TooltipLayout getLayout() {
+ return (TooltipLayout) getStateHelper().eval(PropertyKeys.layout,
TooltipLayout.DEFAULT);
+ }
+
+ public void setLayout(TooltipLayout layout) {
+ getStateHelper().put(PropertyKeys.layout, layout);
+ }
+
+ public boolean isAttached() {
+ return
Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.attached, true)));
+ }
+
+ public void setAttached(boolean attached) {
+ getStateHelper().put(PropertyKeys.attached, attached);
+ }
+
+ public TooltipDirection getDirection() {
+ return (TooltipDirection) getStateHelper().eval(PropertyKeys.direction,
TooltipDirection.DEFAULT);
+ }
+
+ public void setDirection(TooltipDirection direction) {
+ getStateHelper().put(PropertyKeys.direction, direction);
+ }
+
+ public boolean isDisabled() {
+ return
Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.disabled)));
+ }
+
+ public void setDisabled(boolean disabled) {
+ getStateHelper().put(PropertyKeys.disabled, disabled);
+ }
+
+ public boolean isFollowMouse() {
+ return
Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.followMouse, true)));
+ }
+
+ public void setFollowMouse(boolean followMouse) {
+ getStateHelper().put(PropertyKeys.followMouse, followMouse);
+ }
+
+ public int getHideDelay() {
+ return (Integer) getStateHelper().eval(PropertyKeys.hideDelay, 0);
+ }
+
+ public void setHideDelay(int hideDelay) {
+ getStateHelper().put(PropertyKeys.hideDelay, hideDelay);
+ }
+
+ public String getHideEvent() {
+ return (String) getStateHelper().eval(PropertyKeys.hideEvent,
"mouseleave");
+ }
+
+ public void setHideEvent(String hideEvent) {
+ getStateHelper().put(PropertyKeys.hideEvent, hideEvent);
+ }
+
+ public int getHorizontalOffset() {
+ return (Integer) getStateHelper().eval(PropertyKeys.horizontalOffset, 10);
+ }
+
+ public void setHorizontalOffset(int horizontalOffset) {
+ getStateHelper().put(PropertyKeys.horizontalOffset, horizontalOffset);
+ }
+
+ public TooltipMode getMode() {
+ return (TooltipMode) getStateHelper().eval(PropertyKeys.mode,
TooltipMode.DEFAULT);
+ }
+
+ public void setMode(TooltipMode mode) {
+ getStateHelper().put(PropertyKeys.mode, mode);
+ }
+
+ public int getShowDelay() {
+ return (Integer) getStateHelper().eval(PropertyKeys.showDelay, 0);
+ }
+
+ public void setShowDelay(int showDelay) {
+ getStateHelper().put(PropertyKeys.showDelay, showDelay);
+ }
+
+ public String getShowEvent() {
+ return (String) getStateHelper().eval(PropertyKeys.showEvent,
"mouseenter");
+ }
+
+ public void setShowEvent(String showEvent) {
+ getStateHelper().put(PropertyKeys.showEvent, showEvent);
+ }
+
+ public int getVerticalOffset() {
+ return (Integer) getStateHelper().eval(PropertyKeys.verticalOffset, 10);
+ }
+
+ public void setVerticalOffset(int verticalOffset) {
+ getStateHelper().put(PropertyKeys.verticalOffset, verticalOffset);
+ }
+
+ public boolean isBypassUpdates() {
+ return
Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.bypassUpdates)));
+ }
+
+ public void setBypassUpdates(boolean bypassUpdates) {
+ getStateHelper().put(PropertyKeys.bypassUpdates, bypassUpdates);
+ }
+
+ public boolean isLimitToList() {
+ return
Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.limitToList)));
+ }
+
+ public void setLimitToList(boolean limitToList) {
+ getStateHelper().put(PropertyKeys.limitToList, limitToList);
+ }
+
+ public Object getData() {
+ return getStateHelper().eval(PropertyKeys.data);
+ }
+
+ public void setData(Object data) {
+ getStateHelper().put(PropertyKeys.data, data);
+ }
+
+ public String getStatus() {
+ return (String) getStateHelper().eval(PropertyKeys.status);
+ }
+
+ public void setStatus(String status) {
+ getStateHelper().put(PropertyKeys.status, status);
+ }
+
+ public Object getExecute() {
+ return getStateHelper().eval(PropertyKeys.execute);
+ }
+
+ public void setExecute(Object execute) {
+ getStateHelper().put(PropertyKeys.execute, execute);
+ }
+
+ public Object getRender() {
+ return getStateHelper().eval(PropertyKeys.render);
+ }
+
+ public void setRender(Object render) {
+ getStateHelper().put(PropertyKeys.render, render);
+ }
+
+
+}
Copied:
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTooltip.java
(from rev 19739,
trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTooltip.java)
===================================================================
---
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTooltip.java
(rev 0)
+++
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTooltip.java 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,203 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.component.html;
+
+import org.richfaces.component.UITooltip;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+/**
+ * @author amarkhel
+ * @since 2010-10-24
+ */
+public class HtmlTooltip extends UITooltip implements ClientBehaviorHolder {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.Tooltip";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.Tooltip";
+
+ private static final Collection<String> EVENT_NAMES =
Collections.unmodifiableCollection(Arrays.asList(
+ "click",
+ "dblclick",
+ "mousedown",
+ "mousemove",
+ "mouseout",
+ "mouseover",
+ "mouseup",
+ "hide",
+ "show",
+ "beforehide",
+ "beforeshow"
+ ));
+
+
+ public enum PropertyKeys {
+ style,
+ styleClass,
+ zindex,
+ onclick,
+ ondblclick,
+ onmousedown,
+ onmousemove,
+ onmouseout,
+ onmouseover,
+ onmouseup,
+ onhide,
+ onshow,
+ onbeforehide,
+ onbeforeshow
+ }
+
+ public HtmlTooltip() {
+ setRendererType("org.richfaces.Tooltip");
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ public String getStyle() {
+ return (String) getStateHelper().eval(PropertyKeys.style);
+ }
+
+ public void setStyle(String style) {
+ getStateHelper().put(PropertyKeys.style, style);
+ }
+
+ public String getStyleClass() {
+ return (String) getStateHelper().eval(PropertyKeys.styleClass);
+ }
+
+ public void setStyleClass(String styleClass) {
+ getStateHelper().put(PropertyKeys.styleClass, styleClass);
+ }
+
+ public int getZindex() {
+ return (Integer) getStateHelper().eval(PropertyKeys.zindex);
+ }
+
+ public void setZindex(int zindex) {
+ getStateHelper().put(PropertyKeys.zindex, zindex);
+ }
+
+ public String getOnclick() {
+ return (String) getStateHelper().eval(PropertyKeys.onclick);
+ }
+
+ public void setOnclick(String onclick) {
+ getStateHelper().put(PropertyKeys.onclick, onclick);
+ }
+
+ public String getOndblclick() {
+ return (String) getStateHelper().eval(PropertyKeys.ondblclick);
+ }
+
+ public void setOndblclick(String ondblclick) {
+ getStateHelper().put(PropertyKeys.ondblclick, ondblclick);
+ }
+
+ public String getOnmousedown() {
+ return (String) getStateHelper().eval(PropertyKeys.onmousedown);
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ getStateHelper().put(PropertyKeys.onmousedown, onmousedown);
+ }
+
+ public String getOnmousemove() {
+ return (String) getStateHelper().eval(PropertyKeys.onmousemove);
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ getStateHelper().put(PropertyKeys.onmousemove, onmousemove);
+ }
+
+ public String getOnmouseout() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseout);
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ getStateHelper().put(PropertyKeys.onmouseout, onmouseout);
+ }
+
+ public String getOnmouseover() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseover);
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ getStateHelper().put(PropertyKeys.onmouseover, onmouseover);
+ }
+
+ public String getOnmouseup() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseup);
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ getStateHelper().put(PropertyKeys.onmouseup, onmouseup);
+ }
+
+ public String getOnhide() {
+ return (String) getStateHelper().eval(PropertyKeys.onhide);
+ }
+
+ public void setOnhide(String onhide) {
+ getStateHelper().put(PropertyKeys.onhide, onhide);
+ }
+
+ public String getOnshow() {
+ return (String) getStateHelper().eval(PropertyKeys.onshow);
+ }
+
+ public void setOnshow(String onshow) {
+ getStateHelper().put(PropertyKeys.onshow, onshow);
+ }
+
+ public String getOnbeforehide() {
+ return (String) getStateHelper().eval(PropertyKeys.onbeforehide);
+ }
+
+ public void setOnbeforehide(String onbeforehide) {
+ getStateHelper().put(PropertyKeys.onbeforehide, onbeforehide);
+ }
+
+ public String getOnbeforeshow() {
+ return (String) getStateHelper().eval(PropertyKeys.onbeforeshow);
+ }
+
+ public void setOnbeforeshow(String onbeforeshow) {
+ getStateHelper().put(PropertyKeys.onbeforeshow, onbeforeshow);
+ }
+
+
+
+ @Override
+ public Collection<String> getEventNames() {
+ return EVENT_NAMES;
+ }
+}
+
Modified:
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java
===================================================================
---
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java 2010-10-28
17:05:33 UTC (rev 19740)
@@ -97,7 +97,11 @@
writer.startElement(HtmlConstants.DIV_ELEM, component);
writer.writeAttribute("id", component.getClientId(context),
"clientId");
writer.writeAttribute("class", getStyleClass(component), null);
- writer.writeAttribute(HtmlConstants.STYLE_ATTRIBUTE, getStyle(component), null);
+ String style = getStyle(component);
+ if (style != null) {
+ writer.writeAttribute(HtmlConstants.STYLE_ATTRIBUTE, style, null);
+ }
+
renderPassThroughAttributes(context, component, getPassThroughAttributes());
}
Copied:
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java
(from rev 19739,
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java)
===================================================================
---
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java
(rev 0)
+++
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,217 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.renderkit.html;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.component.AbstractTooltip;
+import org.richfaces.component.html.HtmlTooltip;
+import org.richfaces.renderkit.HtmlConstants;
+import org.richfaces.renderkit.MetaComponentRenderer;
+
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.richfaces.component.util.HtmlUtil.concatClasses;
+import static org.richfaces.renderkit.RenderKitUtils.renderPassThroughAttributes;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
+
+/**
+ * @author amarkhel
+ * @since 2010-10-24
+ */
+@ResourceDependencies( { // TODO review
+ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "jquery.position.js"),
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name = "richfaces-event.js"),
+ @ResourceDependency(name = "richfaces-base-component.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"popup.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"Tooltip.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"tooltip.ecss") })
+public class TooltipRenderer extends DivPanelRenderer implements MetaComponentRenderer {
+
+ public static final String HIDE = "hide";
+ public static final String SHOW = "show";
+ public static final String BEFORE_HIDE = "beforehide";
+ public static final String BEFORE_SHOW = "beforeshow";
+
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ AbstractTooltip tooltip = (AbstractTooltip) component;
+
+ Map<String, String> requestMap =
+ context.getExternalContext().getRequestParameterMap();
+
+ String compClientId = component.getClientId(context);
+ String clientId = requestMap.get(compClientId);
+ if (clientId != null && clientId.equals(compClientId)) {
+
context.getPartialViewContext().getRenderIds().add(tooltip.getContentClientId(context));
+
+ //TODO nick - this should be done on encode, not on decode
+ addOnCompleteParam(tooltip.getClientId());
+ }
+ }
+
+ protected static void addOnCompleteParam(String tooltipId) {
+ AjaxContext.getCurrentInstance().appendOncomplete(new StringBuilder()
+
.append("RichFaces.$('").append(tooltipId).append("').onCompleteHandler();").toString());
+ }
+
+ @Override
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
+ AbstractTooltip tooltip = (AbstractTooltip) component;
+
+ writer.startElement(getMarkupElement(tooltip), component);
+ writer.writeAttribute("id", component.getClientId(context),
"clientId");
+ writer.writeAttribute("class", getStyleClass(component), null);
+ String style = getStyle(component);
+ if (style != null && style.trim().length() > 0) {
+ writer.writeAttribute(HtmlConstants.STYLE_ATTRIBUTE, style, null);
+ }
+
+ renderPassThroughAttributes(context, component, getPassThroughAttributes());
+
+ writer.startElement(getMarkupElement(tooltip), component);
+ writer.writeAttribute("id", component.getClientId(context) +
":cntr", null);
+ writer.writeAttribute("class", "rf-tt-cntr", null);
+
+ encodeLoading(writer, context, tooltip);
+ encodeContentBegin(writer, context, tooltip);
+ }
+
+ private void encodeContentBegin(ResponseWriter writer, FacesContext context,
AbstractTooltip tooltip) throws IOException {
+ writer.startElement(getMarkupElement(tooltip), tooltip);
+ writer.writeAttribute("id", tooltip.getClientId(context) +
"@content", null);
+ writer.writeAttribute("class", "rf-tt-cnt", null);
+ }
+
+ private void encodeLoading(ResponseWriter writer, FacesContext context,
AbstractTooltip tooltip) throws IOException {
+ writer.startElement(getMarkupElement(tooltip), tooltip);
+ writer.writeAttribute("id", tooltip.getClientId(context) +
":loading", null);
+ writer.writeAttribute("class", "rf-tt-loading", null);
+ writer.writeText("Loading...", null);
+ writer.endElement(getMarkupElement(tooltip));
+ }
+
+ private String getMarkupElement(AbstractTooltip component) {
+ switch (component.getLayout()) {
+ case block:
+ return HtmlConstants.DIV_ELEM;
+
+ case inline:
+ return HtmlConstants.SPAN_ELEM;
+
+ default:
+ throw new IllegalStateException("Unknown tooltip layout (=" +
component.getLayout() + ")");
+ }
+ }
+
+ @Override
+ protected String getStyleClass(UIComponent component) {
+ return concatClasses("rf-tt", attributeAsString(component,
"styleClass"));
+ }
+
+ @Override
+ protected JSObject getScriptObject(FacesContext context, UIComponent component) {
+ return new JSObject("RichFaces.ui.Tooltip",
+ component.getClientId(), getScriptObjectOptions(context, component));
+ }
+
+ @Override
+ protected Map<String, Object> getScriptObjectOptions(FacesContext context,
UIComponent component) {
+ HtmlTooltip tooltip = (HtmlTooltip) component;
+
+ Map<String, Object> options = new HashMap<String, Object>();
+ options.put("ajax", getAjaxOptions(context, tooltip));
+ options.put("direction", tooltip.getDirection());
+ options.put("attached", tooltip.isAttached());
+ options.put("offset", getOffset(tooltip));
+ options.put("mode", tooltip.getMode());
+ options.put("disabled", tooltip.isDisabled());
+ options.put("hideDelay", tooltip.getHideDelay());
+ options.put("hideEvent", tooltip.getHideEvent());
+ options.put("showDelay", tooltip.getShowDelay());
+ options.put("showEvent", tooltip.getShowEvent());
+ options.put("followMouse", tooltip.isFollowMouse());
+ options.put("target", tooltip.getTarget());
+
+ addEventOption(context, tooltip, options, HIDE);
+ addEventOption(context, tooltip, options, SHOW);
+ addEventOption(context, tooltip, options, BEFORE_HIDE);
+ addEventOption(context, tooltip, options, BEFORE_SHOW);
+
+ return options;
+ }
+
+ public Map<String, Object> getOffset(HtmlTooltip tooltip) {
+ Map<String, Object> options = new HashMap<String, Object>();
+ // TODO
+ return options;
+ }
+
+ private void encodeContentEnd(ResponseWriter writer, FacesContext context,
AbstractTooltip tooltip) throws IOException {
+ writer.endElement(getMarkupElement(tooltip));
+ }
+
+ @Override
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
+ encodeContentEnd(writer, context, (AbstractTooltip) component);
+
+ writer.endElement(getMarkupElement((AbstractTooltip) component));
+
+ writeJavaScript(writer, context, component);
+
+ writer.endElement(getMarkupElement((AbstractTooltip) component));
+ }
+
+ public void encodeMetaComponent(FacesContext context, UIComponent component, String
metaComponentId) throws IOException {
+ if (AbstractTooltip.CONTENT_META_COMPONENT_ID.equals(metaComponentId)) {
+ AbstractTooltip tooltip = (AbstractTooltip) component;
+ ResponseWriter writer = context.getResponseWriter();
+
+ encodeContentBegin(writer, context, tooltip);
+ for (UIComponent child : tooltip.getChildren()) {
+ child.encodeAll(context);
+ }
+ encodeContentEnd(writer, context, tooltip);
+ }
+ }
+
+ @Override
+ protected Class<? extends UIComponent> getComponentClass() {
+ return AbstractTooltip.class;
+ }
+
+
+}
+
Modified: branches/RF-8742/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
===================================================================
---
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -11,6 +11,112 @@
</behavior>
<component>
+ <component-type>org.richfaces.Tooltip</component-type>
+
<component-class>org.richfaces.component.html.HtmlTooltip</component-class>
+ <property>
+ <description></description>
+ <property-name>for_</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>value</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>layout</property-name>
+ <property-class>org.richfaces.TooltipLayout</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>attached</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>direction</property-name>
+ <property-class>org.richfaces.TooltipDirection</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>disabled</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>followMouse</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>hideDelay</property-name>
+ <property-class>int</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>hideEvent</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>horizontalOffset</property-name>
+ <property-class>int</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>mode</property-name>
+ <property-class>org.richfaces.TooltipMode</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>showDelay</property-name>
+ <property-class>int</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>showEvent</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>verticalOffset</property-name>
+ <property-class>int</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>bypassUpdates</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>limitToList</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>data</property-name>
+ <property-class>java.lang.Object</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>status</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>execute</property-name>
+ <property-class>java.lang.Object</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>render</property-name>
+ <property-class>java.lang.Object</property-class>
+ </property>
+
+ </component>
+
+ <component>
<component-type>org.richfaces.CollapsiblePanel</component-type>
<component-class>org.richfaces.component.html.HtmlCollapsiblePanel</component-class>
<property>
@@ -666,6 +772,12 @@
<render-kit>
<render-kit-id>HTML_BASIC</render-kit-id>
<renderer>
+ <component-family>org.richfaces.Tooltip</component-family>
+ <renderer-type>org.richfaces.Tooltip</renderer-type>
+
<renderer-class>org.richfaces.renderkit.html.TooltipRenderer</renderer-class>
+ </renderer>
+
+ <renderer>
<component-family>org.richfaces.CollapsiblePanel</component-family>
<renderer-type>org.richfaces.CollapsiblePanel</renderer-type>
<renderer-class>org.richfaces.renderkit.html.CollapsiblePanelRenderer</renderer-class>
Modified: branches/RF-8742/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
===================================================================
--- branches/RF-8742/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-10-28
16:13:23 UTC (rev 19739)
+++ branches/RF-8742/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -52,6 +52,201 @@
<tag>
+ <tag-name>tooltip</tag-name>
+ <component>
+ <component-type>org.richfaces.Tooltip</component-type>
+ <renderer-type>org.richfaces.Tooltip</renderer-type>
+
+ </component>
+ <attribute>
+ <description></description>
+ <name>for_</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>value</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>layout</name>
+ <type>org.richfaces.TooltipLayout</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>attached</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>direction</name>
+ <type>org.richfaces.TooltipDirection</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>disabled</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>followMouse</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>hideDelay</name>
+ <type>int</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>hideEvent</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>horizontalOffset</name>
+ <type>int</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>mode</name>
+ <type>org.richfaces.TooltipMode</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>showDelay</name>
+ <type>int</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>showEvent</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>verticalOffset</name>
+ <type>int</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>bypassUpdates</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>limitToList</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>data</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>status</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>execute</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>render</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>style</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>styleClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>zindex</name>
+ <type>int</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>ondblclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onmousedown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onmousemove</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onmouseout</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onmouseover</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onmouseup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onhide</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onshow</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onbeforehide</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>onbeforeshow</name>
+ <type>java.lang.String</type>
+ </attribute>
+
+ </tag>
+
+ <tag>
<tag-name>collapsiblePanel</tag-name>
<component>
<component-type>org.richfaces.CollapsiblePanel</component-type>
Copied:
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip.js
(from rev 19739,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip.js)
===================================================================
---
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip.js
(rev 0)
+++
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip.js 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,292 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.TooltipDirection = {
+ topRight : "topRight",
+ topLeft : "topLeft",
+ bottomRight : "bottomRight",
+ bottomLeft : "bottomLeft",
+ auto : "auto",
+
+ DEFAULT: "bottomRight"
+ };
+ var TooltipDirection = rf.ui.TooltipDirection;
+
+ rf.ui.TooltipMode = {
+ client : "client",
+ ajax : "ajax",
+
+ DEFAULT: "client"
+ };
+ var TooltipMode = rf.ui.TooltipMode;
+
+ var DEFAULT_OPTIONS = {
+ direction : TooltipDirection.DEFAULT,
+ attached : true,
+ offset : [],
+ mode : TooltipMode.DEFAULT,
+ disabled : false,
+ hideDelay : 0,
+ hideEvent : "mouseleave",
+ showDelay : 0,
+ showEvent : "mouseenter",
+ followMouse : true
+ };
+
+ var SHOW_ACTION = {
+
+ /**
+ *
+ * @return {void}
+ * */
+ exec : function (tooltip, event) {
+ var mode = tooltip.mode;
+ if (mode == TooltipMode.ajax) {
+ return this.execAjax(tooltip, event);
+ } else if (mode == TooltipMode.client) {
+ return this.execClient(tooltip, event);
+ } else {
+ rf.log.error("SHOW_ACTION.exec : unknown mode (" + mode +
")");
+ }
+ },
+
+ /**
+ * @protected
+ *
+ * @return {Boolean} false
+ * */
+ execAjax : function (tooltip, event) {
+ tooltip.__loading().show();
+ tooltip.__content().hide();
+ tooltip.__show(event);
+
+ rf.ajax(tooltip.id, null, $.extend({}, tooltip.options["ajax"],
{}));
+
+ return true;
+ },
+
+ /**
+ * @protected
+ *
+ * @return {undefined}
+ * - false - if process has been terminated
+ * - true - in other cases
+ * */
+ execClient : function (tooltip, event) {
+ tooltip.__show(event);
+
+ return tooltip.__fireShow();
+ }
+ };
+
+ rf.ui.Tooltip = rf.BaseComponent.extendClass({
+ // class name
+ name:"Tooltip",
+
+ /**
+ * @class Tooltip
+ * @name Tooltip
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ this.id = componentId
+ this.options = $.extend({}, DEFAULT_OPTIONS, this.options || {}, options ||
{});
+ this.attachToDom.call(this, componentId);
+
+ this.mode = TooltipMode.ajax;
+ this.target = this.options.target;
+
+ this.__addUserEventHandler("hide");
+ this.__addUserEventHandler("show");
+ this.__addUserEventHandler("beforehide");
+ this.__addUserEventHandler("beforeshow");
+
+ this.popup = new RichFaces.ui.Popup(this.id + ":cntr", {
+ attachTo: this.target,
+ attachToBody: false,
+ positionType: "TOOLTIP",
+ positionOffset: [200,200]
+ });
+
+ var tooltip = this;
+ function mouseMoveHandler(event) {
+ tooltip.popup.show(event);
+ }
+
+ $(this.options.target).bind(this.options.showEvent, function (event) {
+ tooltip.show(event);
+
+ if (tooltip.options.followMouse) {
+ $(tooltip.target).bind("mousemove", mouseMoveHandler);
+ }
+ });
+
+ $(tooltip.target).bind(this.options.hideEvent, function (event) {
+ tooltip.hide();
+
+ if (tooltip.options.followMouse) {
+ $(tooltip.target).unbind("mousemove", mouseMoveHandler);
+ }
+ });
+
+ },
+
+ /***************************** Public Methods
****************************************************************/
+ /**
+ * @methodOf
+ * @name PanelMenuItem#hide
+ *
+ * TODO ...
+ *
+ * @return {void} TODO ...
+ */
+ hide: function () {
+ var continueProcess = this.__fireBeforeHide();
+ if (!continueProcess) {
+ return false;
+ }
+
+ this.__hide();
+
+ return this.__fireHide()
+ },
+
+ /**
+ * @private
+ * @return {void} TODO ...
+ */
+ __hide: function () {
+ var tooltip = this;
+ this.__delay(this.options.hideDelay, function () {
+ tooltip.popup.hide();
+ });
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenuItem#show
+ *
+ * TODO ...
+ *
+ * @return {void} TODO ...
+ */
+ show: function (event) {
+ var continueProcess = this.__fireBeforeShow();
+ if (!continueProcess) {
+ return false;
+ }
+
+ SHOW_ACTION.exec(this, event);
+ },
+
+ onCompleteHandler : function () {
+ this.__loading().hide();
+ this.__content().show();
+
+ return this.__fireShow();
+ },
+
+ /**
+ * @private
+ * @return {void} TODO ...
+ */
+ __show: function (event) {
+ var tooltip = this;
+ this.__delay(this.options.hideDelay, function () {
+ tooltip.popup.show(event);
+ });
+ },
+
+ /***************************** Private Methods
****************************************************************/
+ __delay : function (delay, action) {
+ if (delay > 0) {
+ var hidingTimerHandle = window.setTimeout(function() {
+ action();
+
+ if (hidingTimerHandle) {
+ window.clearTimeout(this.hidingTimerHandle);
+ hidingTimerHandle = undefined;
+ }
+ }, delay);
+ } else {
+ action();
+ }
+ },
+
+ __detectAncestorNode: function(leaf, element) {
+ // Return true if "element" is "leaf" or one of its
parents
+ var node = leaf;
+ while (node != null && node != element) {
+ node = node.parentNode;
+ }
+ return (node != null);
+ },
+
+ __loading : function () {
+ return $(document.getElementById(this.id + ":loading"));
+ },
+
+ __content : function () {
+ return $(document.getElementById(this.id + "@content"));
+ },
+
+ __fireHide : function () {
+ return rf.Event.fireById(this.id, "hide", { id: this.id });
+ },
+
+ __fireShow : function () {
+ return rf.Event.fireById(this.id, "show", { id: this.id });
+ },
+
+ __fireBeforeHide : function () {
+ return rf.Event.fireById(this.id, "beforehide", { id: this.id });
+ },
+
+ __fireBeforeShow : function () {
+ return rf.Event.fireById(this.id, "beforeshow", { id: this.id });
+ },
+
+
+
+ /**
+ * @private
+ * */
+ __addUserEventHandler : function (name) {
+ var handler = this.options["on" + name];
+ if (handler) {
+ rf.Event.bindById(this.id, name, handler);
+ }
+ },
+
+ destroy: function () {
+ rf.ui.Tooltip.$super.destroy.call(this);
+ }
+ });
+})(jQuery, RichFaces);
Copied:
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.ecss
(from rev 19739,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.ecss)
===================================================================
---
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.ecss
(rev 0)
+++
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.ecss 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+.rf-tt {
+ position: absolute;
+}
+
+.rf-tt-loading {
+
+}
+
+.rf-tt-cnt {
+
+}
+
+.rf-tt-cntr {
+ position: absolute;
+ display: none;
+}
\ No newline at end of file
Copied:
branches/RF-8742/ui/output/ui/src/test/java/org/richfaces/component/UITooltipTest.java
(from rev 19739,
trunk/ui/output/ui/src/test/java/org/richfaces/component/UITooltipTest.java)
===================================================================
---
branches/RF-8742/ui/output/ui/src/test/java/org/richfaces/component/UITooltipTest.java
(rev 0)
+++
branches/RF-8742/ui/output/ui/src/test/java/org/richfaces/component/UITooltipTest.java 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.component;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.faces.component.UIComponent;
+import java.util.List;
+
+/**
+ * @author amarkhel
+ * @since 2010-10-24
+ */
+public class UITooltipTest {
+
+ private UITooltip tooltip;
+
+ @Before
+ public void setUp () {
+ tooltip = new UITooltip();
+ }
+
+ @Test
+ public void testSomething() {
+ Assert.assertNotNull(tooltip);
+ }
+}
+
Modified:
branches/RF-8742/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java
===================================================================
---
branches/RF-8742/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java 2010-10-28
16:13:23 UTC (rev 19739)
+++
branches/RF-8742/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java 2010-10-28
17:05:33 UTC (rev 19740)
@@ -51,7 +51,6 @@
XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true);
XMLUnit.setIgnoreWhitespace(true);
XMLUnit.setIgnoreComments(true);
-
}
protected HtmlUnitEnvironment environment;
@@ -85,7 +84,7 @@
Diff xmlDiff = new Diff(new StringReader(pageCode), new
InputStreamReader(expectedPageCode));
xmlDiff.overrideDifferenceListener(new IgnoreScriptsContent());
- Assert.assertTrue("XML was not similar:" + xmlDiff.toString(),
xmlDiff.similar());
+ Assert.assertTrue("XML was not similar:" + xmlDiff.toString() +
"\n\n" + pageCode, xmlDiff.similar());
}
}
Copied:
branches/RF-8742/ui/output/ui/src/test/java/org/richfaces/renderkit/html/TooltipRendererTest.java
(from rev 19739,
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/TooltipRendererTest.java)
===================================================================
---
branches/RF-8742/ui/output/ui/src/test/java/org/richfaces/renderkit/html/TooltipRendererTest.java
(rev 0)
+++
branches/RF-8742/ui/output/ui/src/test/java/org/richfaces/renderkit/html/TooltipRendererTest.java 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.richfaces.renderkit.html;
+
+import org.junit.Test;
+import org.xml.sax.SAXException;
+
+import java.io.IOException;
+
+ /**
+ * @author amarkhel
+ * @since 2010-10-24
+ */
+public class TooltipRendererTest extends RendererTestBase {
+
+ @Test
+ public void testDoEncode() throws IOException, SAXException {
+ doTest("tooltip", "f:tooltip");
+ }
+
+}
+
+
+
Copied:
branches/RF-8742/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/tooltip.xhtml
(from rev 19739,
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/tooltip.xhtml)
===================================================================
---
branches/RF-8742/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/tooltip.xhtml
(rev 0)
+++
branches/RF-8742/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/tooltip.xhtml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,47 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright ${year}, Red Hat, Inc. and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:pn="http://richfaces.org/output"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <h:head>
+ <title>Richfaces Tooltip Test</title>
+ </h:head>
+
+<h:body>
+ <h:form id="f" style="border:blue solid thin;">
+ <pn:tooltip id="tooltip">
+ <!-- TODO -->
+ </pn:tooltip>
+ </h:form>
+</h:body>
+</html>
+
+
Copied:
branches/RF-8742/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/tooltip.xmlunit.xml
(from rev 19739,
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/tooltip.xmlunit.xml)
===================================================================
---
branches/RF-8742/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/tooltip.xmlunit.xml
(rev 0)
+++
branches/RF-8742/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/tooltip.xmlunit.xml 2010-10-28
17:05:33 UTC (rev 19740)
@@ -0,0 +1,9 @@
+<span id="f:tooltip" class="rf-tt">
+ <span id="f:tooltip:cntr" class="rf-tt-cntr">
+ <span id="f:tooltip:loading"
class="rf-tt-loading">Loading...</span>
+ <span id="f:tooltip@content"
class="rf-tt-cnt"></span>
+ </span>
+ <script type="text/javascript">
+ // Text
+ </script>
+</span>