From cc6b96d27f6352a63aade55b530614ddb4d603b5 Mon Sep 17 00:00:00 2001 From: pb Date: Sun, 7 Jul 2013 23:14:36 +0000 Subject: [PATCH] Diverses kleine Korrekturen. git-svn-id: https://svn.libreccm.org/ccm/trunk@2249 8810af33-2d31-482b-a856-94f89814c4df --- .../contentassets/ui/RelatedLinkTable.java | 1 + .../arsdigita/cms/contenttypes/Contact.xml | 3 +- .../com/arsdigita/cms/CMSResources.properties | 2 + .../arsdigita/cms/CMSResources_de.properties | 2 + .../cms/CMSResources_en_GB.properties | 2 + .../arsdigita/cms/CMSResources_fr.properties | 2 + .../ContenttypesResources.properties | 22 +-- .../ContenttypesResources_de.properties | 20 +-- ...enericContactAttachPersonPropertyForm.java | 10 +- .../ui/GenericContactEntryAddForm.java | 38 +++-- .../GenericContactPersonPropertiesStep.java | 34 ++++- .../ui/GenericContactPersonSheet.java | 30 ++-- .../ui/GenericContactPropertiesStep.java | 110 ++++++++++---- .../ui/GenericContactPropertyForm.java | 31 +++- ccm-core/src/com/arsdigita/bebop/Link.java | 52 ++++--- .../arsdigita/bebop/table/TableColumn.java | 26 ++-- .../search/ui/BaseQueryComponent.java | 5 + .../com/arsdigita/toolbox/ui/DataTable.java | 141 ++++++++++-------- 18 files changed, 348 insertions(+), 183 deletions(-) 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"> + + createComponent="com.arsdigita.cms.contenttypes.ui.GenericContactCreate"> */ public class GenericContactPropertiesStep extends SimpleEditStep { private static final Logger logger = Logger.getLogger( GenericContactPropertiesStep.class); - /** - * Name of the this edit sheet (Don't know if this this really needed. - * It has the same value in almost all PropertiesStep classes) - */ + + /** Name of the this edit sheet (Don't know if this this really needed. + * It has the same value in almost all PropertiesStep classes) */ public static final String EDIT_BASIC_SHEET_NAME = "editBasic"; /** @@ -38,9 +66,12 @@ public class GenericContactPropertiesStep extends SimpleEditStep { */ public GenericContactPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { + + // Construct a new SimpleEditComponent with basic funtionality super(itemModel, parent); setDefaultEditKey(EDIT_BASIC_SHEET_NAME); + /* Create a SegmentPanel containing all the various editing steps */ SegmentedPanel segmentedPanel = createEditSheet(itemModel, parent); /* Sets the composed segmentedPanel as display component */ @@ -48,6 +79,11 @@ public class GenericContactPropertiesStep extends SimpleEditStep { } /** + * Build the segmented panel. It contains 4 components: + * - basic contentPage properties (title/name) + * - attached person + * - attached address + * - contact entries for this contact * * @param itemModel * @param parent @@ -55,23 +91,27 @@ public class GenericContactPropertiesStep extends SimpleEditStep { */ protected SegmentedPanel createEditSheet(ItemSelectionModel itemModel, AuthoringKitWizard parent) { + /* Use a Segmented Panel for the multiple parts of data */ SegmentedPanel segmentedPanel = new SegmentedPanel(); /* The different parts of information are displayed in seperated * segments each containing a SimpleEditStep */ /* Well, not so simple anymore... */ - /* A new SimpleEditStep */ + + /* A new SimpleEditStep for basic properties */ SimpleEditStep basicProperties = new SimpleEditStep(itemModel, parent, EDIT_BASIC_SHEET_NAME); - /* Create the edit component for this SimpleEditStep and the corresponding link */ - BasicPageForm editBasicSheet = new GenericContactPropertyForm(itemModel, this); + /* Create the edit component for this SimpleEditStep and the + * corresponding link */ + BasicPageForm editBasicSheet = new GenericContactPropertyForm(itemModel, + this); basicProperties.add( EDIT_BASIC_SHEET_NAME, ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.contact.edit_basic_properties"), + "cms.contenttypes.ui.genericcontact.edit_basic_properties"), new WorkflowLockedComponentAccess( editBasicSheet, itemModel), @@ -80,41 +120,49 @@ public class GenericContactPropertiesStep extends SimpleEditStep { /* Set the displayComponent for this step */ basicProperties.setDisplayComponent(getContactPropertySheet(itemModel)); - /* Add the SimpleEditStep to the segmented panel */ - segmentedPanel - .addSegment(new Label(ContenttypesGlobalizationUtil - .globalize("cms.contenttypes.ui.contact.basic_properties")), - basicProperties); + /* Add the basic properties SimpleEditStep to the segmented panel with + * provided title */ + segmentedPanel.addSegment(new + Label(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericcontact.basic_properties")), + basicProperties); + // If not disabled via registry, add the ui for attaching a person if (!GenericContact.getConfig().getHidePerson()) { GenericContactPersonPropertiesStep personProperties = new GenericContactPersonPropertiesStep(itemModel, parent); - segmentedPanel - .addSegment(new Label(ContenttypesGlobalizationUtil - .globalize("cms.contenttypes.ui.contact.person")), - personProperties); + // Add step to segmented panel with the provided title + segmentedPanel.addSegment(new + Label(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericcontact.person")), + personProperties); } + + // If not disabled via registry, add the ui for attaching an address if (!GenericContact.getConfig().getHideAddress()) { GenericContactAddressPropertiesStep addressProperties = new GenericContactAddressPropertiesStep(itemModel, parent); - segmentedPanel - .addSegment(new Label(ContenttypesGlobalizationUtil - .globalize("cms.contenttypes.ui.contact.address")), - addressProperties); + // Add step to segmented panel with the provided title + segmentedPanel.addSegment(new + Label(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericcontact.address")), + addressProperties); } + // Add UI for adding several contact entries. GenericContactEntriesPropertiesStep contactEntries = new GenericContactEntriesPropertiesStep(itemModel, parent); - segmentedPanel - .addSegment(new Label(ContenttypesGlobalizationUtil - .globalize("cms.contenttypes.ui.contact.contactEntry")), - contactEntries); + // Add step to segmented panel with the provided title + segmentedPanel.addSegment(new + Label(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericcontact.contactEntry")), + contactEntries); return segmentedPanel; } @@ -132,12 +180,14 @@ public class GenericContactPropertiesStep extends SimpleEditStep { /* The DisplayComponent for the Basic Properties */ DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); - sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"), "title"); - sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"), "name"); + sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"), + "title"); + sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"), + "name"); if (!ContentSection.getConfig().getHideLaunchDate()) { - sheet.add(GlobalizationUtil - .globalize("cms.contenttypes.ui.launch_date"), + sheet.add(GlobalizationUtil.globalize( + "cms.contenttypes.ui.launch_date"), ContentPage.LAUNCH_DATE, new LaunchDateAttributeFormatter() ); } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertyForm.java index 96c3d44ce..2af895673 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertyForm.java @@ -1,3 +1,21 @@ +/* + * Copyright (C) 2009-2013 Sören Bernstein, University of Bremen. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormProcessException; @@ -13,7 +31,12 @@ import com.arsdigita.cms.contenttypes.GenericContact; import org.apache.log4j.Logger; /** - * Form for editing the basic properties of a basic contact. + * The editing step for contact's basic properties. + * It is part of the central entry point of contact's authoring step + * {@link GenericContactPropertiesStep} + * + * The Form enables editing the basic properties of a basic contact as + * required by parent class ContentPage (i.e. title / name). */ public class GenericContactPropertyForm extends BasicPageForm implements FormProcessListener, @@ -29,13 +52,11 @@ public class GenericContactPropertyForm extends BasicPageForm public static final String ADRESS = GenericContact.ADDRESS; public static final String CONTACT_ENTRIES= GenericContact.CONTACT_ENTRIES; - /** - * ID of the form - */ + /** ID of the form */ public static final String ID = "Contact_edit"; /** - * Constrctor taking an ItemSelectionModel + * Constructor taking an ItemSelectionModel. * * @param itemModel */ diff --git a/ccm-core/src/com/arsdigita/bebop/Link.java b/ccm-core/src/com/arsdigita/bebop/Link.java index 12c242d1b..3ef791bb0 100755 --- a/ccm-core/src/com/arsdigita/bebop/Link.java +++ b/ccm-core/src/com/arsdigita/bebop/Link.java @@ -77,25 +77,22 @@ public class Link extends BaseLink { } /** - * Constructor. + * Constructor, creates a link with a globalized label or an image as label. * - *

