You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2016/07/06 15:44:09 UTC
svn commit: r1751703 - in /myfaces/tobago/trunk:
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/
tobago-core/src/main/java/org/apache/myfaces/tobago/layout/
tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfa...
Author: lofwyr
Date: Wed Jul 6 15:44:09 2016
New Revision: 1751703
URL: http://svn.apache.org/viewvc?rev=1751703&view=rev
Log:
TOBAGO-1531: Extend functinallity of <tc:flexLayout>
Added:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/JustifyContent.java
- copied, changed from r1751678, myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/AlignItems.java
Modified:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FlexLayoutTagDeclaration.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/style/tobago.css
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FlexLayoutTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FlexLayoutTagDeclaration.java?rev=1751703&r1=1751702&r2=1751703&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FlexLayoutTagDeclaration.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FlexLayoutTagDeclaration.java Wed Jul 6 15:44:09 2016
@@ -30,6 +30,7 @@ import org.apache.myfaces.tobago.interna
import org.apache.myfaces.tobago.internal.taglib.declaration.HasRowLayout;
import org.apache.myfaces.tobago.internal.taglib.declaration.IsVisual;
import org.apache.myfaces.tobago.layout.AlignItems;
+import org.apache.myfaces.tobago.layout.JustifyContent;
/**
* Renders a flex layout (CSS3 feature).
@@ -60,4 +61,18 @@ public interface FlexLayoutTagDeclaratio
})
void setAlignItems(String alignItems);
+ /**
+ * This value defines CSS justify-content value of the flex layout.
+ *
+ * @since 3.0.0
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(
+ type = "org.apache.myfaces.tobago.layout.JustifyContent",
+ allowedValues = {
+ JustifyContent.FLEX_START, JustifyContent.FLEX_END, JustifyContent.CENTER, JustifyContent.SPACE_BETWEEN,
+ JustifyContent.SPACE_AROUND
+ })
+ void setJustifyContent(String justifyContent);
+
}
Copied: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/JustifyContent.java (from r1751678, myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/AlignItems.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/JustifyContent.java?p2=myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/JustifyContent.java&p1=myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/AlignItems.java&r1=1751678&r2=1751703&rev=1751703&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/AlignItems.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/JustifyContent.java Wed Jul 6 15:44:09 2016
@@ -19,18 +19,18 @@
package org.apache.myfaces.tobago.layout;
-public enum AlignItems {
+public enum JustifyContent {
flexStart,
flexEnd,
center,
- baseline,
- stretch;
+ spaceBetween,
+ spaceAround;
public static final String FLEX_START = "flexStart";
public static final String FLEX_END = "flexEnd";
public static final String CENTER = "center";
- public static final String BASELINE = "baseline";
- public static final String STRETCH = "stretch";
+ public static final String SPACE_BETWEEN = "spaceBetween";
+ public static final String SPACE_AROUND = "spaceAround";
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java?rev=1751703&r1=1751702&r2=1751703&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java Wed Jul 6 15:44:09 2016
@@ -20,6 +20,7 @@
package org.apache.myfaces.tobago.renderkit.css;
import org.apache.myfaces.tobago.layout.AlignItems;
+import org.apache.myfaces.tobago.layout.JustifyContent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -35,6 +36,13 @@ public enum TobagoClass implements CssIt
ALIGN_ITEMS__FLEX_END("alignItems-flexEnd"),
ALIGN_ITEMS__FLEX_START("alignItems-flexStart"),
ALIGN_ITEMS__STRETCH("alignItems-stretch"),
+
+ JUSTIFY_CONTENT__CENTER("justifyContent-center"),
+ JUSTIFY_CONTENT__FLEX_START("justifyContent-flexStart"),
+ JUSTIFY_CONTENT__FLEX_END("justifyContent-flexEnd"),
+ JUSTIFY_CONTENT__SPACE_BETWEEN("justifyContent-spaceBetween"),
+ JUSTIFY_CONTENT__SPACE_AROUND("justifyContent-spaceAround"),
+
DROPDOWN_SUBMENU("dropdown-submenu"),
TABLE_LAYOUT__FIXED("tableLayout-fixed"),
@@ -93,6 +101,28 @@ public enum TobagoClass implements CssIt
return null;
}
}
+ }
+
+ public static TobagoClass valueOf(JustifyContent justifyContent) {
+ if (justifyContent == null) {
+ return null;
+ } else {
+ switch (justifyContent) {
+ case center:
+ return JUSTIFY_CONTENT__CENTER;
+ case flexEnd:
+ return JUSTIFY_CONTENT__FLEX_END;
+ case flexStart:
+ return JUSTIFY_CONTENT__FLEX_START;
+ case spaceBetween:
+ return JUSTIFY_CONTENT__SPACE_BETWEEN;
+ case spaceAround:
+ return JUSTIFY_CONTENT__SPACE_AROUND;
+ default:
+ LOG.warn("Undefined justifyContent: '{}'.", justifyContent);
+ return null;
+ }
+ }
}
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/style/tobago.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/style/tobago.css?rev=1751703&r1=1751702&r2=1751703&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/style/tobago.css (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/style/tobago.css Wed Jul 6 15:44:09 2016
@@ -144,6 +144,26 @@ body {
align-items: stretch;
}
+.justifyContent-center {
+ justify-content: center;
+}
+
+.justifyContent-flexStart {
+ justify-content: flex-start;
+}
+
+.justifyContent-flexEnd{
+ justify-content: flex-end;
+}
+
+.justifyContent-spaceBetween{
+ justify-content: space-between;
+}
+
+.justifyContent-spaceAround{
+ justify-content: space-around;
+}
+
/* footer -------------------------------------------------------------- */
.tobago-footer {
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg?rev=1751703&r1=1751702&r2=1751703&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg Wed Jul 6 15:44:09 2016
@@ -358,6 +358,10 @@ AlignItemsProperty(property) ::= <<
<NormalProperty(property)>
>>
+JustifyContentProperty(property) ::= <<
+<NormalProperty(property)>
+>>
+
SwitchTypeProperty(property) ::= <<
<NormalProperty(property)>
>>