You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2014/04/26 20:42:41 UTC
svn commit: r1590274 - in /myfaces/tobago/branches/tobago-3.0.x:
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/
tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/stand...
Author: weber
Date: Sat Apr 26 18:42:40 2014
New Revision: 1590274
URL: http://svn.apache.org/r1590274
Log:
TOBAGO-1386 - ToolbarButtons in TabLabels [Merged from trunk: revision 1590236]
Modified:
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java (contents, props changed)
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago.css (contents, props changed)
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java (contents, props changed)
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (contents, props changed)
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java?rev=1590274&r1=1590273&r2=1590274&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java Sat Apr 26 18:42:40 2014
@@ -25,6 +25,7 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.component.OnComponentPopulated;
import org.apache.myfaces.tobago.component.RendererTypes;
import org.apache.myfaces.tobago.component.SupportsRenderedPartially;
+import org.apache.myfaces.tobago.component.UITab;
import org.apache.myfaces.tobago.event.TabChangeEvent;
import org.apache.myfaces.tobago.event.TabChangeListener;
import org.apache.myfaces.tobago.event.TabChangeSource2;
@@ -138,8 +139,25 @@ public abstract class AbstractUITabGroup
if (!isRendered()) {
return;
}
- final AbstractUIPanelBase renderedTab = getRenderedTab();
- renderedTab.processDecodes(context);
+ int index = 0;
+ for (final UIComponent child : getChildren()) {
+ if (child instanceof UITab) {
+ final UITab tab = (UITab) child;
+ if (tab.isRendered()) {
+ if (getRenderedIndex() == index) {
+ tab.processDecodes(context);
+ } else {
+ UIComponent facet = tab.getFacet(Facets.TOOL_BAR);
+ if (facet != null) {
+ facet.processDecodes(context);
+ }
+ }
+ }
+ index++;
+ }
+ }
+// final AbstractUIPanelBase renderedTab = getRenderedTab();
+// renderedTab.processDecodes(context);
for (final UIComponent facet : getFacets().values()) {
facet.processDecodes(context);
}
Propchange: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Sat Apr 26 18:42:40 2014
@@ -0,0 +1,3 @@
+/myfaces/tobago/branches/tobago-1.5.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java:1356585,1357124
+/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java:1226794-1341423
+/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java:1571193,1571804,1571816,1571941,1571945,1571962,1571966,1576730,1589960,1590236
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago.css?rev=1590274&r1=1590273&r2=1590274&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago.css (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago.css Sat Apr 26 18:42:40 2014
@@ -1278,6 +1278,18 @@ div.tobago-richTextEditor-body {
padding-left: 13px;
}
+.tobago-tab-toolBar {
+ position: relative;
+ float: right;
+ top: -2px;
+ right: -7px;
+}
+
+.tobago-tab-toolBar-markup-selected {
+ top: -1px;
+ right: -6px;
+}
+
.tobago-tabGroup {
/*position: absolute;XXX TOBAGO3*/
}
Propchange: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago.css
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Sat Apr 26 18:42:40 2014
@@ -0,0 +1,3 @@
+/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago.css:1356585,1357124
+/myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago.css:1226794-1341423
+/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/tobago.css:1571193,1571804,1571816,1571941,1571945,1571962,1571966,1576730,1589960,1590236
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java?rev=1590274&r1=1590273&r2=1590274&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java Sat Apr 26 18:42:40 2014
@@ -52,6 +52,7 @@ import javax.el.ValueExpression;
import javax.faces.application.Application;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
+import javax.faces.component.UIPanel;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import java.io.IOException;
@@ -212,6 +213,11 @@ public class TabGroupRenderer extends La
}
writer.endElement(HtmlElements.A);
+ final UIPanel toolbar = (UIPanel) tab.getFacet(Facets.TOOL_BAR);
+ if (toolbar != null) {
+ renderTabToolbar(facesContext, writer, tab, toolbar);
+ }
+
if (label.getAccessKey() != null) {
if (LOG.isWarnEnabled()
&& !AccessKeyMap.addAccessKey(facesContext, label.getAccessKey())) {
@@ -232,6 +238,16 @@ public class TabGroupRenderer extends La
}
}
+ protected void renderTabToolbar(
+ final FacesContext facesContext, final TobagoResponseWriter writer, final UITab tab, final UIPanel toolbar)
+ throws IOException {
+ writer.startElement(HtmlElements.SPAN, null);
+ writer.writeClassAttribute(Classes.create(tab, "toolBar"));
+ toolbar.setRendererType("TabGroupToolBar");
+ RenderUtils.encode(facesContext, toolbar);
+ writer.endElement(HtmlElements.SPAN);
+ }
+
private UIToolBar createToolBar(final FacesContext facesContext, final UITabGroup tabGroup) {
final String clientId = tabGroup.getClientId(facesContext);
final Application application = facesContext.getApplication();
@@ -243,12 +259,15 @@ public class TabGroupRenderer extends La
previous.setRendererType(null);
previous.getAttributes().put(Attributes.IMAGE, "image/tabPrev.gif");
previous.setOmit(true); // avoid submit
+ ComponentUtils.putDataAttribute(previous, "tobago-tabgroup-toolbar-prev", "p");
+
// next
final UICommand next = (UICommand) application.createComponent(UICommand.COMPONENT_TYPE);
next.setId(viewRoot.createUniqueId());
next.setRendererType(null);
next.getAttributes().put(Attributes.IMAGE, "image/tabNext.gif");
next.setOmit(true); // avoid submit
+ ComponentUtils.putDataAttribute(next, "tobago-tabgroup-toolbar-next", "n");
// all: sub menu to select any tab directly
final UICommand all = (UICommand) CreateComponentUtils.createComponent(
Propchange: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Sat Apr 26 18:42:40 2014
@@ -0,0 +1,3 @@
+/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java:1356585,1357124
+/myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java:1226794-1341423
+/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java:1571193,1571804,1571816,1571941,1571945,1571962,1571966,1576730,1589960,1590236
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1590274&r1=1590273&r2=1590274&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Sat Apr 26 18:42:40 2014
@@ -889,6 +889,8 @@ var Tobago = {
} else {
Tobago.reloadComponent(this, commands.click.partially, action, commands.click);
}
+ event.preventDefault();
+ return false;
} else if (commands.click.url) {
if (commands.click.target) {
window.open(commands.click.url, commands.click.target)
@@ -2592,8 +2594,7 @@ Tobago.TabGroup.init = function(elements
});
// initialize previous button
- // XXX ":first" and eq(1) are dangerous, please define e.g. a unique class for "previous" and "next"
- tabGroups.find(".tobago-tabGroupToolBar-button:first").click(function() {
+ tabGroups.find("[data-tobago-tabgroup-toolbar-prev]").click(function() {
var tabGroup = jQuery(this).parents(".tobago-tabGroup:first");
var selected = tabGroup.find(".tobago-tab-markup-selected");
// the nearest of the previous siblings, which are not disabled
@@ -2601,8 +2602,7 @@ Tobago.TabGroup.init = function(elements
});
// initialize next button
- // XXX ":first" and eq(1) are dangerous, please define e.g. a unique class for "previous" and "next"
- tabGroups.find(".tobago-tabGroupToolBar-button:eq(1)").click(function() {
+ tabGroups.find("[data-tobago-tabgroup-toolbar-next]").click(function() {
var tabGroup = jQuery(this).parents(".tobago-tabGroup:first");
var selected = tabGroup.find(".tobago-tab-markup-selected");
// the nearest of the next siblings, which are not disabled
Propchange: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Sat Apr 26 18:42:40 2014
@@ -0,0 +1,3 @@
+/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js:1356585,1357124
+/myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js:1226794-1341423
+/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js:1571193,1571804,1571816,1571941,1571945,1571962,1571966,1576730,1589960,1590236