The Component parameter in this constructor is usually a - * {@link Label} or {@link Image}.

+ * @param child The Component parameter in this constructor is + * usually a {@link Label} or {@link Image}. + * @param url 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 url with the + * webapp context path or the dispatcher servlet path. * - *

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 url with the webapp context path or the dispatcher - * servlet path.

- * - *

The vast majority of CCM UI code expects to link through the dispatcher. - * Code that does not should use the Link constructor taking - * a URL.

- * - * @see #Link(String,URL) + * The vast majority of CCM UI code expects to link through + * the dispatcher. Code that does not should use the + * 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.

* * @see #Link(String,URL) + * @deprecated refactor to use Link(Component,PrintListener) to provide a + * globalized label for the link. */ public Link(String label, String url) { super(label, url); @@ -219,6 +218,11 @@ public class Link extends BaseLink { // setVar(name, value); // } + /** + * + * @return + * may be this method should be deprecated as well as addURLVars? + */ public String getURLVarString() { return m_params.toString(); } @@ -241,6 +245,11 @@ public class Link extends BaseLink { setAttribute(FRAME_TARGET_ATTR, frameName); } + /** + * + * @param state + * @param parent + */ protected void generateURL(PageState state, Element parent) { parent.addAttribute("href", prepareURL(state, getTarget())); @@ -255,6 +264,7 @@ public class Link extends BaseLink { * @return the URL appended with ACS-specific URL parameters. */ protected String prepareURL(final PageState state, String location) { + final HttpServletRequest req = state.getRequest(); final HttpServletResponse resp = state.getResponse(); diff --git a/ccm-core/src/com/arsdigita/bebop/table/TableColumn.java b/ccm-core/src/com/arsdigita/bebop/table/TableColumn.java index 7f98bcdf9..5cf42a803 100755 --- a/ccm-core/src/com/arsdigita/bebop/table/TableColumn.java +++ b/ccm-core/src/com/arsdigita/bebop/table/TableColumn.java @@ -85,8 +85,7 @@ public class TableColumn extends SimpleComponent /** * The renderer used for ordinary cells in this column. Null by default, - * which instructs the 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; *

General

* * Wraps any {@link DataQuery} in a sortable Bebop {@link Table}. + * * The {@link DataQuery} is supplied by the {@link DataQueryBuilder} class, * which the user must implement. The 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; * *

Pagination

* - * 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: * - *
DataTable table = new DataTable(...);
+ * 

+ * DataTable table = new DataTable(...);
  * Paginator paginator = new Paginator(table, ...);
- * table.setPaginator(paginator);
+ * table.setPaginator(paginator); + *
* - * The 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. *

* *

Globalization

* - * 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. + * 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);