You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2016/07/08 14:34:05 UTC
svn commit: r1751915 - in /myfaces/tobago/trunk: src/site/apt/
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/
tobago-example/tobago-example-addressb...
Author: lofwyr
Date: Fri Jul 8 14:34:04 2016
New Revision: 1751915
URL: http://svn.apache.org/viewvc?rev=1751915&view=rev
Log:
TOBAGO-1529: Navbar, Toolbar, Menu, etc. for Bootstrap
Removed:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIToolBar.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIToolBarCommand.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIToolBarSelectOne.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ToolBarCommandTagDeclaration.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ToolBarSeparatorTagDeclaration.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ToolBarTagDeclaration.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/image/1x1.png
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRenderer.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRendererBase.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRendererOld.java
Modified:
myfaces/tobago/trunk/src/site/apt/migration-3.0.apt
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/addressbook/editor.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/addressbook/list.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/60-object/object.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/040-command/command.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/02-editor/tree-editor.xhtml
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java
Modified: myfaces/tobago/trunk/src/site/apt/migration-3.0.apt
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/src/site/apt/migration-3.0.apt?rev=1751915&r1=1751914&r2=1751915&view=diff
==============================================================================
--- myfaces/tobago/trunk/src/site/apt/migration-3.0.apt (original)
+++ myfaces/tobago/trunk/src/site/apt/migration-3.0.apt Fri Jul 8 14:34:04 2016
@@ -120,4 +120,6 @@ Migration from Tobago 2.0 to 3.0 (work i
* <<<\<tc:gridLayoutConstraint\>>>> -> <<<\<tc:style\>>>>
+ * <<<\<tc:toolBar\>>>> -> <<<\<tc:buttons\>>>>
+
* If using <<<\<tc:page\>>>> with the attributes state, width, height: remove the attributes
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/addressbook/editor.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/addressbook/editor.xhtml?rev=1751915&r1=1751914&r2=1751915&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/addressbook/editor.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/addressbook/editor.xhtml Fri Jul 8 14:34:04 2016
@@ -29,12 +29,12 @@
<tc:style file="datepicker.css"/>
- <tc:toolBar iconSize="big"> <!-- XXX merge with the other toolbar on list.xhtml !!! -->
+ <tc:buttons> <!-- XXX merge with the other toolbar on list.xhtml !!! -->
<tc:button tip="Logout" action="#{controller.logout}" immediate="true"
image="image/org/tango-project/tango-icon-theme/16x16/actions/system-log-out.png">
<tc:style customClass="btn-danger"/>
</tc:button>
- </tc:toolBar>
+ </tc:buttons>
<tc:box label="#{bundle.editorBoxTitle}">
<tc:flexLayout rows="auto;*;auto">
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/addressbook/list.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/addressbook/list.xhtml?rev=1751915&r1=1751914&r2=1751915&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/addressbook/list.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/addressbook/list.xhtml Fri Jul 8 14:34:04 2016
@@ -24,7 +24,7 @@
<ui:param name="title" value="#{bundle.listPageTitle}"/>
<tc:flowLayout>
- <tc:toolBar iconSize="big">
+ <tc:buttons>
<!--
<tc:button label="#{bundle.toolbarAddressList}" action="#{controller.search}" immediate="true"
image="image/org/tango-project/tango-icon-theme/32x32/mimetypes/x-office-address-book.png"
@@ -54,7 +54,7 @@
<tc:button tip="Logout" action="#{controller.logout}" immediate="true"
image="image/org/tango-project/tango-icon-theme/16x16/actions/system-log-out.png"/>
<tc:style customClass="btn-danger"/>
- </tc:toolBar>
+ </tc:buttons>
<tc:box label="#{bundle.listBoxTitle}">
<f:facet name="layout">
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/60-object/object.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/60-object/object.xhtml?rev=1751915&r1=1751914&r2=1751915&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/60-object/object.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/60-object/object.xhtml Fri Jul 8 14:34:04 2016
@@ -42,31 +42,31 @@
</tc:object>
</tc:section>
<tc:section label="Tool Bar">
- <p>There are two <code class="language-markup"><tc:toolBarCommand/></code>
- within a <code class="language-markup"><tc:toolBar/></code> in this example.
+ <p>There are two <code class="language-markup"><tc:button/></code>
+ within a <code class="language-markup"><tc:buttons/></code> in this example.
The first show the island Tobago,
the second show the worldmap in <code class="language-markup"><tc:object id="map"></code>.
- The toolbarcommands send the parameter (maps-position, maps-zoom, maps-target) to an <code>object.js</code>,
+ The buttons send the parameter (maps-position, maps-zoom, maps-target) to an <code>object.js</code>,
which is shown in the objects.js-box. The JavaScript build the URL for the iframe.</p>
- <pre><code class="language-markup"><tc:toolBarCommand label="Show Tobago" omit="true">
+ <pre><code class="language-markup"><tc:button label="Show Tobago" omit="true">
<tc:dataAttribute name="maps-position" value="11.249123,-60.687103"/>
<tc:dataAttribute name="maps-zoom" value="12"/>
<tc:dataAttribute name="maps-target" value="page:map"/>
-</tc:toolBarCommand></code></pre>
+</tc:button></code></pre>
<tc:button label="show/hide" action="#{objectController.switchCollapsed}"/>
<tc:box label="object.js" collapsed="#{objectController.collapsed}">
<pre><code class="language-javascript"><tc:out value="#{objectController.javaScriptSource}"/></code></pre>
</tc:box>
- <tc:toolBar id="t1" iconSize="off">
- <tc:toolBarCommand id="c1" label="Show Tobago" omit="true">
+ <tc:buttons id="t1">
+ <tc:button id="c1" label="Show Tobago" omit="true">
<tc:dataAttribute name="maps-position" value="11.249123,-60.687103"/>
<tc:dataAttribute name="maps-zoom" value="12"/>
<tc:dataAttribute name="maps-target" value="page:map"/>
- </tc:toolBarCommand>
- <tc:toolBarCommand id="c2" label="Show World" omit="true">
+ </tc:button>
+ <tc:button id="c2" label="Show World" omit="true">
<tc:dataAttribute name="maps-target" value="page:map"/>
- </tc:toolBarCommand>
- </tc:toolBar>
+ </tc:button>
+ </tc:buttons>
<tc:object id="map">
<tc:style width="100%" height="500px"/>
</tc:object>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/040-command/command.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/040-command/command.xhtml?rev=1751915&r1=1751914&r2=1751915&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/040-command/command.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/040-command/command.xhtml Fri Jul 8 14:34:04 2016
@@ -25,19 +25,6 @@
<ui:param name="title" value="TODO"/>
<hr/>
- toolbar
- <hr/>
-
- <tc:toolBar>
- <tc:buttons>
- <tc:button image="fa-universal-access" label="Hallo 1"/>
- <tc:button image="fa-hand-paper-o" label="Hallo"/>
- </tc:buttons>
- <tc:button image="fa-hourglass" label="Hallo"/>
- <tc:in label="Search"/>
- </tc:toolBar>
-
- <hr/>
bar
<hr/>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/02-editor/tree-editor.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/02-editor/tree-editor.xhtml?rev=1751915&r1=1751914&r2=1751915&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/02-editor/tree-editor.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/02-editor/tree-editor.xhtml Fri Jul 8 14:34:04 2016
@@ -57,21 +57,21 @@
</tc:button>
<p>Currently, the buttons 'New' and 'Rename' doesn't work in the toolbar. Use the alternative buttons above.</p>
- <tc:toolBar>
- <tc:toolBarCommand label="New" omit="true" image="fa-file-o">
+ <tc:buttons>
+ <tc:button label="New" omit="true" image="fa-file-o">
<tc:dataAttribute name="alert-text" value="Not implemented yet"/>
- </tc:toolBarCommand>
- <tc:toolBarCommand label="Delete" image="fa-trash-o" action="#{treeEditorController.delete}"/>
- <tc:toolBarCommand label="Rename" omit="true" image="fa-edit">
+ </tc:button>
+ <tc:button label="Delete" image="fa-trash-o" action="#{treeEditorController.delete}"/>
+ <tc:button label="Rename" omit="true" image="fa-edit">
<tc:dataAttribute name="alert-text" value="Not implemented yet"/>
- </tc:toolBarCommand>
- <tc:toolBarCommand label="Cut" action="#{treeEditorController.cut}" image="fa-cut"/>
- <tc:toolBarCommand label="Copy" action="#{treeEditorController.copy}" image="fa-copy"/>
- <tc:toolBarCommand label="Paste" action="#{treeEditorController.paste}" image="fa-paste"/>
- <tc:toolBarCommand label="Up" action="#{treeEditorController.moveUp}" image="fa-level-up"/>
- <tc:toolBarCommand label="Down" action="#{treeEditorController.moveDown}" image="fa-level-down"/>
- <tc:toolBarCommand label="Reset" action="#{treeEditorController.reset}" image="fa-undo"/>
- </tc:toolBar>
+ </tc:button>
+ <tc:button label="Cut" action="#{treeEditorController.cut}" image="fa-cut"/>
+ <tc:button label="Copy" action="#{treeEditorController.copy}" image="fa-copy"/>
+ <tc:button label="Paste" action="#{treeEditorController.paste}" image="fa-paste"/>
+ <tc:button label="Up" action="#{treeEditorController.moveUp}" image="fa-level-up"/>
+ <tc:button label="Down" action="#{treeEditorController.moveDown}" image="fa-level-down"/>
+ <tc:button label="Reset" action="#{treeEditorController.reset}" image="fa-undo"/>
+ </tc:buttons>
<tc:tree value="#{treeEditorController.categoryTree}" var="node"
showRoot="true" showRootJunction="true" selectable="single">
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java?rev=1751915&r1=1751914&r2=1751915&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java Fri Jul 8 14:34:04 2016
@@ -888,7 +888,8 @@ public class SheetRenderer extends Rende
writer.writeAttribute(HtmlAttributes.TITLE, "", false);
writer.writeAttribute(HtmlAttributes.SRC, menuImage, false);
writer.endElement(HtmlElements.IMG);
- ToolBarRendererBase.renderDropDownMenu(facesContext, writer, dropDownMenu);
+
+// ToolBarRendererBase.renderDropDownMenu(facesContext, writer, dropDownMenu);
writer.endElement(HtmlElements.SPAN);
}
Modified: myfaces/tobago/trunk/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/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java?rev=1751915&r1=1751914&r2=1751915&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java Fri Jul 8 14:34:04 2016
@@ -21,13 +21,8 @@ package org.apache.myfaces.tobago.render
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.Facets;
-import org.apache.myfaces.tobago.component.RendererTypes;
-import org.apache.myfaces.tobago.component.UICommand;
-import org.apache.myfaces.tobago.component.UIMenu;
-import org.apache.myfaces.tobago.component.UIMenuCommand;
import org.apache.myfaces.tobago.component.UITab;
import org.apache.myfaces.tobago.component.UITabGroup;
-import org.apache.myfaces.tobago.component.UIToolBar;
import org.apache.myfaces.tobago.context.Markup;
import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.event.TabChangeEvent;
@@ -47,18 +42,14 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
-import org.apache.myfaces.tobago.util.CreateComponentUtils;
-import org.apache.myfaces.tobago.util.FacetUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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;
import java.util.Map;
@@ -67,7 +58,7 @@ public class TabGroupRenderer extends Re
private static final Logger LOG = LoggerFactory.getLogger(TabGroupRenderer.class);
- public static final String ACTIVE_INDEX_POSTFIX = ComponentUtils.SUB_SEPARATOR + "activeIndex";
+ private static final String ACTIVE_INDEX_POSTFIX = ComponentUtils.SUB_SEPARATOR + "activeIndex";
@Override
public void decode(final FacesContext facesContext, final UIComponent component) {
@@ -226,7 +217,7 @@ public class TabGroupRenderer extends Re
}
writer.startElement(HtmlElements.IMG);
writer.writeAttribute(HtmlAttributes.SRC, image, true);
- writer.writeClassAttribute(Classes.create(tab, (label.getLabel() != null? "image-right-margin" : "image")));
+// TBD writer.writeClassAttribute(Classes.create(tab, (label.getLabel() != null? "image-right-margin" : "image")));
writer.endElement(HtmlElements.IMG);
}
if (label.getLabel() != null) {
@@ -238,7 +229,7 @@ public class TabGroupRenderer extends Re
final UIPanel toolbar = (UIPanel) ComponentUtils.getFacet(tab, Facets.toolBar);
if (toolbar != null) {
- Deprecation.LOG.warn("Facet {} is deprecated for <tc:box>", Facets.toolBar.name());
+ Deprecation.LOG.warn("Facet {} is deprecated for <tc:tabGroup>", Facets.toolBar.name());
renderTabToolbar(facesContext, writer, tab, toolbar);
}
@@ -254,8 +245,9 @@ public class TabGroupRenderer extends Re
}
writer.endElement(HtmlElements.UL);
if (tabGroup.isShowNavigationBar()) {
- final UIToolBar toolBar = createToolBar(facesContext, tabGroup);
- renderToolBar(facesContext, writer, tabGroup, toolBar);
+ LOG.warn("Currently not supported: showNavigationBar");
+// final UIToolBar toolBar = createToolBar(facesContext, tabGroup);
+// renderToolBar(facesContext, writer, tabGroup, toolBar);
}
}
@@ -268,82 +260,6 @@ public class TabGroupRenderer extends Re
writer.endElement(HtmlElements.SPAN);
}
- private UIToolBar createToolBar(final FacesContext facesContext, final UITabGroup tabGroup) {
- final String clientId = tabGroup.getClientId(facesContext);
- final Application application = facesContext.getApplication();
- final UIViewRoot viewRoot = facesContext.getViewRoot();
-
- // previous
- final UICommand previous = (UICommand) application.createComponent(UICommand.COMPONENT_TYPE);
- previous.setId(viewRoot.createUniqueId());
- previous.setRendererType(null);
- ComponentUtils.setAttribute(previous, Attributes.image, "image/tabPrev");
- 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);
- ComponentUtils.setAttribute(next, Attributes.image, "image/tabNext");
- 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(
- facesContext, UICommand.COMPONENT_TYPE, null, viewRoot.createUniqueId());
- all.setOmit(true); // avoid submit
-
- final UIMenu menu = (UIMenu) CreateComponentUtils.createComponent(
- facesContext, UIMenu.COMPONENT_TYPE, RendererTypes.Menu, viewRoot.createUniqueId());
- menu.setTransient(true);
-// XXX menu.setCurrentMarkup(Markup.TOP.add(menu.getCurrentMarkup()));
- FacetUtils.setDropDownMenu(all, menu);
- int index = 0;
- for (final UIComponent child : tabGroup.getChildren()) {
- if (child instanceof UITab) {
- final UITab tab = (UITab) child;
- if (tab.isRendered()) {
- final UIMenuCommand entry = (UIMenuCommand) CreateComponentUtils.createComponent(
- facesContext, UIMenuCommand.COMPONENT_TYPE, RendererTypes.MenuCommand, viewRoot.createUniqueId());
- entry.setTransient(true);
- entry.setOmit(true); // avoid submit
- final LabelWithAccessKey label = new LabelWithAccessKey(tab);
- if (label.getLabel() != null) {
- entry.setLabel(label.getLabel());
- } else {
- entry.setLabel(Integer.toString(index + 1));
- }
- if (tab.isDisabled()) {
- entry.setDisabled(true);
- } else {
- ComponentUtils.putDataAttribute(entry, "tobago-index", index); // XXX todo, define a DataAttribute
- }
- menu.getChildren().add(entry);
- }
- index++;
- }
- }
- final UIToolBar toolBar = (UIToolBar) application.createComponent(UIToolBar.COMPONENT_TYPE);
- toolBar.setId(viewRoot.createUniqueId());
- toolBar.setTransient(true);
- toolBar.getChildren().add(previous);
- toolBar.getChildren().add(next);
- toolBar.getChildren().add(all);
- ComponentUtils.setFacet(tabGroup, Facets.toolBar, toolBar);
- return toolBar;
- }
-
- private void renderToolBar(
- final FacesContext facesContext, final TobagoResponseWriter writer, final UITabGroup tabGroup,
- final UIToolBar toolBar)
- throws IOException {
- writer.startElement(HtmlElements.DIV);
- writer.writeClassAttribute(Classes.create(tabGroup, "toolBar"));
- RenderUtils.encode(facesContext, toolBar);
- writer.endElement(HtmlElements.DIV);
- }
-
protected void encodeContent(
FacesContext facesContext, TobagoResponseWriter writer, UITabGroup tabGroup,
int activeIndex, SwitchType switchType) throws IOException {