diff --git a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkTable.java b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkTable.java
index 2f662698c..c676598a3 100755
--- a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkTable.java
+++ b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkTable.java
@@ -68,6 +68,7 @@ public class RelatedLinkTable extends LinkTable {
/**
* @see com.arsdigita.cms.contenttypes.ui.LinkTable#addColumns()
*/
+ @Override
protected void addColumns() {
super.addColumns();
diff --git a/ccm-cms-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml b/ccm-cms-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml
index d12b409fc..45ac1ade8 100644
--- a/ccm-cms-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml
+++ b/ccm-cms-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml
@@ -10,8 +10,9 @@
objectType="com.arsdigita.cms.contenttypes.Contact"
classname="com.arsdigita.cms.contenttypes.Contact">
+
The Component parameter in this constructor is usually a
- * {@link Label} or {@link Image}. Starting with release 5.2, this method prefixes the passed-in url with
- * the path to the CCM dispatcher. Code using this constructor should not
- * prefix The vast majority of CCM UI code expects to link through the dispatcher.
- * Code that does not should use the url with the
+ * webapp context path or the dispatcher servlet path.
*
- * url with the webapp context path or the dispatcher
- * servlet path.Link constructor taking
- * a URL.Link constructor taking a URL.
+ * @see #Link(String,URL)
*/
public Link(Component child, String url) {
super(child, url);
-
init();
}
@@ -120,6 +117,8 @@ public class Link extends BaseLink {
* separate call to the addPrintListener method. PrintListeners
* are a convenient way to alter underlying Link attributes such as Link
* text or target URL within a locked page on a per request basis.
+ * @deprecated refactor to use Link(Component,PrintListener) to provide a
+ * globalized label for the link.
*/
public Link(String label, PrintListener l) {
super(label,l);
@@ -129,13 +128,11 @@ public class Link extends BaseLink {
/**
- * Constructors with PrintListener parameters
- * allow for a {@link PrintListener} to be set for
- * the Link, without the need to make a separate call to
- * the addPrintListener method. PrintListeners
- * are a convenient way to alter underlying Link attributes
- * such as Link text or target URL within a locked page
- * on a per request basis.
+ * Constructors with PrintListener parameters allow for a
+ * {@link PrintListener} to be set for the Link, without the need to make a
+ * separate call to the addPrintListener method. PrintListeners
+ * are a convenient way to alter underlying Link attributes such as Link
+ * text or target URL within a locked page on a per request basis.
*/
public Link(PrintListener l) {
super(l);
@@ -159,6 +156,8 @@ public class Link extends BaseLink {
* Link constructor taking a URL.
Table to use its default
- * renderer.
+ * which instructs the Table to use its default renderer.
*/
private TableCellRenderer m_cellRenderer;
@@ -104,7 +103,11 @@ public class TableColumn extends SimpleComponent
/**
* The display value for identifying the header. Will be passed to the
- * header cell renderer.
+ * header cell renderer.
+ * Usually this will be a {@link Label} passed in by a pattern like
+ * {@code new Label(GlobalizedMessage)}. But it could be any object,
+ * e.g.an image as well. The use of a string is possible but strongly
+ * discouraged because it results in non-localizable UI.
*/
private Object m_headerValue;
@@ -138,8 +141,8 @@ public class TableColumn extends SimpleComponent
* header value. The header key is equal to null.
*
* @param modelIndex the index of the column in the table model from
- * which to retrieve values.
- * @param value the value for the column header.
+ * which to retrieve values.
+ * @param value the value for the column header.
* @pre modelIndex >= 0
*/
public TableColumn(int modelIndex, Object value) {
@@ -151,9 +154,9 @@ public class TableColumn extends SimpleComponent
* header value and key.
*
* @param modelIndex the index of the column in the table model from
- * which to retrieve values.
- * @param value the value for the column header.
- * @param key the key for the column header.
+ * which to retrieve values.
+ * @param value the value for the column header.
+ * @param key the key for the column header.
* @pre modelIndex >= 0
*/
public TableColumn(int modelIndex, Object value, Object key) {
@@ -217,7 +220,9 @@ public class TableColumn extends SimpleComponent
/**
* Get the display value used for the header. This is the object that is
- * passed to the renderer, often a string.
+ * passed to the renderer. Usually this will be a {@link Label} previously
+ * passed in by a pattern like {@code new Label(GlobalizedMessage)}.
+ * The use of a string is possible but strongly discouraged.
*
* @return the display value for the header.
*/
@@ -228,6 +233,9 @@ public class TableColumn extends SimpleComponent
/**
* Set the display value for the header. This object is passed through to
* the header renderer without any modifications.
+ * Usually this will be a {@link Label} passed in by a pattern like
+ * {@code new Label(GlobalizedMessage)}. The use of a string is possible
+ * but strongly discouraged because it results in non-localizable UI.
*
* @param value the new display value for the header.
* @see #getHeaderValue
diff --git a/ccm-core/src/com/arsdigita/search/ui/BaseQueryComponent.java b/ccm-core/src/com/arsdigita/search/ui/BaseQueryComponent.java
index c98893508..141b2e8c6 100755
--- a/ccm-core/src/com/arsdigita/search/ui/BaseQueryComponent.java
+++ b/ccm-core/src/com/arsdigita/search/ui/BaseQueryComponent.java
@@ -120,6 +120,11 @@ public class BaseQueryComponent extends QueryComponent {
}
+ /**
+ *
+ * @param state
+ * @param parent
+ */
@Override
public void generateXML(PageState state,
Element parent) {
diff --git a/ccm-core/src/com/arsdigita/toolbox/ui/DataTable.java b/ccm-core/src/com/arsdigita/toolbox/ui/DataTable.java
index 1bce194d4..83c737981 100755
--- a/ccm-core/src/com/arsdigita/toolbox/ui/DataTable.java
+++ b/ccm-core/src/com/arsdigita/toolbox/ui/DataTable.java
@@ -19,8 +19,6 @@
package com.arsdigita.toolbox.ui;
-import com.arsdigita.toolbox.util.GlobalizationUtil ;
-
import com.arsdigita.bebop.Page;
import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.PaginationModelBuilder;
@@ -63,34 +61,32 @@ import org.apache.log4j.Logger;
* DataQueryBuilder may
- * dynamically construct the query during each request, or return the
- * same named query for each request; the DataTable does
- * not care where the query comes from.
+ * dynamically construct the query during each request, or return the same
+ * named query for each request; the DataTable does not care
+ * where the query comes from.
* * - * This class may contain multiple {@link QueryListener}s. These - * listeners will be fired whenever the query is about to - * be performed, thus giving the user a chance to set - * additional filters on the query. + * This class may contain multiple {@link QueryListener}s. These listeners will + * be fired whenever the query is about to be performed, thus giving the user + * a chance to set additional filters on the query. *
*
* Columns may be added to the DataTable by calling the
- * {@link #addColumn} method. The user may choose to make the column
- * sortable or non-sortable; sortable columns will appear as links
- * on the Web page which, when clicked, will sort the table by the
- * specified column. See the documentation on the various
- * addColumn methods for more information.
+ * {@link #addColumn} method. The user may choose to make the column sortable
+ * or non-sortable; sortable columns will appear as links on the Web page which,
+ * when clicked, will sort the table by the specified column. See the
+ * documentation on the various addColumn methods for more
+ * information.
*
*
- * Note that any {@link com.arsdigita.domain.DomainCollection}
- * can be used with DataTable, since the
- * DomainCollection is merely a wrapper for a {@link
- * com.arsdigita.persistence.DataCollection}, which extends
- * DataQuery. The {@link
- * com.arsdigita.domain.DomainService} class may be used to retieve
- * the DataCollection for any given
+ * Note that any {@link com.arsdigita.domain.DomainCollection} can be used with
+ * DataTable, since the DomainCollection is merely
+ * a wrapper for a {@link com.arsdigita.persistence.DataCollection}, which
+ * extends DataQuery. The {@link com.arsdigita.domain.DomainService}
+ * class may be used to retieve the DataCollection for any given
* DomainCollection.
* * This class sets the XSL "class" attribute to "dataTable" @@ -98,35 +94,34 @@ import org.apache.log4j.Logger; * *
DataTable also
- * implements {@link PaginationModelBuilder}. This means that
- * it could serve as the model builder for any {@link Paginator}
- * component. Pagination of the query occurs after all the sorting
- * and query events have finished. Consider a query which returns
- * the rows "A B C D E F". If the paginator displays 3 rows per page,
- * page 1 will contain "A B C" and page 2 will contain "D E F".
- * If the user then clicks on the header in the DataTable,
- * causing the query to be sorted in reverse order, page 1 will
- * contain "F E D" and page 2 will contain "C B A". In order for
- * pagination to work properly, the following pattern must
- * be used:
+ * DataTable also implements {@link PaginationModelBuilder}.
+ * This means that it could serve as the model builder for any {@link Paginator}
+ * component. Pagination of the query occurs after all the sorting and query
+ * events have finished. Consider a query which returns the rows "A B C D E F".
+ * If the paginator displays 3 rows per page, page 1 will contain "A B C" and
+ * page 2 will contain "D E F".
+ * If the user then clicks on the header in the DataTable, causing
+ * the query to be sorted in reverse order, page 1 will contain "F E D" and
+ * page 2 will contain "C B A". In order for pagination to work properly, the
+ * following pattern must be used:
*
- * * - * TheDataTable table = new DataTable(...); + *+ * table.setPaginator(paginator); + *+ * DataTable table = new DataTable(...); * Paginator paginator = new Paginator(table, ...); - * table.setPaginator(paginator);
setPaginator call is required due to a
- * design flaw in the Paginator component.
+ * The setPaginator call is required due to a design flaw in the
+ * Paginator component.
* * *
DataTable will ordinarily interpret the labels
- * of its column headers as plain text, and spit them out on
- * the screen verbatim. However, if setResouceBundle
- * is called, DataTable will instead interpret the
- * column header labels as keys into the specified resource bundle,
- * thus attempting to globalize the column headers at runtime.
+ * The DataTable will ordinarily interpret the labels of its
+ * column headers as plain text, and spit them out on the screen verbatim.
+ * However, if setResouceBundle is called, DataTable
+ * will instead interpret the column header labels as keys into the specified
+ * resource bundle, thus attempting to globalize the column headers at runtime.
*
*
* @author Stanislav Freidin
@@ -196,9 +191,8 @@ public class DataTable extends Table implements PaginationModelBuilder {
* used to globalize the column labels. If null, column labels will
* be printed verbatim to the screen.
*/
- public DataTable (
- DataQueryBuilder builder, SingleSelectionModel orderModel
- ) {
+ public DataTable (DataQueryBuilder builder,
+ SingleSelectionModel orderModel ) {
this(builder, orderModel, null);
}
@@ -217,6 +211,7 @@ public class DataTable extends Table implements PaginationModelBuilder {
/**
* Register the ordering parameter
*/
+ @Override
public void register(Page p) {
super.register(p);
p.addComponentStateParam(this,
@@ -252,16 +247,20 @@ public class DataTable extends Table implements PaginationModelBuilder {
/**
* Add a column to this table.
*
- * @param label The user-readable label for the column
+ * @param label The user-readable label for the column
+ * NOTE: depending on setResourceBundle() it is treated
+ * as plain text for output or key into bundle
+ * resulting in globalized Labels!
* @param attribute The name of the attribute in the DataQuery
- * which will be used as the value for this column.
+ * which will be used as the value for this column.
* @param isSortable true if it is possible to sort using this column, false
- * otherwise
- * @param renderer a {@link TableCellRenderer} that will be used to
- * format the attribute as a string.
+ * otherwise
+ * @param renderer a {@link TableCellRenderer} that will be used to
+ * format the attribute as a string.
* @return the newly added column
*/
- public TableColumn addColumn(String label, String attribute,
+ public TableColumn addColumn(String label,
+ String attribute,
boolean isSortable,
TableCellRenderer renderer) {
return addColumn(label, attribute, isSortable, renderer, null);
@@ -272,6 +271,9 @@ public class DataTable extends Table implements PaginationModelBuilder {
* Add a column to this table.
*
* @param label The user-readable label for the column
+ * NOTE: depending on setResourceBundle() it is treated
+ * as plain text for output or key into bundle
+ * resulting in globalized Labels!
* @param attribute The name of the attribute in the DataQuery
* which will be used as the value for this column.
* @param isSortable true if it is possible to sort using this column, false
@@ -284,10 +286,14 @@ public class DataTable extends Table implements PaginationModelBuilder {
* @return the newly added column
*/
public TableColumn addColumn(String label, String attribute,
- boolean isSortable, TableCellRenderer renderer, String orderAttribute) {
+ boolean isSortable, TableCellRenderer renderer,
+ String orderAttribute) {
DataTableColumnModel model = (DataTableColumnModel)getColumnModel();
- TableColumn column = new SortableTableColumn (
- model.size(), label, attribute, isSortable, renderer
+ TableColumn column = new SortableTableColumn(model.size(),
+ label,
+ attribute,
+ isSortable,
+ renderer
);
model.add(column, orderAttribute);
@@ -305,6 +311,9 @@ public class DataTable extends Table implements PaginationModelBuilder {
* Add a column to this table.
*
* @param label The user-readable label for the column
+ * NOTE: depending on setResourceBundle() it is treated
+ * as plain text for output or key into bundle
+ * resulting in globalized Labels!
* @param attribute The name of the attribute in the DataQuery
* which will be used as the value for this column.
* @param isSortable true if it is possible to sort using this column, false
@@ -321,6 +330,9 @@ public class DataTable extends Table implements PaginationModelBuilder {
* Add a column to this table.
*
* @param label The user-readable label for the column
+ * NOTE: depending on setResourceBundle() it is treated
+ * as plain text for output or key into bundle
+ * resulting in globalized Labels!
* @param attribute The name of the attribute in the DataQuery
* which will be used as the value for this column.
* @return the newly added column
@@ -338,6 +350,9 @@ public class DataTable extends Table implements PaginationModelBuilder {
* will be used to add {@link ControlLink}s to the table.
*
* @param label The user-readable label for the column
+ * NOTE: depending on setResourceBundle() it is treated
+ * as plain text for output or key into bundle
+ * resulting in globalized Labels!
* @param renderer The cell renderer for the given column
* @return the newly added column
*/
@@ -351,8 +366,9 @@ public class DataTable extends Table implements PaginationModelBuilder {
}
/**
- * @return the {@link DataQueryBuilder} that creates
- * a {@link DataQuery} for this table during each request
+ *
+ * @return the {@link DataQueryBuilder} that creates a {@link DataQuery}
+ * for this table during each request
*/
public DataQueryBuilder getDataQueryBuilder() {
return m_builder;
@@ -367,8 +383,8 @@ public class DataTable extends Table implements PaginationModelBuilder {
}
/**
- * Set the {@link SingleSelectionModel} that will determine the order
- * for the items in the tabke
+ * Set the {@link SingleSelectionModel} that will determine the order for
+ * the items in the table.
*
* @param orderModel The new model
*/
@@ -385,8 +401,8 @@ public class DataTable extends Table implements PaginationModelBuilder {
}
/**
- * Add a {@link QueryListener} to this table. The listener
- * will be fired whenever the query is about to be performed.
+ * Add a {@link QueryListener} to this table. The listener will be fired
+ * whenever the query is about to be performed.
*
* @param l the new query listener
*/
@@ -539,12 +555,14 @@ public class DataTable extends Table implements PaginationModelBuilder {
/**
* Lock this table
*/
+ @Override
public void lock() {
m_builder.lock();
super.lock();
}
// Export the current order
+ @Override
public void generateExtraXMLAttributes(PageState s, Element element) {
String key = getOrder(s);
if (key != null) {
@@ -898,6 +916,7 @@ public class DataTable extends Table implements PaginationModelBuilder {
setColumnKey(get(columnIndex), columnKey);
}
+ @Override
public void remove(TableColumn column) {
super.remove(column);
m_columnKeys.remove(column);