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 2014/02/18 14:59:20 UTC
svn commit: r1569326 [1/2] - in
/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src:
main/java/org/apache/myfaces/tobago/component/
main/java/org/apache/myfaces/tobago/context/
main/java/org/apache/myfaces/tobago/facelets/ main/java/org/apache/myface...
Author: lofwyr
Date: Tue Feb 18 13:59:19 2014
New Revision: 1569326
URL: http://svn.apache.org/r1569326
Log:
TOBAGO-1368: Create a new theme which uses Bootstrap
TOBAGO-1358: Using CSS box-sizing: border-box instead of content-box
TOBAGO-1361: New Layout Manager: Flex Box
TOBAGO-1360: Clean up attic browser support
- first working draft
Added:
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/SupportsCss.java
- copied, changed from r1567008, myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/SupportsMarkup.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/BootstrapLayoutRule.java
- copied, changed from r1566572, myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/FlowLayoutRule.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/SupportsCssRule.java
- copied, changed from r1567008, myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/SupportsMarkupRule.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIBootstrapLayout.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFlexLayout.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/BootstrapLayoutTagDeclaration.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FlexLayoutTagDeclaration.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasCss.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasCurrentCss.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/BootstrapPartition.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Css.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/BootstrapPartitionUnitTest.java
Modified:
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/RendererTypes.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManager.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/UserAgent.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIInput.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ResourceManagerImpl.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/LayoutContext.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ButtonTagDeclaration.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/DateTagDeclaration.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/InTagDeclaration.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/LabelTagDeclaration.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PageTagDeclaration.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TextareaTagDeclaration.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TimeTagDeclaration.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRendererBase.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Classes.java
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java Tue Feb 18 13:59:19 2014
@@ -50,6 +50,7 @@ public final class Attributes {
public static final String COLUMNS = "columns";
public static final String CONVERTER = "converter";
public static final String CREATE_SPAN = "createSpan";
+ public static final String CSS = "css";
public static final String CSS_CLASSES_BLOCKS = "cssClassesBlocks";
public static final String DATE_INPUT_ID = "dateInputId";
public static final String DATE_STYLE = "dateStyle";
@@ -62,6 +63,7 @@ public final class Attributes {
public static final String EXPANDED = "expanded";
public static final String EXECUTE = "execute";
public static final String EVENT = "event";
+ public static final String EXTRA_SMALL = "extraSmall";
public static final String FIRST = "first";
public static final String FREQUENCY = "frequency";
public static final String FOCUS = "focus";
@@ -93,6 +95,7 @@ public final class Attributes {
public static final String JSF_RESOURCE = "jsfResource";
public static final String LABEL = "label";
public static final String LABEL_POSITION = "labelPosition";
+ public static final String LARGE = "large";
public static final String LAYOUT_HEIGHT = "layoutHeight";
public static final String LAYOUT_ORDER = "layoutOrder";
public static final String LAYOUT_WIDTH = "layoutWidth";
@@ -121,6 +124,7 @@ public final class Attributes {
public static final String MIN_SEVERITY = "minSeverity";
public static final String MINIMUM_HEIGHT = "minimumHeight";
public static final String MINIMUM_WIDTH = "minimumWidth";
+ public static final String MEDIUM = "medium";
public static final String MODAL = "modal";
public static final String MODE = "mode";
public static final String MUTABLE = "mutable";
@@ -189,6 +193,7 @@ public final class Attributes {
public static final String SHOW_ROW_RANGE = "showRowRange";
public static final String SHOW_SUMMARY = "showSummary";
public static final String SHOW_DETAIL = "showDetail";
+ public static final String SMALL = "small";
public static final String SPAN_X = "spanX";
public static final String SPAN_Y = "spanY";
public static final String SRC = "src";
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/RendererTypes.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/RendererTypes.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/RendererTypes.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/RendererTypes.java Tue Feb 18 13:59:19 2014
@@ -24,6 +24,7 @@ package org.apache.myfaces.tobago.compon
*/
public final class RendererTypes {
+ public static final String BOOTSTRAP_LAYOUT = "BootstrapLayout";
public static final String BOX = "Box";
public static final String BOX_TOOL_BAR = "BoxToolBar";
public static final String BUTTON = "Button";
@@ -35,6 +36,7 @@ public final class RendererTypes {
public static final String DATE = "Date";
public static final String DATE_PICKER = "DatePicker";
public static final String FILE = "File";
+ public static final String FLEX_LAYOUT = "FlexLayout";
public static final String FLOW_LAYOUT = "FlowLayout";
public static final String FORM = "Form";
public static final String GRID_LAYOUT = "GridLayout";
@@ -59,7 +61,7 @@ public final class RendererTypes {
public static final String SELECT_BOOLEAN_CHECKBOX = "SelectBooleanCheckbox";
public static final String SELECT_MANY_CHECKBOX = "SelectManyCheckbox";
public static final String SELECT_MANY_LISTBOX = "SelectManyListbox";
- public static final String SELECT_MANY_SHUTTLE = "SelectManyShuttle";;
+ public static final String SELECT_MANY_SHUTTLE = "SelectManyShuttle";
public static final String SELECT_ONE_CHOICE = "SelectOneChoice";
public static final String SELECT_ONE_RADIO = "SelectOneRadio";
public static final String SELECT_ONE_LISTBOX = "SelectOneListbox";
Copied: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/SupportsCss.java (from r1567008, myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/SupportsMarkup.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/SupportsCss.java?p2=myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/SupportsCss.java&p1=myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/SupportsMarkup.java&r1=1567008&r2=1569326&rev=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/SupportsMarkup.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/component/SupportsCss.java Tue Feb 18 13:59:19 2014
@@ -20,15 +20,15 @@
package org.apache.myfaces.tobago.component;
-import org.apache.myfaces.tobago.context.Markup;
+import org.apache.myfaces.tobago.renderkit.css.Css;
-public interface SupportsMarkup {
+public interface SupportsCss {
- Markup getMarkup();
+ Css getCss();
- void setMarkup(Markup markup);
+ void setCss(Css css);
- Markup getCurrentMarkup();
+ Css getCurrentCss();
- void setCurrentMarkup(Markup markup);
+ void setCurrentCss(Css css);
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManager.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManager.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManager.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManager.java Tue Feb 18 13:59:19 2014
@@ -56,6 +56,8 @@ public interface ResourceManager {
Measure getThemeMeasure(FacesContext facesContext, Configurable configurable, String name);
+ Measure getThemeMeasure(FacesContext facesContext, Configurable configurable, String name, Measure defaultValue);
+
Measure getThemeMeasure(FacesContext facesContext, String rendererType, Markup markup, String name);
@Deprecated
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/UserAgent.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/UserAgent.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/UserAgent.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/UserAgent.java Tue Feb 18 13:59:19 2014
@@ -223,6 +223,10 @@ public final class UserAgent implements
return MSIE.name.equals(name);
}
+ /**
+ * @deprecated no longer supported, since Tobago 3.0
+ */
+ @Deprecated
public boolean isMsie6() {
return MSIE_6_0.name.equals(name) && MSIE_6_0.version.equals(version);
}
Copied: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/BootstrapLayoutRule.java (from r1566572, myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/FlowLayoutRule.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/BootstrapLayoutRule.java?p2=myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/BootstrapLayoutRule.java&p1=myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/FlowLayoutRule.java&r1=1566572&r2=1569326&rev=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/FlowLayoutRule.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/BootstrapLayoutRule.java Tue Feb 18 13:59:19 2014
@@ -20,9 +20,8 @@
package org.apache.myfaces.tobago.facelets;
import org.apache.myfaces.tobago.component.Attributes;
-import org.apache.myfaces.tobago.component.UIFlowLayout;
-import org.apache.myfaces.tobago.layout.Measure;
-import org.apache.myfaces.tobago.layout.TextAlign;
+import org.apache.myfaces.tobago.component.UIBootstrapLayout;
+import org.apache.myfaces.tobago.layout.BootstrapPartition;
import javax.faces.view.facelets.FaceletContext;
import javax.faces.view.facelets.MetaRule;
@@ -30,111 +29,80 @@ import javax.faces.view.facelets.Metadat
import javax.faces.view.facelets.MetadataTarget;
import javax.faces.view.facelets.TagAttribute;
-public class FlowLayoutRule extends MetaRule {
+public class BootstrapLayoutRule extends MetaRule {
- public static final FlowLayoutRule INSTANCE = new FlowLayoutRule();
+ public static final BootstrapLayoutRule INSTANCE = new BootstrapLayoutRule();
public Metadata applyRule(final String name, final TagAttribute attribute, final MetadataTarget metadataTarget) {
- if (metadataTarget.isTargetInstanceOf(UIFlowLayout.class)) {
+ if (metadataTarget.isTargetInstanceOf(UIBootstrapLayout.class)) {
if (attribute.isLiteral()) {
- if (Attributes.TEXT_ALIGN.equals(name)) {
- return new TextAlignMapper(attribute);
+ if (Attributes.EXTRA_SMALL.equals(name)) {
+ return new ExtraSmallMapper(attribute);
}
- if (Attributes.MARGIN_LEFT.equals(name)) {
- return new MarginLeftMapper(attribute);
+ if (Attributes.SMALL.equals(name)) {
+ return new SmallMapper(attribute);
}
- if (Attributes.MARGIN_TOP.equals(name)) {
- return new MarginTopMapper(attribute);
+ if (Attributes.MEDIUM.equals(name)) {
+ return new MediumMapper(attribute);
}
- if (Attributes.MARGIN_RIGHT.equals(name)) {
- return new MarginRightMapper(attribute);
- }
- if (Attributes.MARGIN_BOTTOM.equals(name)) {
- return new MarginBottomMapper(attribute);
- }
- if (Attributes.MARGIN.equals(name)) {
- return new MarginMapper(attribute);
+ if (Attributes.LARGE.equals(name)) {
+ return new LargeMapper(attribute);
}
}
}
return null;
}
- static final class TextAlignMapper extends Metadata {
+ static final class ExtraSmallMapper extends Metadata {
private final TagAttribute attribute;
- TextAlignMapper(final TagAttribute attribute) {
+ ExtraSmallMapper(final TagAttribute attribute) {
this.attribute = attribute;
}
public void applyMetadata(final FaceletContext ctx, final Object instance) {
- final UIFlowLayout gridLayout = (UIFlowLayout) instance;
- gridLayout.setTextAlign(TextAlign.parse(attribute.getValue()));
+ final UIBootstrapLayout gridLayout = (UIBootstrapLayout) instance;
+ gridLayout.setExtraSmall(BootstrapPartition.valueOf(attribute.getValue()));
}
}
- static final class MarginLeftMapper extends Metadata {
+ static final class SmallMapper extends Metadata {
private final TagAttribute attribute;
- MarginLeftMapper(final TagAttribute attribute) {
+ SmallMapper(final TagAttribute attribute) {
this.attribute = attribute;
}
public void applyMetadata(final FaceletContext ctx, final Object instance) {
- final UIFlowLayout gridLayout = (UIFlowLayout) instance;
- gridLayout.setMarginLeft(Measure.valueOf(attribute.getValue()));
+ final UIBootstrapLayout gridLayout = (UIBootstrapLayout) instance;
+ gridLayout.setSmall(BootstrapPartition.valueOf(attribute.getValue()));
}
}
- static final class MarginTopMapper extends Metadata {
+ static final class MediumMapper extends Metadata {
private final TagAttribute attribute;
- MarginTopMapper(final TagAttribute attribute) {
+ MediumMapper(final TagAttribute attribute) {
this.attribute = attribute;
}
public void applyMetadata(final FaceletContext ctx, final Object instance) {
- final UIFlowLayout gridLayout = (UIFlowLayout) instance;
- gridLayout.setMarginTop(Measure.valueOf(attribute.getValue()));
+ final UIBootstrapLayout gridLayout = (UIBootstrapLayout) instance;
+ gridLayout.setMedium(BootstrapPartition.valueOf(attribute.getValue()));
}
}
- static final class MarginRightMapper extends Metadata {
+ static final class LargeMapper extends Metadata {
private final TagAttribute attribute;
- MarginRightMapper(final TagAttribute attribute) {
+ LargeMapper(final TagAttribute attribute) {
this.attribute = attribute;
}
public void applyMetadata(final FaceletContext ctx, final Object instance) {
- final UIFlowLayout gridLayout = (UIFlowLayout) instance;
- gridLayout.setMarginRight(Measure.valueOf(attribute.getValue()));
+ final UIBootstrapLayout gridLayout = (UIBootstrapLayout) instance;
+ gridLayout.setLarge(BootstrapPartition.valueOf(attribute.getValue()));
}
}
- static final class MarginBottomMapper extends Metadata {
- private final TagAttribute attribute;
-
- MarginBottomMapper(final TagAttribute attribute) {
- this.attribute = attribute;
- }
-
- public void applyMetadata(final FaceletContext ctx, final Object instance) {
- final UIFlowLayout gridLayout = (UIFlowLayout) instance;
- gridLayout.setMarginBottom(Measure.valueOf(attribute.getValue()));
- }
- }
-
- static final class MarginMapper extends Metadata {
- private final TagAttribute attribute;
-
- MarginMapper(final TagAttribute attribute) {
- this.attribute = attribute;
- }
-
- public void applyMetadata(final FaceletContext ctx, final Object instance) {
- final UIFlowLayout gridLayout = (UIFlowLayout) instance;
- gridLayout.setMargin(Measure.valueOf(attribute.getValue()));
- }
- }
}
Copied: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/SupportsCssRule.java (from r1567008, myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/SupportsMarkupRule.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/SupportsCssRule.java?p2=myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/SupportsCssRule.java&p1=myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/SupportsMarkupRule.java&r1=1567008&r2=1569326&rev=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/SupportsMarkupRule.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/SupportsCssRule.java Tue Feb 18 13:59:19 2014
@@ -20,8 +20,8 @@
package org.apache.myfaces.tobago.facelets;
import org.apache.myfaces.tobago.component.Attributes;
-import org.apache.myfaces.tobago.component.SupportsMarkup;
-import org.apache.myfaces.tobago.context.Markup;
+import org.apache.myfaces.tobago.component.SupportsCss;
+import org.apache.myfaces.tobago.renderkit.css.Css;
import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
@@ -31,33 +31,33 @@ import javax.faces.view.facelets.Metadat
import javax.faces.view.facelets.MetadataTarget;
import javax.faces.view.facelets.TagAttribute;
-public class SupportsMarkupRule extends MetaRule {
+public class SupportsCssRule extends MetaRule {
- public static final SupportsMarkupRule INSTANCE = new SupportsMarkupRule();
+ public static final SupportsCssRule INSTANCE = new SupportsCssRule();
public Metadata applyRule(final String name, final TagAttribute attribute, final MetadataTarget metadataTarget) {
- if (metadataTarget.isTargetInstanceOf(SupportsMarkup.class)) {
- if (Attributes.MARKUP.equals(name)) {
- return new SupportsMarkupMapper(attribute);
+ if (metadataTarget.isTargetInstanceOf(SupportsCss.class)) {
+ if (Attributes.CSS.equals(name)) {
+ return new SupportsCssMapper(attribute);
}
}
return null;
}
- static final class SupportsMarkupMapper extends Metadata {
+ static final class SupportsCssMapper extends Metadata {
private final TagAttribute attribute;
- public SupportsMarkupMapper(final TagAttribute attribute) {
+ public SupportsCssMapper(final TagAttribute attribute) {
this.attribute = attribute;
}
public void applyMetadata(final FaceletContext ctx, final Object instance) {
if (attribute.isLiteral()) {
- ((SupportsMarkup) instance).setMarkup(Markup.valueOf(attribute.getValue()));
+ ((SupportsCss) instance).setCss(Css.valueOf(attribute.getValue()));
} else {
final ValueExpression expression = attribute.getValueExpression(ctx, Object.class);
- ((UIComponent) instance).setValueExpression(Attributes.MARKUP, expression);
+ ((UIComponent) instance).setValueExpression(Attributes.CSS, expression);
}
}
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java Tue Feb 18 13:59:19 2014
@@ -23,12 +23,14 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.component.InputSuggest;
import org.apache.myfaces.tobago.component.OnComponentCreated;
import org.apache.myfaces.tobago.component.OnComponentPopulated;
+import org.apache.myfaces.tobago.component.SupportsCss;
import org.apache.myfaces.tobago.component.SupportsMarkup;
import org.apache.myfaces.tobago.component.SupportsRenderedPartially;
import org.apache.myfaces.tobago.config.TobagoConfig;
import org.apache.myfaces.tobago.event.SheetStateChangeSource;
import org.apache.myfaces.tobago.event.SortActionSource;
import org.apache.myfaces.tobago.event.TabChangeSource;
+import org.apache.myfaces.tobago.internal.component.AbstractUIBootstrapLayout;
import org.apache.myfaces.tobago.internal.component.AbstractUIFlowLayout;
import org.apache.myfaces.tobago.internal.component.AbstractUIGridLayout;
import org.apache.myfaces.tobago.internal.component.AbstractUIPopup;
@@ -78,6 +80,9 @@ public class TobagoComponentHandler exte
if (AbstractUIFlowLayout.class.isAssignableFrom(aClass)) {
metaRuleset.addRule(FlowLayoutRule.INSTANCE);
}
+ if (AbstractUIBootstrapLayout.class.isAssignableFrom(aClass)) {
+ metaRuleset.addRule(BootstrapLayoutRule.INSTANCE);
+ }
if (TabChangeSource.class.isAssignableFrom(aClass)) {
metaRuleset.addRule(TabChangeSourceRule.INSTANCE);
}
@@ -93,6 +98,10 @@ public class TobagoComponentHandler exte
if (SupportsRenderedPartially.class.isAssignableFrom(aClass)) {
metaRuleset.addRule(SupportsRenderedPartiallyRule.INSTANCE);
}
+ if (SupportsCss.class.isAssignableFrom(aClass)) {
+ metaRuleset.addRule(SupportsCssRule.INSTANCE);
+ }
+
return metaRuleset;
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java Tue Feb 18 13:59:19 2014
@@ -26,7 +26,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.SupportsMarkup;
-import org.apache.myfaces.tobago.component.UIGridLayout;
+import org.apache.myfaces.tobago.component.UIFlexLayout;
import org.apache.myfaces.tobago.component.UILabel;
import org.apache.myfaces.tobago.component.UIPanel;
import org.apache.myfaces.tobago.context.Markup;
@@ -115,7 +115,7 @@ public abstract class TobagoLabelExtensi
final Application application = faceletContext.getFacesContext().getApplication();
- addGridLayout(faceletContext, panel, application);
+ addFlexLayout(faceletContext, panel, application);
addLabel(faceletContext, (UIPanel) panel, application);
final String uid;
@@ -203,28 +203,28 @@ public abstract class TobagoLabelExtensi
}
}
- private void addGridLayout(
+ private void addFlexLayout(
final FaceletContext faceletContext, final UIComponent panel, final Application application) {
- final UIGridLayout gridLayout = (UIGridLayout) application.createComponent(UIGridLayout.COMPONENT_TYPE);
- gridLayout.setRendererType(RendererTypes.GRID_LAYOUT);
+ final UIFlexLayout flexLayout = (UIFlexLayout) application.createComponent(UIFlexLayout.COMPONENT_TYPE);
+ flexLayout.setRendererType(RendererTypes.FLEX_LAYOUT);
if (labelWidthAttribute != null) {
String columns = getColumns(labelWidthAttribute.getValue(faceletContext));
if (!LayoutUtils.checkTokens(columns)) {
LOG.warn("Illegal value for columns = \"" + columns + "\" replacing with default: \"" + DEFAULT_COLUMNS + "\"");
columns = DEFAULT_COLUMNS;
}
- gridLayout.setColumns(columns);
+ flexLayout.setColumns(columns);
} else {
- gridLayout.setColumns(getColumns("auto"));
+ flexLayout.setColumns(getColumns("auto"));
}
- gridLayout.setRows(getRows());
- gridLayout.setId(panel.getId() + "_tx_layout");
- if (gridLayout instanceof OnComponentCreated) {
- ((OnComponentCreated) gridLayout).onComponentCreated(faceletContext.getFacesContext(), panel);
- }
- panel.getFacets().put(Facets.LAYOUT, gridLayout);
- if (gridLayout instanceof OnComponentPopulated) {
- ((OnComponentPopulated) gridLayout).onComponentPopulated(faceletContext.getFacesContext(), panel);
+ flexLayout.setRows(getRows());
+ flexLayout.setId(panel.getId() + "_tx_layout");
+ if (flexLayout instanceof OnComponentCreated) {
+ ((OnComponentCreated) flexLayout).onComponentCreated(faceletContext.getFacesContext(), panel);
+ }
+ panel.getFacets().put(Facets.LAYOUT, flexLayout);
+ if (flexLayout instanceof OnComponentPopulated) {
+ ((OnComponentPopulated) flexLayout).onComponentPopulated(faceletContext.getFacesContext(), panel);
}
}
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIBootstrapLayout.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/AbstractUIBootstrapLayout.java?rev=1569326&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIBootstrapLayout.java (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIBootstrapLayout.java Tue Feb 18 13:59:19 2014
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.tobago.internal.component;
+
+import org.apache.myfaces.tobago.component.SupportsMarkup;
+import org.apache.myfaces.tobago.layout.LayoutManager;
+import org.apache.myfaces.tobago.layout.Orientation;
+
+/**
+ * TODO
+ */
+public abstract class AbstractUIBootstrapLayout extends AbstractUILayoutBase implements LayoutManager, SupportsMarkup {
+
+ public static final String COMPONENT_FAMILY = "org.apache.myfaces.tobago.BootstrapLayout";
+
+ public void init() {
+ }
+
+ public void fixRelativeInsideAuto(final Orientation orientation, final boolean auto) {
+ }
+
+ public void preProcessing(final Orientation orientation) {
+ }
+
+ public void mainProcessing(final Orientation orientation) {
+ }
+
+ public void postProcessing(final Orientation orientation) {
+ }
+}
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFlexLayout.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/AbstractUIFlexLayout.java?rev=1569326&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFlexLayout.java (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFlexLayout.java Tue Feb 18 13:59:19 2014
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.tobago.internal.component;
+
+import org.apache.myfaces.tobago.component.SupportsMarkup;
+import org.apache.myfaces.tobago.layout.LayoutManager;
+import org.apache.myfaces.tobago.layout.Orientation;
+
+/**
+ * TODO
+ */
+public abstract class AbstractUIFlexLayout extends AbstractUILayoutBase implements LayoutManager, SupportsMarkup {
+
+ public static final String COMPONENT_FAMILY = "org.apache.myfaces.tobago.FlexLayout";
+
+ public void init() {
+ }
+
+ public void fixRelativeInsideAuto(final Orientation orientation, final boolean auto) {
+ }
+
+ public void preProcessing(final Orientation orientation) {
+ }
+
+ public void mainProcessing(final Orientation orientation) {
+ }
+
+ public void postProcessing(final Orientation orientation) {
+ }
+}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.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/AbstractUIGridLayout.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java Tue Feb 18 13:59:19 2014
@@ -460,6 +460,10 @@ public abstract class AbstractUIGridLayo
public abstract boolean isRigid();
+ public Grid getGrid() {
+ return grid;
+ }
+
@Override
public boolean getRendersChildren() {
return false;
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIInput.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/AbstractUIInput.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIInput.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIInput.java Tue Feb 18 13:59:19 2014
@@ -19,6 +19,7 @@
package org.apache.myfaces.tobago.internal.component;
+import org.apache.myfaces.tobago.component.SupportsCss;
import org.apache.myfaces.tobago.component.SupportsMarkup;
import org.apache.myfaces.tobago.layout.LayoutComponent;
import org.apache.myfaces.tobago.util.ComponentUtils;
@@ -26,7 +27,7 @@ import org.apache.myfaces.tobago.util.Co
import javax.faces.context.FacesContext;
public abstract class AbstractUIInput extends javax.faces.component.UIInput
- implements SupportsMarkup, LayoutComponent {
+ implements SupportsMarkup, LayoutComponent, SupportsCss {
// TODO can this removed?
public void updateModel(final FacesContext facesContext) {
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.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/AbstractUISheetLayout.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java Tue Feb 18 13:59:19 2014
@@ -364,19 +364,41 @@ public abstract class AbstractUISheetLay
}
private Measure getHeaderHeight(final FacesContext facesContext, final AbstractUISheet sheet) {
- return sheet.isShowHeader()
- ? sheet.getLayoutComponentRenderer(facesContext).getCustomMeasure(facesContext, sheet, "headerHeight")
- : Measure.ZERO;
+ if (sheet.isShowHeader()) {
+ final Measure headerHeight = sheet.getLayoutComponentRenderer(facesContext)
+ .getCustomMeasure(facesContext, sheet, "headerHeight");
+ if (headerHeight != null) {
+ return headerHeight;
+ } else {
+ return Measure.valueOf(20);
+ }
+ } else {
+ return Measure.ZERO;
+ }
}
private Measure getRowHeight(final FacesContext facesContext, final AbstractUISheet sheet) {
- return sheet.getLayoutComponentRenderer(facesContext).getCustomMeasure(facesContext, sheet, "rowHeight");
+ final Measure rowHeight = sheet.getLayoutComponentRenderer(facesContext)
+ .getCustomMeasure(facesContext, sheet, "rowHeight");
+ if (rowHeight != null) {
+ return rowHeight;
+ } else {
+ return Measure.valueOf(20);
+ }
}
private Measure getFooterHeight(final FacesContext facesContext, final AbstractUISheet sheet) {
- return sheet.isPagingVisible()
- ? sheet.getLayoutComponentRenderer(facesContext).getCustomMeasure(facesContext, sheet, "footerHeight")
- : Measure.ZERO;
+ if (sheet.isPagingVisible()) {
+ final Measure footerHeight = sheet.getLayoutComponentRenderer(facesContext)
+ .getCustomMeasure(facesContext, sheet, "footerHeight");
+ if (footerHeight != null) {
+ return footerHeight;
+ } else {
+ return Measure.valueOf(20);
+ }
+ } else {
+ return Measure.ZERO;
+ }
}
private void layoutHeader() {
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ResourceManagerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ResourceManagerImpl.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ResourceManagerImpl.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ResourceManagerImpl.java Tue Feb 18 13:59:19 2014
@@ -49,22 +49,22 @@ public class ResourceManagerImpl impleme
private static final String MINIMIZE_SUFFIX = ".min";
private boolean production;
- private final Map<String, String> resourceList
+ private final Map<String, String> resourceList
= new ConcurrentHashMap<String, String>(100, 0.75f, 1);
- private final Map<RendererCacheKey, Renderer> rendererCache
+ private final Map<RendererCacheKey, Renderer> rendererCache
= new ConcurrentHashMap<RendererCacheKey, Renderer>(100, 0.75f, 1);
- private final Map<ImageCacheKey, StringValue> imageCache
+ private final Map<ImageCacheKey, StringValue> imageCache
= new ConcurrentHashMap<ImageCacheKey, StringValue>(100, 0.75f, 1);
- private final Map<JspCacheKey, String> jspCache
+ private final Map<JspCacheKey, String> jspCache
= new ConcurrentHashMap<JspCacheKey, String>(100, 0.75f, 1);
- private final Map<MiscCacheKey, String[]> miscCache
+ private final Map<MiscCacheKey, String[]> miscCache
= new ConcurrentHashMap<MiscCacheKey, String[]>(100, 0.75f, 1);
- private final Map<PropertyCacheKey, StringValue> propertyCache
+ private final Map<PropertyCacheKey, StringValue> propertyCache
= new ConcurrentHashMap<PropertyCacheKey, StringValue>(100, 0.75f, 1);
- private final Map<ThemeConfigCacheKey, MeasureValue> themeCache
+ private final Map<ThemeConfigCacheKey, MeasureValue> themeCache
= new ConcurrentHashMap<ThemeConfigCacheKey, MeasureValue>(100, 0.75f, 1);
-
+
private TobagoConfigImpl tobagoConfig;
public ResourceManagerImpl(final TobagoConfigImpl tobagoConfig) {
@@ -119,7 +119,7 @@ public class ResourceManagerImpl impleme
if (bundle != null && propertyKey != null) {
final ClientPropertiesKey clientKey = ClientPropertiesKey.get(facesContext);
final PropertyCacheKey cacheKey = new PropertyCacheKey(clientKey, bundle, propertyKey);
-
+
StringValue result = propertyCache.get(cacheKey);
if (result == null) {
final List properties
@@ -172,12 +172,12 @@ public class ResourceManagerImpl impleme
}
return renderer;
}
-
+
@Deprecated
public String[] getScripts(final UIViewRoot viewRoot, final String name) {
return getScripts(FacesContext.getCurrentInstance(), name);
}
-
+
public String[] getScripts(final FacesContext facesContext, final String name) {
return getStrings(facesContext, name, null);
}
@@ -218,6 +218,20 @@ public class ResourceManagerImpl impleme
return getThemeMeasure(facesContext, configurable.getRendererType(), configurable.getCurrentMarkup(), name);
}
+ /**
+ * The default should not be needed, use defaulting from the theme mechanism.
+ */
+ public Measure getThemeMeasure(
+ final FacesContext facesContext, final Configurable configurable, final String name, final Measure defaultValue) {
+ final Measure measure = getThemeMeasure(facesContext, configurable, name);
+ if (measure != null) {
+ return measure;
+ } else {
+// LOG.warn("Using default-value for configurable='" + configurable + "' name='" + name + "'");
+ return defaultValue;
+ }
+ }
+
public Measure getThemeMeasure(
final FacesContext facesContext, final String rendererType, final Markup markup, final String name) {
@@ -260,7 +274,7 @@ public class ResourceManagerImpl impleme
public String getImage(final UIViewRoot viewRoot, final String name) {
return getImage(FacesContext.getCurrentInstance(), name);
}
-
+
public String getImage(final FacesContext facesContext, final String name) {
return getImage(facesContext, name, false);
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/LayoutContext.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/LayoutContext.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/LayoutContext.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/LayoutContext.java Tue Feb 18 13:59:19 2014
@@ -19,12 +19,11 @@
package org.apache.myfaces.tobago.internal.layout;
-import org.apache.myfaces.tobago.internal.util.StringUtils;
import org.apache.myfaces.tobago.internal.component.AbstractUIGridLayout;
+import org.apache.myfaces.tobago.internal.util.StringUtils;
import org.apache.myfaces.tobago.layout.LayoutBase;
import org.apache.myfaces.tobago.layout.LayoutContainer;
import org.apache.myfaces.tobago.layout.LayoutManager;
-import org.apache.myfaces.tobago.layout.Orientation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -80,6 +79,7 @@ public class LayoutContext {
if (trace) {
log("after init", true);
}
+/*
layoutManager.fixRelativeInsideAuto(Orientation.VERTICAL, false);
if (trace) {
log("after fixRelativeInsideAuto vertical", true);
@@ -113,6 +113,7 @@ public class LayoutContext {
log("after postProcessing horizontal", true);
}
+*/
if (debug) {
LOG.debug("Laying out takes: {} ns", new DecimalFormat("#,##0").format(System.nanoTime() - begin));
log("after layout", false);
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/BootstrapLayoutTagDeclaration.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/BootstrapLayoutTagDeclaration.java?rev=1569326&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/BootstrapLayoutTagDeclaration.java (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/BootstrapLayoutTagDeclaration.java Tue Feb 18 13:59:19 2014
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.tobago.internal.taglib.component;
+
+import org.apache.myfaces.tobago.apt.annotation.BodyContent;
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.internal.component.AbstractUIBootstrapLayout;
+import org.apache.myfaces.tobago.component.RendererTypes;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasBinding;
+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.HasMarkup;
+
+/**
+ * Renders a layout using the bootstrap 12 column grid.
+ */
+@Tag(name = "bootstrapLayout", bodyContent = BodyContent.EMPTY)
+@UIComponentTag(
+ uiComponent = "org.apache.myfaces.tobago.component.UIBootstrapLayout",
+ uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUIBootstrapLayout",
+ uiComponentFacesClass = "javax.faces.component.UIComponentBase",
+ componentFamily = AbstractUIBootstrapLayout.COMPONENT_FAMILY,
+ rendererType = RendererTypes.BOOTSTRAP_LAYOUT,
+ allowedChildComponenents = "NONE", isLayout = true)
+public interface BootstrapLayoutTagDeclaration extends HasId, HasBinding, HasMarkup, HasCurrentMarkup {
+
+ /**
+ * TODO
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.BootstrapPartition")
+ void setExtraSmall(String extraSmall);
+
+ /**
+ * TODO
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.BootstrapPartition")
+ void setSmall(String small);
+
+ /**
+ * TODO
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.BootstrapPartition")
+ void setMedium(String medium);
+
+ /**
+ * TODO
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.BootstrapPartition")
+ void setLarge(String large);
+
+}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ButtonTagDeclaration.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/ButtonTagDeclaration.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ButtonTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ButtonTagDeclaration.java Tue Feb 18 13:59:19 2014
@@ -27,6 +27,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;
@@ -61,5 +63,5 @@ import javax.faces.component.UICommand;
public interface ButtonTagDeclaration
extends AbstractCommandTagDeclaration, HasIdBindingAndRendered, HasLabelAndAccessKey, HasImage,
IsDisabled, IsDefaultCommand, HasTip,
- IsDeprecatedInline, HasMarkup, HasCurrentMarkup, HasTabIndex, IsGridLayoutComponent {
+ IsDeprecatedInline, HasMarkup, HasCurrentMarkup, HasTabIndex, IsGridLayoutComponent, HasCss, HasCurrentCss {
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/DateTagDeclaration.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/DateTagDeclaration.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/DateTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/DateTagDeclaration.java Tue Feb 18 13:59:19 2014
@@ -25,6 +25,8 @@ import org.apache.myfaces.tobago.apt.ann
import org.apache.myfaces.tobago.component.Facets;
import org.apache.myfaces.tobago.component.RendererTypes;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasConverter;
+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.HasLabelAndAccessKey;
@@ -58,6 +60,6 @@ import javax.faces.component.UIInput;
public interface DateTagDeclaration
extends InputTagDeclaration, HasIdBindingAndRendered, IsReadonly,
IsDisabled, HasConverter, IsDeprecatedInline, HasLabelAndAccessKey,
- HasTip, IsRequired, HasMarkup, HasCurrentMarkup, HasPlaceholder {
+ HasTip, IsRequired, HasMarkup, HasCurrentMarkup, HasPlaceholder, HasCss, HasCurrentCss {
}
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FlexLayoutTagDeclaration.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/FlexLayoutTagDeclaration.java?rev=1569326&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FlexLayoutTagDeclaration.java (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FlexLayoutTagDeclaration.java Tue Feb 18 13:59:19 2014
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.tobago.internal.taglib.component;
+
+import org.apache.myfaces.tobago.apt.annotation.BodyContent;
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
+import org.apache.myfaces.tobago.component.RendererTypes;
+import org.apache.myfaces.tobago.internal.component.AbstractUIFlexLayout;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasBinding;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasColumnLayout;
+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.HasMarkup;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasRowLayout;
+
+/**
+ * Renders a flex layout (CSS3 feature).
+ */
+@Tag(
+ name = "flexLayout",
+ bodyContent = BodyContent.EMPTY,
+ // todo: write this class: FlexLayoutTagExtraInfo
+ tagExtraInfoClassName = "org.apache.myfaces.tobago.internal.taglib.component.FlexLayoutTagExtraInfo")
+@UIComponentTag(
+ uiComponent = "org.apache.myfaces.tobago.component.UIFlexLayout",
+ uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUIFlexLayout",
+ uiComponentFacesClass = "javax.faces.component.UIComponentBase",
+ componentFamily = AbstractUIFlexLayout.COMPONENT_FAMILY,
+ rendererType = RendererTypes.FLEX_LAYOUT,
+ allowedChildComponenents = "NONE", isLayout = true)
+public interface FlexLayoutTagDeclaration
+ extends HasId, HasBinding, HasMarkup, HasCurrentMarkup, HasColumnLayout, HasRowLayout {
+}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/InTagDeclaration.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/InTagDeclaration.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/InTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/InTagDeclaration.java Tue Feb 18 13:59:19 2014
@@ -27,6 +27,8 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.component.RendererTypes;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasAutocomplete;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasConverter;
+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.HasInputLabel;
@@ -65,6 +67,6 @@ import javax.faces.component.UIInput;
public interface InTagDeclaration
extends HasIdBindingAndRendered, HasConverter, IsReadonly, IsDisabled, IsRequired, HasTip, IsPassword,
HasSuggestMethod, HasMarkup, HasCurrentMarkup, InputTagDeclaration, HasInputLabel, IsDeprecatedInline,
- HasAutocomplete, HasPlaceholder {
+ HasAutocomplete, HasPlaceholder, HasCss, HasCurrentCss {
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/LabelTagDeclaration.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/LabelTagDeclaration.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/LabelTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/LabelTagDeclaration.java Tue Feb 18 13:59:19 2014
@@ -24,6 +24,8 @@ import org.apache.myfaces.tobago.apt.ann
import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
import org.apache.myfaces.tobago.component.RendererTypes;
+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.HasFor;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
@@ -47,7 +49,8 @@ import javax.faces.component.UIOutput;
rendererType = RendererTypes.LABEL,
allowedChildComponenents = "NONE")
public interface LabelTagDeclaration extends HasIdBindingAndRendered,
- HasLabelWithAccessKey, HasFor, IsDeprecatedInline, HasTip, HasMarkup, HasCurrentMarkup, IsGridLayoutComponent {
+ HasLabelWithAccessKey, HasFor, IsDeprecatedInline, HasTip, HasMarkup, HasCurrentMarkup, IsGridLayoutComponent,
+ HasCss, HasCurrentCss {
/**
* Text value to display as label. Overwritten by 'labelWithAccessKey'
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PageTagDeclaration.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/PageTagDeclaration.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PageTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PageTagDeclaration.java Tue Feb 18 13:59:19 2014
@@ -28,6 +28,8 @@ import org.apache.myfaces.tobago.apt.ann
import org.apache.myfaces.tobago.component.Facets;
import org.apache.myfaces.tobago.component.RendererTypes;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasBinding;
+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.HasId;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabel;
@@ -62,7 +64,7 @@ import javax.faces.component.UIForm;
public interface PageTagDeclaration
extends HasLabel, HasId, HasBinding, HasMarkup, HasCurrentMarkup,
- IsGridLayoutComponentWithDimension, IsGridLayoutContainer {
+ IsGridLayoutComponentWithDimension, IsGridLayoutContainer, HasCss, HasCurrentCss {
/**
* Contains the id of the component which should have the focus after
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TextareaTagDeclaration.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/TextareaTagDeclaration.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TextareaTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TextareaTagDeclaration.java Tue Feb 18 13:59:19 2014
@@ -25,6 +25,8 @@ import org.apache.myfaces.tobago.apt.ann
import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
import org.apache.myfaces.tobago.component.RendererTypes;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasConverter;
+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.HasLabelAndAccessKey;
@@ -50,7 +52,7 @@ import javax.faces.component.UIInput;
allowedChildComponenents = "NONE")
public interface TextareaTagDeclaration
extends HasIdBindingAndRendered, HasConverter, IsReadonly, IsDisabled, IsRequired, HasLabelAndAccessKey, HasTip,
- HasMarkup, HasCurrentMarkup, InputTagDeclaration {
+ HasMarkup, HasCurrentMarkup, InputTagDeclaration, HasCss, HasCurrentCss {
/**
* The row count for this component.
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TimeTagDeclaration.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/TimeTagDeclaration.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TimeTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/TimeTagDeclaration.java Tue Feb 18 13:59:19 2014
@@ -22,6 +22,8 @@ package org.apache.myfaces.tobago.intern
import org.apache.myfaces.tobago.apt.annotation.Tag;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
import org.apache.myfaces.tobago.component.RendererTypes;
+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.HasLabelAndAccessKey;
@@ -48,6 +50,7 @@ import javax.faces.component.UIInput;
allowedChildComponenents = "NONE")
public interface TimeTagDeclaration
extends InputTagDeclaration, HasIdBindingAndRendered,
- IsReadonly, IsDisabled, IsDeprecatedInline, HasLabelAndAccessKey, HasTip, IsRequired, HasMarkup, HasCurrentMarkup {
+ IsReadonly, IsDisabled, IsDeprecatedInline, HasLabelAndAccessKey, HasTip, IsRequired, HasMarkup, HasCurrentMarkup,
+ HasCss, HasCurrentCss {
}
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasCss.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/declaration/HasCss.java?rev=1569326&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasCss.java (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasCss.java Tue Feb 18 13:59:19 2014
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.tobago.internal.taglib.declaration;
+
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+
+public interface HasCss {
+
+ /**
+ * TODO
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.renderkit.css.Css")
+ void setCss(String css);
+
+}
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasCurrentCss.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/declaration/HasCurrentCss.java?rev=1569326&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasCurrentCss.java (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasCurrentCss.java Tue Feb 18 13:59:19 2014
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.tobago.internal.taglib.declaration;
+
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+
+public interface HasCurrentCss {
+
+ /**
+ * TODO
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.renderkit.css.Css", isTransient = true)
+ void setCurrentCss(String currentCss);
+
+}
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/BootstrapPartition.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/BootstrapPartition.java?rev=1569326&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/BootstrapPartition.java (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/BootstrapPartition.java Tue Feb 18 13:59:19 2014
@@ -0,0 +1,97 @@
+package org.apache.myfaces.tobago.layout;
+
+import org.apache.myfaces.tobago.internal.util.StringUtils;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * A list of positive integers with sum 12. Is used for the bootstrap column partitioning.
+ */
+public final class BootstrapPartition {
+
+ private static final Integer[] PART_12 = new Integer[] {12};
+
+ private final Integer[] parts;
+
+ public BootstrapPartition(Integer... parts) {
+ if (checkSum(parts)) {
+ this.parts = parts;
+ } else {
+ this.parts = createParts(parts);
+ }
+ }
+
+ public static BootstrapPartition valueOf(String string) {
+ final List<Integer> integers = StringUtils.parseIntegerList(string, ";");
+ return new BootstrapPartition(integers.toArray(new Integer[integers.size()]));
+ }
+
+ public static BootstrapPartition valueOf(Object object) {
+ if (object instanceof String) {
+ return valueOf((String) object);
+ } else if (object instanceof Integer[]) {
+ return new BootstrapPartition(( Integer[]) object);
+ } else if (object != null) {
+ return valueOf(object.toString());
+ } else {
+ return new BootstrapPartition(PART_12);
+ }
+ }
+
+ private boolean checkSum(final Integer[] summands) {
+ if (summands == null || summands.length == 0) {
+ return false;
+ }
+ int sum = 0;
+ for (int summand : summands) {
+ if (summand < 1) {
+ return false;
+ }
+ sum += summand;
+ if (sum > 12) {
+ return false;
+ }
+ }
+ return sum == 12;
+ }
+
+ private Integer[] createParts(Integer[] summands) {
+ return createParts(Arrays.asList(summands));
+ }
+
+ private Integer[] createParts(List<Integer> summands) {
+ List<Integer> list = new ArrayList<Integer>();
+ if (summands == null || summands.size() == 0) {
+ return PART_12;
+ }
+ int sum = 0;
+ for (int summand : summands) {
+ if (summand < 1) {
+ summand = 1;
+ }
+ if (sum + summand > 12) {
+ break;
+ }
+ sum += summand;
+ list.add(summand);
+ }
+ if (sum < 12) {
+ list.add(12 - sum);
+ }
+ return list.toArray(new Integer[list.size()]);
+ }
+
+ public Integer[] getParts() {
+ return parts;
+ }
+
+ public int getSize() {
+ return parts.length;
+ }
+
+ public int getPart(final int column) {
+ return parts[column];
+ }
+}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRendererBase.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRendererBase.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRendererBase.java Tue Feb 18 13:59:19 2014
@@ -66,51 +66,51 @@ public abstract class LayoutComponentRen
}
public Measure getMarginLeft(final FacesContext facesContext, final Configurable component) {
- return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_LEFT);
+ return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_LEFT, Measure.ZERO);
}
public Measure getMarginRight(final FacesContext facesContext, final Configurable component) {
- return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_RIGHT);
+ return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_RIGHT, Measure.ZERO);
}
public Measure getMarginTop(final FacesContext facesContext, final Configurable component) {
- return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_TOP);
+ return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_TOP, Measure.ZERO);
}
public Measure getMarginBottom(final FacesContext facesContext, final Configurable component) {
- return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_BOTTOM);
+ return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_BOTTOM, Measure.ZERO);
}
public Measure getBorderLeft(final FacesContext facesContext, final Configurable component) {
- return getResourceManager().getThemeMeasure(facesContext, component, Attributes.BORDER_LEFT);
+ return getResourceManager().getThemeMeasure(facesContext, component, Attributes.BORDER_LEFT, Measure.ZERO);
}
public Measure getBorderRight(final FacesContext facesContext, final Configurable component) {
- return getResourceManager().getThemeMeasure(facesContext, component, Attributes.BORDER_RIGHT);
+ return getResourceManager().getThemeMeasure(facesContext, component, Attributes.BORDER_RIGHT, Measure.ZERO);
}
public Measure getBorderTop(final FacesContext facesContext, final Configurable component) {
- return getResourceManager().getThemeMeasure(facesContext, component, Attributes.BORDER_TOP);
+ return getResourceManager().getThemeMeasure(facesContext, component, Attributes.BORDER_TOP, Measure.ZERO);
}
public Measure getBorderBottom(final FacesContext facesContext, final Configurable component) {
- return getResourceManager().getThemeMeasure(facesContext, component, Attributes.BORDER_BOTTOM);
+ return getResourceManager().getThemeMeasure(facesContext, component, Attributes.BORDER_BOTTOM, Measure.ZERO);
}
public Measure getPaddingLeft(final FacesContext facesContext, final Configurable component) {
- return getResourceManager().getThemeMeasure(facesContext, component, Attributes.PADDING_LEFT);
+ return getResourceManager().getThemeMeasure(facesContext, component, Attributes.PADDING_LEFT, Measure.ZERO);
}
public Measure getPaddingRight(final FacesContext facesContext, final Configurable component) {
- return getResourceManager().getThemeMeasure(facesContext, component, Attributes.PADDING_RIGHT);
+ return getResourceManager().getThemeMeasure(facesContext, component, Attributes.PADDING_RIGHT, Measure.ZERO);
}
public Measure getPaddingTop(final FacesContext facesContext, final Configurable component) {
- return getResourceManager().getThemeMeasure(facesContext, component, Attributes.PADDING_TOP);
+ return getResourceManager().getThemeMeasure(facesContext, component, Attributes.PADDING_TOP, Measure.ZERO);
}
public Measure getPaddingBottom(final FacesContext facesContext, final Configurable component) {
- return getResourceManager().getThemeMeasure(facesContext, component, Attributes.PADDING_BOTTOM);
+ return getResourceManager().getThemeMeasure(facesContext, component, Attributes.PADDING_BOTTOM, Measure.ZERO);
}
public Measure getVerticalScrollbarWeight(final FacesContext facesContext, final Configurable component) {
@@ -119,7 +119,7 @@ public abstract class LayoutComponentRen
if (weight != null) {
return weight;
} else { // default
- return getResourceManager().getThemeMeasure(facesContext, component, "verticalScrollbarWeight");
+ return getResourceManager().getThemeMeasure(facesContext, component, "verticalScrollbarWeight", Measure.ZERO);
}
}
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java Tue Feb 18 13:59:19 2014
@@ -19,12 +19,14 @@
package org.apache.myfaces.tobago.renderkit;
+import org.apache.myfaces.tobago.component.SupportsCss;
import org.apache.myfaces.tobago.component.SupportsMarkup;
import org.apache.myfaces.tobago.config.Configurable;
import org.apache.myfaces.tobago.context.Markup;
import org.apache.myfaces.tobago.context.ResourceManager;
import org.apache.myfaces.tobago.internal.context.ResourceManagerFactory;
import org.apache.myfaces.tobago.layout.Measure;
+import org.apache.myfaces.tobago.renderkit.css.Css;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -58,6 +60,12 @@ public class RendererBase extends Render
final Markup markup = ComponentUtils.updateMarkup(component, supportsMarkup.getMarkup());
supportsMarkup.setCurrentMarkup(markup);
}
+
+ if (component instanceof SupportsCss) {
+ final SupportsCss supportsCss = (SupportsCss) component;
+ final Css css = supportsCss.getCss();
+ supportsCss.setCurrentCss(css != null ? css : new Css());
+ }
}
public boolean getPrepareRendersChildren() {
@@ -194,4 +202,14 @@ public class RendererBase extends Render
}
return resourceManager;
}
+
+ /**
+ * The return value of this method will be cached, so it's not possible to return state information.
+ * This method will not called often.
+ * @since Tobago 3.0.0
+ * @return Additional CSS classes.
+ */
+ public String[] getAdditionalClasses() {
+ return new String[0];
+ }
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Classes.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Classes.java?rev=1569326&r1=1569325&r2=1569326&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Classes.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Classes.java Tue Feb 18 13:59:19 2014
@@ -20,6 +20,7 @@
package org.apache.myfaces.tobago.renderkit.css;
import org.apache.commons.collections.map.MultiKeyMap;
+import org.apache.myfaces.tobago.component.SupportsCss;
import org.apache.myfaces.tobago.component.SupportsMarkup;
import org.apache.myfaces.tobago.context.Markup;
import org.apache.myfaces.tobago.context.Theme;
@@ -33,39 +34,34 @@ import javax.faces.component.UIComponent
import javax.faces.context.FacesContext;
/**
- * Builds the CSS class attribute of tags.
- * The names will be generated in a formal way, so generic name (and abbrevation) are possible.
- * The class works like a factory, so caching will be possible.
+ * Builds the CSS class attribute of tags. The names will be generated in a formal way, so generic name (and
+ * abbreviation) are possible. The class works like a factory, so caching will be possible.
* <p/>
* The default naming conventions allow these values:<br/>
- *
- * <ul>
- * <li>tobago-<rendererName></li>
- * <li>tobago-<rendererName>-markup-<markupName></li>
- * <li>tobago-<rendererName>-<subElement></li>
- * <li>tobago-<rendererName>-<subElement>-markup-<markupName></li>
- * </ul>
- *
- * where
- * <ul>
- * <li><rendererName>, <subElement> and <markupName> must only contain ASCII-chars and -numbers</li>
- * <li><rendererName> is the rendererType with a lower case char as first char</li>
- * <li><subElement> is a sub element of the main tag in the output language (e.g. HTML)</li>
- * <li><markupName> is the name of an existing markup</li>
+ * <p/>
+ * <ul> <li>tobago-<rendererName></li> <li>tobago-<rendererName>-markup-<markupName></li>
+ * <li>tobago-<rendererName>-<subElement></li> <li>tobago-<rendererName>-<subElement>-markup-<markupName></li>
* </ul>
- * If the markup contains more than one name, there will be generated more than one output string.
- * E.g.: UIIn with Markup [readonly, error] will get the class
- * "tobago-in tobago-in-markup-readonly tobago-in-markup-error".
- *
+ * <p/>
+ * where <ul> <li><rendererName>, <subElement> and <markupName> must only contain ASCII-chars and -numbers</li>
+ * <li><rendererName> is the rendererType with a lower case char as first char</li> <li><subElement> is a sub
+ * element of the main tag in the output language (e.g. HTML)</li> <li><markupName> is the name of an existing
+ * markup</li> </ul> If the markup contains more than one name, there will be generated more than one output string.
+ * E.g.: UIIn with Markup [readonly, error] will get the class "tobago-in tobago-in-markup-readonly
+ * tobago-in-markup-error".
*/
public final class Classes {
private static final Logger LOG = LoggerFactory.getLogger(Classes.class);
+ /* With cache it seems to be 10 times faster */
private static final MultiKeyMap CACHE = new MultiKeyMap();
private final String stringValue;
+ // TODO: May remplace "Classes" with "Css"
+ private Css css;
+
public static Classes create(final UIComponent component) {
return create(component, true, null, null, false);
}
@@ -88,18 +84,21 @@ public final class Classes {
final Markup explicit, final boolean ignoreCheck) {
final String rendererName = StringUtils.uncapitalize(component.getRendererType());
final Markup markup = markupFromComponent ? ((SupportsMarkup) component).getCurrentMarkup() : explicit;
- Classes value = (Classes) CACHE.get(rendererName, markup, sub);
- if (value == null) {
- value = new Classes(rendererName, markup, sub, ignoreCheck);
- CACHE.put(rendererName, markup, sub, value);
- if (LOG.isDebugEnabled()) {
- LOG.debug("Element added (size={}) to cache (renderName='{}', markup='{}', sub='{}')",
- CACHE.size(), rendererName, markup, sub);
- }
+// Classes value = (Classes) CACHE.get(rendererName, markup, sub);
+// if (value == null) {
+ final Classes value;
+ value = new Classes(rendererName, markup, sub, ignoreCheck);
+// CACHE.put(rendererName, markup, sub, value);
+// if (LOG.isDebugEnabled()) {
+// LOG.debug("Element added (size={}) to cache (renderName='{}', markup='{}', sub='{}')",
+// CACHE.size(), rendererName, markup, sub);
+// }
+// }
+ if (component instanceof SupportsCss) {
+ value.css = ((SupportsCss) component).getCurrentCss();
}
return value;
}
-
private Classes(final String rendererName, final Markup markup, final String sub, final boolean ignoreMarkupCheck) {
assert sub == null || StringUtils.isAlphanumeric(sub) : "Invalid sub element name: '" + sub + "'";
@@ -136,32 +135,11 @@ public final class Classes {
}
public String getStringValue() {
- return stringValue;
- }
-
- /** @deprecated This workaround will be removed later */
- @Deprecated
- public static String requiredWorkaround(final UIComponent component) {
- final String rendererName = StringUtils.uncapitalize(component.getRendererType());
- return "tobago-" + rendererName + "-markup-required";
- }
-
- /**
- * @deprecated This workaround will be removed later
- */
- @Deprecated
- public static Classes createWorkaround(
- final String rendererName, final String sub, final Markup explicit) {
- return new Classes(rendererName, explicit, sub, false);
- }
-
- /**
- * @deprecated This workaround will be removed later
- */
- @Deprecated
- public static Classes createWorkaround(
- final String rendererName, final Markup explicit) {
- return new Classes(rendererName, explicit, null, false);
+ // XXX optimize
+ if (css != null && css.encode() != null) {
+ return stringValue + " " + css.encode();
+ } else {
+ return stringValue;
+ }
}
-
}
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Css.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Css.java?rev=1569326&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Css.java (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Css.java Tue Feb 18 13:59:19 2014
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.tobago.renderkit.css;
+
+import org.apache.myfaces.tobago.internal.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+public class Css {
+
+ private static final Logger LOG = LoggerFactory.getLogger(Css.class);
+
+
+ private final Set<String> list = new HashSet<String>();
+
+ public Css() {
+ }
+
+ public void add(String css) {
+ // todo: check for forbidden letters: regexp
+ if (css.contains(" ")) {
+ LOG.warn("Not a valid css class name: " + css);
+ }
+ list.add(css);
+ }
+
+ public static Css valueOf(final String string) {
+
+ final StringTokenizer tokenizer = new StringTokenizer(string, " ");
+ final Css css = new Css();
+ while (tokenizer.hasMoreTokens()) {
+ css.add(tokenizer.nextToken());
+ }
+ return css;
+ }
+
+ public static Css valueOf(final Object object) {
+
+ if (object == null) {
+ return new Css();
+ } else if (object instanceof String) {
+ return valueOf((String)object);
+ } else {
+ return valueOf(object.toString());
+ }
+ }
+
+ public String encode() {
+ return StringUtils.join(new ArrayList<String>(list), ' ');
+ }
+
+ public String toString() {
+ return encode();
+ }
+
+}