You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2010/01/05 12:50:30 UTC
svn commit: r896009 [21/30] - in /myfaces/trinidad/branches/2.0.1-branch: ./
src/site/xdoc/devguide/ trinidad-api/
trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/
trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/ ...
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/DetailColumnRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/DetailColumnRenderer.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/DetailColumnRenderer.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/DetailColumnRenderer.java Tue Jan 5 11:48:54 2010
@@ -6,9 +6,9 @@
* 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
@@ -22,28 +22,30 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+
import org.apache.myfaces.trinidad.bean.FacesBean;
import org.apache.myfaces.trinidad.component.UIXCollection;
import org.apache.myfaces.trinidad.component.UIXTable;
import org.apache.myfaces.trinidad.component.core.data.CoreTable;
import org.apache.myfaces.trinidad.context.RenderingContext;
import org.apache.myfaces.trinidad.render.CoreRenderer;
-import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.ShowDetailRenderer;
import org.apache.myfaces.trinidad.util.IntegerUtils;
+import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.ShowDetailRenderer;
public class DetailColumnRenderer extends SpecialColumnRenderer
{
@Override
protected void encodeAll(
- FacesContext context,
- RenderingContext arc,
- UIComponent component,
- FacesBean bean) throws IOException
+ FacesContext context,
+ RenderingContext rc,
+ UIComponent component,
+ FacesBean bean
+ ) throws IOException
{
TableRenderingContext tContext =
TableRenderingContext.getCurrentInstance();
-
+
if (tContext.getRenderStage().getStage() == RenderStage.INITIAL_STAGE)
{
// if we have detail disclosure. then we need to use
@@ -55,82 +57,93 @@
int physicalIndex = tContext.getColumnData().getPhysicalColumnIndex();
tContext.setDetailColumnIndex(physicalIndex);
}
-
- super.encodeAll(context, arc, component, bean);
- }
-
+
+ super.encodeAll(context, rc, component, bean);
+ }
+
@Override
- protected String getHeaderText(FacesBean bean)
+ protected String getHeaderText(
+ UIComponent component,
+ FacesBean bean)
{
RenderingContext arc = RenderingContext.getCurrentInstance();
return arc.getTranslatedString("af_table.DETAIL_COLUMN_HEADER");
}
-
+
@Override
- protected boolean getNoWrap(FacesBean bean)
+ protected boolean getNoWrap(
+ UIComponent component,
+ FacesBean bean)
{
return true;
}
@Override
- protected void renderKids(FacesContext context,
- RenderingContext arc,
- TableRenderingContext tContext,
- UIComponent column) throws IOException
+ protected void renderKids(
+ FacesContext context,
+ RenderingContext rc,
+ TableRenderingContext tContext,
+ UIComponent column
+ ) throws IOException
{
// Delegate to a ShowDetailRenderer, using the table as the underlying
// component
delegateRenderer(context,
- arc,
+ rc,
tContext.getTable(),
getFacesBean(tContext.getTable()),
_detailRenderer);
}
-
+
static private class Detail extends ShowDetailRenderer
{
- public Detail()
+ public Detail()
{
super(CoreTable.TYPE);
}
-
+
@Override
protected void renderAllAttributes(
- FacesContext context,
- RenderingContext arc,
- FacesBean bean)
+ FacesContext context,
+ RenderingContext rc,
+ UIComponent component,
+ FacesBean bean)
{
-
+
}
-
+
@Override
protected void renderPromptStart(
- FacesContext context,
- RenderingContext arc,
- UIComponent component,
- FacesBean bean) throws IOException
+ FacesContext context,
+ RenderingContext rc,
+ UIComponent component,
+ FacesBean bean
+ ) throws IOException
{
// bug 4688350:
component = ((UIXTable) component).getDetailStamp();
- super.renderPromptStart(context, arc, component, bean);
+ super.renderPromptStart(context, rc, component, bean);
}
-
+
@Override
- protected String getValueParameter(UIComponent component)
+ protected String getValueParameter(
+ UIComponent component)
{
UIXCollection cb = (UIXCollection) component;
int rowIndex = cb.getRowIndex();
return IntegerUtils.getString(rowIndex);
}
-
+
@Override
protected boolean isTableDetailDisclosure()
{
return true;
}
-
+
@Override
- protected boolean getDisclosed(FacesBean bean)
+ protected boolean getDisclosed(
+ UIComponent component,
+ FacesBean bean)
{
TableRenderingContext tContext = TableRenderingContext.getCurrentInstance();
UIXTable table = (UIXTable) tContext.getCollectionComponent();
@@ -138,13 +151,17 @@
}
@Override
- protected String getLinkId(String rootId, boolean disclosed)
+ protected String getLinkId(
+ String rootId,
+ boolean disclosed)
{
return _getDetailLinkId(TableRenderingContext.getCurrentInstance());
}
-
+
@Override
- protected String getClientId(FacesContext context, UIComponent component)
+ protected String getClientId(
+ FacesContext context,
+ UIComponent component)
{
TableRenderingContext tContext = TableRenderingContext.getCurrentInstance();
return tContext.getTableId();
@@ -152,7 +169,8 @@
// Returns the ID for the detail-disclosure link. We use IDs of the
// form: "<table name>dd<row index>"
- private static String _getDetailLinkId(TableRenderingContext tContext)
+ private static String _getDetailLinkId(
+ TableRenderingContext tContext)
{
String tableId = tContext.getTableId();
if (tableId == null)
@@ -172,6 +190,6 @@
return buffer.toString();
}
}
-
+
private final CoreRenderer _detailRenderer = new Detail();
}
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/FocusColumnRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/FocusColumnRenderer.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/FocusColumnRenderer.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/FocusColumnRenderer.java Tue Jan 5 11:48:54 2010
@@ -6,9 +6,9 @@
* 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
@@ -28,41 +28,48 @@
import org.apache.myfaces.trinidad.component.UIXTreeTable;
import org.apache.myfaces.trinidad.component.core.data.CoreColumn;
import org.apache.myfaces.trinidad.context.RenderingContext;
+import org.apache.myfaces.trinidad.skin.Icon;
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.OutputUtils;
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SkinSelectors;
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlConstants;
-import org.apache.myfaces.trinidad.skin.Icon;
public class FocusColumnRenderer extends SpecialColumnRenderer
{
@Override
- protected String getHeaderText(FacesBean bean)
+ protected String getHeaderText(
+ UIComponent component,
+ FacesBean bean)
{
RenderingContext arc = RenderingContext.getCurrentInstance();
return arc.getTranslatedString("af_treeTable.FOCUS_COLUMN_HEADER");
}
-
+
@Override
- protected String getHeaderStyleClass(TableRenderingContext tContext)
+ protected String getHeaderStyleClass(
+ TableRenderingContext tContext)
{
return SkinSelectors.AF_COLUMN_HEADER_ICON_STYLE;
}
@Override
- protected String getFormatType(FacesBean bean)
+ protected String getFormatType(
+ UIComponent component,
+ FacesBean bean)
{
return CoreColumn.ALIGN_CENTER;
}
@Override
- protected void renderKids(FacesContext context,
- RenderingContext arc,
- TableRenderingContext trc,
- UIComponent column) throws IOException
+ protected void renderKids(
+ FacesContext context,
+ RenderingContext rc,
+ TableRenderingContext trc,
+ UIComponent column
+ ) throws IOException
{
TreeTableRenderingContext ttrc = (TreeTableRenderingContext) trc;
-
+
ResponseWriter writer = context.getResponseWriter();
UIXTreeTable hGrid = ttrc.getUIXTreeTable();
@@ -72,39 +79,39 @@
// do not render a focus icon if the node is not expandable
// do not render the focus icon if this is the first row
- if (hGrid.isContainer() &&
+ if (hGrid.isContainer() &&
(hGrid.getDepth() >= focusPathSize))
{
writer.startElement(XhtmlConstants.LINK_ELEMENT, null);
- if (supportsNavigation(arc))
+ if (supportsNavigation(rc))
{
- String onclick =
+ String onclick =
TreeUtils.callJSFocusNode(hGrid, ttrc.getJSVarName());
writer.writeURIAttribute(XhtmlConstants.HREF_ATTRIBUTE, "#", null);
writer.writeAttribute(XhtmlConstants.ONCLICK_ATTRIBUTE, onclick, null);
}
- _renderFocusIcon(context, arc, arc.getTranslatedString("af_treeTable.FOCUS_TIP"));
+ _renderFocusIcon(context, rc, rc.getTranslatedString("af_treeTable.FOCUS_TIP"));
writer.endElement(XhtmlConstants.LINK_ELEMENT);
}
}
- // Renders the focus icon
+ // Renders the focus icon
private void _renderFocusIcon(
- FacesContext fc,
- RenderingContext arc,
+ FacesContext facesContext,
+ RenderingContext rc,
String altText
) throws IOException
{
- Icon icon = arc.getIcon(SkinSelectors.AF_TREE_TABLE_FOCUS_ICON_NAME);
+ Icon icon = rc.getIcon(SkinSelectors.AF_TREE_TABLE_FOCUS_ICON_NAME);
if (icon != null)
{
- // Render focus icon with embedded=true, since
+ // Render focus icon with embedded=true, since
// focus icon is always rendered within its own link.
- OutputUtils.renderIcon(fc, arc, icon, altText, null, true);
+ OutputUtils.renderIcon(facesContext, rc, icon, altText, null, true);
}
}
}
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/SelectionColumnRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/SelectionColumnRenderer.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/SelectionColumnRenderer.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/SelectionColumnRenderer.java Tue Jan 5 11:48:54 2010
@@ -6,9 +6,9 @@
* 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
@@ -39,41 +39,49 @@
}
@Override
- protected void renderKids(FacesContext context,
- RenderingContext arc,
- TableRenderingContext trc,
- UIComponent column) throws IOException
+ protected void renderKids(
+ FacesContext context,
+ RenderingContext rc,
+ TableRenderingContext trc,
+ UIComponent column
+ ) throws IOException
{
UIComponent table = trc.getTable();
- delegateRenderer(context, arc, table,
- getFacesBean(table),
+ delegateRenderer(context, rc, table,
+ getFacesBean(table),
trc.hasSelectAll()
? _multiRenderer
: _singleRenderer);
}
-
+
@Override
- protected String getHeaderText(FacesBean bean)
+ protected String getHeaderText(
+ UIComponent component,
+ FacesBean bean)
{
RenderingContext arc = RenderingContext.getCurrentInstance();
TableRenderingContext tContext =
TableRenderingContext.getCurrentInstance();
- String key = _isMultipleSelection(tContext)
+ String key = _isMultipleSelection(tContext)
? "af_tableSelectMany.SELECT_COLUMN_HEADER"
: "af_tableSelectOne.SELECT_COLUMN_HEADER";
-
+
return arc.getTranslatedString(key);
- }
+ }
@Override
- protected boolean getNoWrap(FacesBean bean)
+ protected boolean getNoWrap(
+ UIComponent component,
+ FacesBean bean)
{
return false;
}
@Override
- protected String getFormatType(FacesBean bean)
+ protected String getFormatType(
+ UIComponent component,
+ FacesBean bean)
{
return CoreColumn.ALIGN_CENTER;
}
@@ -88,7 +96,7 @@
{
return tContext.hasSelectAll();
}
-
+
private final CoreRenderer _singleRenderer;
private final CoreRenderer _multiRenderer;
}
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/SpecialColumnRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/SpecialColumnRenderer.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/SpecialColumnRenderer.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/SpecialColumnRenderer.java Tue Jan 5 11:48:54 2010
@@ -6,9 +6,9 @@
* 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
@@ -19,6 +19,7 @@
package org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.table;
import javax.faces.component.UIComponent;
+
import org.apache.myfaces.trinidad.bean.FacesBean;
import org.apache.myfaces.trinidad.component.core.data.CoreColumn;
import org.apache.myfaces.trinidad.context.RenderingContext;
@@ -40,35 +41,42 @@
}
@Override
- protected boolean getHeaderNoWrap(FacesBean bean)
+ protected boolean getHeaderNoWrap(
+ UIComponent component,
+ FacesBean bean)
{
return true;
}
@Override
- protected boolean getSortable(FacesBean bean)
+ protected boolean getSortable(
+ UIComponent component,
+ FacesBean bean)
{
return false;
}
@Override
- protected String getSortProperty(FacesBean bean)
+ protected String getSortProperty(
+ UIComponent component,
+ FacesBean bean)
{
return null;
}
@Override
- protected String getHeaderInlineStyle(RenderingContext arc)
+ protected String getHeaderInlineStyle(
+ RenderingContext rc)
{
- if (XhtmlRenderer.isIE(arc))
+ if (XhtmlRenderer.isIE(rc))
return "word-break:keep-all"; // bugs 2342291, 1999842
-
+
return null;
}
-
+
@Override
protected boolean isSpecialColumn()
{
return true;
- }
+ }
}
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectManyRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectManyRenderer.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectManyRenderer.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectManyRenderer.java Tue Jan 5 11:48:54 2010
@@ -6,9 +6,9 @@
* 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
@@ -29,26 +29,26 @@
import javax.faces.context.ResponseWriter;
import javax.faces.event.FacesEvent;
-import org.apache.myfaces.trinidad.logging.TrinidadLogger;
-
import org.apache.myfaces.trinidad.bean.FacesBean;
import org.apache.myfaces.trinidad.component.UIXCollection;
import org.apache.myfaces.trinidad.component.UIXTable;
import org.apache.myfaces.trinidad.component.UIXTree;
+import org.apache.myfaces.trinidad.context.RenderingContext;
import org.apache.myfaces.trinidad.event.SelectionEvent;
+import org.apache.myfaces.trinidad.logging.TrinidadLogger;
import org.apache.myfaces.trinidad.model.RowKeySet;
-
-import org.apache.myfaces.trinidad.context.RenderingContext;
import org.apache.myfaces.trinidad.render.CoreRenderer;
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.OutputUtils;
+
public class TableSelectManyRenderer extends TableSelectOneRenderer
{
public static final String UNSELECTED_KEY = "_us";
public static final String SELECTED_KEY = "_s";
public static final String SELECTED_MODE_KEY = "_sm";
- public TableSelectManyRenderer(FacesBean.Type type)
+ public TableSelectManyRenderer(
+ FacesBean.Type type)
{
super(type);
}
@@ -58,7 +58,9 @@
//
@SuppressWarnings("unchecked")
@Override
- public void decode(FacesContext context, UIComponent component)
+ public void decode(
+ FacesContext context,
+ UIComponent component)
{
UIXCollection table = (UIXCollection) component;
Object oldKey = table.getRowKey();
@@ -66,10 +68,10 @@
table.setRowIndex(-1);
String tableId = table.getClientId(context);
- Map<String, String[]> parameters =
+ Map<String, String[]> parameters =
context.getExternalContext().getRequestParameterValuesMap();
- String[] unselectedBoxes =
+ String[] unselectedBoxes =
parameters.get(tableId+NamingContainer.SEPARATOR_CHAR+UNSELECTED_KEY);
// check to see if there were any selection boxes in the request.
@@ -78,7 +80,7 @@
if ((unselectedBoxes == null) || (unselectedBoxes.length == 0))
return;
- String[] selectedBoxes =
+ String[] selectedBoxes =
parameters.get(tableId+NamingContainer.SEPARATOR_CHAR+SELECTED_KEY);
// must work with both table and hgrid:
@@ -121,13 +123,15 @@
table.setRowKey(oldKey);
}
- private void _setDeltas(UIXCollection table,
- String[] selectedBoxes, String[] unselectedBoxes,
- RowKeySet current,
- RowKeySet selectedDelta,
- RowKeySet unselectedDelta)
+ private void _setDeltas(
+ UIXCollection table,
+ String[] selectedBoxes,
+ String[] unselectedBoxes,
+ RowKeySet current,
+ RowKeySet selectedDelta,
+ RowKeySet unselectedDelta)
{
- Map<String, Boolean> deltas =
+ Map<String, Boolean> deltas =
new HashMap<String, Boolean>(unselectedBoxes.length);
for(int i=0; i< unselectedBoxes.length; i++)
{
@@ -171,7 +175,8 @@
}
@Override
- protected CoreRenderer createCellRenderer(FacesBean.Type type)
+ protected CoreRenderer createCellRenderer(
+ FacesBean.Type type)
{
return new Checkbox(type);
}
@@ -184,16 +189,17 @@
public static void renderScripts(
FacesContext context,
- RenderingContext arc,
+ RenderingContext rc,
TableRenderingContext trc,
- boolean autoSubmit) throws IOException
+ boolean autoSubmit
+ ) throws IOException
{
- if (arc.getProperties().put(_JS_RENDERED_KEY, Boolean.TRUE) == null)
+ if (rc.getProperties().put(_JS_RENDERED_KEY, Boolean.TRUE) == null)
{
ResponseWriter writer = context.getResponseWriter();
writer.startElement("script", null);
- renderScriptDeferAttribute(context, arc);
- renderScriptTypeAttribute(context, arc);
+ renderScriptDeferAttribute(context, rc);
+ renderScriptTypeAttribute(context, rc);
String jsCall =
TreeUtils.setupJSMultiSelectCollectionComponent(
@@ -209,19 +215,20 @@
// render hidden field for select mode. this field lets the server
// know that the user has selected "all" or "none", so that it can
// use that when repopulating the page or another record set.
- if (arc.getFormData() != null)
- arc.getFormData().addNeededValue(selectedModeName);
+ if (rc.getFormData() != null)
+ rc.getFormData().addNeededValue(selectedModeName);
}
@Override
protected void renderCellContent(
FacesContext context,
- RenderingContext arc,
+ RenderingContext rc,
TableRenderingContext tContext,
UIComponent component,
- FacesBean bean) throws IOException
+ FacesBean bean
+ ) throws IOException
{
- super.renderCellContent(context, arc, tContext, component, bean);
+ super.renderCellContent(context, rc, tContext, component, bean);
_renderUnsuccessfulField(context, tContext);
}
@@ -231,7 +238,8 @@
*/
private void _renderUnsuccessfulField(
FacesContext context,
- TableRenderingContext tContext) throws IOException
+ TableRenderingContext tContext
+ ) throws IOException
{
String unsuccessfulId = (tContext.getTableId() +
NamingContainer.SEPARATOR_CHAR +
@@ -244,12 +252,10 @@
value);
}
-
-
-
static private class Checkbox extends TableSelectOneRenderer.Radio
{
- public Checkbox(FacesBean.Type type)
+ public Checkbox(
+ FacesBean.Type type)
{
super(type);
}
@@ -257,7 +263,8 @@
@Override
protected void renderId(
FacesContext context,
- UIComponent component) throws IOException
+ UIComponent component
+ ) throws IOException
{
TableRenderingContext tContext =
TableRenderingContext.getCurrentInstance();
@@ -269,7 +276,7 @@
// =-=AEW Inefficient. We only need the "id" when there's
// a shortDescription (which is when we'll get a label)
- if (getShortDesc(getFacesBean(component)) != null)
+ if (getShortDesc(component, getFacesBean(component)) != null)
writer.writeAttribute("id", getClientId(context, component), null);
}
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRenderer.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRenderer.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRenderer.java Tue Jan 5 11:48:54 2010
@@ -44,14 +44,15 @@
public class TableSelectOneRenderer extends XhtmlRenderer
{
-
- public TableSelectOneRenderer(FacesBean.Type type)
+ public TableSelectOneRenderer(
+ FacesBean.Type type)
{
super(type);
}
@Override
- protected void findTypeConstants(FacesBean.Type type)
+ protected void findTypeConstants(
+ FacesBean.Type type)
{
super.findTypeConstants(type);
_renderer = createCellRenderer(type);
@@ -62,7 +63,9 @@
//
@SuppressWarnings("unchecked")
@Override
- public void decode(FacesContext context, UIComponent component)
+ public void decode(
+ FacesContext context,
+ UIComponent component)
{
UIXCollection table = (UIXCollection) component;
Object oldKey = table.getRowKey();
@@ -114,7 +117,6 @@
}
}
-
//
// Encode
//
@@ -126,10 +128,11 @@
@Override
protected void encodeAll(
- FacesContext context,
- RenderingContext arc,
- UIComponent component,
- FacesBean bean) throws IOException
+ FacesContext context,
+ RenderingContext rc,
+ UIComponent component,
+ FacesBean bean
+ ) throws IOException
{
TableRenderingContext tContext =
TableRenderingContext.getCurrentInstance();
@@ -149,7 +152,7 @@
break;
case RenderStage.DATA_STAGE:
- renderCellContent(context, arc, tContext, component, bean);
+ renderCellContent(context, rc, tContext, component, bean);
break;
default:
@@ -162,21 +165,23 @@
return true;
}
- protected CoreRenderer createCellRenderer(FacesBean.Type type)
+ protected CoreRenderer createCellRenderer(
+ FacesBean.Type type)
{
return new Radio(type);
}
protected void renderCellContent(
FacesContext context,
- RenderingContext arc,
+ RenderingContext rc,
TableRenderingContext tContext,
UIComponent component,
- FacesBean bean) throws IOException
+ FacesBean bean
+ ) throws IOException
{
- arc.setCurrentClientId(tContext.getTableId());
- delegateRenderer(context, arc, component, bean, _renderer);
- arc.setCurrentClientId(null);
+ rc.setCurrentClientId(tContext.getTableId());
+ delegateRenderer(context, rc, component, bean, _renderer);
+ rc.setCurrentClientId(null);
}
/**
@@ -184,7 +189,8 @@
* for testing.
*/
static String __getSelectionParameterName(
- FacesContext context, UIComponent table)
+ FacesContext context,
+ UIComponent table)
{
return (table.getClientId(context) +
NamingContainer.SEPARATOR_CHAR +
@@ -193,13 +199,15 @@
public static class Radio extends SimpleSelectBooleanCheckboxRenderer
{
- public Radio(FacesBean.Type type)
+ public Radio(
+ FacesBean.Type type)
{
super(type);
}
@Override
- protected String getCompositeId(String clientId)
+ protected String getCompositeId(
+ String clientId)
{
return null;
}
@@ -208,15 +216,20 @@
* we do not want to render the simple span for the checkbox.
*/
@Override
- protected boolean getRenderSimpleSpan(FacesBean bean)
+ protected boolean getRenderSimpleSpan(
+ UIComponent component,
+ FacesBean bean)
{
return false;
}
+
/**
* don't render a special content style class on the radio.
*/
@Override
- protected String getContentStyleClass(FacesBean bean)
+ protected String getContentStyleClass(
+ UIComponent component,
+ FacesBean bean)
{
return null;
}
@@ -224,7 +237,8 @@
@Override
protected void renderId(
FacesContext context,
- UIComponent component) throws IOException
+ UIComponent component
+ ) throws IOException
{
TableRenderingContext tContext =
TableRenderingContext.getCurrentInstance();
@@ -235,19 +249,23 @@
writer.writeAttribute("name", param, null);
// =-=AEW Inefficient. We only need the "id" when there's
// a shortDescription (which is when we'll get a label)
- if (getShortDesc(getFacesBean(component)) != null)
+ if (getShortDesc(component, getFacesBean(component)) != null)
writer.writeAttribute("id", getClientId(context, component), null);
}
@Override
- protected String getClientId(FacesContext context, UIComponent component)
+ protected String getClientId(
+ FacesContext context,
+ UIComponent component)
{
// We use the table's container client ID
return component.getContainerClientId(context);
}
@Override
- protected Object getSubmittedValue(FacesBean bean)
+ protected Object getSubmittedValue(
+ UIComponent component,
+ FacesBean bean)
{
TableRenderingContext tContext =
TableRenderingContext.getCurrentInstance();
@@ -262,7 +280,8 @@
}
@Override
- protected Object getValueAttr(RenderingContext arc)
+ protected Object getValueAttr(
+ RenderingContext rc)
{
TableRenderingContext tContext =
TableRenderingContext.getCurrentInstance();
@@ -271,7 +290,9 @@
}
@Override
- protected String getShortDesc(FacesBean bean)
+ protected String getShortDesc(
+ UIComponent component,
+ FacesBean bean)
{
String key = getDefaultShortDescKey();
RenderingContext arc = RenderingContext.getCurrentInstance();
@@ -284,13 +305,17 @@
}
@Override
- protected char getAccessKey(FacesBean bean)
+ protected char getAccessKey(
+ UIComponent component,
+ FacesBean bean)
{
return CHAR_UNDEFINED;
}
@Override
- protected boolean isImmediate(FacesBean bean)
+ protected boolean isImmediate(
+ UIComponent component,
+ FacesBean bean)
{
TableRenderingContext tContext =
TableRenderingContext.getCurrentInstance();
@@ -298,13 +323,18 @@
}
@Override
- protected boolean getReadOnly(FacesContext context, FacesBean bean)
+ protected boolean getReadOnly(
+ FacesContext context,
+ UIComponent component,
+ FacesBean bean)
{
return false;
}
@Override
- protected boolean getDisabled(FacesBean bean)
+ protected boolean getDisabled(
+ UIComponent component,
+ FacesBean bean)
{
return false;
}
@@ -313,7 +343,9 @@
* @todo Support?
*/
@Override
- protected String getOnblur(FacesBean bean)
+ protected String getOnblur(
+ UIComponent component,
+ FacesBean bean)
{
return null;
}
@@ -322,28 +354,35 @@
* @todo Support?
*/
@Override
- protected String getOnfocus(FacesBean bean)
+ protected String getOnfocus(
+ UIComponent component,
+ FacesBean bean)
{
return null;
}
@Override
- protected String getOnchange(FacesBean bean)
+ protected String getOnchange(
+ UIComponent component,
+ FacesBean bean)
{
return null;
}
- protected String getOnselect(FacesBean bean)
+ protected String getOnselect(
+ UIComponent component,
+ FacesBean bean)
{
return null;
}
@Override
- protected String getText(FacesBean bean)
+ protected String getText(
+ UIComponent component,
+ FacesBean bean)
{
return null;
}
-
}
private CoreRenderer _renderer;
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeNodeColumnRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeNodeColumnRenderer.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeNodeColumnRenderer.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeNodeColumnRenderer.java Tue Jan 5 11:48:54 2010
@@ -19,6 +19,7 @@
package org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.table;
import java.io.IOException;
+
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -37,16 +38,19 @@
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlConstants;
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer;
+
public class TreeNodeColumnRenderer extends ColumnRenderer
{
@Override
- protected void renderKids(FacesContext context,
- RenderingContext arc,
- TableRenderingContext tContext,
- UIComponent column) throws IOException
+ protected void renderKids(
+ FacesContext context,
+ RenderingContext rc,
+ TableRenderingContext tContext,
+ UIComponent column
+ ) throws IOException
{
TreeTableRenderingContext ttrc = (TreeTableRenderingContext) tContext;
- boolean isRTL = arc.isRightToLeft();
+ boolean isRTL = rc.isRightToLeft();
UIXTreeTable hGrid = ttrc.getUIXTreeTable();
final boolean disclosed;
final String onclick;
@@ -115,40 +119,42 @@
// Render the style class on the link, so that we can
// disable the link's text decoration
- renderStyleClass(context, arc,
+ renderStyleClass(context, rc,
SkinSelectors.AF_TREE_TABLE_EXPANSION_ICON_STYLE_CLASS);
//HKuhn - don't render onclick in printable mode
- if (XhtmlRenderer.supportsScripting(arc))
+ if (XhtmlRenderer.supportsScripting(rc))
{
writer.writeAttribute("onclick", onclick, null);
writer.writeURIAttribute("href", "#", null);
}
// Render the expand/collapse Icon
- _renderExpansionIcon(context, arc, disclosed, onclick);
+ _renderExpansionIcon(context, rc, disclosed, onclick);
writer.endElement("a");
}
- _renderNodeIcon(context, arc, hGrid, disclosed, onclick != null);
+ _renderNodeIcon(context, rc, hGrid, disclosed, onclick != null);
UIComponent nodeStampColumn = ttrc.getTreeNodeStamp();
// if in screen reader mode render the node depth from the root as well
- _renderNodeStampBasedOnAccessibilty(context, arc, ttrc, nodeStampColumn);
+ _renderNodeStampBasedOnAccessibilty(context, rc, ttrc, nodeStampColumn);
writer.endElement("div");
}
-
- private int _getSpacerWidth(TreeTableRenderingContext ttrc)
+ private int _getSpacerWidth(
+ TreeTableRenderingContext ttrc)
{
return ttrc.getSpacerWidth();
}
// Renders the unique id for the expand/collapse icon
- private void _renderIconID(FacesContext fc,
- TableRenderingContext tContext) throws IOException
+ private void _renderIconID(
+ FacesContext fc,
+ TableRenderingContext tContext
+ ) throws IOException
{
// we need to render a unique ID for the expand/collapse link, so that
// PPR can restore the focus correctly after a PPR request:
@@ -159,10 +165,11 @@
// Renders the expansion Icon
private void _renderExpansionIcon(
- FacesContext context,
- RenderingContext arc,
+ FacesContext context,
+ RenderingContext rc,
boolean disclosed,
- Object onclick) throws IOException
+ Object onclick
+ ) throws IOException
{
final String iconName;
final String altTextKey;
@@ -181,31 +188,31 @@
altTextKey = _EXPAND_TIP_KEY;
}
- Icon icon = arc.getIcon(iconName);
+ Icon icon = rc.getIcon(iconName);
if (icon != null)
{
- Object altText = arc.getTranslatedString(altTextKey);
- OutputUtils.renderIcon(context, arc, icon, altText, null);
+ Object altText = rc.getTranslatedString(altTextKey);
+ OutputUtils.renderIcon(context, rc, icon, altText, null);
}
}
private void _renderNodeIcon(
- FacesContext context,
- RenderingContext arc,
- UIXTreeTable ttr,
- boolean disclosed,
- boolean hasChildren
- ) throws IOException
+ FacesContext context,
+ RenderingContext rc,
+ UIXTreeTable ttr,
+ boolean disclosed,
+ boolean hasChildren
+ ) throws IOException
{
- Icon nodeIcon = getNodeIcon(arc, getNodeType(ttr), disclosed, hasChildren);
+ Icon nodeIcon = getNodeIcon(rc, getNodeType(ttr), disclosed, hasChildren);
if (nodeIcon != null)
{
- OutputUtils.renderIcon(context, arc, nodeIcon, null, null);
+ OutputUtils.renderIcon(context, rc, nodeIcon, null, null);
}
}
protected String getNodeType(
- UIXTreeTable ttr
+ UIXTreeTable ttr
)
{
String nodeType = null;
@@ -234,10 +241,9 @@
}
protected String getNodeIconSelector(
- String nodeType,
- boolean disclosed,
- boolean hasChildren
- )
+ String nodeType,
+ boolean disclosed,
+ boolean hasChildren)
{
if (hasChildren)
{
@@ -254,11 +260,10 @@
}
protected Icon getNodeIcon(
- RenderingContext rc,
- String nodeType,
- boolean disclosed,
- boolean hasChildren
- )
+ RenderingContext rc,
+ String nodeType,
+ boolean disclosed,
+ boolean hasChildren)
{
if (nodeType == null || nodeType.length() == 0)
{
@@ -280,27 +285,28 @@
}
private void _renderNodeStampBasedOnAccessibilty(
- FacesContext context,
- RenderingContext arc,
+ FacesContext context,
+ RenderingContext rc,
TreeTableRenderingContext ttrc,
- UIComponent column) throws IOException
+ UIComponent column
+ ) throws IOException
{
- if (XhtmlRenderer.isScreenReaderMode(arc))
+ if (XhtmlRenderer.isScreenReaderMode(rc))
{
int depth = ttrc.getUIXTreeTable().getDepth() + 1;
- if (arc.isRightToLeft())
+ if (rc.isRightToLeft())
{
- super.renderKids(context, arc, ttrc, column);
- TreeUtils.writeNodeLevel(context, arc, depth, _NODE_LEVEL_TEXT_KEY);
+ super.renderKids(context, rc, ttrc, column);
+ TreeUtils.writeNodeLevel(context, rc, depth, _NODE_LEVEL_TEXT_KEY);
}
else
{
- TreeUtils.writeNodeLevel(context, arc, depth, _NODE_LEVEL_TEXT_KEY);
- super.renderKids(context, arc, ttrc, column);
+ TreeUtils.writeNodeLevel(context, rc, depth, _NODE_LEVEL_TEXT_KEY);
+ super.renderKids(context, rc, ttrc, column);
}
}
else
- super.renderKids(context, arc, ttrc, column);
+ super.renderKids(context, rc, ttrc, column);
}
// This String is included in the generated IDs that are
@@ -321,5 +327,4 @@
public static final String NODE_ICON_COLLAPSED_SUFFIX = "-collapsed";
public static final int NODE_ICON_MAX_WIDTH = 18;
-
}
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeTableNavRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeTableNavRenderer.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeTableNavRenderer.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeTableNavRenderer.java Tue Jan 5 11:48:54 2010
@@ -6,9 +6,9 @@
* 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
@@ -28,16 +28,18 @@
import org.apache.myfaces.trinidad.component.UIXTreeTable;
import org.apache.myfaces.trinidad.component.core.data.CoreTreeTable;
import org.apache.myfaces.trinidad.context.RenderingContext;
+import org.apache.myfaces.trinidad.skin.Icon;
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.OutputUtils;
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SkinSelectors;
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlConstants;
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer;
import org.apache.myfaces.trinidadinternal.share.util.FastMessageFormat;
-import org.apache.myfaces.trinidad.skin.Icon;
+
public class TreeTableNavRenderer extends XhtmlRenderer
{
- public TreeTableNavRenderer(boolean isTop)
+ public TreeTableNavRenderer(
+ boolean isTop)
{
super(CoreTreeTable.TYPE);
_isTop = isTop;
@@ -53,10 +55,11 @@
@Override
protected void encodeAll(
- FacesContext context,
- RenderingContext arc,
- UIComponent component,
- FacesBean bean) throws IOException
+ FacesContext context,
+ RenderingContext rc,
+ UIComponent component,
+ FacesBean bean
+ ) throws IOException
{
//TODO
final Object childTypeText = null;
@@ -66,20 +69,21 @@
int rows = hgrid.getRows();
int first = hgrid.getFirst();
int rowCount = hgrid.getRowCount();
- _renderViewNavBar(context, arc, ttrc, hgrid,
+ _renderViewNavBar(context, rc, ttrc, hgrid,
first, childTypeText, _isTop, rows, rowCount);
}
private void _renderViewNavBar(
- FacesContext context,
- RenderingContext arc,
+ FacesContext context,
+ RenderingContext rc,
TreeTableRenderingContext ttrc,
- UIXTreeTable hgrid,
- int rangeStart,
- Object text,
- boolean isTop,
- int viewSize,
- int numChildren) throws IOException
+ UIXTreeTable hgrid,
+ int rangeStart,
+ Object text,
+ boolean isTop,
+ int viewSize,
+ int numChildren
+ ) throws IOException
{
int nextWindowStart = 0;
int nextWindowEnd = 0;
@@ -118,7 +122,7 @@
}
// First get the link direction text
- String direction = arc.getTranslatedString((isTop
+ String direction = rc.getTranslatedString((isTop
? _PREVIOUS_KEY
: _NEXT_KEY));
String linkText = direction;
@@ -154,7 +158,7 @@
srcs[strNum] = "" + numChildren;
}
- String format = arc.getTranslatedString(formatKey);
+ String format = rc.getTranslatedString(formatKey);
if (format != null)
{
FastMessageFormat fmf = new FastMessageFormat(format);
@@ -162,19 +166,20 @@
}
}
- _writeCellContents(context, arc, ttrc, hgrid, linkText, disabled, isTop, nextWindowStart);
+ _writeCellContents(context, rc, ttrc, hgrid, linkText, disabled, isTop, nextWindowStart);
}
private void _writeCellContents(
- FacesContext context,
- RenderingContext arc,
+ FacesContext context,
+ RenderingContext rc,
TreeTableRenderingContext ttrc,
- UIXTreeTable hgrid,
- String text,
- boolean disabled,
- boolean isTop,
- int index) throws IOException
+ UIXTreeTable hgrid,
+ String text,
+ boolean disabled,
+ boolean isTop,
+ int index
+ ) throws IOException
{
if (text == null)
return;
@@ -184,7 +189,7 @@
String onclick =
TreeUtils.callJSGotoNode(hgrid, ttrc.getJSVarName(), index);
- boolean isRTL = arc.isRightToLeft();
+ boolean isRTL = rc.isRightToLeft();
int depth = hgrid.getDepth()+1;
int spacerWidth = _getSpacerWidth();
@@ -203,31 +208,31 @@
"position:relative;top:0px;left:0px;margin-left:"+
depth * spacerWidth + "px", null);
}
-
- Icon icon = _getIcon(arc, isTop, disabled);
-
+
+ Icon icon = _getIcon(rc, isTop, disabled);
+
if (icon != null)
{
writer.startElement(XhtmlConstants.LINK_ELEMENT, null);
- String shortDesc =
- arc.getTranslatedString(isTop ? _PREVIOUS_ALT_KEY : _NEXT_ALT_KEY);
-
+ String shortDesc =
+ rc.getTranslatedString(isTop ? _PREVIOUS_ALT_KEY : _NEXT_ALT_KEY);
+
if (!disabled)
{
writer.writeURIAttribute(XhtmlConstants.HREF_ATTRIBUTE, "#", null);
writer.writeAttribute(XhtmlConstants.ONCLICK_ATTRIBUTE, onclick, null);
writer.writeAttribute("title", shortDesc, null);
- }
-
- String align = OutputUtils.getMiddleIconAlignment(arc);
- OutputUtils.renderIcon(context, arc, icon, shortDesc, align);
-
+ }
+
+ String align = OutputUtils.getMiddleIconAlignment(rc);
+ OutputUtils.renderIcon(context, rc, icon, shortDesc, align);
+
writer.endElement(XhtmlConstants.LINK_ELEMENT);
}
-
+
writer.startElement(XhtmlConstants.LINK_ELEMENT, null);
-
+
final String styleClass;
if (disabled)
{
@@ -238,22 +243,22 @@
styleClass = SkinSelectors.HGRID_NAV_ROW_ALINK_STYLE_CLASS;
writer.writeURIAttribute(XhtmlConstants.HREF_ATTRIBUTE, "#", null);
writer.writeAttribute(XhtmlConstants.ONCLICK_ATTRIBUTE, onclick, null);
- String shortDesc =
- arc.getTranslatedString(isTop ? _PREVIOUS_ALT_KEY : _NEXT_ALT_KEY);
+ String shortDesc =
+ rc.getTranslatedString(isTop ? _PREVIOUS_ALT_KEY : _NEXT_ALT_KEY);
writer.writeAttribute("title", shortDesc, null);
- }
-
- renderStyleClass(context, arc, styleClass);
+ }
+
+ renderStyleClass(context, rc, styleClass);
if (text != null)
writer.writeText(text, null);
writer.endElement(XhtmlConstants.LINK_ELEMENT);
-
+
writer.endElement("div");
writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT);
}
private Icon _getIcon(
- RenderingContext arc,
+ RenderingContext rc,
boolean isTop,
boolean isDisabled
)
@@ -272,8 +277,8 @@
? SkinSelectors.AF_TREE_TABLE_DISABLED_NAV_DOWN_ICON_NAME
: SkinSelectors.AF_TREE_TABLE_NAV_DOWN_ICON_NAME;
}
-
- return arc.getIcon(iconKey);
+
+ return rc.getIcon(iconKey);
}
private int _getSpacerWidth()
@@ -310,5 +315,5 @@
"af_treeTable.NAV_CELL_FORMAT_T_NC_private";
private static final String _FORMAT_KEY_NTNC =
"af_treeTable.NAV_CELL_FORMAT_NT_NC_private";
-
+
}
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/CellFormatRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/CellFormatRenderer.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/CellFormatRenderer.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/CellFormatRenderer.java Tue Jan 5 11:48:54 2010
@@ -6,9 +6,9 @@
* 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
@@ -20,8 +20,6 @@
import java.io.IOException;
-import java.util.List;
-
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
@@ -29,21 +27,20 @@
import org.apache.myfaces.trinidad.bean.FacesBean;
import org.apache.myfaces.trinidad.bean.PropertyKey;
import org.apache.myfaces.trinidad.component.html.HtmlCellFormat;
-
import org.apache.myfaces.trinidad.context.RenderingContext;
-
-import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.OutputUtils;
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer;
+
public class CellFormatRenderer extends XhtmlRenderer
{
public CellFormatRenderer()
{
super(HtmlCellFormat.TYPE);
}
-
+
@Override
- protected void findTypeConstants(FacesBean.Type type)
+ protected void findTypeConstants(
+ FacesBean.Type type)
{
super.findTypeConstants(type);
_widthKey = type.findKey("width");
@@ -66,34 +63,35 @@
@Override
protected void encodeAll(
- FacesContext context,
- RenderingContext arc,
- UIComponent component,
- FacesBean bean) throws IOException
+ FacesContext context,
+ RenderingContext rc,
+ UIComponent component,
+ FacesBean bean
+ ) throws IOException
{
ResponseWriter rw = context.getResponseWriter();
- String element = isHeader(bean) ? "th" : "td";
+ String element = isHeader(component, bean) ? "th" : "td";
rw.startElement(element, component);
renderId(context, component);
- renderAllAttributes(context, arc, bean);
- renderHAlign(context, arc, getHalign(bean));
- rw.writeAttribute("valign", getValign(bean), "valign");
- rw.writeAttribute("abbr", getShortText(bean), "shortText");
- rw.writeAttribute("headers", getHeaders(bean), "headers");
- rw.writeAttribute("width", getWidth(bean), "width");
- rw.writeAttribute("height", getHeight(bean), "height");
-
- int colspan = getColumnSpan(bean);
+ renderAllAttributes(context, rc, component, bean);
+ renderHAlign(context, rc, getHalign(component, bean));
+ rw.writeAttribute("valign", getValign(component, bean), "valign");
+ rw.writeAttribute("abbr", getShortText(component, bean), "shortText");
+ rw.writeAttribute("headers", getHeaders(component, bean), "headers");
+ rw.writeAttribute("width", getWidth(component, bean), "width");
+ rw.writeAttribute("height", getHeight(component, bean), "height");
+
+ int colspan = getColumnSpan(component, bean);
if (colspan > 1)
rw.writeAttribute("colspan", colspan, "columnSpan");
- int rowspan = getRowSpan(bean);
+ int rowspan = getRowSpan(component, bean);
if (rowspan > 1)
rw.writeAttribute("rowspan", rowspan, "rowSpan");
- if (isWrappingDisabled(bean))
+ if (isWrappingDisabled(component, bean))
{
// On PDA browser where the width is limited, nowrap will not be set.
- if (isDesktop(arc))
+ if (isDesktop(rc))
{
rw.writeAttribute("nowrap", Boolean.TRUE, "wrappingDisabled");
}
@@ -104,37 +102,51 @@
rw.endElement(element);
}
- protected Object getWidth(FacesBean bean)
+ protected Object getWidth(
+ UIComponent component,
+ FacesBean bean)
{
return bean.getProperty(_widthKey);
}
- protected Object getHeight(FacesBean bean)
+ protected Object getHeight(
+ UIComponent component,
+ FacesBean bean)
{
return bean.getProperty(_heightKey);
}
- protected Object getHalign(FacesBean bean)
+ protected Object getHalign(
+ UIComponent component,
+ FacesBean bean)
{
return bean.getProperty(_halignKey);
}
- protected Object getValign(FacesBean bean)
+ protected Object getValign(
+ UIComponent component,
+ FacesBean bean)
{
return bean.getProperty(_valignKey);
}
- protected boolean isWrappingDisabled(FacesBean bean)
+ protected boolean isWrappingDisabled(
+ UIComponent component,
+ FacesBean bean)
{
return Boolean.TRUE.equals(bean.getProperty(_wrappingDisabledKey));
}
- protected Object getShortText(FacesBean bean)
+ protected Object getShortText(
+ UIComponent component,
+ FacesBean bean)
{
return bean.getProperty(_shortTextKey);
}
- protected int getColumnSpan(FacesBean bean)
+ protected int getColumnSpan(
+ UIComponent component,
+ FacesBean bean)
{
Object o = bean.getProperty(_columnSpanKey);
if (o == null)
@@ -143,7 +155,9 @@
return toInt(o);
}
- protected int getRowSpan(FacesBean bean)
+ protected int getRowSpan(
+ UIComponent component,
+ FacesBean bean)
{
Object o = bean.getProperty(_rowSpanKey);
if (o == null)
@@ -152,17 +166,20 @@
return toInt(o);
}
- protected Object getHeaders(FacesBean bean)
+ protected Object getHeaders(
+ UIComponent component,
+ FacesBean bean)
{
return bean.getProperty(_headersKey);
}
- protected boolean isHeader(FacesBean bean)
+ protected boolean isHeader(
+ UIComponent component,
+ FacesBean bean)
{
return Boolean.TRUE.equals(bean.getProperty(_headerKey));
}
-
private PropertyKey _widthKey;
private PropertyKey _heightKey;
private PropertyKey _halignKey;
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/RowLayoutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/RowLayoutRenderer.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/RowLayoutRenderer.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/RowLayoutRenderer.java Tue Jan 5 11:48:54 2010
@@ -6,9 +6,9 @@
* 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
@@ -20,8 +20,6 @@
import java.io.IOException;
-import java.util.List;
-
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
@@ -31,22 +29,22 @@
import org.apache.myfaces.trinidad.component.html.HtmlCellFormat;
import org.apache.myfaces.trinidad.component.html.HtmlRowLayout;
import org.apache.myfaces.trinidad.component.html.HtmlTableLayout;
-
import org.apache.myfaces.trinidad.context.RenderingContext;
-
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.OutputUtils;
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer;
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlUtils;
+
public class RowLayoutRenderer extends XhtmlRenderer
{
public RowLayoutRenderer()
{
super(HtmlRowLayout.TYPE);
}
-
+
@Override
- protected void findTypeConstants(FacesBean.Type type)
+ protected void findTypeConstants(
+ FacesBean.Type type)
{
super.findTypeConstants(type);
_widthKey = type.findKey("width");
@@ -62,26 +60,24 @@
@Override
protected void encodeAll(
- FacesContext context,
- RenderingContext arc,
- UIComponent component,
- FacesBean bean) throws IOException
+ FacesContext context,
+ RenderingContext rc,
+ UIComponent component,
+ FacesBean bean
+ ) throws IOException
{
ResponseWriter rw = context.getResponseWriter();
boolean needsTable = _shouldRenderTable(component);
rw.startElement(needsTable ? "table" : "tr", component);
renderId(context, component);
- renderAllAttributes(context, arc, bean);
- renderHAlign(context, arc, getHalign(bean));
- rw.writeAttribute("valign", getValign(bean), "valign");
-
+ renderAllAttributes(context, rc, component, bean);
+ renderHAlign(context, rc, getHalign(component, bean));
+ rw.writeAttribute("valign", getValign(component, bean), "valign");
+
if (needsTable)
{
- OutputUtils.renderLayoutTableAttributes(context,
- arc,
- 0,
- getWidth(bean));
+ OutputUtils.renderLayoutTableAttributes(context, rc, 0, getWidth(component, bean));
rw.startElement("tr", null);
}
@@ -90,10 +86,11 @@
rw.endElement("tr");
if (needsTable)
rw.endElement("table");
-
+
}
- static private boolean _shouldRenderTable(UIComponent component)
+ static private boolean _shouldRenderTable(
+ UIComponent component)
{
UIComponent parent = XhtmlUtils.getStructuralParent(component);
return !(parent instanceof HtmlTableLayout);
@@ -102,7 +99,8 @@
@Override
protected void encodeChild(
FacesContext context,
- UIComponent child) throws IOException
+ UIComponent child
+ ) throws IOException
{
// TODO: handle cellFormat that is inside of (for example) an iterator
if (child instanceof HtmlCellFormat)
@@ -118,17 +116,23 @@
}
}
- protected Object getWidth(FacesBean bean)
+ protected Object getWidth(
+ UIComponent component,
+ FacesBean bean)
{
return bean.getProperty(_widthKey);
}
- protected Object getHalign(FacesBean bean)
+ protected Object getHalign(
+ UIComponent component,
+ FacesBean bean)
{
return bean.getProperty(_halignKey);
}
- protected Object getValign(FacesBean bean)
+ protected Object getValign(
+ UIComponent component,
+ FacesBean bean)
{
return bean.getProperty(_valignKey);
}
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/ScriptRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/ScriptRenderer.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/ScriptRenderer.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/ScriptRenderer.java Tue Jan 5 11:48:54 2010
@@ -6,9 +6,9 @@
* 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
@@ -20,8 +20,6 @@
import java.io.IOException;
-import java.util.List;
-
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
@@ -29,20 +27,20 @@
import org.apache.myfaces.trinidad.bean.FacesBean;
import org.apache.myfaces.trinidad.bean.PropertyKey;
import org.apache.myfaces.trinidad.component.html.HtmlScript;
-
import org.apache.myfaces.trinidad.context.RenderingContext;
-
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer;
+
public class ScriptRenderer extends XhtmlRenderer
{
public ScriptRenderer()
{
super(HtmlScript.TYPE);
}
-
+
@Override
- protected void findTypeConstants(FacesBean.Type type)
+ protected void findTypeConstants(
+ FacesBean.Type type)
{
super.findTypeConstants(type);
_textKey = type.findKey("text");
@@ -70,13 +68,13 @@
// TODO: should we render language="javascript"? The
// old renderer did
renderScriptTypeAttribute(context, arc);
- if (!getGeneratesContent(bean))
+ if (!getGeneratesContent(component, bean))
{
renderScriptDeferAttribute(context, arc);
}
- String source = getSource(context, bean);
- String text = getText(bean);
+ String source = getSource(context, component, bean);
+ String text = getText(component, bean);
if (source != null)
{
renderEncodedResourceURI(context, "src", source);
@@ -99,7 +97,7 @@
{
rw.startElement("script", component);
renderScriptTypeAttribute(context, arc);
- if (!getGeneratesContent(bean))
+ if (!getGeneratesContent(component, bean))
{
renderScriptDeferAttribute(context, arc);
}
@@ -109,22 +107,29 @@
}
}
- protected String getSource(FacesContext context, FacesBean bean)
+ protected String getSource(
+ FacesContext context,
+ UIComponent component,
+ FacesBean bean)
{
return toResourceUri(context, bean.getProperty(_sourceKey));
}
- protected String getText(FacesBean bean)
+ protected String getText(
+ UIComponent component,
+ FacesBean bean)
{
return toString(bean.getProperty(_textKey));
}
- protected boolean getGeneratesContent(FacesBean bean)
+ protected boolean getGeneratesContent(
+ UIComponent component,
+ FacesBean bean)
{
Object o = bean.getProperty(_generatesContentKey);
if (o == null)
o = _generatesContentKey.getDefault();
-
+
// TODO: change the default, as very few scripts actually
// write content
return Boolean.TRUE.equals(o);
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/TableLayoutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/TableLayoutRenderer.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/TableLayoutRenderer.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/html/TableLayoutRenderer.java Tue Jan 5 11:48:54 2010
@@ -6,9 +6,9 @@
* 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
@@ -20,8 +20,6 @@
import java.io.IOException;
-import java.util.List;
-
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
@@ -29,21 +27,21 @@
import org.apache.myfaces.trinidad.bean.FacesBean;
import org.apache.myfaces.trinidad.bean.PropertyKey;
import org.apache.myfaces.trinidad.component.html.HtmlTableLayout;
-
import org.apache.myfaces.trinidad.context.RenderingContext;
-
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.OutputUtils;
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer;
+
public class TableLayoutRenderer extends XhtmlRenderer
{
public TableLayoutRenderer()
{
super(HtmlTableLayout.TYPE);
}
-
+
@Override
- protected void findTypeConstants(FacesBean.Type type)
+ protected void findTypeConstants(
+ FacesBean.Type type)
{
super.findTypeConstants(type);
_widthKey = type.findKey("width");
@@ -62,44 +60,45 @@
@Override
protected void encodeAll(
- FacesContext context,
- RenderingContext arc,
- UIComponent component,
- FacesBean bean) throws IOException
+ FacesContext context,
+ RenderingContext rc,
+ UIComponent component,
+ FacesBean bean
+ ) throws IOException
{
ResponseWriter rw = context.getResponseWriter();
rw.startElement("table", component);
renderId(context, component);
- renderAllAttributes(context, arc, bean);
- renderHAlign(context, arc, getHalign(bean));
+ renderAllAttributes(context, rc, component, bean);
+ renderHAlign(context, rc, getHalign(component, bean));
// TODO: if TABLES_CAP_ADVANCED and TABLES_CAP_ADVANCED_ATTRS
// are both false, don't render cell padding, cell spacing, or border
- OutputUtils.renderDataTableAttributes(context,
- arc,
- getCellPadding(bean),
- getCellSpacing(bean),
- getBorderWidth(bean),
- getWidth(bean),
- getSummary(bean));
-
-
+ OutputUtils.renderDataTableAttributes(context, rc, getCellPadding(component, bean),
+ getCellSpacing(component, bean), getBorderWidth(component, bean),
+ getWidth(component, bean), getSummary(component, bean));
encodeAllChildren(context, component);
rw.endElement("table");
}
- protected Object getWidth(FacesBean bean)
+ protected Object getWidth(
+ UIComponent component,
+ FacesBean bean)
{
return bean.getProperty(_widthKey);
}
- protected Object getHalign(FacesBean bean)
+ protected Object getHalign(
+ UIComponent component,
+ FacesBean bean)
{
return bean.getProperty(_halignKey);
}
- protected Object getCellSpacing(FacesBean bean)
+ protected Object getCellSpacing(
+ UIComponent component,
+ FacesBean bean)
{
Object o = bean.getProperty(_cellSpacingKey);
if (o == null)
@@ -107,7 +106,9 @@
return o;
}
- protected Object getCellPadding(FacesBean bean)
+ protected Object getCellPadding(
+ UIComponent component,
+ FacesBean bean)
{
Object o = bean.getProperty(_cellPaddingKey);
if (o == null)
@@ -115,7 +116,9 @@
return o;
}
- protected Object getBorderWidth(FacesBean bean)
+ protected Object getBorderWidth(
+ UIComponent component,
+ FacesBean bean)
{
Object o = bean.getProperty(_borderWidthKey);
if (o == null)
@@ -123,7 +126,9 @@
return o;
}
- protected Object getSummary(FacesBean bean)
+ protected Object getSummary(
+ UIComponent component,
+ FacesBean bean)
{
Object o = bean.getProperty(_summaryKey);
// Because table layout is for layout, default to an empty
@@ -133,7 +138,6 @@
return o;
}
-
private PropertyKey _widthKey;
private PropertyKey _halignKey;
private PropertyKey _cellSpacingKey;
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/ComponentFacesBean.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/ComponentFacesBean.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/ComponentFacesBean.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/ComponentFacesBean.java Tue Jan 5 11:48:54 2010
@@ -6,9 +6,9 @@
* 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
@@ -19,23 +19,27 @@
package org.apache.myfaces.trinidadinternal.renderkit.htmlBasic;
import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import java.util.Set;
import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
+import javax.faces.component.behavior.ClientBehavior;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
import org.apache.myfaces.trinidad.bean.FacesBean;
import org.apache.myfaces.trinidad.bean.PropertyKey;
+
/**
- * Implementation of FacesBean that purely passes through
+ * Implementation of FacesBean that purely passes through
* back to a UIComponent. This exists so that we can
* reuse existing rendering code to render on a non-FacesBean-based
* component. It's also completely immutable.
- *
+ *
*/
public class ComponentFacesBean implements FacesBean
{
@@ -130,7 +134,6 @@
{
throw new UnsupportedOperationException();
}
-
final public Set<PropertyKey> keySet()
{
@@ -147,6 +150,16 @@
throw new UnsupportedOperationException();
}
+ public boolean initialStateMarked()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void clearInitialState()
+ {
+ throw new UnsupportedOperationException();
+ }
+
public void restoreState(FacesContext context, Object state)
{
throw new UnsupportedOperationException();
@@ -157,5 +170,15 @@
throw new UnsupportedOperationException();
}
+ public void addClientBehavior(String eventName, ClientBehavior behavior)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Map<String, List<ClientBehavior>> getClientBehaviors()
+ {
+ throw new UnsupportedOperationException();
+ }
+
private final UIComponent _component;
}
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlCommandButtonRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlCommandButtonRenderer.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlCommandButtonRenderer.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlCommandButtonRenderer.java Tue Jan 5 11:48:54 2010
@@ -6,9 +6,9 @@
* 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
@@ -48,42 +48,42 @@
UIComponent component)
throws IOException
{
- if (!component.isRendered())
+ if (!component.isRendered())
{
return;
}
-
+
Map<String, Object> attrs = component.getAttributes();
UICommand command = (UICommand) component;
// Which button type (SUBMIT, RESET, or BUTTON) should we generate?
String type = CoreRenderer.toString(attrs.get("type"));
- if (type == null)
+ if (type == null)
{
type = "submit";
}
ResponseWriter writer = context.getResponseWriter();
-
+
String label = CoreRenderer.toString(command.getValue());
-
+
String imageSrc = CoreRenderer.toResourceUri(context, attrs.get("image"));
writer.startElement("input", component);
String id = component.getClientId(context);
writer.writeAttribute("id", id, "id");
writer.writeAttribute("name", id, null);
boolean isImage = (imageSrc != null);
- if (isImage)
+ if (isImage)
{
imageSrc = context.getExternalContext().encodeResourceURL(imageSrc);
writer.writeAttribute("type", "image", "type");
writer.writeURIAttribute("src", imageSrc, "image");
- }
- else
+ }
+ else
{
writer.writeAttribute("type", type.toLowerCase(), "type");
writer.writeAttribute("value", label, "value");
}
-
+
RenderingContext arc = RenderingContext.getCurrentInstance();
String script;
// If it's an image, we can't really go through the full-page submit
@@ -136,8 +136,8 @@
}
private void _writeBooleanPassThruAttr(
- ResponseWriter out,
- Map<String, Object> attrs,
+ ResponseWriter out,
+ Map<String, Object> attrs,
String key)
throws IOException
{
@@ -149,8 +149,8 @@
}
private void _writePassThruAttrs(
- ResponseWriter out,
- Map<String, Object> attrs,
+ ResponseWriter out,
+ Map<String, Object> attrs,
String[] keys)
throws IOException
{
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlCommandLinkRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlCommandLinkRenderer.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlCommandLinkRenderer.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlCommandLinkRenderer.java Tue Jan 5 11:48:54 2010
@@ -6,9 +6,9 @@
* 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
@@ -19,6 +19,7 @@
package org.apache.myfaces.trinidadinternal.renderkit.htmlBasic;
import java.io.IOException;
+
import java.util.List;
import javax.faces.component.UIComponent;
@@ -27,9 +28,9 @@
import org.apache.myfaces.trinidad.bean.FacesBean;
import org.apache.myfaces.trinidad.render.RenderUtils;
-
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.CommandLinkRenderer;
+
/**
* Renderer for h:commandLink.
* <p>
@@ -81,38 +82,48 @@
return new CommandLinkRenderer()
{
@Override
- public FacesBean getFacesBean(UIComponent comp)
+ public FacesBean getFacesBean(
+ UIComponent comp)
{
return bean;
}
@Override
- protected String getText(FacesBean bean)
+ protected String getText(
+ UIComponent component,
+ FacesBean bean)
{
return toString(component.getAttributes().get("value"));
}
@Override
- protected String getShortDesc(FacesBean bean)
+ protected String getShortDesc(
+ UIComponent component,
+ FacesBean bean)
{
return toString(component.getAttributes().get("title"));
}
@Override
- protected char getAccessKey(FacesBean bean)
+ protected char getAccessKey(
+ UIComponent component,
+ FacesBean bean)
{
return toChar(component.getAttributes().get("accesskey"));
}
@Override
- protected String getInlineStyle(FacesBean bean)
+ protected String getInlineStyle(
+ UIComponent component,
+ FacesBean bean)
{
return toString(component.getAttributes().get("style"));
}
-
@Override
- protected boolean getDisabled(FacesBean bean)
+ protected boolean getDisabled(
+ UIComponent component,
+ FacesBean bean)
{
return Boolean.TRUE.equals(component.getAttributes().get("disabled"));
}
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlFormRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlFormRenderer.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlFormRenderer.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlFormRenderer.java Tue Jan 5 11:48:54 2010
@@ -6,9 +6,9 @@
* 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
@@ -19,6 +19,7 @@
package org.apache.myfaces.trinidadinternal.renderkit.htmlBasic;
import java.io.IOException;
+
import java.util.Map;
import javax.faces.component.UIComponent;
@@ -26,9 +27,9 @@
import javax.faces.render.Renderer;
import org.apache.myfaces.trinidad.bean.FacesBean;
-
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.FormRenderer;
+
/**
* Renderer for h:commandLink.
* <p>
@@ -69,32 +70,41 @@
return new FormRenderer()
{
@Override
- public FacesBean getFacesBean(UIComponent comp)
+ public FacesBean getFacesBean(
+ UIComponent comp)
{
return bean;
}
@Override
- protected String getInlineStyle(FacesBean bean)
+ protected String getInlineStyle(
+ UIComponent component,
+ FacesBean bean)
{
return toString(component.getAttributes().get("style"));
}
@Override
- protected String getTargetFrame(FacesBean bean)
+ protected String getTargetFrame(
+ UIComponent component,
+ FacesBean bean)
{
return toString(component.getAttributes().get("target"));
}
@Override
- protected String getShortDesc(FacesBean bean)
+ protected String getShortDesc(
+ UIComponent component,
+ FacesBean bean)
{
return toString(component.getAttributes().get("title"));
}
@SuppressWarnings("unchecked")
@Override
- protected boolean getUsesUpload(FacesBean bean)
+ protected boolean getUsesUpload(
+ UIComponent component,
+ FacesBean bean)
{
Map<String, Object> attrs = component.getAttributes();
return "multipart/form-data".equals(attrs.get("enctype"));
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java Tue Jan 5 11:48:54 2010
@@ -35,6 +35,7 @@
import javax.el.ELContext;
import javax.el.ValueExpression;
+import javax.faces.application.ProjectStage;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
@@ -921,9 +922,37 @@
// else return false.
private boolean _isDisableContentCompressionParameterTrue(FacesContext context)
{
- ExternalContext external = context.getExternalContext();
+ // TODO: this section needs to be MOVED up, perhaps to API,
+ // as the StyleContextIMPL.java has exactly the same code;
+ // this will be fixed with the advent of "TRINIDAD-1662".
+
+ String disableContentCompression = context.getExternalContext().
+ getInitParameter(Configuration.DISABLE_CONTENT_COMPRESSION);
- return "true".equals(external.getInitParameter(Configuration.DISABLE_CONTENT_COMPRESSION));
+ boolean disableContentCompressionBoolean;
+
+ // what value has been specified for the DISABLE_CONTENT_COMPRESSION param?
+ if (disableContentCompression != null)
+ {
+ disableContentCompressionBoolean = "true".equals(disableContentCompression);
+ }
+ else
+ {
+ // if the DISABLE_CONTENT_COMPRESSION parameter has NOT been specified, let us
+ // apply the DEFAULT values for the certain Project Stages:
+ // -PRODUCTION we want this value to be FALSE;
+ // -other stages we use TRUE
+ disableContentCompressionBoolean = !(context.isProjectStage(ProjectStage.Production));
+ }
+
+ // if Apache MyFaces Trinidad is running in production stage and
+ // running with content compression disabled we generate a WARNING
+ // message
+ if (disableContentCompressionBoolean && context.isProjectStage(ProjectStage.Production))
+ {
+ _LOG.warning("DISABLE_CONTENT_COMPRESSION_IN_PRODUCTION_STAGE");
+ }
+ return disableContentCompressionBoolean;
}
// a TranslationSource fills in the keyValueMap differently depending upon
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js Tue Jan 5 11:48:54 2010
@@ -1847,13 +1847,13 @@
// WM5.
if (isPartial && _supportsPPR())
{
- // In the case of Windows-mobile(WM) browsers, during rendering,
+ // In the case of Windows-mobile(WM) browsers, during rendering,
// Trinidad stores the value of the request-header field, UA-pixels,
- // into a hidden-parameter's value attribute. WM browsers' PPRs don't
- // contain UA-pixels in their request-headers. So during a WM browser's
- // PPR, we need to manually set the field, UA-pixels, into the
+ // into a hidden-parameter's value attribute. WM browsers' PPRs don't
+ // contain UA-pixels in their request-headers. So during a WM browser's
+ // PPR, we need to manually set the field, UA-pixels, into the
// request-header with the hidden parameter's value.
-
+
if (_agent.isPIE || _agent.isWindowsMobile6)
{
var header = new Array(1);
@@ -1861,9 +1861,9 @@
TrPage.getInstance().sendPartialFormPost(form, parameters, header);
}
else
- {
+ {
TrPage.getInstance().sendPartialFormPost(form, parameters);
- }
+ }
}
else
{
@@ -3148,14 +3148,35 @@
shortCircuit // shortcircuit if handler 1 false
)
{
- var result1 = _callChained(evh1, target, event);
- if ( shortCircuit && (result1 == false))
- return false;
- var result2 = _callChained(evh2, target, event);
+ return _chainMultiple([evh1, evh2], target, event, shortCircuit);
+}
- // since undefined results should be evaluated as true,
- // return false only if either result1 or result2 return false
- return !((result1 == false) || (result2 == false));
+/**
+ * Chain two or more functions together returning whether the default
+ * event handling should occur
+ */
+function _chainMultiple(
+ eventHandlers, // Array of event handler JavaScript strings
+ target, // target of event
+ event, // the fired event (or null)
+ shortCircuit // shortcircuit if handler 1 false
+ )
+{
+ var overallResult = true;
+ for (var i = 0, size = eventHandlers.length; i < size; ++i)
+ {
+ var result = _callChained(eventHandlers[i], target, event);
+ if (result === false)
+ {
+ if (shortCircuit)
+ {
+ return false;
+ }
+ overallResult = false;
+ }
+ }
+
+ return overallResult;
}
function _callChained(
@@ -3206,11 +3227,8 @@
{
return true;
}
-
}
-
-
// Enforce the maximum length of a form element
// Returns true if event processing should continue, false otherwise.
function _checkLength(formElement, length, event)
Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/resources/META-INF/trinidad-version.txt
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/resources/META-INF/trinidad-version.txt?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/resources/META-INF/trinidad-version.txt (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/resources/META-INF/trinidad-version.txt Tue Jan 5 11:48:54 2010
@@ -1 +1 @@
-1_2_12_2
+2_0_0