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/01/28 14:43:59 UTC
svn commit: r1727348 - in
/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit:
css/ html/standard/standard/tag/
Author: lofwyr
Date: Thu Jan 28 13:43:59 2016
New Revision: 1727348
URL: http://svn.apache.org/viewvc?rev=1727348&view=rev
Log:
TOBAGO-1529: Navbar, Toolbar, Menu, etc. for Bootstrap
Modified:
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/css/BootstrapClass.java
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CommandGroupRenderer.java
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CommandRenderer.java
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/css/BootstrapClass.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/css/BootstrapClass.java?rev=1727348&r1=1727347&r2=1727348&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/css/BootstrapClass.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/css/BootstrapClass.java Thu Jan 28 13:43:59 2016
@@ -100,6 +100,7 @@ public enum BootstrapClass implements Cs
DANGER("danger"),
DISABLED("disabled"),
DROPDOWN("dropdown"),
+ DROPDOWN_ITEM("dropdown-item"),
DROPDOWN_MENU("dropdown-menu"),
DROPDOWN_TOGGLE("dropdown-toggle"),
FADE("fade"),
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/CommandGroupRenderer.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/CommandGroupRenderer.java?rev=1727348&r1=1727347&r2=1727348&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/CommandGroupRenderer.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/CommandGroupRenderer.java Thu Jan 28 13:43:59 2016
@@ -56,7 +56,7 @@ public class CommandGroupRenderer extend
encodeChildren(facesContext, child);
} else {
writer.startElement(HtmlElements.LI);
- writer.writeClassAttribute(BootstrapClass.NAV_ITEM);
+ writer.writeClassAttribute(BootstrapClass.NAV_ITEM, BootstrapClass.DROPDOWN);
child.encodeAll(facesContext);
writer.endElement(HtmlElements.LI);
}
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/CommandRenderer.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/CommandRenderer.java?rev=1727348&r1=1727347&r2=1727348&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/CommandRenderer.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/CommandRenderer.java Thu Jan 28 13:43:59 2016
@@ -27,6 +27,7 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
import org.apache.myfaces.tobago.renderkit.css.Classes;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
import org.apache.myfaces.tobago.renderkit.html.Command;
import org.apache.myfaces.tobago.renderkit.html.CommandMap;
@@ -159,13 +160,10 @@ public class CommandRenderer extends Com
for (UIComponent child : component.getChildren()) {
if (child.isRendered()) {
writer.startElement(HtmlElements.LI);
- if (child instanceof AbstractUICommand) {
- AbstractUICommand command = (AbstractUICommand) child;
- if (command.isParentOfCommands()) {
- // fixme: this name comes not from bootstrap, using prefix? tobago-command-dropdown-submenu
- writer.writeClassAttribute(TobagoClass.DROPDOWN_SUBMENU);
- }
- }
+ CssItem submenu = child instanceof AbstractUICommand &&((AbstractUICommand)child).isParentOfCommands()
+ ? TobagoClass.DROPDOWN_SUBMENU : null;
+ // fixme: this name comes not from bootstrap, using prefix? tobago-command-dropdown-submenu
+ writer.writeClassAttribute(BootstrapClass.DROPDOWN_ITEM, submenu);
child.encodeAll(facesContext);
writer.endElement(HtmlElements.LI);
}