You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2005/05/04 18:15:28 UTC
svn commit: r168140 - in /incubator/beehive/trunk/netui/src:
tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/
tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/exceptions/
tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/rendering/
tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/
util/org/apache/beehive/netui/util/iterator/
Author: ekoneil
Date: Wed May 4 09:15:26 2005
New Revision: 168140
URL: http://svn.apache.org/viewcvs?rev=168140&view=rev
Log:
Data grid Javadoc.
BB: self
DRT: NetUI pass
BVT: NetUI pass
Modified:
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridConfig.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridConfigFactory.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridResourceProvider.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridState.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridURLBuilder.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/exceptions/CellDecoratorException.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/exceptions/DataGridExtensionException.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/exceptions/IllegalFilterException.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/rendering/DataGridTagModel.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractCell.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Caption.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/DataGridUtil.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Footer.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Header.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/RenderPager.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/TemplateCell.java
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/iterator/ResultSetIterator.java
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridConfig.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridConfig.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridConfig.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridConfig.java Wed May 4 09:15:26 2005
@@ -29,7 +29,25 @@
import org.apache.beehive.netui.databinding.datagrid.api.rendering.StyleModel;
/**
- *
+ * <p>
+ * Abstract class used by the data grid to create model objects used for state
+ * management and rendering. This abstraction exists in order to all the data grid's
+ * implementation to be configurable. Various data grid features are exposed here including
+ * sorting, filtering, and paging. In addition, classes such as the {@link PagerRenderer} and
+ * {@link StyleModel} are created by subclasses in order to provide a data grid specific
+ * implementation of pager UI or style support.
+ * </p>
+ * <p>
+ * By default, DataGridConfig implementations are not thread safe, but custom implementations are
+ * free to store instance state as long as the DataGridConfig object lifetimes are managed
+ * in user code.
+ * </p>
+ * <p>
+ * A specific DataGridConfig object can be created and passed to a data grid via the
+ * data grid's
+ * {@link org.apache.beehive.netui.tags.databinding.datagrid.DataGrid#setDataGridConfig(DataGridConfig)}
+ * method.
+ * </p>
*/
public abstract class DataGridConfig
implements java.io.Serializable {
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridConfigFactory.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridConfigFactory.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridConfigFactory.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridConfigFactory.java Wed May 4 09:15:26 2005
@@ -21,18 +21,35 @@
import org.apache.beehive.netui.databinding.datagrid.runtime.util.ExtensionUtil;
/**
- *
+ * <p>
+ * A factory for creating instances of a {@link DataGridConfig}.
+ * </p>
*/
public final class DataGridConfigFactory {
+ private static final DataGridConfig DEFAULT_DATA_GRID_CONFIG = new DefaultDataGridConfig();
/* do not construct */
private DataGridConfigFactory() {
}
+ /**
+ * Create an instance of the default {@link DataGridConfig} object. When no other configuration
+ * information is available, clients can use this method to create an instance that
+ * provides sufficient defaults for data grid rendering.
+ *
+ * @return the default data grid config object.
+ */
public static final DataGridConfig getInstance() {
- return new DefaultDataGridConfig();
+ return DEFAULT_DATA_GRID_CONFIG;
}
+ /**
+ * Create an instance of a {@link DataGridConfig} object given a {@link Class} object.
+ * The given class must extend the {@link DataGridConfig} base class.
+ *
+ * @param clazz the class to instantiate
+ * @return the new {@link DataGridConfig} instance
+ */
public static final DataGridConfig getInstance(Class clazz) {
DataGridConfig config = (DataGridConfig)ExtensionUtil.instantiateClass(clazz, DataGridConfig.class);
return config;
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridResourceProvider.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridResourceProvider.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridResourceProvider.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridResourceProvider.java Wed May 4 09:15:26 2005
@@ -22,7 +22,10 @@
import java.text.MessageFormat;
/**
- *
+ * <p>
+ * This abstract class provides an abstraction used for obtaining messages and strings used
+ * during data grid rendering.
+ * </p>
*/
public abstract class DataGridResourceProvider {
@@ -30,30 +33,79 @@
private String _resourceBundlePath = null;
private Locale _locale = null;
+ /**
+ * Abstract method used to obtain a message {@link String} given a <code>key</code>
+ *
+ * @param key the key used to lookup a {@link String}
+ * @return the returned String if a message is found matching the key
+ */
public abstract String getMessage(String key);
+ /**
+ * Abstract method used to format a pattern given a pattern / message key and an array of
+ * arguments.
+ *
+ * @param key the key to use when looking up a message to format
+ * @param args the arguments to use when formatting a message
+ * @return the formatted message if a message is found matching the key
+ */
public abstract String formatMessage(String key, Object[] args);
+ /**
+ * Accessor for determining if implementations are chaining enabled. When chaining
+ * is enabled, subclasses must use any nested DataGridResourceProvider instances to
+ * lookup messages. When chaining is enabled, the default messages for the data grid
+ * will be returned. When chaining is disabled, implementations are free to
+ * hide message keys.
+ *
+ * @return <code>true</code> if chaining is enabled; <code>false</code> otherwise
+ */
public boolean isEnableChaining() {
return _enableChaining;
}
+ /**
+ * Setter for enabling or disabling chaining
+ *
+ * @param enableChaining the new chaining enabled value
+ */
public void setEnableChaining(boolean enableChaining) {
_enableChaining = enableChaining;
}
+ /**
+ * Set the {@link Locale} in which a message {@link String} should be looked up.
+ *
+ * @param locale the {@link Locale} to use
+ */
public void setLocale(Locale locale) {
_locale = locale;
}
+ /**
+ * Accessor for obtaining the {@link Locale} used when looking up messages.
+ *
+ * @return the {@link Locale} used for message lookup or <code>null</code> if no {@link Locale} was set
+ */
public Locale getLocale() {
return _locale;
}
+ /**
+ * Set the path used for creating a {@link ResourceBundle} object.
+ *
+ * @param resourceBundlePath the path to a resource bundle
+ */
public void setResourceBundlePath(String resourceBundlePath) {
_resourceBundlePath = resourceBundlePath;
}
+ /**
+ * Accessor for obtaining the path to the resource bundle used by a DataGridResourceProvider
+ * implementation.
+ *
+ * @return the path to the {@link ResourceBundle}
+ */
public String getResourceBundlePath() {
return _resourceBundlePath;
}
@@ -63,7 +115,16 @@
return rb;
}
+ /**
+ * Internal convenience method that is used to format a message given a pattern
+ * and a set of arguments.
+ *
+ * @param pattern the pattern to format
+ * @param args the arguments to use when formatting
+ * @return the formatted string
+ */
protected String internalFormatMessage(String pattern, Object[] args) {
+ /* todo: perf -- could the MessageFormat objects be cached? */
MessageFormat format = new MessageFormat(pattern);
String msg = format.format(args).toString();
return msg;
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridState.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridState.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridState.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridState.java Wed May 4 09:15:26 2005
@@ -22,7 +22,16 @@
import org.apache.beehive.netui.databinding.datagrid.api.pager.PagerModel;
/**
- *
+ * <p>
+ * A class used to encapsulate the default state information for a data grid. All grids are
+ * capable of supporting sorting, filtering, and paging. This class holds the JavaBean model
+ * objects that maintain the sort, filter, and page state of a data grid.
+ * </p>
+ * <p>
+ * Instances of DataGridState can live longer than a single request. As a result, DataGridState
+ * objects are serializable, so subclasses should avoid non-transient references to objects
+ * like the {@link javax.servlet.http.HttpServletRequest}.
+ * </p>
*/
public class DataGridState
implements java.io.Serializable {
@@ -31,26 +40,56 @@
private SortModel _sortModel;
private PagerModel _pagerModel;
+ /**
+ * Get the {@link SortModel} for a data grid.
+ *
+ * @return the {@link SortModel}
+ */
public SortModel getSortModel() {
return _sortModel;
}
+ /**
+ * Set the {@link SortModel} for a data grid.
+ *
+ * @param sortModel the new {@link SortModel}
+ */
public void setSortModel(SortModel sortModel) {
_sortModel = sortModel;
}
+ /**
+ * Set the {@link FilterModel} for the data grid
+ *
+ * @return the {@link FilterModel}
+ */
public FilterModel getFilterModel() {
return _filterModel;
}
+ /**
+ * Set the {@link FilterModel} for the data grid
+ *
+ * @param filterModel the new {@link FilterModel}
+ */
public void setFilterModel(FilterModel filterModel) {
_filterModel = filterModel;
}
+ /**
+ * Get the {@link PagerModel} for the data grid
+ *
+ * @return the {@link PagerModel}
+ */
public PagerModel getPagerModel() {
return _pagerModel;
}
+ /**
+ * Set the {@link PagerModel} for the data grid
+ *
+ * @param pagerModel the new {@link PagerModel}
+ */
public void setPagerModel(PagerModel pagerModel) {
_pagerModel = pagerModel;
}
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridURLBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridURLBuilder.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridURLBuilder.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/DataGridURLBuilder.java Wed May 4 09:15:26 2005
@@ -19,8 +19,9 @@
import java.util.Map;
-import org.apache.beehive.netui.databinding.datagrid.api.sort.SortDirection;
-
+/**
+ *
+ */
public abstract class DataGridURLBuilder {
public abstract Map getQueryParams();
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/exceptions/CellDecoratorException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/exceptions/CellDecoratorException.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/exceptions/CellDecoratorException.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/exceptions/CellDecoratorException.java Wed May 4 09:15:26 2005
@@ -18,23 +18,43 @@
package org.apache.beehive.netui.databinding.datagrid.api.exceptions;
/**
- *
+ * Exception thrown when an error occurs while rendering a
+ * {@link org.apache.beehive.netui.databinding.datagrid.api.rendering.CellDecorator}.
*/
public class CellDecoratorException
extends RuntimeException {
+ /**
+ * Default constructor
+ */
public CellDecoratorException() {
super();
}
+ /**
+ * Constructor with cause message
+ *
+ * @param message
+ */
public CellDecoratorException(String message) {
super(message);
}
+ /**
+ * Constructor with cause
+ *
+ * @param cause
+ */
public CellDecoratorException(Throwable cause) {
super(cause);
}
+ /**
+ * Constructor with message and cause
+ *
+ * @param message
+ * @param cause
+ */
public CellDecoratorException(String message, Throwable cause) {
super(message, cause);
}
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/exceptions/DataGridExtensionException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/exceptions/DataGridExtensionException.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/exceptions/DataGridExtensionException.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/exceptions/DataGridExtensionException.java Wed May 4 09:15:26 2005
@@ -18,23 +18,41 @@
package org.apache.beehive.netui.databinding.datagrid.api.exceptions;
/**
- * Exception thrown when an error occurs while extending the data grid.
+ * Exception thrown when an error occurs while extending the data grid. This
+ * exception could result for many reasons all of which are related to configuring
+ * data grid features.
*/
public class DataGridExtensionException
extends RuntimeException {
+ /**
+ * Default constructor
+ */
public DataGridExtensionException() {
super();
}
+ /**
+ * Constructor with cause message
+ *
+ * @param message
+ */
public DataGridExtensionException(String message) {
super(message);
}
+ /**
+ * Constructor with cause
+ *
+ * @param cause
+ */
public DataGridExtensionException(Throwable cause) {
super(cause);
}
+ /**
+ * Constructor with cause and message
+ */
public DataGridExtensionException(String message, Throwable cause) {
super(message, cause);
}
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/exceptions/IllegalFilterException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/exceptions/IllegalFilterException.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/exceptions/IllegalFilterException.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/exceptions/IllegalFilterException.java Wed May 4 09:15:26 2005
@@ -18,23 +18,40 @@
package org.apache.beehive.netui.databinding.datagrid.api.exceptions;
/**
- *
+ * Exception thrown when a {@link org.apache.beehive.netui.databinding.datagrid.api.filter.Filter}
+ * object is invalid while being manipulated by the data grid framework.
*/
public class IllegalFilterException
extends RuntimeException {
+ /**
+ * Default constructor
+ */
public IllegalFilterException() {
super();
}
+ /**
+ * Constructor with cause message
+ * @param message
+ */
public IllegalFilterException(String message) {
super(message);
}
+ /**
+ * Constructor with cause
+ * @param cause
+ */
public IllegalFilterException(Throwable cause) {
super(cause);
}
+ /**
+ * Constructor with cause and message
+ * @param message
+ * @param cause
+ */
public IllegalFilterException(String message, Throwable cause) {
super(message, cause);
}
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/rendering/DataGridTagModel.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/rendering/DataGridTagModel.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/rendering/DataGridTagModel.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/api/rendering/DataGridTagModel.java Wed May 4 09:15:26 2005
@@ -17,7 +17,6 @@
*/
package org.apache.beehive.netui.databinding.datagrid.api.rendering;
-import java.util.Map;
import java.util.HashMap;
import javax.servlet.jsp.JspContext;
import javax.servlet.http.HttpServletRequest;
@@ -35,15 +34,44 @@
import org.apache.beehive.netui.util.Bundle;
/**
- *
+ * <p>
+ * The DataGridTagModel is a JavaBean that is exposed by the NetUI data grid tag into
+ * the {@link javax.servlet.jsp.PageContext} in a JSP. This bean exposes state and services
+ * which can be data bound by an expression language in a JSP.
+ * </p>
+ * <p>
+ * </p>
*/
public class DataGridTagModel {
+ /**
+ * The render state used when the data grid performs its first pass through its tag body.
+ */
public static final int RENDER_STATE_START = 10;
+
+ /**
+ * The render state used when the data grid is rendering the caption tag.
+ */
public static final int RENDER_STATE_CAPTION = 20;
+
+ /**
+ * The render state used when the data grid is rendering the header tag.
+ */
public static final int RENDER_STATE_HEADER = 30;
+
+ /**
+ * The render state used when the data grid is rendering the data rows.
+ */
public static final int RENDER_STATE_GRID = 40;
+
+ /**
+ * The render state used when the data grid is rendering the footer.
+ */
public static final int RENDER_STATE_FOOTER = 50;
+
+ /**
+ * The render state used when the data grid has completed rendering.
+ */
public static final int RENDER_STATE_END = 60;
private static final int RENDER_STATE_UNINIT = -1;
@@ -64,6 +92,13 @@
private DataGridURLBuilder _urlBuilder = null;
private DataGridConfig _dataGridConfig = null;
+ /**
+ * Constructor used to build a DataGridTagModel.
+ *
+ * @param name the name of the data grid
+ * @param dataGridConfig the {@link DataGridConfig} object for a data grid
+ * @param jspContext the {@link JspContext} for the JSP in which the data grid's rendering started
+ */
public DataGridTagModel(String name, DataGridConfig dataGridConfig, JspContext jspContext) {
super();
@@ -78,18 +113,63 @@
_urlBuilder = stateFactory.getDataGridURLBuilder(_name, _dataGridConfig);
}
+ /**
+ * Accessor for the name of the data grid.
+ *
+ * @return the name of the data grid
+ */
public String getName() {
return _name;
}
+ /**
+ * Accessor for the {@link JspContext} for the JSP in which the grid started to render.
+ *
+ * @return the {@link JspContext}
+ */
public JspContext getJspContext() {
return _jspContext;
}
+ /**
+ * <p>
+ * Accessor for the current render state. This should be used by clients that need to
+ * affect their behavior based on the data grid's current render state. This value will
+ * be one of:
+ * <ul>
+ * <li>{@link DataGridTagModel.RENDER_STATE_START}</li>
+ * <li>{@link DataGridTagModel.RENDER_STATE_CAPTION}</li>
+ * <li>{@link DataGridTagModel.RENDER_STATE_HEADER}</li>
+ * <li>{@link DataGridTagModel.RENDER_STATE_GRID}</li>
+ * <li>{@link DataGridTagModel.RENDER_STATE_FOOTER}</li>
+ * <li>{@link DataGridTagModel.RENDER_STATE_END}</li>
+ * </ul>
+ * </p>
+ *
+ * @return the current render state
+ */
public int getRenderState() {
return _renderState;
}
+ /**
+ * <p>
+ * Method that alters the data grid's current render to the new <code>renderState</code>. If
+ * the provided render state value is unknown, an {@link IllegalStateException} is thrown. The
+ * data grid cycles through its state in this order:
+ * <ul>
+ * <li>{@link DataGridTagModel.RENDER_STATE_START}</li>
+ * <li>{@link DataGridTagModel.RENDER_STATE_CAPTION}</li>
+ * <li>{@link DataGridTagModel.RENDER_STATE_HEADER}</li>
+ * <li>{@link DataGridTagModel.RENDER_STATE_GRID}</li>
+ * <li>{@link DataGridTagModel.RENDER_STATE_FOOTER}</li>
+ * <li>{@link DataGridTagModel.RENDER_STATE_END}</li>
+ * </ul>
+ * </p>
+ *
+ * @param renderState the DataGridTagModel's new render state
+ * @throws IllegalStateException if an invalid state is provided
+ */
public void changeRenderState(int renderState) {
switch(_renderState) {
case RENDER_STATE_UNINIT:
@@ -117,16 +197,34 @@
return;
}
+ /**
+ * Accessor for the {@link PagedDataSet} that is used to render a data set in the grid.
+ *
+ * @return a {@link PagedDataSet} for the current data set
+ */
public PagedDataSet getDataSet() {
return _dataSet;
}
- /* todo: would be nice to address this side-effect outside of the setter */
+ /**
+ * Setter for the {@link PagedDataSet} object. In order to canonicalize the type used by
+ * the data grid to manipulate the data set, the {@link PagedDataSet} is used to
+ * navigate the data set.
+ *
+ * @param dataSet the data set
+ */
public void setDataSet(PagedDataSet dataSet) {
+ /* todo: would be nice to address this side-effect outside of the setter */
_dataSet = dataSet;
_dataGridState.getPagerModel().setDataSetSize(_dataSet.getSize());
}
+ /**
+ * Accessor for the {@link PagerRenderer}. This is the {@link PagerRenderer} instance that
+ * will be used to render the UI used to display the pager.
+ *
+ * @return the {@link PagerRenderer} for the data grid
+ */
public PagerRenderer getPagerRenderer() {
if(_pagerRenderer == null)
setPagerRenderer(_dataGridConfig.getDefaultPagerRenderer());
@@ -134,8 +232,13 @@
return _pagerRenderer;
}
- /* todo: would be nice to address this side-effect outside of the setter */
+ /**
+ * Set the {@link PagerRenderer} used to render the paging UI for the data grid.
+ *
+ * @param pagerRenderer the {@link PagerRenderer} to use
+ */
public void setPagerRenderer(PagerRenderer pagerRenderer) {
+ /* todo: would be nice to address this side-effect outside of the setter */
_pagerRenderer = pagerRenderer;
_pagerRenderer.setDataGridTagModel(this);
}
@@ -204,13 +307,13 @@
overrideResourceProvider.addResourceOverride(key, value);
}
- /* todo: fix the message here to format with the context path */
public String getResourcePath() {
+ /* todo: fix the message here to format with the context path */
return _request.getContextPath() + "/" + getMessage(IDataGridMessageKeys.DATAGRID_RESOURCE_PATH);
}
- /* todo: move to the DataGridConfig object */
public String getSortImagePath(SortDirection sortDirection) {
+ /* todo: move to the DataGridConfig object */
if(sortDirection == SortDirection.ASCENDING)
return getMessage(IDataGridMessageKeys.SORT_ASC_IMAGE_PATH);
else if(sortDirection == SortDirection.DESCENDING)
@@ -225,36 +328,90 @@
return getMessage(IDataGridMessageKeys.SORT_NONE_IMAGE_PATH);
}
+ /**
+ * Method used to render the data grid's pager UI into the given {@link AbstractRenderAppender}.
+ *
+ * @param appender the {@link AbstractRenderAppender} into which the pager will be rendered
+ */
public void renderPager(AbstractRenderAppender appender) {
if(getPagerRenderer() != null)
appender.append(getPagerRenderer().render());
}
+ /**
+ * Accessor for obtaining the {@link DataGridState} object. This is a JavaBean
+ * property that can be accessed via an expression language in order to obtain
+ * access to the state information for the data grid stored in the returned object.
+ *
+ * @return the data grid's {@link DataGridState}
+ */
public DataGridState getState() {
return _dataGridState;
}
+ /**
+ * Accessor for obtaining the {@link DataGridURLBuilder} object. This is a JavaBean
+ * that can be accessed via an expression language in order to obtain access to the
+ * URL information for the data grid stored in the returned object.
+ *
+ * @return the data grid's {@link DataGridURLBuilder}
+ */
public DataGridURLBuilder getUrlBuilder() {
return _urlBuilder;
}
+ /**
+ * Accessor for obtaining the current index in the data set. This value is a zero
+ * based count current item being rendered. For the array {"foo", "bar", "baz"}, the
+ * indices for each item would be 0, 1, and 2. This value does correspond to the
+ * index into an Object array or a list, but in an arbitrary Collection, the index
+ * is simply the number of items that appeared in the Collection before the current one.
+ *
+ * @return the current index
+ */
public int getCurrentIndex() {
+ assert _dataSet != null;
return _dataSet.getCurrentIndex();
}
+ /**
+ * Accessor for obtaining the current item in the data set.
+ *
+ * @return the current item in the data set
+ */
public Object getCurrentItem() {
+ assert _dataSet != null;
return _dataSet.getCurrentItem();
}
+ /**
+ * Accessor for obtaining the data source expression that was used to data bind to the data set.
+ *
+ * @return the String for the data source
+ */
public String getDataSource() {
+ assert _dataSet != null;
return _dataSet.getDataSource();
}
+ /**
+ * Accessor for getting the next item in the data set.
+ *
+ * @return the next item in the data set. Note, depending on the data set, this item could
+ * be <code>null</code>.
+ */
public Object nextDataItem() {
+ assert _dataSet != null;
return _dataSet.next();
}
+ /**
+ * Accessor for determining if there is another item in the data set.
+ *
+ * @return <code>true</code> if there is a next item; <code>false</code> otherwise.
+ */
public boolean hasNextDataItem() {
+ assert _dataSet != null;
return _dataSet.hasNext();
}
@@ -263,6 +420,16 @@
Implementation specifics
------------------------------------------------------------- */
+
+ /**
+ * <p>
+ * An internal class that represents a {@link DataGridResourceProvider} that supports
+ * property-by-property overrides. A JSP is able to specify message keys whose values
+ * to override; in situations where this functionality is used, this class provides
+ * the {@link DataGridResourceProvider} abstraction that implements this override
+ * functionality.
+ * </p>
+ */
private final class OverridableDataGridResourceProvider
extends DataGridResourceProvider {
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractCell.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractCell.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractCell.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractCell.java Wed May 4 09:15:26 2005
@@ -24,11 +24,9 @@
import org.apache.beehive.netui.databinding.datagrid.api.rendering.DataGridTagModel;
import org.apache.beehive.netui.databinding.datagrid.api.rendering.CellModel;
-import org.apache.beehive.netui.tags.AbstractSimpleTag;
import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender;
import org.apache.beehive.netui.tags.rendering.StringBuilderRenderAppender;
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
-import org.apache.beehive.netui.tags.html.IFormattable;
import org.apache.beehive.netui.tags.html.HtmlConstants;
import org.apache.beehive.netui.tags.html.FormatTag.Formatter;
import org.apache.beehive.netui.util.Bundle;
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java Wed May 4 09:15:26 2005
@@ -31,14 +31,10 @@
import org.apache.beehive.netui.databinding.datagrid.api.filter.FilterModel;
import org.apache.beehive.netui.tags.IAttributeConsumer;
import org.apache.beehive.netui.tags.IBehaviorConsumer;
-import org.apache.beehive.netui.tags.TagConfig;
-import org.apache.beehive.netui.tags.javascript.ScriptRequestState;
import org.apache.beehive.netui.tags.html.HtmlConstants;
-import org.apache.beehive.netui.tags.html.Form;
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
import org.apache.beehive.netui.tags.rendering.TdTag;
import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender;
-import org.apache.beehive.netui.tags.rendering.AbstractHtmlControlState;
import org.apache.beehive.netui.util.Bundle;
/**
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Caption.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Caption.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Caption.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Caption.java Wed May 4 09:15:26 2005
@@ -24,7 +24,6 @@
import javax.servlet.jsp.JspContext;
import javax.servlet.http.HttpServletRequest;
-import org.apache.beehive.netui.tags.AbstractSimpleTag;
import org.apache.beehive.netui.tags.html.HtmlConstants;
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
import org.apache.beehive.netui.tags.rendering.CaptionTag;
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/DataGridUtil.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/DataGridUtil.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/DataGridUtil.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/DataGridUtil.java Wed May 4 09:15:26 2005
@@ -19,10 +19,8 @@
import javax.servlet.jsp.JspContext;
-import org.apache.beehive.netui.databinding.datagrid.api.exceptions.DataGridExtensionException;
import org.apache.beehive.netui.databinding.datagrid.api.rendering.DataGridTagModel;
import org.apache.beehive.netui.databinding.datagrid.api.rendering.CellModel;
-import org.apache.beehive.netui.util.logging.Logger;
/**
*
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Footer.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Footer.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Footer.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Footer.java Wed May 4 09:15:26 2005
@@ -24,7 +24,6 @@
import javax.servlet.jsp.JspContext;
import javax.servlet.http.HttpServletRequest;
-import org.apache.beehive.netui.tags.AbstractSimpleTag;
import org.apache.beehive.netui.tags.IHtmlEvents;
import org.apache.beehive.netui.tags.IHtmlI18n;
import org.apache.beehive.netui.tags.html.HtmlConstants;
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Header.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Header.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Header.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Header.java Wed May 4 09:15:26 2005
@@ -26,7 +26,6 @@
import javax.servlet.jsp.JspContext;
import javax.servlet.http.HttpServletRequest;
-import org.apache.beehive.netui.tags.AbstractSimpleTag;
import org.apache.beehive.netui.tags.IHtmlI18n;
import org.apache.beehive.netui.tags.IHtmlEvents;
import org.apache.beehive.netui.tags.html.HtmlConstants;
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/RenderPager.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/RenderPager.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/RenderPager.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/RenderPager.java Wed May 4 09:15:26 2005
@@ -17,11 +17,9 @@
*/
package org.apache.beehive.netui.tags.databinding.datagrid;
-import javax.servlet.jsp.JspContext;
import javax.servlet.jsp.JspException;
import org.apache.beehive.netui.databinding.datagrid.api.rendering.DataGridTagModel;
-import org.apache.beehive.netui.tags.AbstractSimpleTag;
import org.apache.beehive.netui.util.Bundle;
/**
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java Wed May 4 09:15:26 2005
@@ -34,8 +34,18 @@
import org.apache.beehive.netui.tags.IHtmlEvents;
/**
- * @jsptagref.tagdescription Renders a column of data in a data grid.
- * @netui:tag name="spanCell" description="Renders a column of data in a NetUI grid" body-content="scriptless"
+ * <p>
+ * Data grid cell that renders an HTML <span> tag containing the tag's <code>value</code> attribute. The
+ * span cell is rendered inside of an HTML table <td>. The span cell supports various nested tags including
+ * those that provide formatting via the NetUI {@link IFormattable} interface and those that augment the
+ * available attribute set via the NetUI {@link org.apache.beehive.netui.tags.IAttributeConsumer} interface.
+ * </p>
+ *
+ * @jsptagref.tagdescription Data grid cell that renders an HTML <span> tag containing the tag's
+ * <code>value</code> attribute.
+ *
+ * @netui:tag name="spanCell" description="Data grid cell that renders its value attribute into an HTML <span>"
+ * body-content="scriptless"
*/
public class SpanCell
extends AbstractHtmlTableCell
@@ -47,15 +57,20 @@
private SpanCellModel _spanCellModel = new SpanCellModel();
private SpanTag.State _spanState = _spanCellModel.getSpanState();
+ /**
+ * The name of this tag; this value is used for error reporting.
+ *
+ * @return the String name of this tag
+ */
public String getTagName() {
return "SpanCell";
}
/**
- * Sets the onClick javascript event.
+ * Sets the onClick javascript event for the HTML span.
*
- * @param onClick - the onClick event.
- * @jsptagref.attributedescription The onClick JavaScript event.
+ * @param onClick - the onClick event for the HTML span.
+ * @jsptagref.attributedescription The onClick JavaScript event for the HTML span.
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_onClick</i>
* @netui:attribute required="false" rtexprvalue="true" description="The onClick JavaScript event."
@@ -65,130 +80,130 @@
}
/**
- * Sets the onDblClick javascript event.
+ * Sets the onDblClick javascript event for the HTML span.
*
- * @param onDblClick - the onDblClick event.
- * @jsptagref.attributedescription The onDblClick JavaScript event.
+ * @param onDblClick - the onDblClick event for the HTML span.
+ * @jsptagref.attributedescription The onDblClick JavaScript event for the HTML span.
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_onDblClick</i>
- * @netui:attribute required="false" rtexprvalue="true" description="The onDblClick JavaScript event."
+ * @netui:attribute required="false" rtexprvalue="true" description="The onDblClick JavaScript event for the HTML span."
*/
public void setOnDblClick(String onDblClick) {
_spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONDBLCLICK, onDblClick);
}
/**
- * Sets the onKeyDown javascript event.
+ * Sets the onKeyDown javascript event for the HTML span.
*
- * @param onKeyDown - the onKeyDown event.
- * @jsptagref.attributedescription The onKeyDown JavaScript event.
+ * @param onKeyDown - the onKeyDown event for the HTML span.
+ * @jsptagref.attributedescription The onKeyDown JavaScript event for the HTML span.
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_onKeyDown</i>
- * @netui:attribute required="false" rtexprvalue="true" description="The onKeyDown JavaScript event."
+ * @netui:attribute required="false" rtexprvalue="true" description="The onKeyDown JavaScript event for the HTML span."
*/
public void setOnKeyDown(String onKeyDown) {
_spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYDOWN, onKeyDown);
}
/**
- * Sets the onKeyUp javascript event.
+ * Sets the onKeyUp javascript event for the HTML span.
*
* @param onKeyUp - the onKeyUp event.
- * @jsptagref.attributedescription The onKeyUp JavaScript event.
+ * @jsptagref.attributedescription The onKeyUp JavaScript event for the HTML span.
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_onKeyUp</i>
- * @netui:attribute required="false" rtexprvalue="true" description="The onKeyUp JavaScript event."
+ * @netui:attribute required="false" rtexprvalue="true" description="The onKeyUp JavaScript event for the HTML span."
*/
public void setOnKeyUp(String onKeyUp) {
_spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYUP, onKeyUp);
}
/**
- * Sets the onKeyPress javascript event.
+ * Sets the onKeyPress javascript event for the HTML span.
*
* @param onKeyPress - the onKeyPress event.
- * @jsptagref.attributedescription The onKeyPress JavaScript event.
+ * @jsptagref.attributedescription The onKeyPress JavaScript event for the HTML span.
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_onKeyPress</i>
- * @netui:attribute required="false" rtexprvalue="true" description="The onKeyPress JavaScript event."
+ * @netui:attribute required="false" rtexprvalue="true" description="The onKeyPress JavaScript event for the HTML span."
*/
public void setOnKeyPress(String onKeyPress) {
_spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYPRESS, onKeyPress);
}
/**
- * Sets the onMouseDown javascript event.
+ * Sets the onMouseDown javascript event for the HTML span.
*
* @param onMouseDown - the onMouseDown event.
- * @jsptagref.attributedescription The onMouseDown JavaScript event.
+ * @jsptagref.attributedescription The onMouseDown JavaScript event for the HTML span.
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_onMouseDown</i>
- * @netui:attribute required="false" rtexprvalue="true" description="The onMouseDown JavaScript event."
+ * @netui:attribute required="false" rtexprvalue="true" description="The onMouseDown JavaScript event for the HTML span."
*/
public void setOnMouseDown(String onMouseDown) {
_spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEDOWN, onMouseDown);
}
/**
- * Sets the onMouseUp javascript event.
+ * Sets the onMouseUp javascript event for the HTML span.
*
* @param onMouseUp - the onMouseUp event.
- * @jsptagref.attributedescription The onMouseUp JavaScript event.
+ * @jsptagref.attributedescription The onMouseUp JavaScript event for the HTML span.
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_onMouseUp</i>
- * @netui:attribute required="false" rtexprvalue="true" description="The onMouseUp JavaScript event."
+ * @netui:attribute required="false" rtexprvalue="true" description="The onMouseUp JavaScript event for the HTML span."
*/
public void setOnMouseUp(String onMouseUp) {
_spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEUP, onMouseUp);
}
/**
- * Sets the onMouseMove javascript event.
+ * Sets the onMouseMove javascript event for the HTML span.
*
* @param onMouseMove - the onMouseMove event.
- * @jsptagref.attributedescription The onMouseMove JavaScript event.
+ * @jsptagref.attributedescription The onMouseMove JavaScript event for the HTML span.
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_onMouseMove</i>
- * @netui:attribute required="false" rtexprvalue="true" description="The onMouseMove JavaScript event."
+ * @netui:attribute required="false" rtexprvalue="true" description="The onMouseMove JavaScript event for the HTML span."
*/
public void setOnMouseMove(String onMouseMove) {
_spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEMOVE, onMouseMove);
}
/**
- * Sets the onMouseOut javascript event.
+ * Sets the onMouseOut javascript event for the HTML span.
*
* @param onMouseOut - the onMouseOut event.
- * @jsptagref.attributedescription The onMouseOut JavaScript event.
+ * @jsptagref.attributedescription The onMouseOut JavaScript event for the HTML span.
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_onMouseOut</i>
- * @netui:attribute required="false" rtexprvalue="true" description="The onMouseOut JavaScript event."
+ * @netui:attribute required="false" rtexprvalue="true" description="The onMouseOut JavaScript event for the HTML span."
*/
public void setOnMouseOut(String onMouseOut) {
_spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOUT, onMouseOut);
}
/**
- * Sets the onMouseOver javascript event.
+ * Sets the onMouseOver javascript event for the HTML span.
*
* @param onMouseOver - the onMouseOver event.
- * @jsptagref.attributedescription The onMouseOver JavaScript event.
+ * @jsptagref.attributedescription The onMouseOver JavaScript event for the HTML span.
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_onMouseOver</i>
- * @netui:attribute required="false" rtexprvalue="true" description="The onMouseOver JavaScript event."
+ * @netui:attribute required="false" rtexprvalue="true" description="The onMouseOver JavaScript event for the HTML span."
*/
public void setOnMouseOver(String onMouseOver) {
_spanState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOVER, onMouseOver);
}
/**
- * Sets the style of the rendered html tag.
+ * Sets the style for the HTML span.
*
* @param style - the html style.
- * @jsptagref.attributedescription The style.
+ * @jsptagref.attributedescription The style for the HTML span
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_style</i>
- * @netui:attribute required="false" rtexprvalue="true" description="The style."
+ * @netui:attribute required="false" rtexprvalue="true" description="The style for the HTML span"
*/
public void setStyle(String style) {
if("".equals(style)) return;
@@ -197,13 +212,13 @@
}
/**
- * Sets the style class of the rendered html tag.
+ * Sets the style class for the HTML span.
*
* @param styleClass - the html style class.
- * @jsptagref.attributedescription The style class.
+ * @jsptagref.attributedescription The style class for the HTML span
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_style_class</i>
- * @netui:attribute required="false" rtexprvalue="true" description="The style class."
+ * @netui:attribute required="false" rtexprvalue="true" description="The style class for the HTML span."
*/
public void setStyleClass(String styleClass) {
if("".equals(styleClass)) return;
@@ -212,26 +227,26 @@
}
/**
- * Sets the value of the title attribute.
+ * Sets the value of the title attribute for the HTML span.
*
* @param title
- * @jsptagref.attributedescription The title.
+ * @jsptagref.attributedescription The title for the HTML span.
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_title</i>
- * @netui:attribute required="false" rtexprvalue="true" description="The title. "
+ * @netui:attribute required="false" rtexprvalue="true" description="The title for the HTML span."
*/
public void setTitle(String title) {
_spanState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TITLE, title);
}
/**
- * Sets the lang attribute for the HTML element.
+ * Sets the lang attribute for the HTML span.
* @param lang
- * @jsptagref.attributedescription The lang.
+ * @jsptagref.attributedescription The lang for the HTML span.
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_lang</i>
* @netui:attribute required="false" rtexprvalue="true"
- * description="The lang."
+ * description="The lang for the HTML span"
*/
public void setLang(String lang)
{
@@ -239,13 +254,13 @@
}
/**
- * Sets the lang attribute for the HTML element.
+ * Sets the dir attribute for the HTML span.
* @param dir
* @jsptagref.attributedescription The dir.
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_dir</i>
* @netui:attribute required="false" rtexprvalue="true"
- * description="The dir."
+ * description="The dir for the HTML span."
*/
public void setDir(String dir)
{
@@ -253,14 +268,20 @@
}
/**
- * Set the name of the tagId for the span.
+ * <p>
+ * Set the name of the tagId for the HTML span. This value will have the index of the current data item
+ * in the data set appended to the tagId so that the identifiers are unique in the rendered JSP.
+ * </p>
+ * <p>
+ * For example, if a data set contains {"foo", "bar", "baz"} rendered using a spanCell with a tagId
+ * "theTagId", the resulting tagId values will be {"theTagId0", "theTagId1", "theTagId2"}.
*
- * @param tagId - the the name of the tagId for the span.
+ * @param tagId - the the name of the tagId for the HTML span.
* @jsptagref.attributedescription The tagId.
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_tagId</i>
* @netui:attribute required="false" rtexprvalue="true"
- * description="String value. Sets the id (or name) attribute of the rendered HTML tag. "
+ * description="String value. Sets the id (or name) attribute of the rendered HTML span."
*/
public void setTagId(String tagId)
throws JspException {
@@ -268,12 +289,38 @@
}
/**
+ * <p>
+ * Set the value rendered inside of the HTML span. This is the visible text that is displayed in the HTML
+ * rendered by this tag.
+ * </p>
+ *
+ * @jsptagref.attributedescription The value of the visible text rendered inside of the HTML span.
+ * @jsptagref.databindable false
* @netui:attribute required="true" rtexprvalue="true"
*/
public void setValue(String value) {
_spanCellModel.setValue(value);
}
+ /**
+ * <p>
+ * Implementation of {@link org.apache.beehive.netui.tags.IAttributeConsumer} interface. This
+ * allows a page author to add additional attributes to the HTML rendered by this tag. The attribute
+ * facets which can be consumed include:
+ * <ul>
+ * <li><code>span</code> -- attributes set using this facet will be rendered as HTML attributes on the
+ * rendered HTML <span> tag.</li>
+ * </ul>
+ * </p>
+ * <p>
+ * This tag also accepts facets supported by {@link AbstractHtmlTableCell#setAttribute(String, String, String)}
+ * </p>
+ *
+ * @param name the name of the attribute
+ * @param value the value of the attribute
+ * @param facet the facet for the attribute; this value must be match one of the facets supported by the JSP tags
+ * @throws JspException thrown when the given facet String is not recognized as a valid facet name
+ */
public void setAttribute(String name, String value, String facet)
throws JspException {
if(facet == null || facet.equals(SPAN_FACET_NAME))
@@ -282,6 +329,11 @@
super.setAttribute(name, value, facet);
}
+ /**
+ * Render the cell's contents. This method implements support for executing the span cell's decorator.
+ * @param appender the {@link AbstractRenderAppender} used to collect the rendered output
+ * @param jspFragmentOutput the String result of having evaluated the span cell's {@link javax.servlet.jsp.tagext.JspFragment}
+ */
protected void renderDataCellContents(AbstractRenderAppender appender, String jspFragmentOutput) {
/* render any JavaScript needed to support framework features */
if (_spanState.id != null) {
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/TemplateCell.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/TemplateCell.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/TemplateCell.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/TemplateCell.java Wed May 4 09:15:26 2005
@@ -22,11 +22,45 @@
import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender;
/**
- * @jsptagref.tagdescription Renders a column templated by the body of the JSP tag.
- * @netui:tag name="templateCell" description="Renders a column templated by the body of the JSP tag" body-content="scriptless"
+ * <p>
+ * Data grid cell that renders the content contained inside of its body inside of an HTML <td>
+ * tag. The body of the template cell can contain any JSP markup that is legal to nest inside of
+ * a {@link javax.servlet.jsp.tagext.SimpleTag}.
+ * </p>
+ * <p>
+ * The set of JSP implicit objects available to the body include:
+ * <ul>
+ * <li><code>dataGridModel</code> -- the {@link org.apache.beehive.netui.databinding.datagrid.api.rendering.DataGridTagModel}
+ * for the cell's containing data grid.</li>
+ * <li><code>container</code> -- the {@link org.apache.beehive.netui.script.common.IDataAccessProvider} instance
+ * that exposes the current data item and the current item's index</li>
+ * <li></li>
+ * </ul>
+ * </p>
+ * <p>
+ * The HTML events, core attributes, and internationalization JSP tag attributes are applied to the
+ * <td>.
+ * </p>
+ * <p>
+ * The templateCell can be used to render HTML UI that is not supported with other data grid cell types. For example,
+ * to build UI that will POST data to a form, the NetUI {@link org.apache.beehive.netui.tags.html.TextBox} tag can
+ * be used as:
+ * <pre>
+ * <netui-data:templateCell>
+ * <netui:textBox dataSource="container.item.name"/>
+ * </netui-data:templateCell>
+ * </pre>
+ * </p>
+ *
+ * @jsptagref.tagdescription Data grid cell that renders the content contained inside of its body inside of an
+ * HTML <td> tag. The body of the template cell can contain any JSP markup that is legal to nest inside of
+ * a {@link javax.servlet.jsp.tagext.SimpleTag}.
+ *
+ * @netui:tag name="templateCell" description="Data grid cell that renders the content resulting from evaluating its body"
+ * body-content="scriptless"
*/
public class TemplateCell
- extends AbstractHtmlTableCell {
+ extends AbstractHtmlTableCell {
public String getTagName() {
return "TemplateCell";
Modified: incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/iterator/ResultSetIterator.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/iterator/ResultSetIterator.java?rev=168140&r1=168139&r2=168140&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/iterator/ResultSetIterator.java (original)
+++ incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/iterator/ResultSetIterator.java Wed May 4 09:15:26 2005
@@ -29,7 +29,9 @@
import org.apache.beehive.netui.util.logging.Logger;
/**
- *
+ * <p>
+ * {@link Iterator} implementation for {@link ResultSet}.
+ * </p>
*/
public class ResultSetIterator
implements Iterator {
@@ -40,11 +42,17 @@
private String[] _columnNames = null;
private ResultSet _rs = null;
- public ResultSetIterator(ResultSet rs) {
- if(rs == null)
+ /**
+ * Create a ResultSetIterator for the <code>resultSet</code>.
+ *
+ * @param resultSet the ResultSet to iterate over
+ * @throws IllegalStateException when a {@link SQLException} occurs manipulating the ResultSet
+ */
+ public ResultSetIterator(ResultSet resultSet) {
+ if(resultSet == null)
return;
- _rs = rs;
+ _rs = resultSet;
try {
// handle RSMD here to build a template map that can contain the data for each row
@@ -65,7 +73,10 @@
}
/**
+ * Check for a subsequent item in the ResultSet.
*
+ * @return <code>true</code> if there is another element; <code>false</code> otherwise
+ * @throws IllegalStateException when a {@link SQLException} occurs advancing the ResultSet
*/
public boolean hasNext() {
if(_rs == null)
@@ -86,7 +97,11 @@
}
/**
+ * Advance to the next row in the ResultSet.
*
+ * @return a {@link java.util.Map} containing the data in the next row. The keys in the map
+ * correspond to the ResultSet's column names and are case insensitive when checking a key.
+ * @throws NoSuchElementException if the ResultSet is null or the end of the ResultSet has been reached
*/
public Object next() {
if(_rs == null)
@@ -110,6 +125,11 @@
}
}
+ /**
+ * The remove operation is unsupported on the ResultSetIterator.
+ *
+ * @throws UnsupportedOperationException always
+ */
public void remove() {
throw new UnsupportedOperationException(Bundle.getErrorString("IteratorFactory_Iterator_removeUnsupported",
new Object[]{this.getClass().getName()}));