myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1644387 - in /myfaces/tobago/branches/tobago-3.0.x: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/ tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ tobago-theme/tobago-theme-bootstrap/...
Date Wed, 10 Dec 2014 12:56:03 GMT
Author: lofwyr
Date: Wed Dec 10 12:56:03 2014
New Revision: 1644387

URL: http://svn.apache.org/r1644387
Log:
TOBAGO-1368: Create a new theme which uses Bootstrap
 - toolbar

Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUICommand.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIToolBarCommand.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/CommandTagDeclaration.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/MenuCommandTagDeclaration.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectBooleanCommandTagDeclaration.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ToolBarCommandTagDeclaration.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ToolBarSelectOneTagDeclaration.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-bootstrap/src/main/java/org/apache/myfaces/tobago/renderkit/html/bootstrap/standard/tag/ButtonRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-bootstrap/src/main/java/org/apache/myfaces/tobago/renderkit/html/bootstrap/standard/tag/ToolBarRenderer.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/ButtonRenderer.java

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUICommand.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/AbstractUICommand.java?rev=1644387&r1=1644386&r2=1644387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUICommand.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUICommand.java
Wed Dec 10 12:56:03 2014
@@ -21,6 +21,7 @@ package org.apache.myfaces.tobago.intern
 
 import org.apache.myfaces.tobago.component.Facets;
 import org.apache.myfaces.tobago.component.OnComponentPopulated;
+import org.apache.myfaces.tobago.component.SupportsAccessKey;
 import org.apache.myfaces.tobago.component.SupportsRenderedPartially;
 import org.apache.myfaces.tobago.event.PopupFacetActionListener;
 import org.apache.myfaces.tobago.layout.LayoutComponent;
@@ -34,7 +35,7 @@ import java.util.Iterator;
 
 public abstract class AbstractUICommand
     extends AbstractUICommandBase
