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 2015/09/16 11:17:38 UTC
svn commit: r1703372 [3/4] - in /myfaces/tobago/branches/tobago-3.0.x:
tobago-core/src/main/java/org/apache/myfaces/tobago/component/
tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/
tobago-core/src/main/java/org/apache/myfaces/tobago/inte...
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/Overflow.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/Overflow.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/Overflow.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/Overflow.java Wed Sep 16 09:17:36 2015
@@ -33,12 +33,27 @@ public enum Overflow {
/**
* @deprecated Since Tobago 3.0.0 Please use {@link Overflow#hidden}
*/
- public static final Overflow HIDDEN=hidden;
+ public static final Overflow HIDDEN = hidden;
/**
* @deprecated Since Tobago 3.0.0 Please use {@link Overflow#scroll}
*/
- public static final Overflow SCROLL=scroll;
+ public static final Overflow SCROLL = scroll;
+
+ /**
+ * Internal constant to use in annotations. Please use {@link Overflow#auto}
+ */
+ public static final String STRING_AUTO = "auto";
+
+ /**
+ * Internal constant to use in annotations. Please use {@link Overflow#hidden}
+ */
+ public static final String STRING_HIDDEN = "hidden";
+
+ /**
+ * Internal constant to use in annotations. Please use {@link Overflow#scroll}
+ */
+ public static final String STRING_SCROLL = "scroll";
/**
* @deprecated Since Tobago 3.0.0 Please use {@link Overflow:name}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutRendererWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutRendererWrapper.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutRendererWrapper.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutRendererWrapper.java Wed Sep 16 09:17:36 2015
@@ -26,15 +26,7 @@ import javax.faces.context.FacesContext;
public abstract class AbstractLayoutRendererWrapper
- extends AbstractLayoutableRendererBaseWrapper implements LayoutRenderer, SpacingValues, MarginValues {
-
- public Measure getColumnSpacing(final FacesContext facesContext, final Configurable component) {
- return ((SpacingValues) getRenderer(facesContext)).getColumnSpacing(facesContext, component);
- }
-
- public Measure getRowSpacing(final FacesContext facesContext, final Configurable component) {
- return ((SpacingValues) getRenderer(facesContext)).getRowSpacing(facesContext, component);
- }
+ extends AbstractLayoutableRendererBaseWrapper implements LayoutRenderer, MarginValues {
public Measure getMarginLeft(final FacesContext facesContext, final Configurable component) {
return ((MarginValues) getRenderer(facesContext)).getMarginLeft(facesContext, component);
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutableRendererBaseWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutableRendererBaseWrapper.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutableRendererBaseWrapper.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutableRendererBaseWrapper.java Wed Sep 16 09:17:36 2015
@@ -28,10 +28,6 @@ import javax.faces.context.FacesContext;
public abstract class AbstractLayoutableRendererBaseWrapper extends AbstractRendererBaseWrapper
implements LayoutComponentRenderer {
- public Measure getCustomMeasure(final FacesContext facesContext, final Configurable component, final String name) {
- return ((LayoutComponentRenderer) getRenderer(facesContext)).getCustomMeasure(facesContext, component, name);
- }
-
public Measure getWidth(final FacesContext facesContext, final Configurable component) {
return ((LayoutComponentRenderer) getRenderer(facesContext)).getWidth(facesContext, component);
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/LayoutComponentRenderer.java Wed Sep 16 09:17:36 2015
@@ -26,8 +26,6 @@ import javax.faces.context.FacesContext;
public interface LayoutComponentRenderer {
- Measure getCustomMeasure(FacesContext facesContext, Configurable component, String name);
-
Measure getWidth(FacesContext facesContext, Configurable component);
Measure getHeight(FacesContext facesContext, Configurable component);
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=1703372&r1=1703371&r2=1703372&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 Wed Sep 16 09:17:36 2015
@@ -27,10 +27,6 @@ import javax.faces.context.FacesContext;
public abstract class LayoutComponentRendererBase extends RendererBase implements LayoutComponentRenderer {
- public Measure getCustomMeasure(final FacesContext facesContext, final Configurable component, final String name) {
- return getResourceManager().getThemeMeasure(facesContext, component, name);
- }
-
public Measure getWidth(final FacesContext facesContext, final Configurable component) {
return getResourceManager().getThemeMeasure(facesContext, component, Attributes.WIDTH);
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Style.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/Style.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Style.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Style.java Wed Sep 16 09:17:36 2015
@@ -19,96 +19,96 @@
package org.apache.myfaces.tobago.renderkit.css;
+import org.apache.myfaces.tobago.component.UIStyle;
import org.apache.myfaces.tobago.layout.Display;
-import org.apache.myfaces.tobago.layout.LayoutBase;
-import org.apache.myfaces.tobago.layout.LayoutComponent;
-import org.apache.myfaces.tobago.layout.LayoutContainer;
import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.layout.Overflow;
import org.apache.myfaces.tobago.layout.Position;
import org.apache.myfaces.tobago.layout.TextAlign;
-import javax.faces.context.FacesContext;
import java.io.Serializable;
+/**
+ * A subset of the CSS style used by Tobago. It's more or less the layout specific part.
+ */
public class Style implements Serializable {
-
- private static final long serialVersionUID = 4L;
+
+ private static final long serialVersionUID = 5L;
private Measure width;
private Measure height;
+
+ private Measure minWidth;
+ private Measure minHeight;
+ private Measure maxWidth;
+ private Measure maxHeight;
+
private Measure left;
+ private Measure right;
private Measure top;
- private Display display;
- private Position position;
- private Overflow overflowX;
- private Overflow overflowY;
- private Measure marginLeft;
- private Measure marginRight;
- private Measure marginTop;
- private Measure marginBottom;
- private Measure margin;
+ private Measure bottom;
+
private Measure paddingLeft;
private Measure paddingRight;
private Measure paddingTop;
private Measure paddingBottom;
- private Measure padding;
+
+ private Measure marginLeft;
+ private Measure marginRight;
+ private Measure marginTop;
+ private Measure marginBottom;
+
+ private Overflow overflowX;
+ private Overflow overflowY;
+ private Display display;
+ private Position position;
+
private String backgroundImage;
private String backgroundPosition;
- private Integer zIndex;
+ private Integer zIndex; // TBD
private TextAlign textAlign;
+ private Boolean empty;
+
public Style() {
}
- public Style(final Style map) {
- this.width = map.width;
- this.height = map.height;
- this.left = map.left;
- this.top = map.top;
- this.display = map.display;
- this.position = map.position;
- this.overflowX = map.overflowX;
- this.overflowY = map.overflowY;
- this.marginLeft = map.marginLeft;
- this.marginRight = map.marginRight;
- this.marginTop = map.marginTop;
- this.marginBottom = map.marginBottom;
- this.margin = map.margin;
- this.paddingLeft = map.paddingLeft;
- this.paddingRight = map.paddingRight;
- this.paddingTop = map.paddingTop;
- this.paddingBottom = map.paddingBottom;
- this.padding = map.padding;
- this.backgroundImage = map.backgroundImage;
- this.backgroundPosition = map.backgroundPosition;
- this.zIndex = map.zIndex;
- this.textAlign = map.textAlign;
- }
-
- public Style(final FacesContext facesContext, final LayoutBase layout) {
-
- final String rendererType = layout.getRendererType();
-
- width = layout.getCurrentWidth();
- height = layout.getCurrentHeight();
- left = layout.getLeft();
- top = layout.getTop();
-
- // if there are a position coordinates, activate absolute positioning
- // XXX String "Page" is not nice here
- if ((left != null || top != null) && !rendererType.contains("Page")) {
- position = Position.absolute;
- }
-
- if (layout instanceof LayoutComponent) { // fixme
- display = ((LayoutComponent) layout).getDisplay();
- }
-
- if (layout instanceof LayoutContainer) {
- overflowX = ((LayoutContainer) layout).isOverflowX() ? Overflow.auto : null;
- overflowY = ((LayoutContainer) layout).isOverflowY() ? Overflow.auto : null;
- }
+ public Style(final UIStyle style) {
+
+ width = style.getWidth();
+ height = style.getHeight();
+
+ minWidth = style.getMinWidth();
+ minHeight = style.getMinHeight();
+ maxWidth = style.getMaxWidth();
+ maxHeight = style.getMaxHeight();
+
+ left = style.getLeft();
+ right = style.getRight();
+ top = style.getTop();
+ bottom = style.getBottom();
+
+ paddingLeft = style.getPaddingLeft();
+ paddingRight = style.getPaddingRight();
+ paddingTop = style.getPaddingTop();
+ paddingBottom = style.getPaddingBottom();
+
+ marginLeft = style.getMarginLeft();
+ marginRight = style.getMarginRight();
+ marginTop = style.getMarginTop();
+ marginBottom = style.getMarginBottom();
+
+ overflowX = style.getOverflowX();
+ overflowY = style.getOverflowY();
+ display = style.getDisplay();
+ position = style.getPosition();
+
+ // tbd: backgroundImage from UIStyle?
+ // tbd: backgroundPosition from UIStyle?
+ // tbd: zIndex from UIStyle?
+ textAlign = style.getTextAlign();
+
+ checkEmptiness();
}
/**
@@ -120,6 +120,49 @@ public class Style implements Serializab
return backgroundImage != null;
}
+ public boolean isEmpty() {
+ if (empty == null) {
+ checkEmptiness();
+ }
+ return empty;
+ }
+
+ public void checkEmptiness() {
+ empty
+ = width == null
+ && height == null
+
+ && minWidth == null
+ && minHeight == null
+ && maxWidth == null
+ && maxHeight == null
+
+ && left == null
+ && right == null
+ && top == null
+ && bottom == null
+
+ && marginLeft == null
+ && marginRight == null
+ && marginTop == null
+ && marginBottom == null
+
+ && paddingLeft == null
+ && paddingRight == null
+ && paddingTop == null
+ && paddingBottom == null
+
+ && display == null
+ && position == null
+ && overflowX == null
+ && overflowY == null
+
+ && backgroundImage == null
+ && backgroundPosition == null
+ && zIndex == null
+ && textAlign == null;
+ }
+
public String encode() {
final StringBuilder buf = new StringBuilder();
if (width != null) {
@@ -132,9 +175,24 @@ public class Style implements Serializab
buf.append(height.serialize());
buf.append(';');
}
- if (top != null) {
- buf.append("top:");
- buf.append(top.serialize());
+ if (minWidth != null) {
+ buf.append("min-width:");
+ buf.append(minWidth.serialize());
+ buf.append(';');
+ }
+ if (minHeight != null) {
+ buf.append("min-height:");
+ buf.append(minHeight.serialize());
+ buf.append(';');
+ }
+ if (maxWidth != null) {
+ buf.append("max-width:");
+ buf.append(maxWidth.serialize());
+ buf.append(';');
+ }
+ if (maxHeight != null) {
+ buf.append("max-height:");
+ buf.append(maxHeight.serialize());
buf.append(';');
}
if (left != null) {
@@ -142,24 +200,39 @@ public class Style implements Serializab
buf.append(left.serialize());
buf.append(';');
}
- if (display != null) {
- buf.append("display:");
- buf.append(display.getValue());
+ if (right != null) {
+ buf.append("right:");
+ buf.append(right.serialize());
buf.append(';');
}
- if (position != null) {
- buf.append("position:");
- buf.append(position.getValue());
+ if (top != null) {
+ buf.append("top:");
+ buf.append(top.serialize());
buf.append(';');
}
- if (overflowX != null) {
- buf.append("overflow-x:");
- buf.append(overflowX.getValue());
+ if (bottom != null) {
+ buf.append("bottom:");
+ buf.append(bottom.serialize());
buf.append(';');
}
- if (overflowY != null) {
- buf.append("overflow-y:");
- buf.append(overflowY.getValue());
+ if (paddingLeft != null) {
+ buf.append("padding-left:");
+ buf.append(paddingLeft.serialize());
+ buf.append(';');
+ }
+ if (paddingRight != null) {
+ buf.append("padding-right:");
+ buf.append(paddingRight.serialize());
+ buf.append(';');
+ }
+ if (paddingTop != null) {
+ buf.append("padding-top:");
+ buf.append(paddingTop.serialize());
+ buf.append(';');
+ }
+ if (paddingBottom != null) {
+ buf.append("padding-bottom:");
+ buf.append(paddingBottom.serialize());
buf.append(';');
}
if (marginLeft != null) {
@@ -182,34 +255,24 @@ public class Style implements Serializab
buf.append(marginBottom.serialize());
buf.append(';');
}
- if (margin != null) {
- buf.append("margin:");
- buf.append(margin.serialize());
- buf.append(';');
- }
- if (paddingLeft != null) {
- buf.append("padding-left:");
- buf.append(paddingLeft.serialize());
- buf.append(';');
- }
- if (paddingRight != null) {
- buf.append("padding-right:");
- buf.append(paddingRight.serialize());
+ if (overflowX != null) {
+ buf.append("overflow-x:");
+ buf.append(overflowX.getValue());
buf.append(';');
}
- if (paddingTop != null) {
- buf.append("padding-top:");
- buf.append(paddingTop.serialize());
+ if (overflowY != null) {
+ buf.append("overflow-y:");
+ buf.append(overflowY.getValue());
buf.append(';');
}
- if (paddingBottom != null) {
- buf.append("padding-bottom:");
- buf.append(paddingBottom.serialize());
+ if (display != null) {
+ buf.append("display:");
+ buf.append(display.getValue());
buf.append(';');
}
- if (padding != null) {
- buf.append("padding:");
- buf.append(padding.serialize());
+ if (position != null) {
+ buf.append("position:");
+ buf.append(position.getValue());
buf.append(';');
}
if (backgroundImage != null) {
@@ -248,9 +311,24 @@ public class Style implements Serializab
buf.append(height.serialize());
buf.append("\",");
}
- if (top != null) {
- buf.append("\"top\":\"");
- buf.append(top.serialize());
+ if (minWidth != null) {
+ buf.append("\"minWidth\":\"");
+ buf.append(minWidth.serialize());
+ buf.append("\",");
+ }
+ if (minHeight != null) {
+ buf.append("\"minHeight\":\"");
+ buf.append(minHeight.serialize());
+ buf.append("\",");
+ }
+ if (maxWidth != null) {
+ buf.append("\"maxWidth\":\"");
+ buf.append(maxWidth.serialize());
+ buf.append("\",");
+ }
+ if (maxHeight != null) {
+ buf.append("\"maxHeight\":\"");
+ buf.append(maxHeight.serialize());
buf.append("\",");
}
if (left != null) {
@@ -258,24 +336,39 @@ public class Style implements Serializab
buf.append(left.serialize());
buf.append("\",");
}
- if (display != null) {
- buf.append("\"display\":\"");
- buf.append(display.getValue());
+ if (right != null) {
+ buf.append("\"right\":\"");
+ buf.append(right.serialize());
buf.append("\",");
}
- if (position != null) {
- buf.append("\"position\":\"");
- buf.append(position.getValue());
+ if (top != null) {
+ buf.append("\"top\":\"");
+ buf.append(top.serialize());
buf.append("\",");
}
- if (overflowX != null) {
- buf.append("\"overflowX\":\"");
- buf.append(overflowX.getValue());
+ if (bottom != null) {
+ buf.append("\"bottom\":\"");
+ buf.append(bottom.serialize());
buf.append("\",");
}
- if (overflowY != null) {
- buf.append("\"overflowY\":\"");
- buf.append(overflowY.getValue());
+ if (paddingLeft != null) {
+ buf.append("\"paddingLeft\":\"");
+ buf.append(paddingLeft.serialize());
+ buf.append("\",");
+ }
+ if (paddingRight != null) {
+ buf.append("\"paddingRight\":\"");
+ buf.append(paddingRight.serialize());
+ buf.append("\",");
+ }
+ if (paddingTop != null) {
+ buf.append("\"paddingTop\":\"");
+ buf.append(paddingTop.serialize());
+ buf.append("\",");
+ }
+ if (paddingBottom != null) {
+ buf.append("\"paddingBottom\":\"");
+ buf.append(paddingBottom.serialize());
buf.append("\",");
}
if (marginLeft != null) {
@@ -298,34 +391,24 @@ public class Style implements Serializab
buf.append(marginBottom.serialize());
buf.append("\",");
}
- if (margin != null) {
- buf.append("\"margin\":\"");
- buf.append(margin.serialize());
- buf.append("\",");
- }
- if (paddingLeft != null) {
- buf.append("\"paddingLeft\":\"");
- buf.append(paddingLeft.serialize());
- buf.append("\",");
- }
- if (paddingRight != null) {
- buf.append("\"paddingRight\":\"");
- buf.append(paddingRight.serialize());
+ if (overflowX != null) {
+ buf.append("\"overflowX\":\"");
+ buf.append(overflowX.getValue());
buf.append("\",");
}
- if (paddingTop != null) {
- buf.append("\"paddingTop\":\"");
- buf.append(paddingTop.serialize());
+ if (overflowY != null) {
+ buf.append("\"overflowY\":\"");
+ buf.append(overflowY.getValue());
buf.append("\",");
}
- if (paddingBottom != null) {
- buf.append("\"paddingBottom\":\"");
- buf.append(paddingBottom.serialize());
+ if (display != null) {
+ buf.append("\"display\":\"");
+ buf.append(display.getValue());
buf.append("\",");
}
- if (padding != null) {
- buf.append("\"padding\":\"");
- buf.append(padding.serialize());
+ if (position != null) {
+ buf.append("\"position\":\"");
+ buf.append(position.getValue());
buf.append("\",");
}
if (backgroundImage != null) {
@@ -341,7 +424,7 @@ public class Style implements Serializab
if (zIndex != null) {
buf.append("\"zIndex\":");
buf.append(zIndex);
- buf.append(";");
+ buf.append(",");
}
if (textAlign != null) {
buf.append("\"textAlign\":\"");
@@ -362,6 +445,7 @@ public class Style implements Serializab
}
public void setWidth(final Measure width) {
+ empty = null;
this.width = width;
}
@@ -370,30 +454,88 @@ public class Style implements Serializab
}
public void setHeight(final Measure height) {
+ empty = null;
this.height = height;
}
+ public Measure getMinWidth() {
+ return minWidth;
+ }
+
+ public void setMinWidth(Measure minWidth) {
+ empty = null;
+ this.minWidth = minWidth;
+ }
+
+ public Measure getMinHeight() {
+ return minHeight;
+ }
+
+ public void setMinHeight(Measure minHeight) {
+ empty = null;
+ this.minHeight = minHeight;
+ }
+
+ public Measure getMaxWidth() {
+ return maxWidth;
+ }
+
+ public void setMaxWidth(Measure maxWidth) {
+ empty = null;
+ this.maxWidth = maxWidth;
+ }
+
+ public Measure getMaxHeight() {
+ return maxHeight;
+ }
+
+ public void setMaxHeight(Measure maxHeight) {
+ empty = null;
+ this.maxHeight = maxHeight;
+ }
+
public Measure getLeft() {
return left;
}
public void setLeft(final Measure left) {
+ empty = null;
this.left = left;
}
+ public Measure getRight() {
+ return right;
+ }
+
+ public void setRight(Measure right) {
+ empty = null;
+ this.right = right;
+ }
+
public Measure getTop() {
return top;
}
public void setTop(final Measure top) {
+ empty = null;
this.top = top;
}
+ public Measure getBottom() {
+ return bottom;
+ }
+
+ public void setBottom(Measure bottom) {
+ empty = null;
+ this.bottom = bottom;
+ }
+
public Display getDisplay() {
return display;
}
public void setDisplay(final Display display) {
+ empty = null;
this.display = display;
}
@@ -402,6 +544,7 @@ public class Style implements Serializab
}
public void setPosition(final Position position) {
+ empty = null;
this.position = position;
}
@@ -410,6 +553,7 @@ public class Style implements Serializab
}
public void setOverflowX(final Overflow overflowX) {
+ empty = null;
this.overflowX = overflowX;
}
@@ -418,6 +562,7 @@ public class Style implements Serializab
}
public void setOverflowY(final Overflow overflowY) {
+ empty = null;
this.overflowY = overflowY;
}
@@ -426,6 +571,7 @@ public class Style implements Serializab
}
public void setMarginLeft(final Measure marginLeft) {
+ empty = null;
this.marginLeft = marginLeft;
}
@@ -434,6 +580,7 @@ public class Style implements Serializab
}
public void setMarginRight(final Measure marginRight) {
+ empty = null;
this.marginRight = marginRight;
}
@@ -442,6 +589,7 @@ public class Style implements Serializab
}
public void setMarginTop(final Measure marginTop) {
+ empty = null;
this.marginTop = marginTop;
}
@@ -450,22 +598,16 @@ public class Style implements Serializab
}
public void setMarginBottom(final Measure marginBottom) {
+ empty = null;
this.marginBottom = marginBottom;
}
- public Measure getMargin() {
- return margin;
- }
-
- public void setMargin(final Measure margin) {
- this.margin = margin;
- }
-
public Measure getPaddingLeft() {
return paddingLeft;
}
public void setPaddingLeft(final Measure paddingLeft) {
+ empty = null;
this.paddingLeft = paddingLeft;
}
@@ -474,6 +616,7 @@ public class Style implements Serializab
}
public void setPaddingRight(final Measure paddingRight) {
+ empty = null;
this.paddingRight = paddingRight;
}
@@ -482,6 +625,7 @@ public class Style implements Serializab
}
public void setPaddingTop(final Measure paddingTop) {
+ empty = null;
this.paddingTop = paddingTop;
}
@@ -490,22 +634,15 @@ public class Style implements Serializab
}
public void setPaddingBottom(final Measure paddingBottom) {
+ empty = null;
this.paddingBottom = paddingBottom;
}
- public Measure getPadding() {
- return padding;
- }
-
- public void setPadding(final Measure padding) {
- this.padding = padding;
- }
-
public String getBackgroundImage() {
return backgroundImage;
}
- public void setBackgroundImage(final String backgroundImage) {
+ public void setBackgroundImage(String backgroundImage) {
this.backgroundImage = backgroundImage;
}
@@ -522,6 +659,7 @@ public class Style implements Serializab
}
public void setZIndex(final Integer zIndex) {
+ empty = null;
this.zIndex = zIndex;
}
@@ -530,6 +668,7 @@ public class Style implements Serializab
}
public void setTextAlign(final TextAlign textAlign) {
+ empty = null;
this.textAlign = textAlign;
}
}
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/StyleUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/StyleUnitTest.java?rev=1703372&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/StyleUnitTest.java (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/StyleUnitTest.java Wed Sep 16 09:17:36 2015
@@ -0,0 +1,99 @@
+/*
+ * 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.layout.Display;
+import org.apache.myfaces.tobago.layout.Measure;
+import org.apache.myfaces.tobago.layout.Overflow;
+import org.apache.myfaces.tobago.layout.Position;
+import org.apache.myfaces.tobago.layout.TextAlign;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class StyleUnitTest {
+
+ @Test
+ public void testEncodedEmpty() {
+ Style style = new Style();
+ Assert.assertEquals("Check encoder", "", style.encode());
+ Assert.assertEquals("Check encoder JSON", "{}", style.encodeJson());
+ }
+
+ @Test
+ public void testEncodedFull() {
+ Style style = new Style();
+
+ style.setWidth(Measure.valueOf(110));
+ style.setHeight(Measure.valueOf(220));
+
+ style.setMinWidth(Measure.valueOf(100));
+ style.setMinHeight(Measure.valueOf(200));
+ style.setMaxWidth(Measure.valueOf(111));
+ style.setMaxHeight(Measure.valueOf(222));
+
+ style.setLeft(Measure.valueOf(44));
+ style.setRight(Measure.valueOf(55));
+ style.setTop(Measure.valueOf(66));
+ style.setBottom(Measure.valueOf(77));
+
+ style.setPaddingLeft(Measure.valueOf(333));
+ style.setPaddingRight(Measure.valueOf(444));
+ style.setPaddingTop(Measure.valueOf(555));
+ style.setPaddingBottom(Measure.valueOf(666));
+
+ style.setMarginLeft(Measure.valueOf(3333));
+ style.setMarginRight(Measure.valueOf(4444));
+ style.setMarginTop(Measure.valueOf(5555));
+ style.setMarginBottom(Measure.valueOf(6666));
+
+ style.setOverflowX(Overflow.auto);
+ style.setOverflowX(Overflow.scroll);
+ style.setDisplay(Display.block);
+ style.setPosition(Position.absolute);
+
+ style.setBackgroundImage("url('icon.pgn')");
+ style.setBackgroundPosition("center");
+ style.setZIndex(2);
+ style.setTextAlign(TextAlign.justify);
+
+ final String encoded = style.encode();
+ final String json = style.encodeJson();
+
+ final String manually = ("{\"" + encoded
+ .replaceAll(":", "\":\"")
+ .replaceAll(";", "\",\"")
+ .replaceAll("-h", "H")
+ .replaceAll("-w", "W")
+ .replaceAll("-l", "L")
+ .replaceAll("-r", "R")
+ .replaceAll("-t", "T")
+ .replaceAll("-b", "B")
+ .replaceAll("-x", "X")
+ .replaceAll("-y", "Y")
+ .replaceAll("-i", "I")
+ .replaceAll("-a", "A")
+ .replaceAll("-p", "P")
+ .replaceAll("\"2\"", "2")
+ + "\"}")
+ .replaceAll(",\"\"}", "}");
+
+ Assert.assertEquals("Check different encoders", manually, json);
+ }
+}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/02/container.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/02/container.xhtml?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/02/container.xhtml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/02/container.xhtml Wed Sep 16 09:17:36 2015
@@ -21,17 +21,12 @@
xmlns:tc="http://myfaces.apache.org/tobago/component"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core">
- <tc:panel>
- <f:facet name="layout">
- <tc:gridLayout columns="400px;*" rows="200px;*"/>
- </f:facet>
- <!-- code-sniplet-start id="box" -->
- <tc:box label="Box Headline">
+ <ui:param name="title" value="Container"/>
+
+ <tc:segmentLayout medium="6;6">
+ <tc:box label="Box (height=200px)">
+ <tc:style height="200px"/>
</tc:box>
- <!-- code-sniplet-end id="box" -->
- <tc:panel/>
- <tc:panel>
- <tc:gridLayoutConstraint columnSpan="2"/>
- </tc:panel>
- </tc:panel>
+ <tc:box label="Box (no height set)"/>
+ </tc:segmentLayout>
</ui:composition>
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/03/separator.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/03/separator.xhtml?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/03/separator.xhtml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/03/separator.xhtml Wed Sep 16 09:17:36 2015
@@ -21,8 +21,9 @@
xmlns:tc="http://myfaces.apache.org/tobago/component"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core">
+ <ui:param name="title" value="Separator"/>
- <tc:box label="Separator">
+ <tc:panel>
<f:facet name="layout">
<tc:gridLayout columns="1*;1*" rows="auto;*"/>
</f:facet>
@@ -58,5 +59,5 @@
<tc:textarea/>
</tc:panel>
- </tc:box>
+ </tc:panel>
</ui:composition>
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/06-validation/validation.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/06-validation/validation.xhtml?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/06-validation/validation.xhtml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/06-validation/validation.xhtml Wed Sep 16 09:17:36 2015
@@ -49,7 +49,8 @@
<tc:textarea label="#{overviewBundle.validation_description}" required="true" value="#{validationBean.text}"/>
- <tc:flowLayout textAlign="right">
+ <tc:flowLayout>
+ <tc:style textAlign="right"/>
<tc:button action="#{overviewController.noop}" label="#{overviewBundle.validation_submit}"
defaultCommand="true"/>
</tc:flowLayout>
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml Wed Sep 16 09:17:36 2015
@@ -82,7 +82,8 @@
</tc:form>
<tc:form>
- <tc:flowLayout textAlign="right">
+ <tc:flowLayout>
+ <tc:style textAlign="right"/>
<tc:in placeholder="Search"/>
<tc:button defaultCommand="true" omit="true" label="go">
<tc:dataAttribute name="alert-text"
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/image/tobago_head.png
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/image/tobago_head.png?rev=1703372&view=auto
==============================================================================
Binary file - no diff available.
Propchange: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/image/tobago_head.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/flowLayout/flowLayout-textAlign.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/flowLayout/flowLayout-textAlign.xhtml?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/flowLayout/flowLayout-textAlign.xhtml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/flowLayout/flowLayout-textAlign.xhtml Wed Sep 16 09:17:36 2015
@@ -28,7 +28,8 @@
<tc:gridLayout rows="20px;auto;20px;auto;20px;auto;60px;"/>
</f:facet>
- <tc:flowLayout textAlign="left">
+ <tc:flowLayout>
+ <tc:style textAlign="left"/>
<tc:out id="left" value="left">
<tc:dataAttribute name="assert-left" value="0"/>
<tc:dataAttribute name="assert-top" value="0"/>
@@ -40,7 +41,8 @@
<tc:separator/>
- <tc:flowLayout textAlign="right">
+ <tc:flowLayout>
+ <tc:style textAlign="right"/>
<tc:out id="right" value="right">
<tc:dataAttribute name="assert-left" value="577"/>
<tc:dataAttribute name="assert-top" value="31"/>
@@ -52,7 +54,8 @@
<tc:separator/>
- <tc:flowLayout textAlign="center">
+ <tc:flowLayout>
+ <tc:style textAlign="center"/>
<tc:out id="center" value="center">
<tc:dataAttribute name="assert-left" value="283"/>
<tc:dataAttribute name="assert-top" value="62"/>
@@ -64,7 +67,8 @@
<tc:separator/>
- <tc:flowLayout textAlign="justify">
+ <tc:flowLayout>
+ <tc:style textAlign="justify"/>
1_XXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXX
2_XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX
3_XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
@@ -78,7 +82,7 @@
4_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
</tc:flowLayout>
- <tc:script file="script/tobago-assert.js"/>
+ <!--<tc:script file="script/tobago-assert.js"/>-->
</tc:page>
</f:view>
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUINumberSlider.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUINumberSlider.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUINumberSlider.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUINumberSlider.java Wed Sep 16 09:17:36 2015
@@ -19,13 +19,15 @@
package org.apache.myfaces.tobago.internal.component;
+import org.apache.myfaces.tobago.component.SupportsStyle;
import org.apache.myfaces.tobago.layout.LayoutComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.LongRangeValidator;
import javax.faces.validator.ValidatorException;
-public abstract class AbstractUINumberSlider extends javax.faces.component.UIInput implements LayoutComponent {
+public abstract class AbstractUINumberSlider extends javax.faces.component.UIInput
+ implements LayoutComponent, SupportsStyle {
public abstract Integer getMin();
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISplitLayout.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISplitLayout.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISplitLayout.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISplitLayout.java Wed Sep 16 09:17:36 2015
@@ -126,20 +126,9 @@ public abstract class AbstractUISplitLay
public abstract Orientation getOrientation();
- @Deprecated
- public abstract Measure getCellspacing();
-
public abstract Measure getRowSpacing();
public abstract Measure getColumnSpacing();
- public abstract Measure getMarginLeft();
-
- public abstract Measure getMarginTop();
-
- public abstract Measure getMarginRight();
-
- public abstract Measure getMarginBottom();
-
public abstract boolean isRigid();
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/taglib/sandbox/NumberSliderTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/taglib/sandbox/NumberSliderTagDeclaration.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/taglib/sandbox/NumberSliderTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/taglib/sandbox/NumberSliderTagDeclaration.java Wed Sep 16 09:17:36 2015
@@ -26,6 +26,7 @@ import org.apache.myfaces.tobago.apt.ann
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.HasMarkup;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasStyle;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasValue;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasValueChangeListener;
import org.apache.myfaces.tobago.internal.taglib.declaration.IsDisabled;
@@ -46,7 +47,7 @@ import javax.faces.component.UIInput;
rendererType = "NumberSlider")
public interface NumberSliderTagDeclaration
extends HasIdBindingAndRendered, IsReadonly, IsDisabled, HasMarkup, HasCurrentMarkup,
- HasValue, HasValueChangeListener, IsGridLayoutComponent {
+ HasValue, HasValueChangeListener, IsGridLayoutComponent, HasStyle {
/**
* The minimum integer that can be entered and which represents the left
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/taglib/sandbox/SplitLayoutTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/taglib/sandbox/SplitLayoutTagDeclaration.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/taglib/sandbox/SplitLayoutTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/taglib/sandbox/SplitLayoutTagDeclaration.java Wed Sep 16 09:17:36 2015
@@ -28,8 +28,6 @@ import org.apache.myfaces.tobago.interna
import org.apache.myfaces.tobago.internal.taglib.declaration.HasBorder;
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.HasMargin;
-import org.apache.myfaces.tobago.internal.taglib.declaration.HasMargins;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasSpacing;
import org.apache.myfaces.tobago.layout.Orientation;
@@ -47,8 +45,8 @@ import org.apache.myfaces.tobago.layout.
componentFamily = AbstractUIGridLayout.COMPONENT_FAMILY,
rendererType = "SplitLayout",
allowedChildComponenents = "NONE", isLayout = true)
-public interface SplitLayoutTagDeclaration extends HasId, HasBorder, HasSpacing, HasMargin,
- HasMargins, HasBinding, HasMarkup, HasCurrentMarkup {
+public interface SplitLayoutTagDeclaration
+ extends HasId, HasBorder, HasSpacing, HasBinding, HasMarkup, HasCurrentMarkup {
/**
* This value defines the layout constraints for the layout.
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/tag/NumberSliderRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/tag/NumberSliderRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/tag/NumberSliderRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/tag/NumberSliderRenderer.java Wed Sep 16 09:17:36 2015
@@ -65,29 +65,29 @@ public class NumberSliderRenderer extend
final Integer max = ComponentUtils.getIntAttribute(slider, "max");
final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
- final Style style = new Style(facesContext, slider);
- final int width = -1;
- int sliderWidthPerc
- = getResourceManager().getThemeMeasure(facesContext, slider, SLIDER_WIDTH_PERCENT).getPixel();
- if (sliderWidthPerc <= 25) {
- sliderWidthPerc = 25;
- }
- if (sliderWidthPerc >= 75) {
- sliderWidthPerc = 75;
- }
- int sliderWidth = 100; // fixme
- int inputWidth = 50; // fixme;
- if (style.getWidth() != null && style.getWidth().getPixel() >= 0) {
- sliderWidth = (width * sliderWidthPerc) / 100;
- inputWidth = (width * (100 - sliderWidthPerc)) / 100;
- }
+// final Style style = slider.getStyle();
+// final int width = -1;
+// int sliderWidthPerc
+// = getResourceManager().getThemeMeasure(facesContext, slider, SLIDER_WIDTH_PERCENT).getPixel();
+// if (sliderWidthPerc <= 25) {
+// sliderWidthPerc = 25;
+// }
+// if (sliderWidthPerc >= 75) {
+// sliderWidthPerc = 75;
+// }
+// int sliderWidth = 100; // fixme
+// int inputWidth = 50; // fixme;
+// if (style.getWidth() != null && style.getWidth().getPixel() >= 0) {
+// sliderWidth = (width * sliderWidthPerc) / 100;
+// inputWidth = (width * (100 - sliderWidthPerc)) / 100;
+// }
writer.startElement(HtmlElements.TABLE, slider);
writer.writeAttribute(HtmlAttributes.ROLE, HtmlRoleValues.PRESENTATION.toString(), false);
writer.writeIdAttribute(id);
writer.writeClassAttribute(Classes.create(slider));
HtmlRendererUtils.writeDataAttributes(facesContext, writer, slider);
- writer.writeStyleAttribute(style);
+ writer.writeStyleAttribute(slider.getStyle());
//writer.writeAttribute(HtmlAttributes.BORDER,"1",false);
writer.startElement(HtmlElements.TR, null);
@@ -95,7 +95,7 @@ public class NumberSliderRenderer extend
writer.writeClassAttribute(Classes.create(slider, "min"));
final Style widthStyle = new Style();
- widthStyle.setWidth(Measure.valueOf(sliderWidth / 2));
+// widthStyle.setWidth(Measure.valueOf(sliderWidth / 2));
writer.writeStyleAttribute(widthStyle);
writer.startElement(HtmlElements.SPAN, null);
writer.writeClassAttribute(Classes.create(slider, "min"));
@@ -119,7 +119,7 @@ public class NumberSliderRenderer extend
writer.startElement(HtmlElements.INPUT, null);
writer.writeClassAttribute(Classes.create(slider, "input"));
- widthStyle.setWidth(Measure.valueOf(inputWidth));
+// widthStyle.setWidth(Measure.valueOf(inputWidth));
writer.writeStyleAttribute(widthStyle);
final String inputIdAndName = getIdForInputField(facesContext, slider);
writer.writeNameAttribute(inputIdAndName);
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SplitLayoutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SplitLayoutRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SplitLayoutRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SplitLayoutRenderer.java Wed Sep 16 09:17:36 2015
@@ -19,27 +19,26 @@
package org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag;
-import org.apache.myfaces.tobago.internal.layout.LayoutUtils;
-import org.apache.myfaces.tobago.layout.Orientation;
-import org.apache.myfaces.tobago.renderkit.html.standard.standard.tag.GridLayoutRenderer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import org.apache.myfaces.tobago.internal.component.AbstractUISplitLayout;
+import org.apache.myfaces.tobago.internal.layout.LayoutUtils;
import org.apache.myfaces.tobago.layout.Display;
import org.apache.myfaces.tobago.layout.LayoutComponent;
import org.apache.myfaces.tobago.layout.LayoutContainer;
import org.apache.myfaces.tobago.layout.Measure;
-import org.apache.myfaces.tobago.renderkit.css.Classes;
+import org.apache.myfaces.tobago.layout.Orientation;
import org.apache.myfaces.tobago.layout.Position;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.HtmlInputTypes;
+import org.apache.myfaces.tobago.renderkit.html.standard.standard.tag.GridLayoutRenderer;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/BoxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/BoxRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/BoxRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/BoxRenderer.java Wed Sep 16 09:17:36 2015
@@ -77,6 +77,7 @@ public class BoxRenderer extends BoxRend
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
}
HtmlRendererUtils.writeDataAttributes(facesContext, writer, box);
+ writer.writeStyleAttribute(box.getStyle());
if (label != null || labelString != null || toolbar != null) {
writer.startElement(HtmlElements.DIV, box);
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/BoxRendererOld.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/BoxRendererOld.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/BoxRendererOld.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/BoxRendererOld.java Wed Sep 16 09:17:36 2015
@@ -23,10 +23,8 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.component.RendererTypes;
import org.apache.myfaces.tobago.component.UIBox;
import org.apache.myfaces.tobago.component.UIMenuBar;
-import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.renderkit.BoxRendererBase;
import org.apache.myfaces.tobago.renderkit.css.Classes;
-import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
@@ -52,13 +50,6 @@ public class BoxRendererOld extends BoxR
final UIComponent label = box.getFacet(Facets.LABEL);
final String labelString = box.getLabel();
final UIPanel toolbar = (UIPanel) box.getFacet(Facets.TOOL_BAR);
- final Style style = new Style(facesContext, box);
- if (toolbar != null) {
- final Measure padding = getResourceManager().getThemeMeasure(facesContext, box, "paddingTopWhenToolbar");
- style.setPaddingTop(padding);
- style.setPaddingBottom(Measure.ZERO);
- }
-
writer.startElement(HtmlElements.FIELDSET, box);
writer.writeClassAttribute(Classes.create(box));
final String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, box);
@@ -66,7 +57,6 @@ public class BoxRendererOld extends BoxR
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
}
HtmlRendererUtils.writeDataAttributes(facesContext, writer, box);
- writer.writeStyleAttribute(style);
if (label != null || labelString != null || toolbar != null) {
writer.startElement(HtmlElements.LEGEND, box);
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ButtonRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ButtonRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ButtonRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ButtonRenderer.java Wed Sep 16 09:17:36 2015
@@ -29,7 +29,6 @@ import org.apache.myfaces.tobago.interna
import org.apache.myfaces.tobago.renderkit.CommandRendererBase;
import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
import org.apache.myfaces.tobago.renderkit.css.Classes;
-import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.Command;
import org.apache.myfaces.tobago.renderkit.html.CommandMap;
import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
@@ -112,8 +111,7 @@ public class ButtonRenderer extends Comm
}
}
- final Style style = new Style(facesContext, button);
- writer.writeStyleAttribute(style);
+ writer.writeStyleAttribute(button.getStyle());
writer.writeClassAttribute(Classes.create(button));
if (button instanceof UIButton && ((UIButton) component).isDefaultCommand()) {
final AbstractUIForm form = ComponentUtils.findAncestor(component, AbstractUIForm.class);
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CalendarRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CalendarRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CalendarRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CalendarRenderer.java Wed Sep 16 09:17:36 2015
@@ -72,7 +72,7 @@ public class CalendarRenderer extends La
writer.writeIdAttribute(id);
writer.writeClassAttribute(Classes.create(output));
HtmlRendererUtils.writeDataAttributes(facesContext, writer, component);
- final Style style = new Style(facesContext, output);
+ final Style style = output.getStyle();
writer.writeStyleAttribute(style);
final String dateInputId = (String) output.getAttributes().get(Attributes.DATE_INPUT_ID);
if (dateInputId != null) {
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CommandRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CommandRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CommandRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CommandRenderer.java Wed Sep 16 09:17:36 2015
@@ -26,7 +26,6 @@ import org.apache.myfaces.tobago.interna
import org.apache.myfaces.tobago.renderkit.CommandRendererBase;
import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
import org.apache.myfaces.tobago.renderkit.css.Classes;
-import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.BootstrapClass;
import org.apache.myfaces.tobago.renderkit.html.Command;
import org.apache.myfaces.tobago.renderkit.html.CommandMap;
@@ -88,8 +87,7 @@ public class CommandRenderer extends Com
}
}
HtmlRendererUtils.writeDataAttributes(facesContext, writer, link);
- final Style style = new Style(facesContext, link);
- writer.writeStyleAttribute(style);
+ writer.writeStyleAttribute(link.getStyle());
if (link.isParentOfCommands()) {
writer.writeClassAttribute(BootstrapClass.DROPDOWN_TOGGLE); // todo: CSS classes
writer.writeAttribute(DataAttributes.TOGGLE, "dropdown", false);
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FileRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FileRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FileRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FileRenderer.java Wed Sep 16 09:17:36 2015
@@ -24,7 +24,6 @@ import org.apache.myfaces.tobago.interna
import org.apache.myfaces.tobago.internal.util.FacesContextUtils;
import org.apache.myfaces.tobago.internal.webapp.TobagoMultipartFormdataRequest;
import org.apache.myfaces.tobago.renderkit.css.Classes;
-import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.HtmlInputTypes;
@@ -95,7 +94,6 @@ public class FileRenderer extends InputR
final AbstractUIFile file = (AbstractUIFile) component;
final String clientId = file.getClientId(facesContext);
- final Style style = new Style(facesContext, file);
final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
@@ -103,7 +101,7 @@ public class FileRenderer extends InputR
writer.writeIdAttribute(clientId);
writer.writeClassAttribute(Classes.create(file));
HtmlRendererUtils.writeDataAttributes(facesContext, writer, file);
- writer.writeStyleAttribute(style);
+ writer.writeStyleAttribute(file.getStyle());
// visible fake input for a pretty look
writer.startElement(HtmlElements.DIV, file);
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FlowLayoutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FlowLayoutRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FlowLayoutRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FlowLayoutRenderer.java Wed Sep 16 09:17:36 2015
@@ -19,16 +19,10 @@
package org.apache.myfaces.tobago.renderkit.html.standard.standard.tag;
-import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UIFlowLayout;
-import org.apache.myfaces.tobago.config.Configurable;
import org.apache.myfaces.tobago.layout.LayoutContainer;
-import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.renderkit.RendererBase;
-import org.apache.myfaces.tobago.renderkit.SpacingValues;
import org.apache.myfaces.tobago.renderkit.css.Classes;
-import org.apache.myfaces.tobago.renderkit.css.Style;
-import org.apache.myfaces.tobago.renderkit.html.BootstrapClass;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
@@ -38,20 +32,15 @@ import javax.faces.component.UIComponent
import javax.faces.context.FacesContext;
import java.io.IOException;
-public class FlowLayoutRenderer extends RendererBase implements SpacingValues {
+public class FlowLayoutRenderer extends RendererBase {
@Override
public void encodeBegin(final FacesContext facesContext, final UIComponent component) throws IOException {
final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
final UIFlowLayout layout = (UIFlowLayout) component;
writer.startElement(HtmlElements.DIV, layout);
- writer.writeClassAttribute(Classes.create(layout), BootstrapClass.textAlign(layout.getTextAlign()));
- final Style style = new Style();
- style.setMarginLeft(layout.getMarginLeft());
- style.setMarginRight(layout.getMarginRight());
- style.setMarginTop(layout.getMarginTop());
- style.setMarginBottom(layout.getMarginBottom());
- writer.writeStyleAttribute(style);
+ writer.writeClassAttribute(Classes.create(layout));
+ writer.writeStyleAttribute(layout.getStyle());
}
@Override
@@ -68,12 +57,4 @@ public class FlowLayoutRenderer extends
final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
writer.endElement(HtmlElements.DIV);
}
-
- public Measure getColumnSpacing(final FacesContext facesContext, final Configurable component) {
- return getResourceManager().getThemeMeasure(facesContext, component, Attributes.COLUMN_SPACING);
- }
-
- public Measure getRowSpacing(final FacesContext facesContext, final Configurable component) {
- return getResourceManager().getThemeMeasure(facesContext, component, Attributes.ROW_SPACING);
- }
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/GridLayoutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/GridLayoutRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/GridLayoutRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/GridLayoutRenderer.java Wed Sep 16 09:17:36 2015
@@ -33,7 +33,6 @@ import org.apache.myfaces.tobago.layout.
import org.apache.myfaces.tobago.layout.RelativeLayoutToken;
import org.apache.myfaces.tobago.renderkit.MarginValues;
import org.apache.myfaces.tobago.renderkit.RendererBase;
-import org.apache.myfaces.tobago.renderkit.SpacingValues;
import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -49,7 +48,7 @@ import javax.faces.component.UIComponent
import javax.faces.context.FacesContext;
import java.io.IOException;
-public class GridLayoutRenderer extends RendererBase implements SpacingValues, MarginValues {
+public class GridLayoutRenderer extends RendererBase implements MarginValues {
private static final Logger LOG = LoggerFactory.getLogger(GridLayoutRenderer.class);
@@ -188,14 +187,6 @@ public class GridLayoutRenderer extends
// writer.endElement(HtmlElements.DIV);
}
- public Measure getColumnSpacing(final FacesContext facesContext, final Configurable component) {
- return getResourceManager().getThemeMeasure(facesContext, component, Attributes.COLUMN_SPACING);
- }
-
- public Measure getRowSpacing(final FacesContext facesContext, final Configurable component) {
- return getResourceManager().getThemeMeasure(facesContext, component, Attributes.ROW_SPACING);
- }
-
public Measure getMarginLeft(final FacesContext facesContext, final Configurable component) {
return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_LEFT);
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/InRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/InRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/InRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/InRenderer.java Wed Sep 16 09:17:36 2015
@@ -24,7 +24,6 @@ import org.apache.myfaces.tobago.interna
import org.apache.myfaces.tobago.internal.util.FacesContextUtils;
import org.apache.myfaces.tobago.internal.util.StringUtils;
import org.apache.myfaces.tobago.renderkit.css.Classes;
-import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.BootstrapClass;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -107,8 +106,7 @@ public class InRenderer extends InputRen
if (tabIndex != null) {
writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
}
- final Style style = new Style(facesContext, input);
- writer.writeStyleAttribute(style);
+ writer.writeStyleAttribute(input.getStyle());
final String placeholder = input.getPlaceholder();
if (!disabled && !readonly && StringUtils.isNotBlank(placeholder)) {
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/LabelRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/LabelRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/LabelRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/LabelRenderer.java Wed Sep 16 09:17:36 2015
@@ -26,7 +26,6 @@ import org.apache.myfaces.tobago.interna
import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
import org.apache.myfaces.tobago.renderkit.css.Classes;
-import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
@@ -75,7 +74,7 @@ public class LabelRenderer extends Layou
HtmlRendererUtils.writeDataAttributes(facesContext, writer, label);
final Classes classes = Classes.create(label);
writer.writeClassAttribute(classes);
- writer.writeStyleAttribute(new Style(facesContext, label));
+ writer.writeStyleAttribute(label.getStyle());
writer.writeIdAttribute(clientId);
if (forValue != null) {
writer.writeAttribute(HtmlAttributes.FOR, forValue, false);
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/LinkRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/LinkRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/LinkRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/LinkRenderer.java Wed Sep 16 09:17:36 2015
@@ -27,7 +27,6 @@ import org.apache.myfaces.tobago.layout.
import org.apache.myfaces.tobago.renderkit.CommandRendererBase;
import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
import org.apache.myfaces.tobago.renderkit.css.Classes;
-import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.Command;
import org.apache.myfaces.tobago.renderkit.html.CommandMap;
import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
@@ -79,8 +78,7 @@ public class LinkRenderer extends Comman
}
}
HtmlRendererUtils.writeDataAttributes(facesContext, writer, link);
- final Style style = new Style(facesContext, link);
- writer.writeStyleAttribute(style);
+ writer.writeStyleAttribute(link.getStyle());
writer.writeClassAttribute(Classes.create(link));
writer.writeIdAttribute(clientId);
writer.writeNameAttribute(clientId);
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MediatorRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MediatorRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MediatorRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MediatorRenderer.java Wed Sep 16 09:17:36 2015
@@ -19,14 +19,13 @@
package org.apache.myfaces.tobago.renderkit.html.standard.standard.tag;
-import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.UIMediator;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
-import org.apache.myfaces.tobago.renderkit.css.Style;
+import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -43,7 +42,7 @@ public class MediatorRenderer extends La
final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
writer.startElement(HtmlElements.DIV, mediator);
HtmlRendererUtils.writeDataAttributes(facesContext, writer, mediator);
- writer.writeStyleAttribute(new Style(facesContext, mediator));
+ writer.writeStyleAttribute(mediator.getStyle());
}
@Override
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuBarRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuBarRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuBarRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuBarRenderer.java Wed Sep 16 09:17:36 2015
@@ -54,7 +54,7 @@ public class MenuBarRenderer extends Lay
writer.writeIdAttribute(menuBar.getClientId(facesContext));
writer.writeClassAttribute(Classes.create(menuBar));
HtmlRendererUtils.writeDataAttributes(facesContext, writer, menuBar);
- final Style style = new Style(facesContext, menuBar);
+ final Style style = menuBar.getStyle();
writer.writeStyleAttribute(style);
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MessagesRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MessagesRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MessagesRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MessagesRenderer.java Wed Sep 16 09:17:36 2015
@@ -32,12 +32,10 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.context.Markup;
import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.internal.ajax.AjaxInternalUtils;
-import org.apache.myfaces.tobago.internal.component.AbstractUIPage;
import org.apache.myfaces.tobago.internal.util.FacesContextUtils;
import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
import org.apache.myfaces.tobago.renderkit.css.Classes;
-import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.Aria;
import org.apache.myfaces.tobago.renderkit.html.BootstrapClass;
import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
@@ -85,7 +83,7 @@ public class MessagesRenderer extends La
final List<UIMessages.Item> messageList = messages.createMessageList(facesContext);
if (messageList.size() > 0) { // in ie empty span gets a height
- writer.writeStyleAttribute(new Style(facesContext, messages));
+ writer.writeStyleAttribute(messages.getStyle());
// with id
/*String focusId = null;
@@ -173,12 +171,6 @@ public class MessagesRenderer extends La
CreateComponentUtils.createComponent(facesContext, UIPopup.COMPONENT_TYPE, RendererTypes.POPUP, id);
popup.getAttributes().put(Attributes.Z_INDEX, 10);
- final AbstractUIPage page = ComponentUtils.findPage(facesContext, messages);
-
- popup.setWidth(page.getCurrentWidth().subtract(200));
- popup.setHeight(page.getCurrentHeight().subtract(200));
- popup.setLeft(Measure.valueOf(100));
- popup.setTop(Measure.valueOf(100));
popup.setRendered(true);
popup.setActivated(true);
popup.onComponentPopulated(facesContext, messages);
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java Wed Sep 16 09:17:36 2015
@@ -23,7 +23,6 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
import org.apache.myfaces.tobago.renderkit.css.Classes;
-import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
@@ -55,8 +54,7 @@ public class ObjectRenderer extends Layo
writer.writeAttribute(HtmlAttributes.SRC, ResourceManagerUtils.getBlankPage(facesContext), false);
}
writer.writeClassAttribute(Classes.create(object));
- final Style style = new Style(facesContext, object);
- writer.writeStyleAttribute(style);
+ writer.writeStyleAttribute(object.getStyle());
String noframes = ResourceManagerUtils.getPropertyNotNull(
facesContext, "tobago", "browser.noframe.message.prefix");
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/OutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/OutRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/OutRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/OutRenderer.java Wed Sep 16 09:17:36 2015
@@ -22,7 +22,6 @@ package org.apache.myfaces.tobago.render
import org.apache.myfaces.tobago.component.UIOut;
import org.apache.myfaces.tobago.config.TobagoConfig;
import org.apache.myfaces.tobago.renderkit.css.Classes;
-import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.BootstrapClass;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -58,8 +57,7 @@ public class OutRenderer extends LabelLa
writer.startElement(HtmlElements.P, out);
writer.writeIdAttribute(id);
HtmlRendererUtils.writeDataAttributes(facesContext, writer, out);
- final Style style = new Style(facesContext, out);
- writer.writeStyleAttribute(style);
+ writer.writeStyleAttribute(out.getStyle());
writer.writeClassAttribute(Classes.create(out), BootstrapClass.FORM_CONTROL_STATIC);
final String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, out);
if (title != null) {
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java?rev=1703372&r1=1703371&r2=1703372&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java Wed Sep 16 09:17:36 2015
@@ -69,7 +69,6 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
-import java.util.Set;
public class PageRenderer extends LayoutComponentRendererBase {
@@ -220,17 +219,6 @@ public class PageRenderer extends Layout
}
}
- // style sniplets
- final Set<String> styleBlocks = FacesContextUtils.getStyleBlocks(facesContext);
- if (styleBlocks.size() > 0) {
- writer.startElement(HtmlElements.STYLE, null);
- writer.flush(); // is needed in some cases, e. g. TOBAGO-1094
- for (final String cssBlock : styleBlocks) {
- writer.write(cssBlock);
- }
- writer.endElement(HtmlElements.STYLE);
- }
-
// render remaining script tags
for (final String scriptFile : theme.getScriptResources(productionMode)) {
encodeScript(facesContext, writer, scriptFile);
@@ -244,28 +232,6 @@ public class PageRenderer extends Layout
checkDuplicates(theme.getScriptResources(productionMode), FacesContextUtils.getScriptFiles(facesContext));
}
- writer.startJavascript();
- // onload script
- writeEventFunction(writer, FacesContextUtils.getOnloadScripts(facesContext), "load", false);
-
- // onunload script
- writeEventFunction(writer, FacesContextUtils.getOnunloadScripts(facesContext), "unload", false);
-
- // onexit script
- writeEventFunction(writer, FacesContextUtils.getOnexitScripts(facesContext), "exit", false);
-
- writeEventFunction(writer, FacesContextUtils.getOnsubmitScripts(facesContext), "submit", true);
-
- int debugCounter = 0;
- for (final String scriptBlock : FacesContextUtils.getScriptBlocks(facesContext)) {
-
- if (LOG.isDebugEnabled()) {
- LOG.debug("write script block " + ++debugCounter + " :\n" + scriptBlock);
- }
- writer.write(scriptBlock);
- writer.write('\n');
- }
- writer.endJavascript();
writer.endElement(HtmlElements.HEAD);
}
@@ -360,7 +326,7 @@ public class PageRenderer extends Layout
writer.writeClassAttribute(Classes.create(page, "content"));
}
writer.writeIdAttribute(clientId + ComponentUtils.SUB_SEPARATOR + "content");
- final Style style = new Style(facesContext, page);
+ final Style style = page.getStyle();
// XXX position the div, so that the scrollable area is correct.
// XXX better to take this fact into layout management.
// XXX is also useful in boxes, etc.