Author: ekoneil Date: Wed Jan 26 10:57:36 2005 New Revision: 126525 URL: http://svn.apache.org/viewcvs?view=rev&rev=126525 Log: Add two new data grid column types:
- templateColumn Add a column that outputs its body. This supports things like: <netui:textBox/> inside of a data grid column. - imageAnchorColumn Add a column that renders an image anchor as: <a><img/></a> BB: self DRT: NetUI drt / datagrid pass Added: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/cell/ImageAnchorCellModel.java (contents, props changed) incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/cell/TemplateCellModel.java (contents, props changed) incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/rendering/cell/ImageAnchorCellDecorator.java (contents, props changed) incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorColumn.java (contents, props changed) incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/TemplateColumn.java (contents, props changed) incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/misc/imageAnchorColumn.jsp (contents, props changed) incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/misc/imageColumn.jsp (contents, props changed) incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/misc/templateColumn.jsp (contents, props changed) incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridImageAnchorColumnSmokeTest.xml (contents, props changed) incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridImageColumnTest.xml (contents, props changed) incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridTemplateColumnTest.xml (contents, props changed) Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/CellModel.java incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/cellrepeater/CellRepeater.java incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractColumn.java incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlColumn.java incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AnchorColumn.java incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageColumn.java incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanColumn.java incubator/beehive/trunk/netui/test/ant/buildWebapp.xml incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/CellModel.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/CellModel.java?view=diff&rev=126525&p1=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/CellModel.java&r1=126524&p2=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/CellModel.java&r2=126525 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/CellModel.java (original) +++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/CellModel.java Wed Jan 26 10:57:36 2005 @@ -33,9 +33,6 @@ private DataGridModel _dataGridModel; private ArrayList<Formatter> _formatters; - public CellModel() { - } - public boolean isRenderingHeader() { return _columnsModel.getRenderState() == ColumnsModel.HEADER_RENDER_STATE; } Added: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/cell/ImageAnchorCellModel.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/cell/ImageAnchorCellModel.java?view=auto&rev=126525 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/cell/ImageAnchorCellModel.java Wed Jan 26 10:57:36 2005 @@ -0,0 +1,41 @@ +/* + * Copyright 2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * $Header:$ + */ +package org.apache.beehive.netui.databinding.datagrid.model.cell; + +import org.apache.beehive.netui.tags.rendering.ImageTag; +import org.apache.beehive.netui.tags.rendering.ImageTag.State; + +/** + * + */ +public class ImageAnchorCellModel + extends AnchorCellModel { + + private ImageTag.State _imageState = null; + + public ImageTag.State getImageState() { + if(_imageState == null) + _imageState = new ImageTag.State(); + + return _imageState; + } + + public void setImageState(State imageState) { + _imageState = imageState; + } +} Added: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/cell/TemplateCellModel.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/cell/TemplateCellModel.java?view=auto&rev=126525 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/cell/TemplateCellModel.java Wed Jan 26 10:57:36 2005 @@ -0,0 +1,27 @@ +/* + * Copyright 2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * $Header:$ + */ +package org.apache.beehive.netui.databinding.datagrid.model.cell; + +import org.apache.beehive.netui.databinding.datagrid.model.CellModel; + +/** + * + */ +public class TemplateCellModel + extends CellModel { +} Added: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/rendering/cell/ImageAnchorCellDecorator.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/rendering/cell/ImageAnchorCellDecorator.java?view=auto&rev=126525 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/rendering/cell/ImageAnchorCellDecorator.java Wed Jan 26 10:57:36 2005 @@ -0,0 +1,86 @@ +/* + * Copyright 2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * $Header:$ + */ +package org.apache.beehive.netui.databinding.datagrid.rendering.cell; + +import java.net.URISyntaxException; +import javax.servlet.jsp.JspContext; +import javax.servlet.http.HttpServletRequest; + +import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender; +import org.apache.beehive.netui.tags.rendering.AnchorTag; +import org.apache.beehive.netui.tags.rendering.ImageTag; +import org.apache.beehive.netui.tags.rendering.TagRenderingBase; +import org.apache.beehive.netui.tags.databinding.datagrid.DataGridUtil; +import org.apache.beehive.netui.databinding.datagrid.model.CellModel; +import org.apache.beehive.netui.databinding.datagrid.model.DataGridModel; +import org.apache.beehive.netui.databinding.datagrid.model.cell.ImageAnchorCellModel; +import org.apache.beehive.netui.databinding.datagrid.util.JspUtil; +import org.apache.beehive.netui.util.logging.Logger; + +/** + */ +public class ImageAnchorCellDecorator + extends CellDecorator { + + private static final Logger LOGGER = Logger.getInstance(ImageAnchorCellDecorator.class); + + public void decorate(JspContext jspContext, AbstractRenderAppender appender, CellModel cellModel) + throws CellDecoratorException { + + HttpServletRequest request = JspUtil.getRequest(jspContext); + + assert cellModel instanceof ImageAnchorCellModel; + ImageAnchorCellModel imageAnchorCellModel = (ImageAnchorCellModel)cellModel; + + + AnchorTag.State anchorState = imageAnchorCellModel.getAnchorState(); + ImageTag.State imageState = imageAnchorCellModel.getImageState(); + + DataGridModel dgm = DataGridUtil.getDataGridModel(jspContext); + assert dgm != null; + + String url = null; + try { + url = JspUtil.createURL(imageAnchorCellModel.getHref(), + imageAnchorCellModel.getAction(), + null, + imageAnchorCellModel.getScopeId(), + imageAnchorCellModel.getParams(), + jspContext); + } catch(URISyntaxException mue) { + + if(LOGGER.isErrorEnabled()) + LOGGER.error("Exception creating URL with href " + imageAnchorCellModel.getHref() + + " action " + imageAnchorCellModel.getAction(), mue); + + throw new CellDecoratorException("An exception occurred creating an URL while decorating an Anchor", mue); + } + + anchorState.href = url; + + TagRenderingBase imageTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.IMAGE_TAG, request); + TagRenderingBase anchorTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.ANCHOR_TAG, request); + + anchorTag.doStartTag(appender, anchorState); + imageTag.doStartTag(appender, imageState); + imageTag.doEndTag(appender); + anchorTag.doEndTag(appender); + + + } +} Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/cellrepeater/CellRepeater.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/cellrepeater/CellRepeater.java?view=diff&rev=126525&p1=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/cellrepeater/CellRepeater.java&r1=126524&p2=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/cellrepeater/CellRepeater.java&r2=126525 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/cellrepeater/CellRepeater.java (original) +++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/cellrepeater/CellRepeater.java Wed Jan 26 10:57:36 2005 @@ -17,30 +17,21 @@ */ package org.apache.beehive.netui.tags.databinding.cellrepeater; -// java imports - import java.util.ArrayList; import java.util.Iterator; import java.util.List; - import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.TryCatchFinally; -// internal imports import org.apache.beehive.netui.tags.DataSourceTag; - import org.apache.beehive.netui.tags.databinding.cellrepeater.style.CellRepeaterStyleBean; - import org.apache.beehive.netui.util.Bundle; import org.apache.beehive.netui.util.exception.LocalizedUnsupportedOperationException; import org.apache.beehive.netui.util.logging.Logger; import org.apache.beehive.netui.util.iterator.IteratorFactory; -import org.apache.beehive.netui.script.common.DataAccessProviderBean; import org.apache.beehive.netui.script.common.IDataAccessProvider; import org.apache.beehive.netui.script.common.DataAccessProviderStack; -// external imports - /** * <p/> * The CellRepeater tag is a repeating, databound tag that renders @@ -154,7 +145,6 @@ implements IDataAccessProvider, TryCatchFinally { private static final Logger LOGGER = Logger.getInstance(CellRepeater.class); - private static final int DEFAULT_DIMENSION_VALUE = -1; private boolean _valid = true; @@ -165,7 +155,7 @@ private int _currentColumn = -1; private int _rows = DEFAULT_DIMENSION_VALUE; private StringBuilder _contentBuffer = null; - private List _dataList = null; + private ArrayList _dataList = null; private Object _currentItem = null; private CellRepeaterStyleBean _styleContext = new CellRepeaterStyleBean(); @@ -378,18 +368,20 @@ if(getDataSource() != null) source = evaluateDataSource(); - if(hasErrors()) return SKIP_BODY; + if(hasErrors()) + return SKIP_BODY; if(source != null) { Iterator iterator = null; iterator = IteratorFactory.createIterator(source); if(iterator == null) { - // @TODO: Logging - System.err.println("CellRepeater: The data structure from which to create an iterator is null."); + if(LOGGER.isInfoEnabled()) + LOGGER.info("CellRepeater: The data structure from which to create an iterator is null."); iterator = IteratorFactory.EMPTY_ITERATOR; } - if(hasErrors()) return SKIP_BODY; + if(hasErrors()) + return SKIP_BODY; if(iterator != null) { _dataList = new ArrayList(); @@ -399,17 +391,16 @@ } } - // get the rows / columns if they were databound - //evaluateRowColumnExpressions(); - - if(hasErrors()) return SKIP_BODY; + if(hasErrors()) + return SKIP_BODY; if(_rows == DEFAULT_DIMENSION_VALUE || _columns == DEFAULT_DIMENSION_VALUE) { - // can try to guess the dimensions + /* try to guess the dimensions of the table */ if(_dataList != null && _dataList.size() > 0) { guessDimensions(_dataList); - if(hasErrors()) return SKIP_BODY; + if(hasErrors()) + return SKIP_BODY; } // can't guess the dimensions else { @@ -422,7 +413,8 @@ // check to make sure the rows / columns are actually valid before starting to render validateAttributes(_rows, _columns); - if(hasErrors()) return SKIP_BODY; + if(hasErrors()) + return SKIP_BODY; addContent(renderTableTag()); @@ -485,9 +477,8 @@ } // end - if(_currentRow == _rows && _currentColumn == 0) { + if(_currentRow == _rows && _currentColumn == 0) return SKIP_BODY; - } if(_currentColumn == 0) addContent((renderRowTag())); @@ -498,7 +489,8 @@ haveNext = ensureItem(_currentRow * _columns + _currentColumn, _dataList); if(!haveNext) { - if(LOGGER.isDebugEnabled()) LOGGER.debug("missing next at location (" + _currentRow + ", " + _currentColumn + ")"); + if(LOGGER.isDebugEnabled()) + LOGGER.debug("missing next at location (" + _currentRow + ", " + _currentColumn + ")"); // render empty cell addContent(renderCellTag(computeStyleIndex(_currentRow, _currentColumn))); @@ -525,7 +517,6 @@ reportErrors(); } else if(_valid) { addContent("</table>"); - write(getContent()); } @@ -606,7 +597,8 @@ */ protected void localRelease() { super.localRelease(); - if(bodyContent != null) bodyContent.clearBody(); + if(bodyContent != null) + bodyContent.clearBody(); _rows = DEFAULT_DIMENSION_VALUE; _columns = DEFAULT_DIMENSION_VALUE; @@ -631,7 +623,8 @@ if(_rows == 0 || _columns == 0) reportBasicError(Bundle.getString("Tags_CellRepeater_missingRowsOrColumns")); - if(data == null) return; + if(data == null) + return; int dataSize = data.size(); if(_rows == DEFAULT_DIMENSION_VALUE && _columns == DEFAULT_DIMENSION_VALUE) { @@ -639,11 +632,15 @@ } else if(_rows == DEFAULT_DIMENSION_VALUE) { int remainder = dataSize % _columns; _rows = (dataSize / _columns) + (remainder > 0 ? 1 : 0); - if(LOGGER.isDebugEnabled()) LOGGER.debug("guessed row size: " + _rows); + + if(LOGGER.isDebugEnabled()) + LOGGER.debug("guessed row size: " + _rows); } else if(_columns == DEFAULT_DIMENSION_VALUE) { int remainder = dataSize % _rows; _columns = (dataSize / _rows) + (remainder > 0 ? 1 : 0); - if(LOGGER.isDebugEnabled()) LOGGER.debug("guessed column size: " + _columns); + + if(LOGGER.isDebugEnabled()) + LOGGER.debug("guessed column size: " + _columns); } } @@ -709,7 +706,6 @@ _currentItem = data.get(index); _currentIndex = index; return true; - } else - return false; + } else return false; } } Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractColumn.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractColumn.java?view=diff&rev=126525&p1=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractColumn.java&r1=126524&p2=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractColumn.java&r2=126525 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractColumn.java (original) +++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractColumn.java Wed Jan 26 10:57:36 2005 @@ -28,7 +28,6 @@ import org.apache.beehive.netui.tags.rendering.StringBuilderRenderAppender; import org.apache.beehive.netui.tags.html.IFormattable; import org.apache.beehive.netui.tags.html.FormatTag.Formatter; -import org.apache.beehive.netui.util.logging.Logger; /** * @@ -37,7 +36,6 @@ extends AbstractSimpleTag implements IFormattable { - private static final Logger LOGGER = Logger.getInstance(AbstractColumn.class); private static final String EMPTY_CELL = " "; private String _headerText = null; Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlColumn.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlColumn.java?view=diff&rev=126525&p1=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlColumn.java&r1=126524&p2=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlColumn.java&r2=126525 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlColumn.java (original) +++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlColumn.java Wed Jan 26 10:57:36 2005 @@ -47,7 +47,6 @@ implements IAttributeConsumer { private static final String HEADER_FACET_NAME = "header"; - private static final String DEFAULT_FACET_NAME = "default"; private static final String CELL_FACET_NAME = "cell"; private static final CellDecorator DEFAULT_HEADER_RENDERER; @@ -125,192 +124,6 @@ _headerCellModel.setSortHref(sortHref); } - /** - * Sets the onClick javascript event. - * - * @param onClick - the onClick event. - * @jsptagref.attributedescription The onClick JavaScript event. - * @jsptagref.databindable false - * @jsptagref.attributesyntaxvalue <i>string_onClick</i> - * @netui:attribute required="false" rtexprvalue="true" description="The onClick JavaScript event." - * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" - */ - public void setOnClick(String onClick) { - internalGetHtmlState().registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONCLICK, onClick); - } - - /** - * Sets the onDblClick javascript event. - * - * @param onDblClick - the onDblClick event. - * @jsptagref.attributedescription The onDblClick JavaScript event. - * @jsptagref.databindable false - * @jsptagref.attributesyntaxvalue <i>string_onDblClick</i> - * @netui:attribute required="false" rtexprvalue="true" description="The onDblClick JavaScript event." - * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" - */ - public void setOnDblClick(String onDblClick) { - internalGetHtmlState().registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONDBLCLICK, onDblClick); - } - - /** - * Sets the onKeyDown javascript event. - * - * @param onKeyDown - the onKeyDown event. - * @jsptagref.attributedescription The onKeyDown JavaScript event. - * @jsptagref.databindable false - * @jsptagref.attributesyntaxvalue <i>string_onKeyDown</i> - * @netui:attribute required="false" rtexprvalue="true" description="The onKeyDown JavaScript event." - * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" - */ - public void setOnKeyDown(String onKeyDown) { - internalGetHtmlState().registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYDOWN, onKeyDown); - } - - /** - * Sets the onKeyUp javascript event. - * - * @param onKeyUp - the onKeyUp event. - * @jsptagref.attributedescription The onKeyUp JavaScript event. - * @jsptagref.databindable false - * @jsptagref.attributesyntaxvalue <i>string_onKeyUp</i> - * @netui:attribute required="false" rtexprvalue="true" description="The onKeyUp JavaScript event." - * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" - */ - public void setOnKeyUp(String onKeyUp) { - internalGetHtmlState().registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYUP, onKeyUp); - } - - /** - * Sets the onKeyPress javascript event. - * - * @param onKeyPress - the onKeyPress event. - * @jsptagref.attributedescription The onKeyPress JavaScript event. - * @jsptagref.databindable false - * @jsptagref.attributesyntaxvalue <i>string_onKeyPress</i> - * @netui:attribute required="false" rtexprvalue="true" description="The onKeyPress JavaScript event." - * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" - */ - public void setOnKeyPress(String onKeyPress) { - internalGetHtmlState().registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYPRESS, onKeyPress); - } - - /** - * Sets the onMouseDown javascript event. - * - * @param onMouseDown - the onMouseDown event. - * @jsptagref.attributedescription The onMouseDown JavaScript event. - * @jsptagref.databindable false - * @jsptagref.attributesyntaxvalue <i>string_onMouseDown</i> - * @netui:attribute required="false" rtexprvalue="true" description="The onMouseDown JavaScript event." - * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" - */ - public void setOnMouseDown(String onMouseDown) { - internalGetHtmlState().registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEDOWN, onMouseDown); - } - - /** - * Sets the onMouseUp javascript event. - * - * @param onMouseUp - the onMouseUp event. - * @jsptagref.attributedescription The onMouseUp JavaScript event. - * @jsptagref.databindable false - * @jsptagref.attributesyntaxvalue <i>string_onMouseUp</i> - * @netui:attribute required="false" rtexprvalue="true" description="The onMouseUp JavaScript event." - * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" - */ - public void setOnMouseUp(String onMouseUp) { - internalGetHtmlState().registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEUP, onMouseUp); - } - - /** - * Sets the onMouseMove javascript event. - * - * @param onMouseMove - the onMouseMove event. - * @jsptagref.attributedescription The onMouseMove JavaScript event. - * @jsptagref.databindable false - * @jsptagref.attributesyntaxvalue <i>string_onMouseMove</i> - * @netui:attribute required="false" rtexprvalue="true" description="The onMouseMove JavaScript event." - * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" - */ - public void setOnMouseMove(String onMouseMove) { - internalGetHtmlState().registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEMOVE, onMouseMove); - } - - /** - * Sets the onMouseOut javascript event. - * - * @param onMouseOut - the onMouseOut event. - * @jsptagref.attributedescription The onMouseOut JavaScript event. - * @jsptagref.databindable false - * @jsptagref.attributesyntaxvalue <i>string_onMouseOut</i> - * @netui:attribute required="false" rtexprvalue="true" description="The onMouseOut JavaScript event." - * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" - */ - public void setOnMouseOut(String onMouseOut) { - internalGetHtmlState().registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOUT, onMouseOut); - } - - /** - * Sets the onMouseOver javascript event. - * - * @param onMouseOver - the onMouseOver event. - * @jsptagref.attributedescription The onMouseOver JavaScript event. - * @jsptagref.databindable false - * @jsptagref.attributesyntaxvalue <i>string_onMouseOver</i> - * @netui:attribute required="false" rtexprvalue="true" description="The onMouseOver JavaScript event." - * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" - */ - public void setOnMouseOver(String onMouseOver) { - internalGetHtmlState().registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOVER, onMouseOver); - } - - /** - * Sets the style of the rendered html tag. - * - * @param style - the html style. - * @jsptagref.attributedescription The style. - * @jsptagref.databindable false - * @jsptagref.attributesyntaxvalue <i>string_style</i> - * @netui:attribute required="false" rtexprvalue="true" description="The style." - * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.JspStyleProperty" category="format" - */ - public void setStyle(String style) { - if("".equals(style)) return; - - internalGetHtmlState().style = style; - } - - /** - * Sets the style class of the rendered html tag. - * - * @param styleClass - the html style class. - * @jsptagref.attributedescription The style class. - * @jsptagref.databindable false - * @jsptagref.attributesyntaxvalue <i>string_style_class</i> - * @netui:attribute required="false" rtexprvalue="true" description="The style class." - * @netui.tldx:attribute category="Format" - */ - public void setStyleClass(String styleClass) { - if("".equals(styleClass)) return; - - internalGetHtmlState().styleClass = styleClass; - } - - /** - * Sets the value of the title attribute. - * - * @param title - * @jsptagref.attributedescription The title. - * @jsptagref.databindable false - * @jsptagref.attributesyntaxvalue <i>string_title</i> - * @netui:attribute required="false" rtexprvalue="true" description="The title. " - * @netui.tldx:attribute category="misc" - */ - public void setTitle(String title) { - internalGetHtmlState().registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TITLE, title); - } - /* -------------------------------------------------------------- * * <th> attributes @@ -715,16 +528,12 @@ addStateAttribute(_thState, name, value); else if(facet != null && facet.equals(CELL_FACET_NAME)) addStateAttribute(_tdState, name, value); - else if(facet == null || !facet.equals(DEFAULT_FACET_NAME)) - addStateAttribute(internalGetHtmlState(), name, value); else { String s = Bundle.getString("Tags_AttributeFacetNotSupported", new Object[]{facet}); throw new JspException(s); } } - protected abstract AbstractHtmlState internalGetHtmlState(); - protected void renderHeaderCell(AbstractRenderAppender appender) throws IOException, JspException { @@ -777,14 +586,11 @@ /* todo: this needs to run in order to cause the nested parameter / attribute / etc tags to do their work */ JspFragment fragment = getJspBody(); StringWriter sw = new StringWriter(); - if(fragment != null) { + if(fragment != null) fragment.invoke(sw); - /* ignore any produced output */ - sw.toString(); - } tableRenderer.openTableCell(_tdState, appender); - renderDataCellContents(appender); + renderDataCellContents(appender, sw.toString()); tableRenderer.closeTableCell(appender); } @@ -808,7 +614,8 @@ SORTED_HEADER_RENDERER.decorate(getJspContext(), appender, _headerCellModel); } - protected abstract void renderDataCellContents(AbstractRenderAppender appender); + protected abstract void renderDataCellContents(AbstractRenderAppender appender, String output) + throws IOException, JspException; protected void applyAttributes() throws JspException { @@ -839,7 +646,7 @@ } } - private void addStateAttribute(AbstractHtmlState state, String name, String value) + protected final void addStateAttribute(AbstractHtmlState state, String name, String value) throws JspException { // validate the name attribute, in the case of an error simply return. Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AnchorColumn.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AnchorColumn.java?view=diff&rev=126525&p1=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AnchorColumn.java&r1=126524&p2=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AnchorColumn.java&r2=126525 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AnchorColumn.java (original) +++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AnchorColumn.java Wed Jan 26 10:57:36 2005 @@ -26,6 +26,7 @@ import org.apache.beehive.netui.tags.html.HtmlConstants; import org.apache.beehive.netui.tags.rendering.AbstractHtmlState; import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender; +import org.apache.beehive.netui.tags.rendering.AnchorTag; import org.apache.beehive.netui.util.ParamHelper; import org.apache.beehive.netui.util.Bundle; @@ -44,6 +45,7 @@ private static final String REQUIRED_ATTR = "href, action, linkName"; private AnchorCellModel _anchorCellModel = new AnchorCellModel(); + private AnchorTag.State _anchorState = _anchorCellModel.getAnchorState(); public String getTagName() { return "AnchorColumn"; @@ -51,16 +53,188 @@ /** * Sets the onClick javascript event. - * @param onclick - the onClick event. + * + * @param onClick - the onClick event. * @jsptagref.attributedescription The onClick JavaScript event. * @jsptagref.databindable false * @jsptagref.attributesyntaxvalue <i>string_onClick</i> - * @netui:attribute required="false" rtexprvalue="true" - * description="The onClick JavaScript event." + * @netui:attribute required="false" rtexprvalue="true" description="The onClick JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnClick(String onClick) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONCLICK, onClick); + } + + /** + * Sets the onDblClick javascript event. + * + * @param onDblClick - the onDblClick event. + * @jsptagref.attributedescription The onDblClick JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onDblClick</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onDblClick JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnDblClick(String onDblClick) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONDBLCLICK, onDblClick); + } + + /** + * Sets the onKeyDown javascript event. + * + * @param onKeyDown - the onKeyDown event. + * @jsptagref.attributedescription The onKeyDown JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onKeyDown</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onKeyDown JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnKeyDown(String onKeyDown) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYDOWN, onKeyDown); + } + + /** + * Sets the onKeyUp javascript event. + * + * @param onKeyUp - the onKeyUp event. + * @jsptagref.attributedescription The onKeyUp JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onKeyUp</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onKeyUp JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnKeyUp(String onKeyUp) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYUP, onKeyUp); + } + + /** + * Sets the onKeyPress javascript event. + * + * @param onKeyPress - the onKeyPress event. + * @jsptagref.attributedescription The onKeyPress JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onKeyPress</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onKeyPress JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnKeyPress(String onKeyPress) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYPRESS, onKeyPress); + } + + /** + * Sets the onMouseDown javascript event. + * + * @param onMouseDown - the onMouseDown event. + * @jsptagref.attributedescription The onMouseDown JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseDown</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseDown JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseDown(String onMouseDown) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEDOWN, onMouseDown); + } + + /** + * Sets the onMouseUp javascript event. + * + * @param onMouseUp - the onMouseUp event. + * @jsptagref.attributedescription The onMouseUp JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseUp</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseUp JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseUp(String onMouseUp) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEUP, onMouseUp); + } + + /** + * Sets the onMouseMove javascript event. + * + * @param onMouseMove - the onMouseMove event. + * @jsptagref.attributedescription The onMouseMove JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseMove</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseMove JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseMove(String onMouseMove) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEMOVE, onMouseMove); + } + + /** + * Sets the onMouseOut javascript event. + * + * @param onMouseOut - the onMouseOut event. + * @jsptagref.attributedescription The onMouseOut JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseOut</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseOut JavaScript event." * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" */ - public void setOnClick(String onclick) { - _anchorCellModel.getAnchorState().onClick = setNonEmptyValueAttribute(onclick); + public void setOnMouseOut(String onMouseOut) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOUT, onMouseOut); + } + + /** + * Sets the onMouseOver javascript event. + * + * @param onMouseOver - the onMouseOver event. + * @jsptagref.attributedescription The onMouseOver JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseOver</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseOver JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseOver(String onMouseOver) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOVER, onMouseOver); + } + + /** + * Sets the style of the rendered html tag. + * + * @param style - the html style. + * @jsptagref.attributedescription The style. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_style</i> + * @netui:attribute required="false" rtexprvalue="true" description="The style." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.JspStyleProperty" category="format" + */ + public void setStyle(String style) { + if("".equals(style)) return; + + _anchorState.style = style; + } + + /** + * Sets the style class of the rendered html tag. + * + * @param styleClass - the html style class. + * @jsptagref.attributedescription The style class. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_style_class</i> + * @netui:attribute required="false" rtexprvalue="true" description="The style class." + * @netui.tldx:attribute category="Format" + */ + public void setStyleClass(String styleClass) { + if("".equals(styleClass)) return; + + _anchorState.styleClass = styleClass; + } + + /** + * Sets the value of the title attribute. + * + * @param title + * @jsptagref.attributedescription The title. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_title</i> + * @netui:attribute required="false" rtexprvalue="true" description="The title. " + * @netui.tldx:attribute category="misc" + */ + public void setTitle(String title) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TITLE, title); } /** @@ -207,6 +381,13 @@ _anchorCellModel.setAction(setRequiredValueAttribute(action, "action")); } + public void setAttribute(String name, String value, String facet) + throws JspException { + if(facet == null) + super.addStateAttribute(_anchorState, name, value); + else super.setAttribute(name, value, facet); + } + public void addParameter(String name, Object value, String facet) throws JspException { ParamHelper.addParam(_anchorCellModel.getParams(), name, value); @@ -231,11 +412,7 @@ } } - protected AbstractHtmlState internalGetHtmlState() { - return _anchorCellModel.getAnchorState(); - } - - protected void renderDataCellContents(AbstractRenderAppender appender) { + protected void renderDataCellContents(AbstractRenderAppender appender, String jspFragmentOutput) { DECORATOR.decorate(getJspContext(), appender, _anchorCellModel); } Added: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorColumn.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorColumn.java?view=auto&rev=126525 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorColumn.java Wed Jan 26 10:57:36 2005 @@ -0,0 +1,604 @@ +/* + * Copyright 2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * $Header:$ + */ +package org.apache.beehive.netui.tags.databinding.datagrid; + +import javax.servlet.jsp.JspException; + +import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender; +import org.apache.beehive.netui.tags.rendering.AbstractHtmlState; +import org.apache.beehive.netui.tags.rendering.ImageTag; +import org.apache.beehive.netui.tags.rendering.AnchorTag; +import org.apache.beehive.netui.tags.html.HtmlConstants; +import org.apache.beehive.netui.databinding.datagrid.model.CellModel; +import org.apache.beehive.netui.databinding.datagrid.model.cell.ImageAnchorCellModel; +import org.apache.beehive.netui.databinding.datagrid.rendering.cell.ImageAnchorCellDecorator; + +/** + * @netui:tag name="imageAnchorColumn" description="Renders a column containing an image anchor" + * body-content="scriptless" + * @netui.tldx:tag whitespace="indent" + */ +public class ImageAnchorColumn + extends AbstractHtmlColumn { + + /* + todo: support rolloverImage on the <img> tags + */ + + private static final ImageAnchorCellDecorator DECORATOR = new ImageAnchorCellDecorator(); + private static final String IMAGE_FACET_NAME = "image"; + + private ImageAnchorCellModel _imageAnchorCellModel = new ImageAnchorCellModel(); + private AnchorTag.State _anchorState = _imageAnchorCellModel.getAnchorState(); + private ImageTag.State _imageState = _imageAnchorCellModel.getImageState(); + + public String getTagName() { + return "ImageAnchorColumn"; + } + + /** + * Sets the onClick javascript event. + * + * @param onClick - the onClick event. + * @jsptagref.attributedescription The onClick JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onClick</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onClick JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnClick(String onClick) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONCLICK, onClick); + } + + /** + * Sets the onDblClick javascript event. + * + * @param onDblClick - the onDblClick event. + * @jsptagref.attributedescription The onDblClick JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onDblClick</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onDblClick JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnDblClick(String onDblClick) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONDBLCLICK, onDblClick); + } + + /** + * Sets the onKeyDown javascript event. + * + * @param onKeyDown - the onKeyDown event. + * @jsptagref.attributedescription The onKeyDown JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onKeyDown</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onKeyDown JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnKeyDown(String onKeyDown) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYDOWN, onKeyDown); + } + + /** + * Sets the onKeyUp javascript event. + * + * @param onKeyUp - the onKeyUp event. + * @jsptagref.attributedescription The onKeyUp JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onKeyUp</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onKeyUp JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnKeyUp(String onKeyUp) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYUP, onKeyUp); + } + + /** + * Sets the onKeyPress javascript event. + * + * @param onKeyPress - the onKeyPress event. + * @jsptagref.attributedescription The onKeyPress JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onKeyPress</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onKeyPress JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnKeyPress(String onKeyPress) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYPRESS, onKeyPress); + } + + /** + * Sets the onMouseDown javascript event. + * + * @param onMouseDown - the onMouseDown event. + * @jsptagref.attributedescription The onMouseDown JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseDown</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseDown JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseDown(String onMouseDown) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEDOWN, onMouseDown); + } + + /** + * Sets the onMouseUp javascript event. + * + * @param onMouseUp - the onMouseUp event. + * @jsptagref.attributedescription The onMouseUp JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseUp</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseUp JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseUp(String onMouseUp) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEUP, onMouseUp); + } + + /** + * Sets the onMouseMove javascript event. + * + * @param onMouseMove - the onMouseMove event. + * @jsptagref.attributedescription The onMouseMove JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseMove</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseMove JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseMove(String onMouseMove) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEMOVE, onMouseMove); + } + + /** + * Sets the onMouseOut javascript event. + * + * @param onMouseOut - the onMouseOut event. + * @jsptagref.attributedescription The onMouseOut JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseOut</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseOut JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseOut(String onMouseOut) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOUT, onMouseOut); + } + + /** + * Sets the onMouseOver javascript event. + * + * @param onMouseOver - the onMouseOver event. + * @jsptagref.attributedescription The onMouseOver JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseOver</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseOver JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseOver(String onMouseOver) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOVER, onMouseOver); + } + + /** + * Sets the style of the rendered html tag. + * + * @param style - the html style. + * @jsptagref.attributedescription The style. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_style</i> + * @netui:attribute required="false" rtexprvalue="true" description="The style." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.JspStyleProperty" category="format" + */ + public void setStyle(String style) { + if("".equals(style)) return; + + _anchorState.style = style; + } + + /** + * Sets the style class of the rendered html tag. + * + * @param styleClass - the html style class. + * @jsptagref.attributedescription The style class. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_style_class</i> + * @netui:attribute required="false" rtexprvalue="true" description="The style class." + * @netui.tldx:attribute category="Format" + */ + public void setStyleClass(String styleClass) { + if("".equals(styleClass)) return; + + _anchorState.styleClass = styleClass; + } + + /** + * Sets the value of the title attribute. + * + * @param title + * @jsptagref.attributedescription The title. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_title</i> + * @netui:attribute required="false" rtexprvalue="true" description="The title. " + * @netui.tldx:attribute category="misc" + */ + public void setTitle(String title) { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TITLE, title); + } + + + /* --------------------------------------------------------- + + Anchor specifc attributes + + --------------------------------------------------------- */ + + /** + * Sets <code>charset</code> attribute for the anchor. + * @param charSet - the window target. + * @jsptagref.attributedescription The character set. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_charset</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The character set." + * @netui.tldx:attribute category="misc" + */ + public void setCharSet(String charSet) + { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.CHARSET, charSet); + } + + /** + * Sets <code>type</code> attribute for the anchor. + * @param type - the window target. + * @jsptagref.attributedescription The type. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_type</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The type." + * @netui.tldx:attribute category="misc" + */ + public void setType(String type) + { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TYPE, type); + } + + /** + * Sets <code>hreflang</code> attribute for the anchor. + * @param hreflang - the window target. + * @jsptagref.attributedescription The HREF lang. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_hreflang</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The HREF lang." + * @netui.tldx:attribute category="misc" + */ + public void setHrefLang(String hreflang) + { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.HREFLANG, hreflang); + } + + /** + * Sets <code>rel</code> attribute for the anchor. + * @param rel - the window target. + * @jsptagref.attributedescription The rel. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_rel</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The rel." + * @netui.tldx:attribute category="misc" + */ + public void setRel(String rel) + { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.REL, rel); + } + + /** + * Sets <code>rev</code> attribute for the anchor. + * @param rev - the window target. + * @jsptagref.attributedescription The rev. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_rev</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The rev." + * @netui.tldx:attribute category="misc" + */ + public void setRev(String rev) + { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.REV, rev); + } + + + /** + * Sets the window target. + * @param target - the window target. + * @jsptagref.attributedescription The window target. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_action</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The window target." + * @netui.tldx:attribute category="misc" + */ + public void setTarget(String target) + { + _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TARGET, target); + } + + /** + * Sets the href of the Anchor. This attribute will accept the empty String as a legal value. + * @param href - the hyperlink URI for the Area. + * @jsptagref.attributedescription The URL to go to. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_href</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The URL to go to." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.URIPropertyClass" + * reftype="url" + */ + public void setHref(String href) { + _imageAnchorCellModel.setHref(href); + } + + /** + * Set the target "scope" for the anchor's action. Multiple active page flows may exist concurrently within named + * scopes. This attribute selects which named scope to use. If omitted, the default scope is assumed. + * @param targetScope - the name of the target scope in which the associated action's page flow resides. + * @jsptagref.attributedescription The target scope in which the associated action's page flow resides. + * @jsptagref.databindable true + * @jsptagref.attributesyntaxvalue <i>string_targetScope</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The target scope in which the associated action's page flow resides" + * @netui.tldx:attribute category="general" + */ + public void setTargetScope(String targetScope) { + _imageAnchorCellModel.setScopeId(targetScope); + } + + /** + * Set the name of the action for the Area. + * @param action - the name of the action to set for the Area. + * @jsptagref.attributedescription The action method to invoke. The action method must be in the Controller file + * of the Page Flow directory. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_action</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The action method to invoke. The action method must be in the Controller file of the Page Flow directory." + * @netui.tldx:attribute reftype="netui-action-url" category="general" + */ + public void setAction(String action) + throws JspException { + _imageAnchorCellModel.setAction(setRequiredValueAttribute(action, "action")); + } + + /* --------------------------------------------------------- + + Image specifc attributes + + --------------------------------------------------------- */ + + /** + * Sets the property to specify where to align the image. + * @param align - the image alignment. + * @jsptagref.attributedescription The alignment of the image. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_align</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The alignment of the image." + * @netui.tldx:attribute + */ + public void setAlign(String align) + { + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.ALIGN, align); + } + + /** + * Sets the property to specify the alt text of the image. + * @param alt - the image alignment. + * @jsptagref.attributedescription The alternative text of the image + * @jsptagref.databindable Read Only + * @jsptagref.attributesyntaxvalue <i>string_alt</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The alternative text of the image." + * @netui.tldx:attribute + */ + public void setAlt(String alt) + { + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.ALT, alt); + } + + /** + * Sets the property to specify the longdesc. + * @param longdesc - the longdesc. + * @netui:attribute required="false" rtexprvalue="true" + * description="Sets the property to specify the longdesc." + * @netui.tldx:attribute category="misc" + */ + public void setLongdesc(String longdesc) + { + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.LONGDESC, longdesc); + } + + /** + * Sets the border size around the image. + * @param border - the border size. + * @jsptagref.attributedescription The border size around the image + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>integer_pixelBorder</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The border size around the image." + * @netui.tldx:attribute + */ + public void setBorder(String border) + { + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.BORDER, border); + } + + /** + * Sets the image height. + * @param height - the height. + * @jsptagref.attributedescription The image height + * @jsptagref.databindable Read Only + * @jsptagref.attributesyntaxvalue <i>integer_height</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The image height." + * @netui.tldx:attribute + */ + public void setHeight(String height) + { + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.HEIGHT, height); + } + + /** + * Sets the the horizontal spacing around the image. + * @param hspace - the horizontal spacing. + * @jsptagref.attributedescription The horizontal spacing around the image. + * @jsptagref.databindable Read Only + * @jsptagref.attributesyntaxvalue <i>integer_hspace</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The horizontal spacing around the image." + * @netui.tldx:attribute category="misc" + */ + public void setHspace(String hspace) + { + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.HSPACE, hspace); + } + + /** + * Sets the server-side image map declaration. + * @param ismap - the image map declaration. + * @jsptagref.attributedescription The server-side map declaration. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_isMap</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The server-side map declaration." + * @netui.tldx:attribute category="misc" + */ + public void setIsmap(String ismap) + { + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.ISMAP, ismap); + } + + /** + * Sets the image source URI. + * @param src - the image source URI. + * @jsptagref.attributedescription The image source URI + * @jsptagref.databindable Read Only + * @jsptagref.attributesyntaxvalue <i>string_src</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The image source URI" + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.URIPropertyClass" + * reftype="img-url" + */ + public void setSrc(String src) + throws JspException + { + _imageState.src = src; + } + + /** + * Sets the client-side image map declaration. + * @param usemap - the map declaration. + * @jsptagref.attributedescription The client-side image map declaration + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_useMap</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The client-side image map declaration" + * @netui.tldx:attribute category="misc" + */ + public void setUsemap(String usemap) + { + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.USEMAP, usemap); + } + + /** + * Sets the vertical spacing around the image. + * @param vspace - the vertical spacing. + * @jsptagref.attributedescription The vertical spacing around the image. + * @jsptagref.databindable Read Only + * @jsptagref.attributesyntaxvalue <i>string_vspace</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The vertical spacing around the image." + * @netui.tldx:attribute + */ + public void setVspace(String vspace) + { + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.VSPACE, vspace); + } + + /** + * Set the <img> style for the contained image. When the tag library is + * running in legacy mode, this will override the <code>style</code> attribute if that is + * set. If this is not set, and <code>style</code> is set, then it will be applied to + * the image. + * @param imageStyle - the label style + * @netui:attribute required="false" rtexprvalue="true" + * description="Set the style for the contained image. " + * @netui.tldx:attribute category="format" propertyclass="workshop.jspdesigner.properties.JspStyleProperty" + */ + public void setImageStyle(String imageStyle) + { + _imageState.style = imageStyle; + } + + /** + * Set the label style class for each contained Image. When the tag library is + * running in legacy mode, this will override the <code>styleClass</code> attribute if that is + * set. If this is not set, and <code>styleClass</code> is set, then it will be applied to + * the image. + * @param imageClass - the image class + * @netui:attribute required="false" rtexprvalue="true" + * description="Set the label style class for each contained image." + * @netui.tldx:attribute category="format" + */ + public void setImageStyleClass(String imageClass) + { + _imageState.styleClass = imageClass; + } + + /** + * Sets the image width. + * @param width - the image width. + * @jsptagref.attributedescription The image width. + * @jsptagref.databindable Read Only + * @jsptagref.attributesyntaxvalue <i>integer_pixelWidth</i> + * @netui:attribute required="false" rtexprvalue="true" + * description="The image width." + * @netui.tldx:attribute + */ + public void setWidth(String width) + { + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.WIDTH, width); + } + + public void setAttribute(String name, String value, String facet) + throws JspException { + if(facet == null) + super.addStateAttribute(_anchorState, name, value); + else if(facet.equals(IMAGE_FACET_NAME)) + super.addStateAttribute(_imageState, name, value); + else super.setAttribute(name, value, facet); + } + + protected void renderDataCellContents(AbstractRenderAppender appender, String jspFragmentOutput) { + assert DECORATOR != null; + assert appender != null; + assert _imageAnchorCellModel != null; + + DECORATOR.decorate(getJspContext(), appender, _imageAnchorCellModel); + } + + protected CellModel internalGetCellModel() { + return _imageAnchorCellModel; + } +} Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageColumn.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageColumn.java?view=diff&rev=126525&p1=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageColumn.java&r1=126524&p2=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageColumn.java&r2=126525 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageColumn.java (original) +++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageColumn.java Wed Jan 26 10:57:36 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.databinding.datagrid; +import javax.servlet.jsp.JspException; + import org.apache.beehive.netui.databinding.datagrid.model.cell.ImageCellModel; import org.apache.beehive.netui.databinding.datagrid.model.CellModel; import org.apache.beehive.netui.databinding.datagrid.rendering.cell.ImageCellDecorator; @@ -35,7 +37,197 @@ private static final ImageCellDecorator DECORATOR = new ImageCellDecorator(); private ImageCellModel _imageCellModel = new ImageCellModel(); - private ImageTag.State _state = _imageCellModel.getImageState(); + private ImageTag.State _imageState = _imageCellModel.getImageState(); + + public String getTagName() { + return "ImageColumn"; + } + + /** + * Sets the onClick javascript event. + * + * @param onClick - the onClick event. + * @jsptagref.attributedescription The onClick JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onClick</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onClick JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnClick(String onClick) { + _imageState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONCLICK, onClick); + } + + /** + * Sets the onDblClick javascript event. + * + * @param onDblClick - the onDblClick event. + * @jsptagref.attributedescription The onDblClick JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onDblClick</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onDblClick JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnDblClick(String onDblClick) { + _imageState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONDBLCLICK, onDblClick); + } + + /** + * Sets the onKeyDown javascript event. + * + * @param onKeyDown - the onKeyDown event. + * @jsptagref.attributedescription The onKeyDown JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onKeyDown</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onKeyDown JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnKeyDown(String onKeyDown) { + _imageState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYDOWN, onKeyDown); + } + + /** + * Sets the onKeyUp javascript event. + * + * @param onKeyUp - the onKeyUp event. + * @jsptagref.attributedescription The onKeyUp JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onKeyUp</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onKeyUp JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnKeyUp(String onKeyUp) { + _imageState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYUP, onKeyUp); + } + + /** + * Sets the onKeyPress javascript event. + * + * @param onKeyPress - the onKeyPress event. + * @jsptagref.attributedescription The onKeyPress JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onKeyPress</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onKeyPress JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnKeyPress(String onKeyPress) { + _imageState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYPRESS, onKeyPress); + } + + /** + * Sets the onMouseDown javascript event. + * + * @param onMouseDown - the onMouseDown event. + * @jsptagref.attributedescription The onMouseDown JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseDown</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseDown JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseDown(String onMouseDown) { + _imageState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEDOWN, onMouseDown); + } + + /** + * Sets the onMouseUp javascript event. + * + * @param onMouseUp - the onMouseUp event. + * @jsptagref.attributedescription The onMouseUp JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseUp</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseUp JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseUp(String onMouseUp) { + _imageState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEUP, onMouseUp); + } + + /** + * Sets the onMouseMove javascript event. + * + * @param onMouseMove - the onMouseMove event. + * @jsptagref.attributedescription The onMouseMove JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseMove</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseMove JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseMove(String onMouseMove) { + _imageState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEMOVE, onMouseMove); + } + + /** + * Sets the onMouseOut javascript event. + * + * @param onMouseOut - the onMouseOut event. + * @jsptagref.attributedescription The onMouseOut JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseOut</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseOut JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseOut(String onMouseOut) { + _imageState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOUT, onMouseOut); + } + + /** + * Sets the onMouseOver javascript event. + * + * @param onMouseOver - the onMouseOver event. + * @jsptagref.attributedescription The onMouseOver JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseOver</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseOver JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseOver(String onMouseOver) { + _imageState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOVER, onMouseOver); + } + + /** + * Sets the style of the rendered html tag. + * + * @param style - the html style. + * @jsptagref.attributedescription The style. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_style</i> + * @netui:attribute required="false" rtexprvalue="true" description="The style." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.JspStyleProperty" category="format" + */ + public void setStyle(String style) { + if("".equals(style)) return; + + _imageState.style = style; + } + + /** + * Sets the style class of the rendered html tag. + * + * @param styleClass - the html style class. + * @jsptagref.attributedescription The style class. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_style_class</i> + * @netui:attribute required="false" rtexprvalue="true" description="The style class." + * @netui.tldx:attribute category="Format" + */ + public void setStyleClass(String styleClass) { + if("".equals(styleClass)) return; + + _imageState.styleClass = styleClass; + } + + /** + * Sets the value of the title attribute. + * + * @param title + * @jsptagref.attributedescription The title. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_title</i> + * @netui:attribute required="false" rtexprvalue="true" description="The title. " + * @netui.tldx:attribute category="misc" + */ + public void setTitle(String title) { + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TITLE, title); + } /** * @jsptagref.attributedescription The source of the image to display. @@ -45,7 +237,7 @@ * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.URIPropertyClass" reftype="img-url" */ public void setSrc(String src) { - _state.src = src; + _imageState.src = src; } /** @@ -57,7 +249,7 @@ * @netui:attribute required="false" rtexprvalue="true" description="The alignment of the image." */ public void setAlign(String align) { - _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.ALIGN, align); + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.ALIGN, align); } /** @@ -69,7 +261,7 @@ * @netui:attribute required="false" rtexprvalue="true" description="The horizontal spacing around the image." */ public void setHspace(String hspace) { - _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.HSPACE, hspace); + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.HSPACE, hspace); } /** @@ -79,14 +271,14 @@ * @netui:attribute required="false" rtexprvalue="true" */ public void setVspace(String vspace) { - _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.VSPACE, vspace); + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.VSPACE, vspace); } /** * @netui:attribute required="false" rtexprvalue="true" */ public void setBorder(String border) { - _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.BORDER, border); + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.BORDER, border); } /** @@ -96,7 +288,7 @@ * @netui:attribute required="false" rtexprvalue="true" */ public void setHeight(String height) { - _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.HEIGHT, height); + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.HEIGHT, height); } /** @@ -106,23 +298,18 @@ * @netui:attribute required="false" rtexprvalue="true" */ public void setWidth(String width) { - _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.WIDTH, width); + _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.WIDTH, width); } - public String getTagName() { - return "ImageColumn"; + public void setAttribute(String name, String value, String facet) + throws JspException { + if(facet == null) + super.addStateAttribute(_imageState, name, value); + else super.setAttribute(name, value, facet); } - protected void renderDataCellContents(AbstractRenderAppender appender) { + protected void renderDataCellContents(AbstractRenderAppender appender, String jspFragmentOutput) { DECORATOR.decorate(getJspContext(), appender, _imageCellModel); - } - - private AbstractHtmlState internalGetImageState() { - return _imageCellModel.getImageState(); - } - - protected AbstractHtmlState internalGetHtmlState() { - return internalGetImageState(); } protected CellModel internalGetCellModel() { Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanColumn.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanColumn.java?view=diff&rev=126525&p1=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanColumn.java&r1=126524&p2=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanColumn.java&r2=126525 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanColumn.java (original) +++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanColumn.java Wed Jan 26 10:57:36 2005 @@ -17,8 +17,12 @@ */ package org.apache.beehive.netui.tags.databinding.datagrid; +import javax.servlet.jsp.JspException; + import org.apache.beehive.netui.tags.rendering.AbstractHtmlState; import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender; +import org.apache.beehive.netui.tags.rendering.SpanTag; +import org.apache.beehive.netui.tags.html.HtmlConstants; import org.apache.beehive.netui.databinding.datagrid.model.cell.SpanCellModel; import org.apache.beehive.netui.databinding.datagrid.model.CellModel; import org.apache.beehive.netui.databinding.datagrid.rendering.cell.SpanCellDecorator; @@ -35,28 +39,218 @@ private static final SpanCellDecorator DECORATOR = new SpanCellDecorator(); - private SpanCellModel _literalCellModel = new SpanCellModel(); + private SpanCellModel _spanCellModel = new SpanCellModel(); + private SpanTag.State _spanState = _spanCellModel.getSpanState(); public String getTagName() { return "LiteralCellModel"; } /** + * Sets the onClick javascript event. + * + * @param onClick - the onClick event. + * @jsptagref.attributedescription The onClick JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onClick</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onClick JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnClick(String onClick) { + _spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONCLICK, onClick); + } + + /** + * Sets the onDblClick javascript event. + * + * @param onDblClick - the onDblClick event. + * @jsptagref.attributedescription The onDblClick JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onDblClick</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onDblClick JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnDblClick(String onDblClick) { + _spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONDBLCLICK, onDblClick); + } + + /** + * Sets the onKeyDown javascript event. + * + * @param onKeyDown - the onKeyDown event. + * @jsptagref.attributedescription The onKeyDown JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onKeyDown</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onKeyDown JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnKeyDown(String onKeyDown) { + _spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYDOWN, onKeyDown); + } + + /** + * Sets the onKeyUp javascript event. + * + * @param onKeyUp - the onKeyUp event. + * @jsptagref.attributedescription The onKeyUp JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onKeyUp</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onKeyUp JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnKeyUp(String onKeyUp) { + _spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYUP, onKeyUp); + } + + /** + * Sets the onKeyPress javascript event. + * + * @param onKeyPress - the onKeyPress event. + * @jsptagref.attributedescription The onKeyPress JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onKeyPress</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onKeyPress JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnKeyPress(String onKeyPress) { + _spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYPRESS, onKeyPress); + } + + /** + * Sets the onMouseDown javascript event. + * + * @param onMouseDown - the onMouseDown event. + * @jsptagref.attributedescription The onMouseDown JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseDown</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseDown JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseDown(String onMouseDown) { + _spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEDOWN, onMouseDown); + } + + /** + * Sets the onMouseUp javascript event. + * + * @param onMouseUp - the onMouseUp event. + * @jsptagref.attributedescription The onMouseUp JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseUp</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseUp JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseUp(String onMouseUp) { + _spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEUP, onMouseUp); + } + + /** + * Sets the onMouseMove javascript event. + * + * @param onMouseMove - the onMouseMove event. + * @jsptagref.attributedescription The onMouseMove JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseMove</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseMove JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseMove(String onMouseMove) { + _spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEMOVE, onMouseMove); + } + + /** + * Sets the onMouseOut javascript event. + * + * @param onMouseOut - the onMouseOut event. + * @jsptagref.attributedescription The onMouseOut JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseOut</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseOut JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseOut(String onMouseOut) { + _spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOUT, onMouseOut); + } + + /** + * Sets the onMouseOver javascript event. + * + * @param onMouseOver - the onMouseOver event. + * @jsptagref.attributedescription The onMouseOver JavaScript event. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_onMouseOver</i> + * @netui:attribute required="false" rtexprvalue="true" description="The onMouseOver JavaScript event." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event" + */ + public void setOnMouseOver(String onMouseOver) { + _spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOVER, onMouseOver); + } + + /** + * Sets the style of the rendered html tag. + * + * @param style - the html style. + * @jsptagref.attributedescription The style. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_style</i> + * @netui:attribute required="false" rtexprvalue="true" description="The style." + * @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.JspStyleProperty" category="format" + */ + public void setStyle(String style) { + if("".equals(style)) return; + + _spanState.style = style; + } + + /** + * Sets the style class of the rendered html tag. + * + * @param styleClass - the html style class. + * @jsptagref.attributedescription The style class. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_style_class</i> + * @netui:attribute required="false" rtexprvalue="true" description="The style class." + * @netui.tldx:attribute category="Format" + */ + public void setStyleClass(String styleClass) { + if("".equals(styleClass)) return; + + _spanState.styleClass = styleClass; + } + + /** + * Sets the value of the title attribute. + * + * @param title + * @jsptagref.attributedescription The title. + * @jsptagref.databindable false + * @jsptagref.attributesyntaxvalue <i>string_title</i> + * @netui:attribute required="false" rtexprvalue="true" description="The title. " + * @netui.tldx:attribute category="misc" + */ + public void setTitle(String title) { + _spanState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TITLE, title); + } + + /** * @netui:attribute required="true" rtexprvalue="true" */ public void setValue(String value) { - _literalCellModel.setValue(value); + _spanCellModel.setValue(value); } - protected void renderDataCellContents(AbstractRenderAppender appender) { - DECORATOR.decorate(getJspContext(), appender, _literalCellModel); + public void setAttribute(String name, String value, String facet) + throws JspException { + if(facet == null) + super.addStateAttribute(_spanState, name, value); + else super.setAttribute(name, value, facet); } - protected AbstractHtmlState internalGetHtmlState() { - return _literalCellModel.getSpanState(); + protected void renderDataCellContents(AbstractRenderAppender appender, String jspFragmentOutput) { + DECORATOR.decorate(getJspContext(), appender, _spanCellModel); } protected CellModel internalGetCellModel() { - return _literalCellModel; + return _spanCellModel; } } Added: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/TemplateColumn.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/TemplateColumn.java?view=auto&rev=126525 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/TemplateColumn.java Wed Jan 26 10:57:36 2005 @@ -0,0 +1,48 @@ +/* + * Copyright 2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * $Header:$ + */ +package org.apache.beehive.netui.tags.databinding.datagrid; + +import java.io.IOException; +import javax.servlet.jsp.JspException; + +import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender; +import org.apache.beehive.netui.databinding.datagrid.model.CellModel; +import org.apache.beehive.netui.databinding.datagrid.model.cell.TemplateCellModel; + +/** + * @netui:tag name="templateColumn" description="Renders a column templated by the body of the JSP tag" + * body-content="scriptless" + * @netui.tldx:tag whitespace="indent" + */ +public class TemplateColumn + extends AbstractHtmlColumn { + + public String getTagName() { + return "TemplateColumn"; + } + + protected void renderDataCellContents(AbstractRenderAppender appender, String jspFragmentOutput) + throws JspException, IOException { + + appender.append(jspFragmentOutput); + } + + protected CellModel internalGetCellModel() { + return new TemplateCellModel(); + } +} Modified: incubator/beehive/trunk/netui/test/ant/buildWebapp.xml Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/ant/buildWebapp.xml?view=diff&rev=126525&p1=incubator/beehive/trunk/netui/test/ant/buildWebapp.xml&r1=126524&p2=incubator/beehive/trunk/netui/test/ant/buildWebapp.xml&r2=126525 ============================================================================== --- incubator/beehive/trunk/netui/test/ant/buildWebapp.xml (original) +++ incubator/beehive/trunk/netui/test/ant/buildWebapp.xml Wed Jan 26 10:57:36 2005 @@ -2,8 +2,7 @@ <project name="Beehive/NetUI/Webapp Build" default="usage" basedir="."> - <import file="../../../beehive-imports.xml"/> -<!-- <property file="${beehive.home}/netui/ant/netui.properties"/> --> + <import file="../../netui-imports.xml"/> <property name="test.dir" location="${beehive.home}/netui/test"/> <!-- ================================================================ --> @@ -54,9 +53,18 @@ <target name="undeploy.testrecorder" if="include.testrecorder" description="Undeploy the test recorder from a webapp"> <echo>Clean the test recorder to webapp at root: ${webapp.dir}</echo> - <ant antfile="${test.dir}/ant/testRecorder.xml" target="undeploy.testrecorder" inheritAll="false"> - <property name="webapp.dir" location="${webapp.dir}"/> - </ant> + <!-- hard code the test recorder clean. this isn't great, but it's a fair workaround --> + <delete quiet="true"> + <fileset dir="${webapp.dir}/WEB-INF/lib"> + <patternset refid="testrecorder.jars"/> + </fileset> + </delete> + <delete quiet="true"> + <fileset dir="${webapp.dir}/testRecorder"> + <include name="*.jsp"/> + <include name="*.inc"/> + </fileset> + </delete> </target> <target name="build.testrecorder" unless="testrecorder.available"> Added: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/misc/imageAnchorColumn.jsp Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/misc/imageAnchorColumn.jsp?view=auto&rev=126525 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/misc/imageAnchorColumn.jsp Wed Jan 26 10:57:36 2005 @@ -0,0 +1,27 @@ +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%> +<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%> +<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> +<%@ taglib prefix="datagrid" tagdir="/WEB-INF/tags/org/apache/beehive/netui/test/databinding/tagfiles" %> +<netui-template:template templatePage="../site/template.jsp"> + <netui-template:setAttribute name="title" value="Template Column Smoke Test"/> + <netui-template:section name="body"> + <p> + <datagrid:portfolioXmlBean/> + <netui-data:dataGrid dataSource="pageScope.stocks" name="stocks"> + <netui-data:configurePager disableDefaultPager="true"/> + <netui-data:columns> + <netui-data:templateColumn headerText="Symbol"> + <netui:span value="${container.item.symbol}"/> + </netui-data:templateColumn> + <netui-data:imageAnchorColumn headerText="Symbol" + src="${pageContext.request.contextPath}/databinding/datagrid/images/${container.item.symbol}.gif" + height="20" width="20" alt="${container.item.web}" + href="${container.item.web}"/> + </netui-data:columns> + </netui-data:dataGrid> + <br/> + </p> + </netui-template:section> +</netui-template:template> \ No newline at end of file Added: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/misc/imageColumn.jsp Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/misc/imageColumn.jsp?view=auto&rev=126525 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/misc/imageColumn.jsp Wed Jan 26 10:57:36 2005 @@ -0,0 +1,25 @@ +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%> +<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%> +<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> +<%@ taglib prefix="datagrid" tagdir="/WEB-INF/tags/org/apache/beehive/netui/test/databinding/tagfiles" %> +<netui-template:template templatePage="../site/template.jsp"> + <netui-template:setAttribute name="title" value="Template Column Smoke Test"/> + <netui-template:section name="body"> + <p> + <datagrid:portfolioXmlBean/> + <netui-data:dataGrid dataSource="pageScope.stocks" name="stocks"> + <netui-data:configurePager disableDefaultPager="true"/> + <netui-data:columns> + <netui-data:templateColumn headerText="Symbol"> + <netui:span value="${container.item.symbol}"/> + </netui-data:templateColumn> + <netui-data:imageColumn headerText="Symbol" + src="${pageContext.request.contextPath}/databinding/datagrid/images/${container.item.symbol}.gif"/> + </netui-data:columns> + </netui-data:dataGrid> + <br/> + </p> + </netui-template:section> +</netui-template:template> \ No newline at end of file Added: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/misc/templateColumn.jsp Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/misc/templateColumn.jsp?view=auto&rev=126525 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/misc/templateColumn.jsp Wed Jan 26 10:57:36 2005 @@ -0,0 +1,26 @@ +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%> +<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%> +<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> +<%@ taglib prefix="datagrid" tagdir="/WEB-INF/tags/org/apache/beehive/netui/test/databinding/tagfiles" %> +<netui-template:template templatePage="../site/template.jsp"> + <netui-template:setAttribute name="title" value="Template Column Smoke Test"/> + <netui-template:section name="body"> + <p> + <datagrid:portfolioXmlBean/> + <netui-data:dataGrid dataSource="pageScope.stocks" name="stocks"> + <netui-data:configurePager disableDefaultPager="true"/> + <netui-data:columns> + <netui-data:templateColumn headerText="Symbol"> + <netui:span value="${container.item.symbol}"/> + </netui-data:templateColumn> + <netui-data:templateColumn headerText="Symbol"> + <netui:textBox dataSource="container.item.shares"/> + </netui-data:templateColumn> + </netui-data:columns> + </netui-data:dataGrid> + <br/> + </p> + </netui-template:section> +</netui-template:template> Modified: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml?view=diff&rev=126525&p1=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml&r1=126524&p2=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml&r2=126525 ============================================================================== --- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml (original) +++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml Wed Jan 26 10:57:36 2005 @@ -2627,15 +2627,44 @@ </features> </test> <test> + <name>DataGridImageColumnTest</name> + <description>DataGridImageColumnTest</description> + <webapp>coreWeb</webapp> + <categories> + <category>bvt</category> + <category>bvt.struts11</category> + <category>datagrid</category> + <category>databinding</category> + </categories> + <features> + <feature>Databinding</feature> + <feature>Data Grid</feature> + </features> + </test> + <test> + <name>DataGridImageAnchorColumnSmokeTest</name> + <description>DataGridImageAnchorColumnSmokeTest</description> + <webapp>coreWeb</webapp> + <categories> + <category>bvt</category> + <category>bvt.struts11</category> + <category>databinding</category> + <category>datagrid</category> + </categories> + <features> + <feature>Databinding</feature> + <feature>Data Grid</feature> + </features> + </test> + <test> <name>DataGridJavaScriptSmoke</name> <description>DataGridJavaScriptSmoke</description> <webapp>coreWeb</webapp> <categories> <category>bvt</category> <category>bvt.struts11</category> - <category>drt</category> - <category>datagrid</category> <category>databinding</category> + <category>datagrid</category> </categories> <features> <feature>Databinding</feature> @@ -2819,6 +2848,21 @@ <category>bvt</category> <category>bvt.struts11</category> <category>drt</category> + <category>datagrid</category> + <category>databinding</category> + </categories> + <features> + <feature>Databinding</feature> + <feature>Data Grid</feature> + </features> + </test> + <test> + <name>DataGridTemplateColumnTest</name> + <description>DataGridTemplateColumnTest</description> + <webapp>coreWeb</webapp> + <categories> + <category>bvt</category> + <category>bvt.struts11</category> <category>datagrid</category> <category>databinding</category> </categories> Added: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridImageAnchorColumnSmokeTest.xml Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridImageAnchorColumnSmokeTest.xml?view=auto&rev=126525 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridImageAnchorColumnSmokeTest.xml Wed Jan 26 10:57:36 2005 @@ -0,0 +1,170 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ses:recorderSession xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session"> + <ses:sessionName>DataGridImageAnchorColumnSmokeTest</ses:sessionName> + <ses:tester>ekoneil</ses:tester> + <ses:startDate>26 Jan 2005, 10:52:20.662 AM MST</ses:startDate> + <ses:description>Smoke test of the imageAnchor column.</ses:description> + <ses:tests> + <ses:test> + <ses:testNumber>1</ses:testNumber> + <ses:request> + <ses:protocol>HTTP</ses:protocol> + <ses:protocolVersion>1.1</ses:protocolVersion> + <ses:host>localhost</ses:host> + <ses:port>8080</ses:port> + <ses:uri>/coreWeb/databinding/datagrid/misc/imageAnchorColumn.jsp</ses:uri> + <ses:method>GET</ses:method> + <ses:parameters/> + <ses:cookies> + <ses:cookie> + <ses:name>JSESSIONID</ses:name> + <ses:value>E2FCE77261C31D9BD63485C1A8FA972B</ses:value> + </ses:cookie> + </ses:cookies> + <ses:headers> + <ses:header> + <ses:name>accept</ses:name> + <ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value> + </ses:header> + <ses:header> + <ses:name>accept-charset</ses:name> + <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value> + </ses:header> + <ses:header> + <ses:name>accept-encoding</ses:name> + <ses:value>gzip,deflate</ses:value> + </ses:header> + <ses:header> + <ses:name>accept-language</ses:name> + <ses:value>en-us,en;q=0.5</ses:value> + </ses:header> + <ses:header> + <ses:name>connection</ses:name> + <ses:value>keep-alive</ses:value> + </ses:header> + <ses:header> + <ses:name>cookie</ses:name> + <ses:value>JSESSIONID=E2FCE77261C31D9BD63485C1A8FA972B</ses:value> + </ses:header> + <ses:header> + <ses:name>host</ses:name> + <ses:value>localhost:8080</ses:value> + </ses:header> + <ses:header> + <ses:name>keep-alive</ses:name> + <ses:value>300</ses:value> + </ses:header> + <ses:header> + <ses:name>user-agent</ses:name> + <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value> + </ses:header> + </ses:headers> + </ses:request> + <ses:response> + <ses:statusCode>200</ses:statusCode> + <ses:reason/> + <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> + + <head> + <title>NetUI Data Grid Samples</title> + <link rel="stylesheet" href="/coreWeb/databinding/datagrid/site/css/default.css" type="text/css"/> + </head> + <base href="http://localhost:8080/coreWeb/databinding/datagrid/misc/imageAnchorColumn.jsp"> + <body> + <p> + <b>Template Column Smoke Test</b> + <table width="100%"> + <tr><td></td></tr> + <tr><td> + + <p> + + + + + + + +<table class="datagrid"> + + + +<thead class="datagrid"> +<tr class="datagrid-header"> + <th class="datagrid">Symbol</th> + + + <th class="datagrid">Symbol</th> + + + +</tr></thead> + +<tr class="datagrid-even"> + <td class="datagrid"> + <span>BEAS</span> + </td> + + <td class="datagrid"><a href="http://www.bea.com"><img src="/coreWeb/databinding/datagrid/images/BEAS.gif" width="20" height="20" alt="http://www.bea.com"></a></td> + + +</tr> +<tr class="datagrid-odd"> + <td class="datagrid"> + <span>CSCO</span> + </td> + + <td class="datagrid"><a href="http://www.cisco.com"><img src="/coreWeb/databinding/datagrid/images/CSCO.gif" width="20" height="20" alt="http://www.cisco.com"></a></td> + + +</tr> +<tr class="datagrid-even"> + <td class="datagrid"> + <span>GE</span> + </td> + + <td class="datagrid"><a href="http://www.ge.com"><img src="/coreWeb/databinding/datagrid/images/GE.gif" width="20" height="20" alt="http://www.ge.com"></a></td> + + +</tr> +<tr class="datagrid-odd"> + <td class="datagrid"> + <span>RHAT</span> + </td> + + <td class="datagrid"><a href="http://www.redhat.com"><img src="/coreWeb/databinding/datagrid/images/RHAT.gif" width="20" height="20" alt="http://www.redhat.com"></a></td> + + +</tr> +<tr class="datagrid-even"> + <td class="datagrid"> + <span>YHOO</span> + </td> + + <td class="datagrid"><a href="http://www.yahoo.com"><img src="/coreWeb/databinding/datagrid/images/YHOO.gif" width="20" height="20" alt="http://www.yahoo.com"></a></td> + + +</tr> + </table> + + + <br/> + </p> + + </td></tr> + </p> + <table> + <tr><td><a href="/netuiDRT/databinding/datagrid/basic/index.jsp">Home</a></td></tr> + </table> + </p> + </body> + +</html>]]></ses:responseBody> + </ses:response> + </ses:test> + </ses:tests> + <ses:endDate>26 Jan 2005, 10:52:25.059 AM MST</ses:endDate> + <ses:testCount>1</ses:testCount> +</ses:recorderSession> \ No newline at end of file Added: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridImageColumnTest.xml Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridImageColumnTest.xml?view=auto&rev=126525 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridImageColumnTest.xml Wed Jan 26 10:57:36 2005 @@ -0,0 +1,170 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ses:recorderSession xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session"> + <ses:sessionName>DataGridImageColumnTest</ses:sessionName> + <ses:tester>ekoneil</ses:tester> + <ses:startDate>26 Jan 2005, 10:52:58.879 AM MST</ses:startDate> + <ses:description>Smoke test of the imageColumn.</ses:description> + <ses:tests> + <ses:test> + <ses:testNumber>1</ses:testNumber> + <ses:request> + <ses:protocol>HTTP</ses:protocol> + <ses:protocolVersion>1.1</ses:protocolVersion> + <ses:host>localhost</ses:host> + <ses:port>8080</ses:port> + <ses:uri>/coreWeb/databinding/datagrid/misc/imageColumn.jsp</ses:uri> + <ses:method>GET</ses:method> + <ses:parameters/> + <ses:cookies> + <ses:cookie> + <ses:name>JSESSIONID</ses:name> + <ses:value>E2FCE77261C31D9BD63485C1A8FA972B</ses:value> + </ses:cookie> + </ses:cookies> + <ses:headers> + <ses:header> + <ses:name>accept</ses:name> + <ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value> + </ses:header> + <ses:header> + <ses:name>accept-charset</ses:name> + <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value> + </ses:header> + <ses:header> + <ses:name>accept-encoding</ses:name> + <ses:value>gzip,deflate</ses:value> + </ses:header> + <ses:header> + <ses:name>accept-language</ses:name> + <ses:value>en-us,en;q=0.5</ses:value> + </ses:header> + <ses:header> + <ses:name>connection</ses:name> + <ses:value>keep-alive</ses:value> + </ses:header> + <ses:header> + <ses:name>cookie</ses:name> + <ses:value>JSESSIONID=E2FCE77261C31D9BD63485C1A8FA972B</ses:value> + </ses:header> + <ses:header> + <ses:name>host</ses:name> + <ses:value>localhost:8080</ses:value> + </ses:header> + <ses:header> + <ses:name>keep-alive</ses:name> + <ses:value>300</ses:value> + </ses:header> + <ses:header> + <ses:name>user-agent</ses:name> + <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value> + </ses:header> + </ses:headers> + </ses:request> + <ses:response> + <ses:statusCode>200</ses:statusCode> + <ses:reason/> + <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> + + <head> + <title>NetUI Data Grid Samples</title> + <link rel="stylesheet" href="/coreWeb/databinding/datagrid/site/css/default.css" type="text/css"/> + </head> + <base href="http://localhost:8080/coreWeb/databinding/datagrid/misc/imageColumn.jsp"> + <body> + <p> + <b>Template Column Smoke Test</b> + <table width="100%"> + <tr><td></td></tr> + <tr><td> + + <p> + + + + + + + +<table class="datagrid"> + + + +<thead class="datagrid"> +<tr class="datagrid-header"> + <th class="datagrid">Symbol</th> + + + <th class="datagrid">Symbol</th> + + + +</tr></thead> + +<tr class="datagrid-even"> + <td class="datagrid"> + <span>BEAS</span> + </td> + + <td class="datagrid"><img src="/coreWeb/databinding/datagrid/images/BEAS.gif"></td> + + +</tr> +<tr class="datagrid-odd"> + <td class="datagrid"> + <span>CSCO</span> + </td> + + <td class="datagrid"><img src="/coreWeb/databinding/datagrid/images/CSCO.gif"></td> + + +</tr> +<tr class="datagrid-even"> + <td class="datagrid"> + <span>GE</span> + </td> + + <td class="datagrid"><img src="/coreWeb/databinding/datagrid/images/GE.gif"></td> + + +</tr> +<tr class="datagrid-odd"> + <td class="datagrid"> + <span>RHAT</span> + </td> + + <td class="datagrid"><img src="/coreWeb/databinding/datagrid/images/RHAT.gif"></td> + + +</tr> +<tr class="datagrid-even"> + <td class="datagrid"> + <span>YHOO</span> + </td> + + <td class="datagrid"><img src="/coreWeb/databinding/datagrid/images/YHOO.gif"></td> + + +</tr> + </table> + + + <br/> + </p> + + </td></tr> + </p> + <table> + <tr><td><a href="/netuiDRT/databinding/datagrid/basic/index.jsp">Home</a></td></tr> + </table> + </p> + </body> + +</html>]]></ses:responseBody> + </ses:response> + </ses:test> + </ses:tests> + <ses:endDate>26 Jan 2005, 10:53:04.717 AM MST</ses:endDate> + <ses:testCount>1</ses:testCount> +</ses:recorderSession> \ No newline at end of file Added: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridTemplateColumnTest.xml Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridTemplateColumnTest.xml?view=auto&rev=126525 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridTemplateColumnTest.xml Wed Jan 26 10:57:36 2005 @@ -0,0 +1,180 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ses:recorderSession xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session"> + <ses:sessionName>DataGridTemplateColumnTest</ses:sessionName> + <ses:tester>ekoneil</ses:tester> + <ses:startDate>26 Jan 2005, 10:42:36.962 AM MST</ses:startDate> + <ses:description>Smoke test of the template column.</ses:description> + <ses:tests> + <ses:test> + <ses:testNumber>1</ses:testNumber> + <ses:request> + <ses:protocol>HTTP</ses:protocol> + <ses:protocolVersion>1.1</ses:protocolVersion> + <ses:host>localhost</ses:host> + <ses:port>8080</ses:port> + <ses:uri>/coreWeb/databinding/datagrid/misc/templateColumn.jsp</ses:uri> + <ses:method>GET</ses:method> + <ses:parameters/> + <ses:cookies> + <ses:cookie> + <ses:name>JSESSIONID</ses:name> + <ses:value>E2FCE77261C31D9BD63485C1A8FA972B</ses:value> + </ses:cookie> + </ses:cookies> + <ses:headers> + <ses:header> + <ses:name>accept</ses:name> + <ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value> + </ses:header> + <ses:header> + <ses:name>accept-charset</ses:name> + <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value> + </ses:header> + <ses:header> + <ses:name>accept-encoding</ses:name> + <ses:value>gzip,deflate</ses:value> + </ses:header> + <ses:header> + <ses:name>accept-language</ses:name> + <ses:value>en-us,en;q=0.5</ses:value> + </ses:header> + <ses:header> + <ses:name>connection</ses:name> + <ses:value>keep-alive</ses:value> + </ses:header> + <ses:header> + <ses:name>cookie</ses:name> + <ses:value>JSESSIONID=E2FCE77261C31D9BD63485C1A8FA972B</ses:value> + </ses:header> + <ses:header> + <ses:name>host</ses:name> + <ses:value>localhost:8080</ses:value> + </ses:header> + <ses:header> + <ses:name>keep-alive</ses:name> + <ses:value>300</ses:value> + </ses:header> + <ses:header> + <ses:name>user-agent</ses:name> + <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value> + </ses:header> + </ses:headers> + </ses:request> + <ses:response> + <ses:statusCode>200</ses:statusCode> + <ses:reason/> + <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> + + <head> + <title>NetUI Data Grid Samples</title> + <link rel="stylesheet" href="/coreWeb/databinding/datagrid/site/css/default.css" type="text/css"/> + </head> + <base href="http://localhost:8080/coreWeb/databinding/datagrid/misc/templateColumn.jsp"> + <body> + <p> + <b>Template Column Smoke Test</b> + <table width="100%"> + <tr><td></td></tr> + <tr><td> + + <p> + + + + + + + +<table class="datagrid"> + + + +<thead class="datagrid"> +<tr class="datagrid-header"> + <th class="datagrid">Symbol</th> + + + <th class="datagrid">Symbol</th> + + + +</tr></thead> + +<tr class="datagrid-even"> + <td class="datagrid"> + <span>BEAS</span> + </td> + + <td class="datagrid"> + <input type="text" name="{pageScope.stocks[1].shares}" value="500"> + </td> + + +</tr> +<tr class="datagrid-odd"> + <td class="datagrid"> + <span>CSCO</span> + </td> + + <td class="datagrid"> + <input type="text" name="{pageScope.stocks[2].shares}" value="400"> + </td> + + +</tr> +<tr class="datagrid-even"> + <td class="datagrid"> + <span>GE</span> + </td> + + <td class="datagrid"> + <input type="text" name="{pageScope.stocks[3].shares}" value="300"> + </td> + + +</tr> +<tr class="datagrid-odd"> + <td class="datagrid"> + <span>RHAT</span> + </td> + + <td class="datagrid"> + <input type="text" name="{pageScope.stocks[4].shares}" value="200"> + </td> + + +</tr> +<tr class="datagrid-even"> + <td class="datagrid"> + <span>YHOO</span> + </td> + + <td class="datagrid"> + <input type="text" name="{pageScope.stocks[5].shares}" value="100"> + </td> + + +</tr> + </table> + + + <br/> + </p> + + </td></tr> + </p> + <table> + <tr><td><a href="/netuiDRT/databinding/datagrid/basic/index.jsp">Home</a></td></tr> + </table> + </p> + </body> + +</html>]]></ses:responseBody> + </ses:response> + </ses:test> + </ses:tests> + <ses:endDate>26 Jan 2005, 10:42:43.050 AM MST</ses:endDate> + <ses:testCount>1</ses:testCount> +</ses:recorderSession> \ No newline at end of file