-    implements SupportsRenderedPartially, OnComponentPopulated, LayoutComponent {
+    implements SupportsRenderedPartially, SupportsAccessKey, OnComponentPopulated, LayoutComponent
{
 
   public void onComponentPopulated(final FacesContext facesContext, final UIComponent parent)
{
     final AbstractUIPopup popup = (AbstractUIPopup) getFacet(Facets.POPUP);
@@ -100,4 +101,9 @@ public abstract class AbstractUICommand
 
   public abstract boolean isOmit();
 
+  public abstract boolean isDisabled();
+
+  public abstract String getTip();
+
+//  public abstract Integer getTabIndex();
 }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIToolBarCommand.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/AbstractUIToolBarCommand.java?rev=1644387&r1=1644386&r2=1644387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIToolBarCommand.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIToolBarCommand.java
Wed Dec 10 12:56:03 2014
@@ -19,6 +19,8 @@
 
 package org.apache.myfaces.tobago.internal.component;
 
-public abstract class AbstractUIToolBarCommand extends AbstractUICommand {
+import org.apache.myfaces.tobago.component.SupportsCss;
+
+public abstract class AbstractUIToolBarCommand extends AbstractUICommand implements SupportsCss
{
 
 }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/CommandTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/CommandTagDeclaration.java?rev=1644387&r1=1644386&r2=1644387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/CommandTagDeclaration.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/CommandTagDeclaration.java
Wed Dec 10 12:56:03 2014
@@ -25,8 +25,9 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.internal.taglib.declaration.AbstractCommandTagDeclaration;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasCurrentMarkup;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasId;
-import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabel;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabelAndAccessKey;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasTip;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasValue;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsDisabled;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsGridLayoutComponent;
@@ -46,7 +47,7 @@ import javax.faces.component.UICommand;
     allowedChildComponenents = "NONE")
 public interface CommandTagDeclaration
     extends AbstractCommandTagDeclaration, HasId, HasValue, IsDisabled, IsGridLayoutComponent,
HasMarkup,
-    HasCurrentMarkup, HasLabel {
+    HasCurrentMarkup, HasLabelAndAccessKey, HasTip {
 
 
 

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/MenuCommandTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/MenuCommandTagDeclaration.java?rev=1644387&r1=1644386&r2=1644387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/MenuCommandTagDeclaration.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/MenuCommandTagDeclaration.java
Wed Dec 10 12:56:03 2014
@@ -28,6 +28,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasImage;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabelAndAccessKey;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasTip;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsDisabled;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsGridLayoutComponent;
 
@@ -47,5 +48,5 @@ import javax.faces.component.UICommand;
     allowedChildComponenents = "NONE")
 public interface MenuCommandTagDeclaration
     extends AbstractCommandTagDeclaration, IsGridLayoutComponent,
-    HasIdBindingAndRendered, HasLabelAndAccessKey, IsDisabled, HasImage, HasMarkup, HasCurrentMarkup
{
+    HasIdBindingAndRendered, HasLabelAndAccessKey, HasTip, IsDisabled, HasImage, HasMarkup,
HasCurrentMarkup {
 }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectBooleanCommandTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectBooleanCommandTagDeclaration.java?rev=1644387&r1=1644386&r2=1644387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectBooleanCommandTagDeclaration.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectBooleanCommandTagDeclaration.java
Wed Dec 10 12:56:03 2014
@@ -23,8 +23,9 @@ import org.apache.myfaces.tobago.apt.ann
 import org.apache.myfaces.tobago.internal.taglib.declaration.AbstractCommandTagDeclaration;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasCurrentMarkup;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
-import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabel;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabelAndAccessKey;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasTip;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasValue;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsGridLayoutComponent;
 
@@ -33,6 +34,6 @@ import org.apache.myfaces.tobago.interna
     uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUICommand",
     uiComponentFacesClass = "javax.faces.component.UICommand")
 public interface SelectBooleanCommandTagDeclaration
-    extends AbstractCommandTagDeclaration, HasIdBindingAndRendered, HasValue, HasLabel,
+    extends AbstractCommandTagDeclaration, HasIdBindingAndRendered, HasValue, HasLabelAndAccessKey,
HasTip,
     IsGridLayoutComponent, HasMarkup, HasCurrentMarkup {
 }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ToolBarCommandTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ToolBarCommandTagDeclaration.java?rev=1644387&r1=1644386&r2=1644387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ToolBarCommandTagDeclaration.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ToolBarCommandTagDeclaration.java
Wed Dec 10 12:56:03 2014
@@ -26,6 +26,8 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.component.Facets;
 import org.apache.myfaces.tobago.component.RendererTypes;
 import org.apache.myfaces.tobago.internal.taglib.declaration.AbstractCommandTagDeclaration;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasCss;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasCurrentCss;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasCurrentMarkup;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasImage;
@@ -58,5 +60,5 @@ import javax.faces.component.UICommand;
     })
 public interface ToolBarCommandTagDeclaration
     extends AbstractCommandTagDeclaration, HasIdBindingAndRendered, HasMarkup, HasCurrentMarkup,
-    HasLabelAndAccessKey, HasImage, IsDisabled, HasTip, IsGridLayoutComponent {
+    HasLabelAndAccessKey, HasImage, IsDisabled, HasTip, IsGridLayoutComponent, HasCss, HasCurrentCss
{
 }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ToolBarSelectOneTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ToolBarSelectOneTagDeclaration.java?rev=1644387&r1=1644386&r2=1644387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ToolBarSelectOneTagDeclaration.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ToolBarSelectOneTagDeclaration.java
Wed Dec 10 12:56:03 2014
@@ -25,8 +25,9 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.internal.taglib.declaration.AbstractCommandTagDeclaration;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasCurrentMarkup;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
-import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabel;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabelAndAccessKey;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasTip;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasValue;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsDisabled;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsGridLayoutComponent;
@@ -44,6 +45,6 @@ import javax.faces.component.UICommand;
     componentFamily = UICommand.COMPONENT_FAMILY,
     rendererType = RendererTypes.MENU_COMMAND,
     allowedChildComponenents = "NONE")
-public interface ToolBarSelectOneTagDeclaration extends AbstractCommandTagDeclaration, HasLabel,
+public interface ToolBarSelectOneTagDeclaration extends AbstractCommandTagDeclaration, HasLabelAndAccessKey,
HasTip,
     HasIdBindingAndRendered, IsDisabled, HasValue, IsGridLayoutComponent, HasMarkup, HasCurrentMarkup
{
 }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-bootstrap/src/main/java/org/apache/myfaces/tobago/renderkit/html/bootstrap/standard/tag/ButtonRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-bootstrap/src/main/java/org/apache/myfaces/tobago/renderkit/html/bootstrap/standard/tag/ButtonRenderer.java?rev=1644387&r1=1644386&r2=1644387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-bootstrap/src/main/java/org/apache/myfaces/tobago/renderkit/html/bootstrap/standard/tag/ButtonRenderer.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-bootstrap/src/main/java/org/apache/myfaces/tobago/renderkit/html/bootstrap/standard/tag/ButtonRenderer.java
Wed Dec 10 12:56:03 2014
@@ -21,7 +21,9 @@ package org.apache.myfaces.tobago.render
 
 import org.apache.myfaces.tobago.component.Attributes;
 import org.apache.myfaces.tobago.component.SupportsCss;
+import org.apache.myfaces.tobago.config.Configurable;
 import org.apache.myfaces.tobago.internal.component.AbstractUIToolBar;
+import org.apache.myfaces.tobago.layout.Measure;
 import org.apache.myfaces.tobago.util.ComponentUtils;
 
 import javax.faces.component.UIComponent;
@@ -50,4 +52,9 @@ public class ButtonRenderer extends org.
       }
     }
   }
