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 2010/05/03 12:45:05 UTC
svn commit: r940412 - in /myfaces/tobago/trunk:
core/src/main/java/org/apache/myfaces/tobago/internal/component/
core/src/main/java/org/apache/myfaces/tobago/renderkit/
core/src/main/java/org/apache/myfaces/tobago/taglib/decl/
example/test/src/main/web...
Author: lofwyr
Date: Mon May 3 10:45:05 2010
New Revision: 940412
URL: http://svn.apache.org/viewvc?rev=940412&view=rev
Log:
TOBAGO-606: new layout manager
- make it possible to scroll inside of a box
- add a div for the content, to scroll it, when needed.
- define the margin of the gridLayout inside of a box/tab/panel/etc. in the theme. For boxes and tabs we use 5px as default, for panels no margin is the default.
Added:
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/MarginValues.java
- copied, changed from r939349, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/SpacingValues.java
myfaces/tobago/trunk/example/test/src/main/webapp/tc/box/box-scrollbar.xhtml
- copied, changed from r939349, myfaces/tobago/trunk/example/test/src/main/webapp/tc/box/box-box-relative.xhtml
Modified:
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutRendererWrapper.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasMargins.java
myfaces/tobago/trunk/example/test/src/main/webapp/tc/box/box-box-auto.xhtml
myfaces/tobago/trunk/theme/charlotteville/src/main/resources/org/apache/myfaces/tobago/renderkit/html/charlotteville/standard/property/tobago-theme-config.properties
myfaces/tobago/trunk/theme/charlotteville/src/main/resources/org/apache/myfaces/tobago/renderkit/html/charlotteville/standard/style/style.css
myfaces/tobago/trunk/theme/richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/property/tobago-theme-config.properties
myfaces/tobago/trunk/theme/richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/style/style.css
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/GridLayoutRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/mozilla/style/style.css
myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java
myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css
myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago-theme-config.properties
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.1.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.2.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component2.0.stg
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java Mon May 3 10:45:05 2010
@@ -185,8 +185,10 @@ public abstract class AbstractUIGridLayo
}
if (sum != null) {
// adding the space between the cells
- sum = sum.add(computeSpacing(orientation, 0, heads.length));
sum = sum.add(LayoutUtils.getBeginOffset(orientation, getLayoutContainer()));
+ sum = sum.add(getMarginBegin(orientation));
+ sum = sum.add(computeSpacing(orientation, 0, heads.length));
+ sum = sum.add(getMarginEnd(orientation));
sum = sum.add(LayoutUtils.getEndOffset(orientation, getLayoutContainer()));
LayoutUtils.setCurrentSize(orientation, getLayoutContainer(), sum);
}
@@ -279,7 +281,7 @@ public abstract class AbstractUIGridLayo
component.setDisplay(Display.BLOCK);
// compute the position of the cell
- Measure position = LayoutUtils.getBeginOffset(orientation, getLayoutContainer());
+ Measure position = Measure.ZERO;
position = position.add(getMarginBegin(orientation));
for (int k = 0; k < i; k++) {
if (heads[k] == null) {
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutRendererWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutRendererWrapper.java?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutRendererWrapper.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/AbstractLayoutRendererWrapper.java Mon May 3 10:45:05 2010
@@ -24,7 +24,7 @@ import javax.faces.context.FacesContext;
public abstract class AbstractLayoutRendererWrapper
- extends AbstractLayoutableRendererBaseWrapper implements LayoutRenderer, SpacingValues {
+ extends AbstractLayoutableRendererBaseWrapper implements LayoutRenderer, SpacingValues, MarginValues {
public Measure getColumnSpacing(FacesContext facesContext, Configurable component) {
return ((SpacingValues) getRenderer(facesContext)).getColumnSpacing(facesContext, component);
@@ -33,4 +33,20 @@ public abstract class AbstractLayoutRend
public Measure getRowSpacing(FacesContext facesContext, Configurable component) {
return ((SpacingValues) getRenderer(facesContext)).getRowSpacing(facesContext, component);
}
+
+ public Measure getMarginLeft(FacesContext facesContext, Configurable component) {
+ return ((MarginValues) getRenderer(facesContext)).getMarginLeft(facesContext, component);
+ }
+
+ public Measure getMarginRight(FacesContext facesContext, Configurable component) {
+ return ((MarginValues) getRenderer(facesContext)).getMarginRight(facesContext, component);
+ }
+
+ public Measure getMarginTop(FacesContext facesContext, Configurable component) {
+ return ((MarginValues) getRenderer(facesContext)).getMarginTop(facesContext, component);
+ }
+
+ public Measure getMarginBottom(FacesContext facesContext, Configurable component) {
+ return ((MarginValues) getRenderer(facesContext)).getMarginBottom(facesContext, component);
+ }
}
Copied: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/MarginValues.java (from r939349, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/SpacingValues.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/MarginValues.java?p2=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/MarginValues.java&p1=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/SpacingValues.java&r1=939349&r2=940412&rev=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/SpacingValues.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/MarginValues.java Mon May 3 10:45:05 2010
@@ -22,10 +22,13 @@ import org.apache.myfaces.tobago.layout.
import javax.faces.context.FacesContext;
-public interface SpacingValues {
+public interface MarginValues {
- Measure getColumnSpacing(FacesContext facesContext, Configurable component);
+ Measure getMarginLeft(FacesContext facesContext, Configurable component);
- Measure getRowSpacing(FacesContext facesContext, Configurable component);
+ Measure getMarginRight(FacesContext facesContext, Configurable component);
+ Measure getMarginTop(FacesContext facesContext, Configurable component);
+
+ Measure getMarginBottom(FacesContext facesContext, Configurable component);
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasMargins.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasMargins.java?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasMargins.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasMargins.java Mon May 3 10:45:05 2010
@@ -23,13 +23,15 @@ import org.apache.myfaces.tobago.apt.ann
public interface HasMargins {
/**
- * Top margin between container component and the children.
+ * Left margin between container component and the children.
*/
@TagAttribute
@UIComponentTagAttribute(
type = "org.apache.myfaces.tobago.layout.Measure",
- defaultCode = "getMargin()")
- void setMarginTop(String margin);
+ defaultCode = "getMargin() != null\n"
+ + " ? getMargin()\n"
+ + " : ((MarginValues)getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this)")
+ void setMarginLeft(String margin);
/**
* Right margin between container component and the children.
@@ -37,24 +39,31 @@ public interface HasMargins {
@TagAttribute
@UIComponentTagAttribute(
type = "org.apache.myfaces.tobago.layout.Measure",
- defaultCode = "getMargin()")
+ defaultCode = "getMargin() != null\n"
+ + " ? getMargin()\n"
+ + " : ((MarginValues)getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this)")
void setMarginRight(String margin);
/**
- * Bottom margin between container component and the children.
+ * Top margin between container component and the children.
*/
@TagAttribute
@UIComponentTagAttribute(
type = "org.apache.myfaces.tobago.layout.Measure",
- defaultCode = "getMargin()")
- void setMarginBottom(String margin);
+ defaultCode = "getMargin() != null\n"
+ + " ? getMargin()\n"
+ + " : ((MarginValues)getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this)")
+ void setMarginTop(String margin);
/**
- * Left margin between container component and the children.
+ * Bottom margin between container component and the children.
*/
@TagAttribute
@UIComponentTagAttribute(
type = "org.apache.myfaces.tobago.layout.Measure",
- defaultCode = "getMargin()")
- void setMarginLeft(String margin);
+ defaultCode = "getMargin() != null\n"
+ + " ? getMargin()\n"
+ + " : ((MarginValues)getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this)")
+ void setMarginBottom(String margin);
+
}
Modified: myfaces/tobago/trunk/example/test/src/main/webapp/tc/box/box-box-auto.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/webapp/tc/box/box-box-auto.xhtml?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/webapp/tc/box/box-box-auto.xhtml (original)
+++ myfaces/tobago/trunk/example/test/src/main/webapp/tc/box/box-box-auto.xhtml Mon May 3 10:45:05 2010
@@ -23,7 +23,7 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core">
<tc:page id="page">
- <tc:gridLayoutConstraint width="500px" height="200px"/>
+ <tc:gridLayoutConstraint width="600px" height="600px"/>
<f:facet name="layout">
<tc:gridLayout columns="auto" rows="auto"/>
</f:facet>
Copied: myfaces/tobago/trunk/example/test/src/main/webapp/tc/box/box-scrollbar.xhtml (from r939349, myfaces/tobago/trunk/example/test/src/main/webapp/tc/box/box-box-relative.xhtml)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/webapp/tc/box/box-scrollbar.xhtml?p2=myfaces/tobago/trunk/example/test/src/main/webapp/tc/box/box-scrollbar.xhtml&p1=myfaces/tobago/trunk/example/test/src/main/webapp/tc/box/box-box-relative.xhtml&r1=939349&r2=940412&rev=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/webapp/tc/box/box-box-relative.xhtml (original)
+++ myfaces/tobago/trunk/example/test/src/main/webapp/tc/box/box-scrollbar.xhtml Mon May 3 10:45:05 2010
@@ -23,15 +23,14 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core">
<tc:page id="page">
- <tc:gridLayoutConstraint width="500px" height="200px"/>
+ <tc:gridLayoutConstraint width="500px" height="150px"/>
- <tc:box id="outerbox" label="outer box">
+ <tc:box id="box" label="outer box">
- <tc:box id="innerbox" label="inner box">
-
- <tc:textarea id="textarea" value="Some text."/>
-
- </tc:box>
+ <tc:textarea id="text1" value="Some text."/>
+ <tc:textarea id="text2" value="Some other text."/>
+ <tc:textarea id="text3" value="More text."/>
+ <tc:textarea id="text4" value="More other text."/>
</tc:box>
Modified: myfaces/tobago/trunk/theme/charlotteville/src/main/resources/org/apache/myfaces/tobago/renderkit/html/charlotteville/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/charlotteville/src/main/resources/org/apache/myfaces/tobago/renderkit/html/charlotteville/standard/property/tobago-theme-config.properties?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/charlotteville/src/main/resources/org/apache/myfaces/tobago/renderkit/html/charlotteville/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/charlotteville/src/main/resources/org/apache/myfaces/tobago/renderkit/html/charlotteville/standard/property/tobago-theme-config.properties Mon May 3 10:45:05 2010
@@ -24,7 +24,7 @@ Box.css.border-left-width=1
Box.css.border-top-width=1
Box.css.border-right-width=1
Box.css.border-bottom-width=1
-Box.leftOffset=6
-Box.topOffset=26
-Box.rightOffset=6
-Box.bottomOffset=6
+Box.leftOffset=1
+Box.topOffset=21
+Box.rightOffset=1
+Box.bottomOffset=1
Modified: myfaces/tobago/trunk/theme/charlotteville/src/main/resources/org/apache/myfaces/tobago/renderkit/html/charlotteville/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/charlotteville/src/main/resources/org/apache/myfaces/tobago/renderkit/html/charlotteville/standard/style/style.css?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/charlotteville/src/main/resources/org/apache/myfaces/tobago/renderkit/html/charlotteville/standard/style/style.css (original)
+++ myfaces/tobago/trunk/theme/charlotteville/src/main/resources/org/apache/myfaces/tobago/renderkit/html/charlotteville/standard/style/style.css Mon May 3 10:45:05 2010
@@ -33,10 +33,6 @@
border-bottom: 1px solid #FECB66;
}
-.tobago-box-content {
- background-color: #FFEECF;
-}
-
/* button ------------------------------------------------------------------ */
.tobago-button-default {
Modified: myfaces/tobago/trunk/theme/richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/property/tobago-theme-config.properties?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/property/tobago-theme-config.properties Mon May 3 10:45:05 2010
@@ -24,10 +24,10 @@ Box.css.border-left-width=1
Box.css.border-top-width=1
Box.css.border-right-width=1
Box.css.border-bottom-width=1
-Box.leftOffset=6
-Box.topOffset=26
-Box.rightOffset=6
-Box.bottomOffset=6
+Box.leftOffset=1
+Box.topOffset=21
+Box.rightOffset=1
+Box.bottomOffset=1
# padding-top + padding-bottom + border-top + border-bottom
TabGroup.paddingHeight=28
Modified: myfaces/tobago/trunk/theme/richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/style/style.css?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/style/style.css (original)
+++ myfaces/tobago/trunk/theme/richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/style/style.css Mon May 3 10:45:05 2010
@@ -112,11 +112,12 @@ img.tobago-progress-color2 {
margin-bottom: 0px;
scrollbar-base-color: #3366CC;
scrollbar-3dlight-color: #3366cc;
- scrollbar-darkshadow-color: #3366CC;
+ scrollbar-darkshadow-color: #E6E6E6;
scrollbar-arrow-color: #3366cc;
scrollbar-face-color: #FFFFFF;
scrollbar-highlight-color: #FFFFFF;
scrollbar-shadow-color: #3366CC;
+ scrollbar-track-color: #E6E6E6;
}
/* box ----------------------------------------------------------------- */
@@ -132,10 +133,6 @@ img.tobago-progress-color2 {
border-bottom: 1px solid #FF9900;
}
-.tobago-box-content {
- background-color: #E6E6E6;
-}
-
/* button ------------------------------------------------------------ */
.tobago-button-default {
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java Mon May 3 10:45:05 2010
@@ -36,6 +36,7 @@ import java.io.IOException;
public class BoxRenderer extends BoxRendererBase {
+ @Override
public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
UIBox box = (UIBox) component;
@@ -67,7 +68,7 @@ public class BoxRenderer extends BoxRend
writer.endElement(HtmlConstants.LEGEND);
}
- Style innerStyle = new Style();
+ Style contentStyle = new Style(facesContext, box);
if (toolbar != null) {
writer.startElement(HtmlConstants.DIV, null);
writer.writeClassAttribute("tobago-box-toolbar-div");
@@ -78,22 +79,32 @@ public class BoxRenderer extends BoxRend
writer.endElement(HtmlConstants.DIV);
writer.endElement(HtmlConstants.DIV);
if (VariableResolverUtils.resolveClientProperties(facesContext).getUserAgent().isMsie()) {
- innerStyle.setTop(Measure.valueOf(-10));
+// XXX check for what is this, and delete or comment it
+ contentStyle.setTop(Measure.valueOf(-10));
}
}
writer.startElement(HtmlConstants.DIV, box);
- writer.writeClassAttribute();
- writer.writeStyleAttribute(innerStyle);
+ writer.writeClassAttribute("tobago-box-content"); // needed to be scrollable inside of the box
+ writer.writeStyleAttribute(contentStyle);
+ final Measure leftOffset = getLeftOffset(facesContext, box);
+ final Measure rightOffset = getRightOffset(facesContext, box);
+ final Measure topOffset = getTopOffset(facesContext, box);
+ final Measure bottomOffset = getBottomOffset(facesContext, box);
+ contentStyle.setWidth(contentStyle.getWidth().subtract(leftOffset).subtract(rightOffset));
+ contentStyle.setHeight(contentStyle.getHeight().subtract(topOffset).subtract(bottomOffset));
+ contentStyle.setLeft(leftOffset);
+ contentStyle.setTop(topOffset);
+ writer.writeStyleAttribute(contentStyle);
}
- public void encodeEnd(FacesContext facesContext,
- UIComponent component) throws IOException {
-
+ @Override
+ public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
ResponseWriter writer = facesContext.getResponseWriter();
writer.endElement(HtmlConstants.DIV);
writer.endElement(HtmlConstants.FIELDSET);
}
+ @Override
public boolean getRendersChildren() {
return true;
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/GridLayoutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/GridLayoutRenderer.java?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/GridLayoutRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/GridLayoutRenderer.java Mon May 3 10:45:05 2010
@@ -22,6 +22,7 @@ import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.config.Configurable;
import org.apache.myfaces.tobago.layout.Measure;
+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.util.RenderUtil;
@@ -30,7 +31,7 @@ import javax.faces.component.UIComponent
import javax.faces.context.FacesContext;
import java.io.IOException;
-public class GridLayoutRenderer extends RendererBase implements SpacingValues {
+public class GridLayoutRenderer extends RendererBase implements SpacingValues, MarginValues {
private static final Logger LOG = LoggerFactory.getLogger(GridLayoutRenderer.class);
@@ -49,7 +50,8 @@ public class GridLayoutRenderer extends
}
@Override
- public void encodeEnd(FacesContext facesContext,
+ public void encodeEnd(
+ FacesContext facesContext,
UIComponent component) throws IOException {
// TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
// writer.endElement(HtmlConstants.DIV);
@@ -58,9 +60,28 @@ public class GridLayoutRenderer extends
public Measure getColumnSpacing(FacesContext facesContext, Configurable component) {
return getResourceManager().getThemeMeasure(facesContext, component, Attributes.COLUMN_SPACING);
}
-
+
public Measure getRowSpacing(FacesContext facesContext, Configurable component) {
return getResourceManager().getThemeMeasure(facesContext, component, Attributes.ROW_SPACING);
}
-
+
+ public Measure getMarginLeft(FacesContext facesContext, Configurable component) {
+ Configurable parent = (Configurable) ((UIComponent) component).getParent();
+ return getResourceManager().getThemeMeasure(facesContext, parent, Attributes.MARGIN_LEFT);
+ }
+
+ public Measure getMarginRight(FacesContext facesContext, Configurable component) {
+ Configurable parent = (Configurable) ((UIComponent) component).getParent();
+ return getResourceManager().getThemeMeasure(facesContext, parent, Attributes.MARGIN_RIGHT);
+ }
+
+ public Measure getMarginTop(FacesContext facesContext, Configurable component) {
+ Configurable parent = (Configurable) ((UIComponent) component).getParent();
+ return getResourceManager().getThemeMeasure(facesContext, parent, Attributes.MARGIN_TOP);
+ }
+
+ public Measure getMarginBottom(FacesContext facesContext, Configurable component) {
+ Configurable parent = (Configurable) ((UIComponent) component).getParent();
+ return getResourceManager().getThemeMeasure(facesContext, parent, Attributes.MARGIN_BOTTOM);
+ }
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/mozilla/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/mozilla/style/style.css?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/mozilla/style/style.css (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/mozilla/style/style.css Mon May 3 10:45:05 2010
@@ -20,12 +20,6 @@
* agent: mozilla
*/
-/* Box ---------------------------------------------------------------- */
-/* fix scrollbar problem in divs without height set*/
-div.tobago-box-no-height {
- padding-bottom: 1px;
-}
-
/* toolBar -------------------------------------------------------------------- */
.tobago-toolBar-button-menu-background-image {
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties Mon May 3 10:45:05 2010
@@ -37,10 +37,10 @@ Box.paddingHeight=31
Box.headerHeight=0
Box.paddingTopWhenToolbar=22
Box.extraPaddingHeightWhenToolbar=10
-Box.leftOffset=10
-Box.topOffset=20
-Box.rightOffset=10
-Box.bottomOffset=10
+Box.leftOffset=0
+Box.topOffset=0
+Box.rightOffset=0
+Box.bottomOffset=0
Button.fontWidth=8
Button.imageWidth=18
@@ -162,10 +162,10 @@ Sheet.horizontalScrollbarWeight=17
Tab.paddingWidth=0
Tab.paddingHeight=0
Tab.headerHeight=0
-Tab.leftOffset=10
-Tab.topOffset=34
-Tab.rightOffset=10
-Tab.bottomOffset=10
+Tab.leftOffset=5
+Tab.topOffset=29
+Tab.rightOffset=5
+Tab.bottomOffset=5
TabGroup.fontWidth=8
TabGroup.paddingWidth=24
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css Mon May 3 10:45:05 2010
@@ -364,13 +364,18 @@ div.tobago-gridLayout-first-column {
fieldset.tobago-box-default {
border: 2px groove #ddeeff;
margin: 0;
- padding: 20px 10px 10px 10px;
+/* padding: 20px 10px 10px 10px;*/
}
legend.tobago-box-default {
color: black; /* font-size: 14px;*/
}
+.tobago-box-content {
+ position: absolute;
+ overflow: auto;
+}
+
.tobago-box-toolbar-div {
position: relative;
top: -36px;
Modified: myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java Mon May 3 10:45:05 2010
@@ -142,12 +142,26 @@ without shadow
// shadow end
writer.endElement(HtmlConstants.DIV);
}
+
+ writer.startElement(HtmlConstants.DIV, null);
+ writer.writeClassAttribute("tobago-box-content"); // needed to be scrollable inside of the box
+ final Style style = new Style(facesContext, box);
+ final Measure leftOffset = getLeftOffset(facesContext, box);
+ final Measure rightOffset = getRightOffset(facesContext, box);
+ final Measure topOffset = getTopOffset(facesContext, box);
+ final Measure bottomOffset = getBottomOffset(facesContext, box);
+ style.setWidth(style.getWidth().subtract(leftOffset).subtract(rightOffset));
+ style.setHeight(style.getHeight().subtract(topOffset).subtract(bottomOffset));
+ style.setLeft(leftOffset);
+ style.setTop(topOffset);
+ writer.writeStyleAttribute(style);
}
@Override
public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
writer.endElement(HtmlConstants.DIV);
+ writer.endElement(HtmlConstants.DIV);
}
protected void renderToolbar(
Modified: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties Mon May 3 10:45:05 2010
@@ -29,10 +29,11 @@ Box.paddingHeight=12
Box.paddingWidth=13
Box.componentExtraWidth=0
Box.componentExtraHeight=0
-Box.leftOffset=6
-Box.topOffset=26
-Box.rightOffset=7
-Box.bottomOffset=7
+Box.leftOffset=1
+Box.topOffset=21
+Box.rightOffset=2
+Box.bottomOffset=2
+# activates the shadow
Box.shadow=1
Button.preferredHeight=20
@@ -98,10 +99,10 @@ Sheet.rightOffset=1
Tab.paddingWidth=0
Tab.paddingHeight=0
-Tab.leftOffset=5
-Tab.topOffset=5
-Tab.rightOffset=5
-Tab.bottomOffset=5
+Tab.leftOffset=0
+Tab.topOffset=0
+Tab.rightOffset=0
+Tab.bottomOffset=0
TabGroup.paddingHeight=22
TabGroup.paddingWidth=23
Modified: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css Mon May 3 10:45:05 2010
@@ -451,11 +451,12 @@ label.tobago-label-error {
margin-bottom: 0px;
scrollbar-base-color: #000000;
scrollbar-3dlight-color: #000000;
- scrollbar-darkshadow-color: #c0c0c0;
+ scrollbar-darkshadow-color: #CCCCCC;
scrollbar-arrow-color: #000000;
- scrollbar-face-color: #c0c0c0;
- scrollbar-highlight-color: #c0c0c0;
- scrollbar-shadow-color: #00000;
+ scrollbar-face-color: #E2E2E2;
+ scrollbar-highlight-color: #E2E2E2;
+ scrollbar-shadow-color: #000000;
+ scrollbar-track-color: #CCCCCC;
}
/* richTextEditor ---------------------------------------------------------- */
Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago-theme-config.properties?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago-theme-config.properties Mon May 3 10:45:05 2010
@@ -18,6 +18,11 @@
# theme: standard
# agent: standard
+Box.marginLeft=5
+Box.marginRight=5
+Box.marginTop=5
+Box.marginBottom=5
+
Cell.leftOffset=0
Cell.topOffset=0
Cell.rightOffset=0
@@ -73,3 +78,8 @@ Separator.css.padding-left=0
Separator.css.padding-top=0
Separator.css.padding-right=0
Separator.css.padding-bottom=0
+
+Tab.marginLeft=5
+Tab.marginRight=5
+Tab.marginTop=5
+Tab.marginBottom=5
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.1.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.1.stg?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.1.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.1.stg Mon May 3 10:45:05 2010
@@ -44,6 +44,7 @@ import org.apache.commons.lang.ArrayUtil
import org.apache.commons.lang.StringUtils;
import org.apache.myfaces.tobago.internal.util.Deprecation;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
+import org.apache.myfaces.tobago.renderkit.MarginValues;
import org.apache.myfaces.tobago.renderkit.SpacingValues;
import java.util.ArrayList;
import java.util.List;
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.2.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.2.stg?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.2.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.2.stg Mon May 3 10:45:05 2010
@@ -45,6 +45,7 @@ import org.apache.commons.lang.StringUti
import org.apache.myfaces.tobago.component.MethodBindingToMethodExpression;
import org.apache.myfaces.tobago.component.MethodExpressionToMethodBinding;
import org.apache.myfaces.tobago.internal.util.Deprecation;
+import org.apache.myfaces.tobago.renderkit.MarginValues;
import org.apache.myfaces.tobago.renderkit.SpacingValues;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
import javax.el.ELException;
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component2.0.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component2.0.stg?rev=940412&r1=940411&r2=940412&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component2.0.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component2.0.stg Mon May 3 10:45:05 2010
@@ -45,6 +45,7 @@ import org.apache.commons.lang.StringUti
import org.apache.myfaces.tobago.component.MethodBindingToMethodExpression;
import org.apache.myfaces.tobago.component.MethodExpressionToMethodBinding;
import org.apache.myfaces.tobago.internal.util.Deprecation;
+import org.apache.myfaces.tobago.renderkit.MarginValues;
import org.apache.myfaces.tobago.renderkit.SpacingValues;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
import javax.el.ELException;