+
+  @Override
+  public Measure getPreferredWidth(FacesContext facesContext, Configurable component) {
+    return null;
+  }
 }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-bootstrap/src/main/java/org/apache/myfaces/tobago/renderkit/html/bootstrap/standard/tag/ToolBarRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-bootstrap/src/main/java/org/apache/myfaces/tobago/renderkit/html/bootstrap/standard/tag/ToolBarRenderer.java?rev=1644387&r1=1644386&r2=1644387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-bootstrap/src/main/java/org/apache/myfaces/tobago/renderkit/html/bootstrap/standard/tag/ToolBarRenderer.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-bootstrap/src/main/java/org/apache/myfaces/tobago/renderkit/html/bootstrap/standard/tag/ToolBarRenderer.java
Wed Dec 10 12:56:03 2014
@@ -77,7 +77,7 @@ public class ToolBarRenderer extends Lay
     writer.startElement(HtmlElements.A);
     writer.writeClassAttribute("navbar-brand");
     writer.writeAttribute(HtmlAttributes.HREF, "#", false);
-    writer.writeText("Address Book"); // fixme
+    writer.writeText("[FIXME]"); // fixme
     writer.endElement(HtmlElements.A);
 
     writer.endElement(HtmlElements.DIV);

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/ButtonRenderer.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/ButtonRenderer.java?rev=1644387&r1=1644386&r2=1644387&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/ButtonRenderer.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/ButtonRenderer.java
Wed Dec 10 12:56:03 2014
@@ -23,6 +23,7 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.component.UIButton;
 import org.apache.myfaces.tobago.config.Configurable;
 import org.apache.myfaces.tobago.context.ResourceManagerUtils;
+import org.apache.myfaces.tobago.internal.component.AbstractUICommand;
 import org.apache.myfaces.tobago.internal.component.AbstractUIForm;
 import org.apache.myfaces.tobago.internal.util.AccessKeyLogger;
 import org.apache.myfaces.tobago.layout.Measure;
@@ -54,7 +55,7 @@ public class ButtonRenderer extends Comm
 
   public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws
IOException {
 
-    final UIButton button = (UIButton) component;
+    final AbstractUICommand button = (AbstractUICommand) component;
     final String clientId = button.getClientId(facesContext);
     final boolean disabled = button.isDisabled();
     final LabelWithAccessKey label = new LabelWithAccessKey(button);
@@ -83,16 +84,18 @@ public class ButtonRenderer extends Comm
         AccessKeyLogger.addAccessKey(facesContext, label.getAccessKey(), clientId);
       }
 
-      final Integer tabIndex = button.getTabIndex();
-      if (tabIndex != null) {
-        writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
+      if (button instanceof UIButton) {
+        final Integer tabIndex = ((UIButton)button).getTabIndex();
+        if (tabIndex != null) {
+          writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
+        }
       }
     }
 
     final Style style = new Style(facesContext, button);
     writer.writeStyleAttribute(style);
     writer.writeClassAttribute(Classes.create(button));
-    if (((UIButton) component).isDefaultCommand()) {
+    if (button instanceof UIButton && ((UIButton) component).isDefaultCommand())
{
       final AbstractUIForm form = ComponentUtils.findAncestor(component, AbstractUIForm.class);
       writer.writeAttribute(DataAttributes.DEFAULT, form.getClientId(facesContext), false);
     }



Mime
View raw message