diff --git a/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentModelBuilder.java b/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentModelBuilder.java index 0aa17a481..d4a60d967 100755 --- a/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentModelBuilder.java +++ b/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentModelBuilder.java @@ -44,6 +44,7 @@ public class FileAttachmentModelBuilder extends AbstractTableModelBuilder { /** * Constructor + * @param model **/ public FileAttachmentModelBuilder(ItemSelectionModel model) { super(); @@ -51,14 +52,18 @@ public class FileAttachmentModelBuilder extends AbstractTableModelBuilder { } /** + * @param table + * @param state * @return a TableModel represented by the PageState **/ + @Override public TableModel makeModel(Table table, PageState state) { m_table = table; return new FileAttachmentTableModel(getDataCollection(state)); } /** + * @param state * @return a data collection of Contacts **/ public DataCollection getDataCollection(PageState state) { @@ -86,6 +91,7 @@ public class FileAttachmentModelBuilder extends AbstractTableModelBuilder { /** * @return the number of columns in the table model **/ + @Override public int getColumnCount() { return 1; } @@ -94,6 +100,7 @@ public class FileAttachmentModelBuilder extends AbstractTableModelBuilder { * @return true if there is more rows in this table model and * false otherwise **/ + @Override public boolean nextRow() { if (_collection == null) { return false; @@ -115,6 +122,7 @@ public class FileAttachmentModelBuilder extends AbstractTableModelBuilder { * @return the Object for the specified column for the * the current row **/ + @Override public Object getElementAt(int columnIndex) { if (columnIndex == 4) { if(FileAttachment.getConfig().isShowAssetIDEnabled()){ @@ -137,6 +145,7 @@ public class FileAttachmentModelBuilder extends AbstractTableModelBuilder { /** * @returns the Object key for the specified column **/ + @Override public Object getKeyAt(int columnIndex) { return _file.getID().toString(); } diff --git a/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentsStep.java b/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentsStep.java index 8a641d22f..a05e91396 100755 --- a/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentsStep.java +++ b/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentsStep.java @@ -96,13 +96,7 @@ public class FileAttachmentsStep extends SecurityPropertyEditor { // The upload form. m_uploadForm = new FileAttachmentUpload(m_item); add("upload", - // XXX todo: method add expects a plain string as label parameter. Use - // of tostring() is ugly and not supported API (for debugging only). - // add method has to be refactored to accept a GlobalizedMessage - // Parameter instead of a plain string for the Label (2. parameter) ! - // It is uggly to make an additional localize() to get an object which - // can be casted to String! - (String)FileAttachmentGlobalize.UploadNewFileLabel().localize(), + FileAttachmentGlobalize.UploadNewFileLabel(), new WorkflowLockedComponentAccess(m_uploadForm, m_item), m_uploadForm.getSaveCancelSection().getCancelButton()); diff --git a/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileDescriptionForm.java b/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileDescriptionForm.java index 41602c176..25f71ae70 100755 --- a/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileDescriptionForm.java +++ b/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileDescriptionForm.java @@ -87,7 +87,9 @@ public class FileDescriptionForm extends FormSection implements * * @param e * the FormSectionEvent + * @throws com.arsdigita.bebop.FormProcessException */ + @Override public void submitted(FormSectionEvent e) throws FormProcessException { if (m_cancel.isSelected(e.getPageState())) { m_fileModel.clearSelection(e.getPageState()); @@ -99,9 +101,10 @@ public class FileDescriptionForm extends FormSection implements /** * Validation listener. * - * @param event - * the FormSectionEvent + * @param event the FormSectionEvent + * @throws com.arsdigita.bebop.FormProcessException */ + @Override public void validate(FormSectionEvent event) throws FormProcessException { PageState state = event.getPageState(); FormData data = event.getFormData(); @@ -116,6 +119,7 @@ public class FileDescriptionForm extends FormSection implements * @param fse * the FormSectionEvent */ + @Override public void init(FormSectionEvent fse) throws FormProcessException { FormData data = fse.getFormData(); PageState state = fse.getPageState(); @@ -133,7 +137,9 @@ public class FileDescriptionForm extends FormSection implements * * @param fse * the FormSectionEvent + * @throws com.arsdigita.bebop.FormProcessException */ + @Override public void process(FormSectionEvent fse) throws FormProcessException { PageState state = fse.getPageState(); diff --git a/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/ui/AgendaPropertyForm.java b/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/ui/AgendaPropertyForm.java index 79cfdd9ec..28d199687 100755 --- a/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/ui/AgendaPropertyForm.java +++ b/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/ui/AgendaPropertyForm.java @@ -97,78 +97,97 @@ public class AgendaPropertyForm extends BasicPageForm protected void addWidgets() { super.addWidgets(); - add(new Label(AgendaGlobalizationUtil - .globalize("cms.contenttypes.ui.summary"))); + // add(new Label(AgendaGlobalizationUtil + // .globalize("cms.contenttypes.ui.summary"))); ParameterModel summaryParam = new StringParameter(SUMMARY); //summaryParam // .addParameterListener(new NotNullValidationListener()); summaryParam.addParameterListener(new StringInRangeValidationListener(0, 4000)); TextArea summary = new TextArea(summaryParam); + summary.setLabel(AgendaGlobalizationUtil + .globalize("cms.contenttypes.ui.summary")); summary.setCols(40); summary.setRows(5); summary.setHint(AgendaGlobalizationUtil.globalize( "cms.contenttypes.ui.summary")); add(summary); - add(new Label(AgendaGlobalizationUtil - .globalize("cms.contenttypes.ui.agenda.agenda_date"))); + // add(new Label(AgendaGlobalizationUtil + // .globalize("cms.contenttypes.ui.agenda.agenda_date"))); ParameterModel agendaDateParam = new DateTimeParameter(AGENDA_DATE); agendaDateParam .addParameterListener(new NotNullValidationListener()); DateTime agendaDate = new DateTime(agendaDateParam); + agendaDate.setLabel(AgendaGlobalizationUtil + .globalize("cms.contenttypes.ui.agenda.agenda_date")); add(agendaDate); - add(new Label(AgendaGlobalizationUtil - .globalize("cms.contenttypes.ui.agenda.location"))); + /* Input field for Location */ + // add(new Label(AgendaGlobalizationUtil + // .globalize("cms.contenttypes.ui.agenda.location"))); ParameterModel locationParam = new StringParameter(LOCATION); //locationParam // .addParameterListener(new NotNullValidationListener()); locationParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); TextArea location = new TextArea(locationParam); + location.setLabel(AgendaGlobalizationUtil + .globalize("cms.contenttypes.ui.agenda.location")); location.setCols(40); location.setRows(3); add(location); - add(new Label(AgendaGlobalizationUtil - .globalize("cms.contenttypes.ui.agenda.attendees"))); + /* Input field for Attendees */ + // add(new Label(AgendaGlobalizationUtil + // .globalize("cms.contenttypes.ui.agenda.attendees"))); ParameterModel attendeesParam = new StringParameter(ATTENDEES); //attendeesParam // .addParameterListener(new NotNullValidationListener()); attendeesParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); TextArea attendees = new TextArea(attendeesParam); + attendees.setLabel(AgendaGlobalizationUtil + .globalize("cms.contenttypes.ui.agenda.attendees")); attendees.setCols(40); attendees.setRows(3); add(attendees); - add(new Label(AgendaGlobalizationUtil - .globalize("cms.contenttypes.ui.agenda.subject_items"))); + /* Input field for Subject Items */ + // add(new Label(AgendaGlobalizationUtil + // .globalize("cms.contenttypes.ui.agenda.subject_items"))); ParameterModel subjectItemsParam = new StringParameter(SUBJECT_ITEMS); //subjectItemsParam // .addParameterListener(new NotNullValidationListener()); subjectItemsParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); TextArea subjectItems = new TextArea(subjectItemsParam); + subjectItems.setLabel(AgendaGlobalizationUtil + .globalize("cms.contenttypes.ui.agenda.subject_items")); subjectItems.setCols(40); subjectItems.setRows(3); add(subjectItems); - add(new Label(AgendaGlobalizationUtil - .globalize("cms.contenttypes.ui.agenda.contact_info"))); + /* Input field for Contact Info */ + // add(new Label(AgendaGlobalizationUtil + // .globalize("cms.contenttypes.ui.agenda.contact_info"))); ParameterModel contactInfoParam = new StringParameter(CONTACT_INFO); //contactInfoParam // .addParameterListener(new NotNullValidationListener()); contactInfoParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); TextArea contactInfo = new TextArea(contactInfoParam); + contactInfo.setLabel(AgendaGlobalizationUtil + .globalize("cms.contenttypes.ui.agenda.contact_info")); contactInfo.setCols(40); contactInfo.setRows(3); add(contactInfo); - add(new Label(AgendaGlobalizationUtil - .globalize("cms.contenttypes.ui.agenda.creation_date"))); + /* Input field for Contact Info */ + // add(new Label(AgendaGlobalizationUtil + // .globalize("cms.contenttypes.ui.agenda.creation_date"))); ParameterModel creationDateParam = new DateParameter(CREATION_DATE); creationDateParam .addParameterListener(new NotNullValidationListener()); com.arsdigita.bebop.form.Date creationDate = new com.arsdigita.bebop.form.Date(creationDateParam); + creationDate.setLabel(AgendaGlobalizationUtil + .globalize("cms.contenttypes.ui.agenda.creation_date")); add(creationDate); @@ -176,7 +195,9 @@ public class AgendaPropertyForm extends BasicPageForm /** * Form initialisation hook. Fills widgets with data. + * @param fse **/ + @Override public void init(FormSectionEvent fse) { FormData data = fse.getFormData(); Agenda agenda = (Agenda) super.initBasicWidgets(fse); @@ -197,7 +218,9 @@ public class AgendaPropertyForm extends BasicPageForm data.put(SUMMARY, agenda.getSummary()); } - /** Cancels streamlined editing. */ + /** Cancels streamlined editing. + * @param fse */ + @Override public void submitted( FormSectionEvent fse ) { if (m_step != null && getSaveCancelSection().getCancelButton() @@ -207,8 +230,10 @@ public class AgendaPropertyForm extends BasicPageForm } /** - * Form processing hook. Saves Agenda object. + * Form processing hook, saves Agenda object. + * @param fse */ + @Override public void process(FormSectionEvent fse) { FormData data = fse.getFormData(); diff --git a/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertyForm.java b/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertyForm.java index bbf77dc3d..343d945a0 100755 --- a/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertyForm.java +++ b/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertyForm.java @@ -20,7 +20,6 @@ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSubmissionListener; @@ -78,24 +77,20 @@ public class ArticlePropertyForm extends GenericArticlePropertyForm protected void addWidgets() { super.addWidgets(); - //add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.lead"))); ParameterModel leadParam = new StringParameter(LEAD); - if (ContentSection.getConfig().mandatoryDescriptions()) { leadParam.addParameterListener( new NotEmptyValidationListener( GlobalizationUtil.globalize( "cms.contenttypes.ui.description_missing"))); } - //leadParam - // .addParameterListener( new NotNullValidationListener() ); leadParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); TextArea lead = new TextArea(leadParam); - lead.setCols(40); - lead.setRows(5); lead.setLabel(GlobalizationUtil.globalize("cms.contenttypes.ui.lead")); lead.setHint(GlobalizationUtil.globalize("cms.contenttypes.ui.lead_hint")); + lead.setCols(40); + lead.setRows(5); add(lead); } diff --git a/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/ui/BookmarkPropertyForm.java b/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/ui/BookmarkPropertyForm.java index d037a8a9f..29bb1caae 100755 --- a/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/ui/BookmarkPropertyForm.java +++ b/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/ui/BookmarkPropertyForm.java @@ -36,10 +36,12 @@ import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.globalization.GlobalizedMessage; /** - * to edit BasicPageForm the basic properties of an Bookmark. This form can be extended to create forms for Bookmark - * subclasses. + * to edit BasicPageForm the basic properties of an Bookmark. This form can be + * extended to create forms for Bookmarksubclasses. */ -public class BookmarkPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener { +public class BookmarkPropertyForm extends BasicPageForm + implements FormProcessListener, + FormInitListener { /** * parameter names @@ -57,11 +59,15 @@ public class BookmarkPropertyForm extends BasicPageForm implements FormProcessLi private final BookmarkPropertiesStep step; /** - * Creates a new form to edit the Bookmark object specified by the item selection model passed in. + * Creates a new form to edit the Bookmark object specified by the + * item selection model passed in. * - * @param itemModel The ItemSelectionModel to use to obtain the Bookmark to work on + * @param itemModel The ItemSelectionModel to use to obtain the Bookmark + * to work on + * @param step */ - public BookmarkPropertyForm(final ItemSelectionModel itemModel, final BookmarkPropertiesStep step) { + public BookmarkPropertyForm(final ItemSelectionModel itemModel, + final BookmarkPropertiesStep step) { super(ID, itemModel); this.step = step; } @@ -73,27 +79,33 @@ public class BookmarkPropertyForm extends BasicPageForm implements FormProcessLi protected void addWidgets() { super.addWidgets(); - add(new Label(GlobalizationUtil.globalize( - "cms.contenttypes.ui.summary"))); + //add(new Label(GlobalizationUtil.globalize( + // "cms.contenttypes.ui.summary"))); final ParameterModel descriptionParam = new StringParameter(DESCRIPTION); final TextArea description = new TextArea(descriptionParam); + description.setLabel(GlobalizationUtil.globalize( + "cms.contenttypes.ui.summary")); description.setCols(40); description.setRows(5); description.setHint(GlobalizationUtil.globalize( "cms.contenttypes.ui.summary_hint")); add(description); - add(new Label(new GlobalizedMessage("cms.contenttypes.ui.bookmark.url", Bookmark.RESOURCES))); + // add(new Label(new GlobalizedMessage("cms.contenttypes.ui.bookmark.url", Bookmark.RESOURCES))); final ParameterModel urlParam = new StringParameter(URL); final TextField url = new TextField(urlParam); + url.setLabel(GlobalizationUtil.globalize( + "cms.contenttypes.ui.bookmark.url")); url.setSize(40); add(url); } /** + * @param fse * Form initialisation hook. Fills widgets with data. */ + @Override public void init(final FormSectionEvent fse) { final FormData data = fse.getFormData(); final Bookmark item = (Bookmark) super.initBasicWidgets(fse); @@ -104,7 +116,9 @@ public class BookmarkPropertyForm extends BasicPageForm implements FormProcessLi /** * Form processing hook. Saves Bookmark object. + * @param fse */ + @Override public void process(final FormSectionEvent fse) { final FormData data = fse.getFormData(); diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionEditForm.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionEditForm.java index 098ba4aa5..bd5126fad 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionEditForm.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionEditForm.java @@ -89,7 +89,7 @@ public class DecisionTreeOptionEditForm extends Form /** * Constructor. * - * @param selArticle the current article + * @param selTree the current decision tree * @param selOption the current section * @param container container which this form is added to */ @@ -133,6 +133,7 @@ public class DecisionTreeOptionEditForm extends Form /** * Returns the save/cancel section from this form. + * @return */ public SaveCancelSection getSaveCancelSection() { return m_saveCancelSection; @@ -161,7 +162,9 @@ public class DecisionTreeOptionEditForm extends Form /** * Form initialisation hook. + * @param fse */ + @Override public void init(FormSectionEvent fse) { PageState state = fse.getPageState(); FormData data = fse.getFormData(); @@ -205,27 +208,34 @@ public class DecisionTreeOptionEditForm extends Form add(m_sectionWidget); - add(new Label(DecisionTreeGlobalizationUtil.globalize( - "cms.contenttypes.ui.decisiontree.options.form.label"))); + // add(new Label(DecisionTreeGlobalizationUtil.globalize( + // "cms.contenttypes.ui.decisiontree.options.form.label"))); TextField labelWidget = new TextField(new TrimmedStringParameter(LABEL)); + labelWidget.setLabel(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.form.label")); labelWidget.addValidationListener(new NotNullValidationListener()); labelWidget.setSize(60); add(labelWidget); - add(new Label(DecisionTreeGlobalizationUtil.globalize( - "cms.contenttypes.ui.decisiontree.options.form.value"))); + // add(new Label(DecisionTreeGlobalizationUtil.globalize( + // "cms.contenttypes.ui.decisiontree.options.form.value"))); TextField valueWidget = new TextField(new TrimmedStringParameter(VALUE)); + valueWidget.setLabel(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.form.value")); valueWidget.addValidationListener(new NotNullValidationListener()); valueWidget.setSize(60); add(valueWidget); } /** + * @param event + * @throws com.arsdigita.bebop.FormProcessException * Called on form submission. Check to see if the user clicked the * cancel button. If they did, don't continue with the form. */ + @Override public void submitted(FormSectionEvent event) - throws FormProcessException { + throws FormProcessException { PageState state = event.getPageState(); if ( m_saveCancelSection.getCancelButton() @@ -234,23 +244,27 @@ public class DecisionTreeOptionEditForm extends Form state, DecisionTreeOptionStep.OPTION_TABLE + m_container.getTypeIDStr()); throw new FormProcessException( - (String)DecisionTreeGlobalizationUtil.globalize( + DecisionTreeGlobalizationUtil.globalize( "cms.contenttypes.ui.decisiontree.options.form.submission_cancelled") - .localize()); + ); } } /** * Called after form has been validated. Create the new SectionOption and * assign it to the current DecisionTree. + * + * @param event + * @throws com.arsdigita.bebop.FormProcessException */ + @Override public void process(FormSectionEvent event) throws FormProcessException { PageState state = event.getPageState(); FormData data = event.getFormData(); DecisionTreeSection section = new DecisionTreeSection(new BigDecimal((String)data.get(SECTION))); - DecisionTreeSectionOption option = null; + DecisionTreeSectionOption option; if (m_selOption.getSelectedKey(state) != null) { BigDecimal id = new BigDecimal(m_selOption .getSelectedKey(state).toString()); diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreePropertiesForm.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreePropertiesForm.java index 6db63a254..4ac0ad8b1 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreePropertiesForm.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreePropertiesForm.java @@ -19,7 +19,6 @@ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.Label; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormProcessListener; @@ -43,11 +42,11 @@ import com.arsdigita.cms.ui.authoring.BasicPageForm; public class DecisionTreePropertiesForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { - private final static String ID = "FORM_PROPERTIES"; - public final static String DESCRIPTION = "description"; - public final static String CANCEL_URL = "cancelURL"; + private final static String ID = "FORM_PROPERTIES"; + public final static String DESCRIPTION = "description"; + public final static String CANCEL_URL = "cancelURL"; - private DecisionTreePropertiesStep m_step; + private final DecisionTreePropertiesStep m_step; /** * Creates a new form to edit the Consultation object specified by the item @@ -69,22 +68,30 @@ public class DecisionTreePropertiesForm extends BasicPageForm implements protected void addWidgets() { super.addWidgets(); - add(new Label(DecisionTreeGlobalizationUtil.globalize( - "cms.contenttypes.ui.decisiontree.properties.form.description_label"))); + // add(new Label(DecisionTreeGlobalizationUtil.globalize( + // "cms.contenttypes.ui.decisiontree.properties.form.description_label"))); TextArea description = new TextArea(new TrimmedStringParameter(DESCRIPTION)); + description.setLabel(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.properties.form.description_label")); description.setRows(5); description.setCols(30); add(description); - add(new Label(DecisionTreeGlobalizationUtil.globalize - ("cms.contenttypes.ui.decisiontree.properties.cancel_url"))); + // add(new Label(DecisionTreeGlobalizationUtil.globalize + // ("cms.contenttypes.ui.decisiontree.properties.cancel_url"))); TextField cancelURL = new TextField(new StringParameter(CANCEL_URL)); + cancelURL.setLabel(DecisionTreeGlobalizationUtil.globalize + ("cms.contenttypes.ui.decisiontree.properties.cancel_url")); cancelURL.setSize(60); add(cancelURL); } - /** Cancels streamlined editing. */ + /** + * Cancels streamlined editing. + * @param fse + */ + @Override public void submitted(FormSectionEvent fse) { PageState state = fse.getPageState(); @@ -94,7 +101,11 @@ public class DecisionTreePropertiesForm extends BasicPageForm implements } } - /** Form processing hook. Saves Event object. */ + /** + * Form processing hook. Saves Event object. + * @param fse + */ + @Override public void process(FormSectionEvent fse) { PageState state = fse.getPageState(); FormData data = fse.getFormData(); @@ -108,7 +119,11 @@ public class DecisionTreePropertiesForm extends BasicPageForm implements m_step.maybeForwardToNextStep(state); } - /** Form initialisation hook. Fills widgets with data. */ + /** + * Form initialisation hook. Fills widgets with data. + * @param fse + */ + @Override public void init(FormSectionEvent fse) { DecisionTree item = (DecisionTree)initBasicWidgets(fse); diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionDeleteForm.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionDeleteForm.java index 6559c3bb1..e5f60d572 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionDeleteForm.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionDeleteForm.java @@ -109,6 +109,7 @@ public class DecisionTreeSectionDeleteForm extends Form * @param event * @throws FormProcessException */ + @Override public void init ( FormSectionEvent event ) throws FormProcessException { String sectionTitle = " "; @@ -127,17 +128,19 @@ public class DecisionTreeSectionDeleteForm extends Form m_sectionNameValue[0] = sectionTitle; } + @Override public void submitted ( FormSectionEvent event ) throws FormProcessException { PageState state = event.getPageState(); if ( m_saveCancelSection.getCancelButton().isSelected(state) ) { - throw new FormProcessException( (String) + throw new FormProcessException( DecisionTreeGlobalizationUtil.globalize( "cms.contenttypes.ui.decisiontree.sections.form.submission_cancelled") - .localize()); + ); } } + @Override public void process ( FormSectionEvent event ) throws FormProcessException { PageState state = event.getPageState(); diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionEditForm.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionEditForm.java index 596cfebfc..088ca2739 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionEditForm.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionEditForm.java @@ -27,7 +27,6 @@ import com.arsdigita.bebop.ColumnPanel; import com.arsdigita.bebop.Form; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; import com.arsdigita.bebop.Page; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.SaveCancelSection; @@ -91,7 +90,7 @@ public class DecisionTreeSectionEditForm extends Form /** * Constructor creates an emnpty section form. * - * @param selArticle the current article + * @param selTree the current Decision Tree * @param selSection the current section * @param container container which this form is added to */ @@ -140,6 +139,8 @@ public class DecisionTreeSectionEditForm extends Form /** * Returns the save/cancel section from this form. + * + * @return */ public SaveCancelSection getSaveCancelSection() { return m_saveCancelSection; @@ -149,24 +150,30 @@ public class DecisionTreeSectionEditForm extends Form * Add form widgets for a Section. */ protected void addWidgets() { - add(new Label(DecisionTreeGlobalizationUtil.globalize( - "cms.contenttypes.ui.decisiontree.sections.form.title_label"))); + // add(new Label(DecisionTreeGlobalizationUtil.globalize( + // "cms.contenttypes.ui.decisiontree.sections.form.title_label"))); TextField titleWidget = new TextField(new TrimmedStringParameter(TITLE)); + titleWidget.setLabel(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.form.title_label")); titleWidget.addValidationListener(new NotEmptyValidationListener()); add(titleWidget); - add(new Label(DecisionTreeGlobalizationUtil.globalize( - "cms.contenttypes.ui.decisiontree.sections.form.parameter_name_label"))); + // add(new Label(DecisionTreeGlobalizationUtil.globalize( + // "cms.contenttypes.ui.decisiontree.sections.form.parameter_name_label"))); TextField parameterWidget = new TextField(new TrimmedStringParameter(PARAMETER_NAME)); + parameterWidget.setLabel(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.form.parameter_name_label")); parameterWidget.addValidationListener(new NotEmptyValidationListener()); parameterWidget.addValidationListener(new DecisionTreeParameterNameValidationListener()); add(parameterWidget); - add(new Label(DecisionTreeGlobalizationUtil.globalize( - "cms.contenttypes.ui.decisiontree.sections.form.instructions_label")), - ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH); + // add(new Label(DecisionTreeGlobalizationUtil.globalize( + // "cms.contenttypes.ui.decisiontree.sections.form.instructions_label")), + // ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH); CMSDHTMLEditor textWidget = new CMSDHTMLEditor(new TrimmedStringParameter(INSTRUCTIONS)); + textWidget.setLabel(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.form.instructions_label")); textWidget.setRows(40); textWidget.setCols(70); textWidget.setWrap(CMSDHTMLEditor.SOFT); @@ -178,9 +185,13 @@ public class DecisionTreeSectionEditForm extends Form * Initialize the form. If there is a selected section, ie. this * is an 'edit' step rather than a 'create new' step, load the data * into the form fields. + * + * @param event + * @throws com.arsdigita.bebop.FormProcessException */ + @Override public void init( FormSectionEvent event ) - throws FormProcessException { + throws FormProcessException { PageState state = event.getPageState(); FormData data = event.getFormData(); m_selInstructions.setSelectedObject(state,null); @@ -211,9 +222,12 @@ public class DecisionTreeSectionEditForm extends Form /** * Called on form submission. Check to see if the user clicked the * cancel button. If they did, don't continue with the form. + * @param event + * @throws com.arsdigita.bebop.FormProcessException */ + @Override public void submitted( FormSectionEvent event ) - throws FormProcessException { + throws FormProcessException { PageState state = event.getPageState(); if ( m_saveCancelSection.getCancelButton() @@ -222,18 +236,22 @@ public class DecisionTreeSectionEditForm extends Form state, DecisionTreeSectionStep.SECTION_TABLE + m_container.getTypeIDStr()); throw new FormProcessException( - (String)DecisionTreeGlobalizationUtil.globalize( + DecisionTreeGlobalizationUtil.globalize( "cms.contenttypes.ui.decisiontree.sections.form.submission_cancelled") - .localize()); + ); } } /** * Called after form has been validated. Create the new TreeSection and * assign it to the current DecisionTree. + * + * @param event + * @throws com.arsdigita.bebop.FormProcessException */ + @Override public void process(FormSectionEvent event) - throws FormProcessException { + throws FormProcessException { PageState state = event.getPageState(); FormData data = event.getFormData(); @@ -282,6 +300,10 @@ public class DecisionTreeSectionEditForm extends Form /** * Utility method to create a Section from the form data supplied. + * + * @param event + * @param tree + * @return */ protected DecisionTreeSection createSection(FormSectionEvent event, DecisionTree tree) { diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetEditForm.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetEditForm.java index b8e0017e5..f7c8742b7 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetEditForm.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetEditForm.java @@ -50,6 +50,7 @@ import com.arsdigita.cms.contenttypes.DecisionTreeSection; import com.arsdigita.cms.contenttypes.DecisionTreeSectionCollection; import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.globalization.GlobalizedMessage; /** * Form to edit an DecisionTreeOptionTarget for a DecisionTree. @@ -248,47 +249,50 @@ public class DecisionTreeTargetEditForm extends Form new Label( DecisionTreeGlobalizationUtil.globalize( "cms.contenttypes.ui.decisiontree.targets.form.none"))); - add(new Label(DecisionTreeGlobalizationUtil.globalize( - "cms.contenttypes.ui.decisiontree.targets.form.match_value"))); + // add(new Label(DecisionTreeGlobalizationUtil.globalize( + // "cms.contenttypes.ui.decisiontree.targets.form.match_value"))); m_matchValueWidget = new SingleSelect(MATCH_OPTION); + m_matchValueWidget.setLabel(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.form.match_value")); m_matchValueWidget.addValidationListener(new NotNullValidationListener()); m_matchValueWidget.addOption(pleaseSelect); - - try { - m_matchValueWidget.addPrintListener(new PrintListener() { - public void prepare(PrintEvent e) { - initMatchOptions(e); - } - }); + try { + m_matchValueWidget.addPrintListener(new PrintListener() { + @Override + public void prepare(PrintEvent e) { + initMatchOptions(e); + } + }); } catch (TooManyListenersException e) { throw new RuntimeException(e); } + add(m_matchValueWidget); - add(m_matchValueWidget); - - add(new Label(DecisionTreeGlobalizationUtil.globalize( - "cms.contenttypes.ui.decisiontree.targets.form.target_url_label"))); + // add(new Label(DecisionTreeGlobalizationUtil.globalize( + // "cms.contenttypes.ui.decisiontree.targets.form.target_url_label"))); m_targetURLWidget = new TextField(TARGET_URL); + m_targetURLWidget.setLabel(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.form.target_url_label")); m_targetURLWidget.setSize(60); add(m_targetURLWidget); - add(new Label(DecisionTreeGlobalizationUtil.globalize( - "cms.contenttypes.ui.decisiontree.targets.form.target_section_label"))); + // add(new Label(DecisionTreeGlobalizationUtil.globalize( + // "cms.contenttypes.ui.decisiontree.targets.form.target_section_label"))); m_targetSectionWidget = new SingleSelect(TARGET_SECTION); + m_targetSectionWidget.setLabel(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.form.target_section_label")); m_targetSectionWidget.addOption(none); - - try { - m_targetSectionWidget.addPrintListener(new PrintListener() { + try { + m_targetSectionWidget.addPrintListener(new PrintListener() { @Override - public void prepare(PrintEvent e) { - initTargetOptions(e); - } - }); + public void prepare(PrintEvent e) { + initTargetOptions(e); + } + }); } catch (TooManyListenersException e) { throw new RuntimeException(e); } - - add(m_targetSectionWidget); + add(m_targetSectionWidget); addValidationListener(new FormValidationListener() { @Override @@ -297,17 +301,15 @@ public class DecisionTreeTargetEditForm extends Form final PageState state = event.getPageState(); if ("".equals(m_targetURLWidget.getValue(state)) && "".equals(m_targetSectionWidget.getValue(state))) { - String msg = (String) DecisionTreeGlobalizationUtil.globalize( - "cms.contenttypes.ui.decisiontree.targets.form.target_required") - .localize(); + GlobalizedMessage msg = DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.form.target_required"); throw new FormProcessException(msg); } if (!"".equals(m_targetURLWidget.getValue(state)) && !"".equals(m_targetSectionWidget.getValue(state))) { - String msg = (String) DecisionTreeGlobalizationUtil.globalize( - "cms.contenttypes.ui.decisiontree.targets.form.duplicate_target") - .localize(); + GlobalizedMessage msg = DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.form.duplicate_target"); throw new FormProcessException(msg); } } @@ -325,21 +327,22 @@ public class DecisionTreeTargetEditForm extends Form throws FormProcessException { PageState state = event.getPageState(); - if ( m_saveCancelSection.getCancelButton() - .isSelected(state) && m_container != null) { - m_container.onlyShowComponent( - state, DecisionTreeTargetStep.TARGET_TABLE + - m_container.getTypeIDStr()); - throw new FormProcessException( - (String)DecisionTreeGlobalizationUtil.globalize( + if ( m_saveCancelSection.getCancelButton().isSelected(state) + && m_container != null) { + m_container.onlyShowComponent(state, + DecisionTreeTargetStep.TARGET_TABLE + + m_container.getTypeIDStr()); + throw new FormProcessException( + DecisionTreeGlobalizationUtil.globalize( "cms.contenttypes.ui.decisiontree.targets.form.submission_cancelled") - .localize()); - } + ); + } } /** * Called after form has been validated. Create the new * DecisionTreeOptionTarget and assign it to the current DecisionTree. + * * @param event * @throws com.arsdigita.bebop.FormProcessException */ @@ -358,7 +361,7 @@ public class DecisionTreeTargetEditForm extends Form targetSection = new DecisionTreeSection(new BigDecimal(sectionID)); } - DecisionTreeOptionTarget target = null; + DecisionTreeOptionTarget target; if (m_selTarget.getSelectedKey(state) != null) { BigDecimal id = new BigDecimal(m_selTarget .getSelectedKey(state).toString()); diff --git a/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/ui/FAQItemPropertyForm.java b/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/ui/FAQItemPropertyForm.java index 9556daf57..84d71753e 100755 --- a/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/ui/FAQItemPropertyForm.java +++ b/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/ui/FAQItemPropertyForm.java @@ -82,39 +82,49 @@ public class FAQItemPropertyForm extends BasicPageForm /** * Adds widgets to the form. */ + @Override protected void addWidgets() { super.addWidgets(); - add( new Label(FAQGlobalizationUtil - .globalize("cms.contenttypes.ui.faq.question")) ); + // add( new Label(FAQGlobalizationUtil + // .globalize("cms.contenttypes.ui.faq.question")) ); ParameterModel questionParam = new StringParameter( QUESTION ); questionParam .addParameterListener( new NotNullValidationListener() ); TextArea question = new TextArea( questionParam ); + question.setLabel(FAQGlobalizationUtil + .globalize("cms.contenttypes.ui.faq.question")); question.setCols( 40 ); question.setRows( 5 ); add( question ); - add( new Label(FAQGlobalizationUtil - .globalize("cms.contenttypes.ui.faq.answer")) ); + // add( new Label(FAQGlobalizationUtil + // .globalize("cms.contenttypes.ui.faq.answer")) ); ParameterModel answerParam = new StringParameter( ANSWER ); - answerParam - .addParameterListener( new NotNullValidationListener() ); + answerParam.addParameterListener( new NotNullValidationListener() ); TextArea answer = new TextArea( answerParam ); + answer.setLabel(FAQGlobalizationUtil + .globalize("cms.contenttypes.ui.faq.answer")); answer.setCols( 40 ); answer.setRows( 5 ); add( answer ); - add( new Label(FAQGlobalizationUtil - .globalize("cms.contenttypes.ui.faq.sectionName")) ); + // add( new Label(FAQGlobalizationUtil + // .globalize("cms.contenttypes.ui.faq.sectionName")) ); ParameterModel sectionNameParam = new StringParameter( SECTION_NAME ); - TextField sectionName = new TextField(sectionNameParam); + TextField sectionName = new TextField(sectionNameParam); + sectionName.setLabel(FAQGlobalizationUtil + .globalize("cms.contenttypes.ui.faq.sectionName")); add(sectionName); } - /** Form initialisation hook. Fills widgets with data. */ + /** + * + * @param fse Form initialisation hook. Fills widgets with data. + */ + @Override public void init( FormSectionEvent fse ) { FormData data = fse.getFormData(); FAQItem faqItem = (FAQItem) super.initBasicWidgets( fse ); @@ -124,7 +134,12 @@ public class FAQItemPropertyForm extends BasicPageForm data.put(SECTION_NAME , faqItem.getSectionName()); } - /** Cancels streamlined editing. */ + /** + * Cancels streamlined editing. + * + * @param fse + */ + @Override public void submitted( FormSectionEvent fse ) { if (m_step != null && getSaveCancelSection().getCancelButton() @@ -133,20 +148,22 @@ public class FAQItemPropertyForm extends BasicPageForm } } - /** Form processing hook. Saves FAQItem object. */ + /** + * Form processing hook. Saves FAQItem object. + * @param fse */ + @Override public void process( FormSectionEvent fse ) { FormData data = fse.getFormData(); FAQItem faqItem = (FAQItem) super.processBasicWidgets( fse ); // save only if save button was pressed - if( faqItem != null - && getSaveCancelSection().getSaveButton() - .isSelected( fse.getPageState() ) ) { - faqItem.setQuestion( (String) data.get( QUESTION ) ); - faqItem.setAnswer( (String) data.get( ANSWER ) ); - faqItem.setSectionName( (String) data.get( SECTION_NAME) ); - faqItem.save(); + if( faqItem != null && getSaveCancelSection().getSaveButton() + .isSelected( fse.getPageState() ) ) { + faqItem.setQuestion( (String) data.get( QUESTION ) ); + faqItem.setAnswer( (String) data.get( ANSWER ) ); + faqItem.setSectionName( (String) data.get( SECTION_NAME) ); + faqItem.save(); } if (m_step != null) { m_step.maybeForwardToNextStep(fse.getPageState()); diff --git a/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/ui/FileStorageItemPropertyForm.java b/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/ui/FileStorageItemPropertyForm.java index 32d87b3e3..bd10d65d5 100755 --- a/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/ui/FileStorageItemPropertyForm.java +++ b/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/ui/FileStorageItemPropertyForm.java @@ -79,18 +79,23 @@ public class FileStorageItemPropertyForm protected void addWidgets() { super.addWidgets(); - add( new Label( GlobalizationUtil.globalize("cms.contenttypes.ui.lead") ) ); - ParameterModel descriptionParam - = new StringParameter( FileStorageItem.DESCRIPTION ); + // add( new Label( GlobalizationUtil.globalize("cms.contenttypes.ui.lead") ) ); + ParameterModel descriptionParam = new StringParameter( FileStorageItem + .DESCRIPTION ); // descriptionParam.addParameterListener( new NotNullValidationListener() ); CMSDHTMLEditor description = new CMSDHTMLEditor( descriptionParam ); + description.setLabel(GlobalizationUtil.globalize("cms.contenttypes.ui.lead")); description.setCols( 40 ); description.setRows( 8 ); add( description ); } - /** Form initialisation hook. Fills widgets with data. */ + /** + * Form initialisation hook. Fills widgets with data. + * @param fse + */ + @Override public void init( FormSectionEvent fse ) { FormData data = fse.getFormData(); FileStorageItem glossary_item @@ -99,7 +104,11 @@ public class FileStorageItemPropertyForm data.put( FileStorageItem.DESCRIPTION, glossary_item.getDescription() ); } - /** Cancels streamlined editing. */ + /** + * Cancels streamlined editing. + * @param fse + */ + @Override public void submitted( FormSectionEvent fse ) { if (m_step != null && getSaveCancelSection().getCancelButton() @@ -108,7 +117,9 @@ public class FileStorageItemPropertyForm } } - /** Form processing hook. Saves FileStorageItem object. */ + /** Form processing hook. Saves FileStorageItem object. + * @param fse */ + @Override public void process( FormSectionEvent fse ) { FormData data = fse.getFormData(); diff --git a/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormActions.java b/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormActions.java index 97de4e2bc..5183edbee 100755 --- a/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormActions.java +++ b/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormActions.java @@ -105,8 +105,8 @@ public class FormActions extends ProcessListenerEditor { panel.setColumnWidth(2, "80%"); panel.setWidth("100%"); - m_lrForm.add(new Label(FormItemGlobalizationUtil.globalize( - "cms.contenttypes.ui.form_item.form_mode_label")) ); + // m_lrForm.add(new Label(FormItemGlobalizationUtil.globalize( + // "cms.contenttypes.ui.form_item.form_mode_label")) ); m_localRemote = new RadioGroup("remote"); Option local = new Option(Boolean.FALSE.toString(), @@ -118,9 +118,12 @@ public class FormActions extends ProcessListenerEditor { "cms.contenttypes.ui.form_item.form_mode_remote")) ); m_localRemote.addOption(local); m_localRemote.addOption(remote); + m_localRemote.setLabel(FormItemGlobalizationUtil.globalize( + "cms.contenttypes.ui.form_item.form_mode_label")); m_localRemote.setLayout(RadioGroup.VERTICAL); m_lrForm.add(m_localRemote); + m_remoteLabel = new Label(FormItemGlobalizationUtil.globalize( "cms.contenttypes.ui.form_item.remote_url_label")); m_lrForm.add(m_remoteLabel); diff --git a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemPropertyForm.java b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemPropertyForm.java index deb7519b5..47c044b99 100755 --- a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemPropertyForm.java +++ b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemPropertyForm.java @@ -18,14 +18,20 @@ */ package com.arsdigita.cms.contenttypes.ui; +import com.arsdigita.bebop.Bebop; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSubmissionListener; +import com.arsdigita.bebop.form.DHTMLEditor; +import com.arsdigita.bebop.form.TextArea; +import com.arsdigita.bebop.parameters.NotNullValidationListener; +import com.arsdigita.bebop.util.BebopConstants; import com.arsdigita.cms.contenttypes.GlossaryItem; import com.arsdigita.cms.contenttypes.util.GlossaryGlobalizationUtil; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.ui.CMSDHTMLEditor; import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.globalization.GlobalizedMessage; @@ -83,9 +89,39 @@ public class GlossaryItemPropertyForm extends BasicPageForm */ super.addWidgets(); - GlossaryItemWidgetBuilder builder = new GlossaryItemWidgetBuilder(); - add(builder.makeDefinitionLabel()); - add(builder.makeDefinitionArea()); + TextArea definition; + switch (GlossaryItem.getConfig().getDefinitionEditorType()) { + case WYSIWYG: + definition = new CMSDHTMLEditor(DEFINITION); + ((CMSDHTMLEditor) definition).setWrap(DHTMLEditor.SOFT); + if (Bebop.getConfig().getDHTMLEditor() + .equals(BebopConstants.BEBOP_FCKEDITOR)) + { + ((CMSDHTMLEditor) definition).setConfig( + new DHTMLEditor.Config("glossaryitem", + GlossaryItem.getConfig().getFckEditorConfig())); + } else { + // remove this so end users cannot browse through back end + // folder system + ((CMSDHTMLEditor) definition).hideButton("insertlink"); + } + break; + default: + definition = new TextArea(DEFINITION); + definition.setWrap(TextArea.SOFT); + break; + } + + definition.setLabel(GlossaryGlobalizationUtil + .globalize("cms.contenttypes.ui.glossary.definition")); + definition.addValidationListener(new NotNullValidationListener()); + definition.setCols(40); + definition.setRows(5); + add(definition); + + // GlossaryItemWidgetBuilder builder = new GlossaryItemWidgetBuilder(); + // add(builder.makeDefinitionLabel()); + // add(builder.makeDefinitionArea()); } /** diff --git a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemWidgetBuilder.java b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemWidgetBuilder.java index cc52a03fd..c6d106a92 100644 --- a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemWidgetBuilder.java +++ b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemWidgetBuilder.java @@ -39,7 +39,9 @@ import static com.arsdigita.cms.contenttypes.ui.GlossaryItemPropertyForm.DEFINIT public class GlossaryItemWidgetBuilder { public TextArea makeDefinitionArea() { - TextArea definition = null; + + TextArea definition; + switch (GlossaryItem.getConfig().getDefinitionEditorType()) { case WYSIWYG: definition = new CMSDHTMLEditor(DEFINITION); @@ -62,14 +64,16 @@ public class GlossaryItemWidgetBuilder { break; } + definition.setLabel(GlossaryGlobalizationUtil + .globalize("cms.contenttypes.ui.glossary.definition")); definition.addValidationListener(new NotNullValidationListener()); definition.setCols(40); definition.setRows(5); return definition; } - public Label makeDefinitionLabel() { - return new Label(GlossaryGlobalizationUtil - .globalize("cms.contenttypes.ui.glossary.definition")); - } + // public Label makeDefinitionLabel() { + // return new Label(GlossaryGlobalizationUtil + // .globalize("cms.contenttypes.ui.glossary.definition")); + // } } diff --git a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/authoring/GlossaryItemCreate.java b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/authoring/GlossaryItemCreate.java index 1e030233d..56613d249 100755 --- a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/authoring/GlossaryItemCreate.java +++ b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/authoring/GlossaryItemCreate.java @@ -67,7 +67,7 @@ public class GlossaryItemCreate extends PageCreate { super.addWidgets(); GlossaryItemWidgetBuilder builder = new GlossaryItemWidgetBuilder(); - add(builder.makeDefinitionLabel()); + // add(builder.makeDefinitionLabel()); add(builder.makeDefinitionArea()); } diff --git a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityAttachAddressPropertyForm.java b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityAttachAddressPropertyForm.java index 39f54cd04..37e7837c7 100644 --- a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityAttachAddressPropertyForm.java +++ b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityAttachAddressPropertyForm.java @@ -116,9 +116,9 @@ public class HealthCareFacilityAttachAddressPropertyForm extends BasicPageForm i Submit target = (Submit) e.getTarget(); if (healthCareFacility.getAddress() != null) { - target.setButtonLabel((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.change").localize()); + target.setButtonLabel(HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.change")); } else { - target.setButtonLabel((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.add").localize()); + target.setButtonLabel(HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.add")); } } }); @@ -130,14 +130,14 @@ public class HealthCareFacilityAttachAddressPropertyForm extends BasicPageForm i @Override public void validate(FormSectionEvent e) throws FormProcessException { if (e.getFormData().get(ITEM_SEARCH) == null) { - throw new FormProcessException((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.wrong_type").localize()); + throw new FormProcessException(HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.wrong_type")); } } public void submitted(FormSectionEvent e) throws FormProcessException { if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) { init(e); - throw new FormProcessException((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.cancelled").localize()); + throw new FormProcessException(HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.cancelled")); } } } diff --git a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityContactAddForm.java b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityContactAddForm.java index a6d98a9e1..868666a0c 100644 --- a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityContactAddForm.java +++ b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityContactAddForm.java @@ -69,17 +69,16 @@ public class HealthCareFacilityContactAddForm extends BasicItemForm { protected void addWidgets() { // Attach a GenericContact object - add(new Label(HealthCareFacilityGlobalizationUtil.globalize( - "cms.contenttypes.ui.healthCareFacility.select_contact"))); this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericContact")); + this.m_itemSearch.setLabel(HealthCareFacilityGlobalizationUtil.globalize( + "cms.contenttypes.ui.healthCareFacility.select_contact")); add(this.m_itemSearch); // GenericContact type field - add(new Label(HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contact.type"))); ParameterModel contactTypeParam = new StringParameter(HealthCareFacilityContactCollection.CONTACT_TYPE); SingleSelect contactType = new SingleSelect(contactTypeParam); contactType.addValidationListener(new NotNullValidationListener()); - contactType.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize()))); + contactType.addOption(new Option("", new Label(ContenttypesGlobalizationUtil.globalize("cms.ui.select_one")))); // Add the Options to the SingleSelect widget StringTokenizer keyList = HealthCareFacility.getConfig().getContactTypeKeys(); @@ -87,7 +86,8 @@ public class HealthCareFacilityContactAddForm extends BasicItemForm { String currentKey = keyList.nextToken(); contactType.addOption(new Option(currentKey, ((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contactType.key." + currentKey).localize()))); } - + contactType.setLabel(HealthCareFacilityGlobalizationUtil.globalize( + "cms.contenttypes.ui.healthCareFacility.contact.type")); add(contactType); } diff --git a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityDeleteAddressForm.java b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityDeleteAddressForm.java index 3a2ad7fcc..7366ea9c3 100644 --- a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityDeleteAddressForm.java +++ b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityDeleteAddressForm.java @@ -58,7 +58,7 @@ public class HealthCareFacilityDeleteAddressForm extends BasicPageForm implement public void prepare(PrintEvent e) { HealthCareFacility healthCareFacility = (HealthCareFacility) getItemSelectionModel().getSelectedObject(e.getPageState()); Submit target = (Submit) e.getTarget(); - target.setButtonLabel((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.delete_address.button_label").localize()); + target.setButtonLabel(HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.delete_address.button_label")); } }); } catch (Exception ex) { diff --git a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityEditAddressPropertyForm.java b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityEditAddressPropertyForm.java index ff9856b76..05efb72f1 100644 --- a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityEditAddressPropertyForm.java +++ b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityEditAddressPropertyForm.java @@ -77,42 +77,45 @@ public class HealthCareFacilityEditAddressPropertyForm extends BasicPageForm imp @Override public void addWidgets() { - add(new Label(ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.address.address"))); + + // add(new Label(ContenttypesGlobalizationUtil.globalize( + // "cms.contenttypes.ui.address.address"))); ParameterModel addressParam = new StringParameter(ADDRESS); addressParam.addParameterListener(new NotNullValidationListener()); addressParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); TextArea address = new TextArea(addressParam); + address.setLabel(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.address.address")); address.setRows(5); address.setCols(30); add(address); if (!HealthCareFacility.getConfig().getHideAddressPostalCode()) { - add(new Label(ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.address.postal_code") )); ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE); TextField postalCode = new TextField(postalCodeParam); /* XXX NumberListener ?*/ + postalCode.setLabel(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.address.postal_code")); add(postalCode); } - add(new Label(ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.address.city") )); ParameterModel cityParam = new StringParameter(CITY); TextField city = new TextField(cityParam); + city.setLabel(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.address.city")); add(city); if (!HealthCareFacility.getConfig().getHideAddressState()) { - add(new Label(ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.address.state") )); ParameterModel stateParam = new StringParameter(STATE); TextField state = new TextField(stateParam); + state.setLabel(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.address.state")); add(state); } if (!HealthCareFacility.getConfig().getHideAddressCountry()) { - add(new Label(ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.address.iso_country_code") )); + // add(new Label(ContenttypesGlobalizationUtil.globalize( + // "cms.contenttypes.ui.address.iso_country_code") )); ParameterModel countryParam = new StringParameter(ISO_COUNTRY_CODE); countryParam.addParameterListener(new StringInRangeValidationListener(0, 2)); @@ -140,6 +143,8 @@ public class HealthCareFacilityEditAddressPropertyForm extends BasicPageForm imp } }); + country.setLabel(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.address.iso_country_code")); add(country); } diff --git a/ccm-cms-types-historicdate/src/com/arsdigita/cms/contenttypes/ui/HistoricDatePropertyForm.java b/ccm-cms-types-historicdate/src/com/arsdigita/cms/contenttypes/ui/HistoricDatePropertyForm.java index f2e57417f..2c0a8aab1 100644 --- a/ccm-cms-types-historicdate/src/com/arsdigita/cms/contenttypes/ui/HistoricDatePropertyForm.java +++ b/ccm-cms-types-historicdate/src/com/arsdigita/cms/contenttypes/ui/HistoricDatePropertyForm.java @@ -66,32 +66,27 @@ public class HistoricDatePropertyForm extends BasicPageForm implements FormProce public void addWidgets() { super.addWidgets(); - add(new Label(HistoricDateGlobalizationUtil.globalize("historicdate.ui.year"))); final IntegerParameter yearParam = new IntegerParameter(HistoricDate.YEAR); final TextField year = new TextField(yearParam); year.setLabel(HistoricDateGlobalizationUtil.globalize("historicdate.ui.year")); add(year); - add(new Label(HistoricDateGlobalizationUtil.globalize("historicdate.ui.month"))); final IntegerParameter monthParam = new IntegerParameter(HistoricDate.MONTH); final TextField month = new TextField(monthParam); month.setLabel(HistoricDateGlobalizationUtil.globalize("historicdate.ui.month")); add(month); - add(new Label(HistoricDateGlobalizationUtil.globalize("historicdate.ui.day_of_month"))); final IntegerParameter dayOfMonthParam = new IntegerParameter(HistoricDate.DAY_OF_MONTH); final TextField dayOfMonth = new TextField(dayOfMonthParam); dayOfMonth.setLabel(HistoricDateGlobalizationUtil.globalize("historicdate.ui.day_of_month")); add(dayOfMonth); - add(new Label(HistoricDateGlobalizationUtil.globalize("historicdate.ui.date_is_approx"))); dateIsApprox = new CheckboxGroup(HistoricDate.DATE_IS_APPROX + "Group"); dateIsApprox.setLabel(HistoricDateGlobalizationUtil.globalize( "historicdate.ui.date_is_approx")); dateIsApprox.addOption(new Option(HistoricDate.DATE_IS_APPROX, "")); add(dateIsApprox); - add(new Label(HistoricDateGlobalizationUtil.globalize("historicdate.ui.lead"))); final ParameterModel leadParam = new StringParameter(HistoricDate.LEAD); final TextArea lead = new TextArea(leadParam); lead.setCols(80); diff --git a/ccm-cms-types-image/src/com/arsdigita/cms/contenttypes/ui/ImagePropertyForm.java b/ccm-cms-types-image/src/com/arsdigita/cms/contenttypes/ui/ImagePropertyForm.java index 9305018c5..c98599000 100755 --- a/ccm-cms-types-image/src/com/arsdigita/cms/contenttypes/ui/ImagePropertyForm.java +++ b/ccm-cms-types-image/src/com/arsdigita/cms/contenttypes/ui/ImagePropertyForm.java @@ -28,8 +28,6 @@ import com.arsdigita.bebop.event.FormSubmissionListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.form.Date; import com.arsdigita.bebop.form.Hidden; -import com.arsdigita.bebop.form.Option; -import com.arsdigita.bebop.form.RadioGroup; import com.arsdigita.bebop.form.TextArea; import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.parameters.BooleanParameter; @@ -53,6 +51,10 @@ public class ImagePropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { + /** Internal logger instance to faciliate debugging. Enable logging output + * by editing /WEB-INF/conf/log4j.properties int the runtime environment + * and set com.arsdigita.cms.contenttypes.ui.ImagePropertyForm=DEBUG + * by uncommenting or adding the line. */ private final static org.apache.log4j.Logger s_log = org.apache.log4j.Logger.getLogger(ImagePropertyForm.class); private ImagePropertiesStep m_step; @@ -87,11 +89,13 @@ public class ImagePropertyForm protected void addWidgets() { super.addWidgets(); - add(new Label(ImageGlobalizationUtil - .globalize("cms.contenttypes.ui.image.caption"))); + // add(new Label(ImageGlobalizationUtil + // .globalize("cms.contenttypes.ui.image.caption"))); ParameterModel captionParam = new StringParameter(Image.CAPTION); captionParam.addParameterListener(new StringInRangeValidationListener(0, 400)); TextField caption = new TextField(captionParam); + caption.setLabel(ImageGlobalizationUtil + .globalize("cms.contenttypes.ui.image.caption")); add(caption); /* Image doesn't use the description property part of the basic @@ -102,15 +106,17 @@ public class ImagePropertyForm ParameterModel descriptionParam = new StringParameter(Image.DESCRIPTION); descriptionParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); TextArea description = new TextArea(descriptionParam); + description.setLabel(GlobalizationUtil + .globalize("cms.contenttypes.ui.description")); description.setRows(10); description.setCols(60); add(description); - add(new Label(ImageGlobalizationUtil - .globalize("cms.contenttypes.ui.image.artist"))); ParameterModel artistParam = new StringParameter(Image.ARTIST); artistParam.addParameterListener(new StringInRangeValidationListener(0, 200)); TextField artist = new TextField(artistParam); + artist.setLabel(ImageGlobalizationUtil + .globalize("cms.contenttypes.ui.image.artist")); add(artist); ParameterModel skipDayParam = new BooleanParameter(Image.SKIPDAY); @@ -121,49 +127,51 @@ public class ImagePropertyForm Hidden skipMonth = new Hidden(skipMonthParam); add(skipMonth); - add(new Label(ImageGlobalizationUtil - .globalize("cms.contenttypes.ui.image.publishDate"))); + // add(new Label(ImageGlobalizationUtil + // .globalize("cms.contenttypes.ui.image.publishDate"))); IncompleteDateParameter publishDateParam = new IncompleteDateParameter(Image.PUBLISHDATE); publishDateParam.allowSkipDay(true); publishDateParam.allowSkipMonth(true); Date publishDate = new Date(publishDateParam); publishDate.setYearRange(Image.getConfig().getStartYear(), GregorianCalendar.getInstance().get(Calendar.YEAR) + Image.getConfig().getEndYearDelta()); + publishDate.setLabel(ImageGlobalizationUtil + .globalize("cms.contenttypes.ui.image.publishDate")); add(publishDate); - add(new Label(ImageGlobalizationUtil - .globalize("cms.contenttypes.ui.image.source"))); ParameterModel sourceParam = new StringParameter(Image.SOURCE); sourceParam.addParameterListener(new StringInRangeValidationListener(0, 600)); TextField source = new TextField(sourceParam); + source.setLabel(ImageGlobalizationUtil + .globalize("cms.contenttypes.ui.image.source")); add(source); - add(new Label(ImageGlobalizationUtil - .globalize("cms.contenttypes.ui.image.media"))); ParameterModel mediaParam = new StringParameter(Image.MEDIA); mediaParam.addParameterListener(new StringInRangeValidationListener(0, 300)); TextField media = new TextField(mediaParam); + media.setLabel(ImageGlobalizationUtil + .globalize("cms.contenttypes.ui.image.media")); add(media); - add(new Label(ImageGlobalizationUtil - .globalize("cms.contenttypes.ui.image.copyright"))); ParameterModel copyrightParam = new StringParameter(Image.COPYRIGHT); copyrightParam.addParameterListener(new StringInRangeValidationListener(0, 400)); TextField copyright = new TextField(copyrightParam); + copyright.setLabel(ImageGlobalizationUtil + .globalize("cms.contenttypes.ui.image.copyright")); add(copyright); - add(new Label(ImageGlobalizationUtil - .globalize("cms.contenttypes.ui.image.site"))); ParameterModel siteParam = new StringParameter(Image.SITE); siteParam.addParameterListener(new StringInRangeValidationListener(0, 500)); TextField site = new TextField(siteParam); + site.setLabel(ImageGlobalizationUtil + .globalize("cms.contenttypes.ui.image.site")); add(site); - add(new Label(ImageGlobalizationUtil - .globalize("cms.contenttypes.ui.image.license"))); ParameterModel licenseParam = new StringParameter(Image.LICENSE); licenseParam.addParameterListener(new StringInRangeValidationListener(0, 300)); TextField license = new TextField(licenseParam); + license.setLabel(ImageGlobalizationUtil + .globalize("cms.contenttypes.ui.image.license")); add(license); add(new Label(ImageGlobalizationUtil @@ -171,20 +179,22 @@ public class ImagePropertyForm ParameterModel materialParam = new StringParameter(Image.MATERIAL); materialParam.addParameterListener(new StringInRangeValidationListener(0, 200)); TextField material = new TextField(materialParam); + material.setLabel(ImageGlobalizationUtil + .globalize("cms.contenttypes.ui.image.material")); add(material); - add(new Label(ImageGlobalizationUtil - .globalize("cms.contenttypes.ui.image.technique"))); ParameterModel techniqueParam = new StringParameter(Image.TECHNIQUE); techniqueParam.addParameterListener(new StringInRangeValidationListener(0, 200)); TextField technique = new TextField(techniqueParam); + technique.setLabel(ImageGlobalizationUtil + .globalize("cms.contenttypes.ui.image.technique")); add(technique); - add(new Label(ImageGlobalizationUtil - .globalize("cms.contenttypes.ui.image.origin"))); ParameterModel originParam = new StringParameter(Image.ORIGIN); originParam.addParameterListener(new StringInRangeValidationListener(0, 200)); TextField origin = new TextField(originParam); + origin.setLabel(ImageGlobalizationUtil + .globalize("cms.contenttypes.ui.image.origin")); add(origin); add(new Label(ImageGlobalizationUtil @@ -192,11 +202,15 @@ public class ImagePropertyForm ParameterModel origSizeParam = new StringParameter(Image.ORIGSIZE); origSizeParam.addParameterListener(new StringInRangeValidationListener(0, 100)); TextField origSize = new TextField(origSizeParam); + origSize.setLabel(ImageGlobalizationUtil + .globalize("cms.contenttypes.ui.image.origSize")); add(origSize); } - /** Form initialisation hook. Fills widgets with data. */ + /** + * @param fse Form initialisation hook. Fills widgets with data. + */ @Override public void init(FormSectionEvent fse) { // Do some initialization hook stuff @@ -233,7 +247,10 @@ public class ImagePropertyForm FormData d = e.getFormData(); } - /** Cancels streamlined editing. */ + /** + * Cancels streamlined editing. + * @param fse + */ @Override public void submitted(FormSectionEvent fse) { if (m_step != null @@ -242,7 +259,10 @@ public class ImagePropertyForm } } - /** Form processing hook. Saves Event object. */ + /** + * Form processing hook. Saves Event object. + * @param fse + */ @Override public void process(FormSectionEvent fse) { FormData data = fse.getFormData(); diff --git a/ccm-cms-types-inlinesite/src/com/arsdigita/cms/contenttypes/ui/InlineSitePropertyForm.java b/ccm-cms-types-inlinesite/src/com/arsdigita/cms/contenttypes/ui/InlineSitePropertyForm.java index 8b36d2028..76dcba5e8 100755 --- a/ccm-cms-types-inlinesite/src/com/arsdigita/cms/contenttypes/ui/InlineSitePropertyForm.java +++ b/ccm-cms-types-inlinesite/src/com/arsdigita/cms/contenttypes/ui/InlineSitePropertyForm.java @@ -19,8 +19,6 @@ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.cms.contenttypes.InlineSite; -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.Label; import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; @@ -28,19 +26,18 @@ import com.arsdigita.bebop.form.TextArea; import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.parameters.NotEmptyValidationListener; import com.arsdigita.bebop.parameters.ParameterModel; -import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.bebop.parameters.StringInRangeValidationListener; import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.cms.CMS; import com.arsdigita.cms.ContentPage; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.util.InlineSiteGlobalizationUtil; import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.util.GlobalizationUtil; /** - * Form to edit the basic properties of an InlineSite. This form can be extended to create forms for InlineSite - * subclasses. + * Form to edit the basic properties of an InlineSite. This form can be + * extended to create forms for InlineSite subclasses. */ public class InlineSitePropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener { @@ -68,8 +65,9 @@ public class InlineSitePropertyForm extends BasicPageForm */ protected void addWidgets() { super.addWidgets(); - add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.description"))); m_description = new TextArea(ContentPage.DESCRIPTION); + m_description.setLabel(GlobalizationUtil.globalize( + "cms.contenttypes.ui.description")); m_description.setCols(30); m_description.setRows(5); if (ContentSection.getConfig().mandatoryDescriptions()) { @@ -83,9 +81,10 @@ public class InlineSitePropertyForm extends BasicPageForm 4000)); add(m_description); - add(new Label("URL:")); ParameterModel urlParam = new StringParameter("url"); m_url = new TextField(urlParam); + m_url.setLabel(InlineSiteGlobalizationUtil.globalize( + "cms.contenttypes.ui.inlinesite.url")); m_url.setSize(40); add(m_url); } @@ -93,6 +92,7 @@ public class InlineSitePropertyForm extends BasicPageForm /** * Form initialisation hook. Fills widgets with data. */ + @Override public void init(FormSectionEvent fse) { InlineSite site = (InlineSite) super.initBasicWidgets(fse); @@ -103,7 +103,9 @@ public class InlineSitePropertyForm extends BasicPageForm /** * Form processing hook. Saves InlineSite object. + * @param fse */ + @Override public void process(FormSectionEvent fse) { InlineSite site = (InlineSite) super.processBasicWidgets(fse); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertiesStep.java index b1a52e802..538964054 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertiesStep.java @@ -24,16 +24,14 @@ import com.arsdigita.cms.ContentPage; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contenttypes.GenericAddress; -import com.arsdigita.domain.DomainObject; -import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.util.GlobalizationUtil; - -import java.text.DateFormat; +import com.arsdigita.domain.DomainObject; +import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; /** * @@ -58,6 +56,10 @@ public class GenericAddressPropertiesStep extends SimpleEditStep { setDisplayComponent(getAddressPropertySheet(itemModel)); } + /** + * + * @param itemModel + */ protected void createEditSheet(ItemSelectionModel itemModel) { BasicPageForm editSheet; editSheet = new GenericAddressPropertyForm(itemModel, this); @@ -99,9 +101,10 @@ public class GenericAddressPropertiesStep extends SimpleEditStep { GenericAddress.ISO_COUNTRY_CODE, new DomainObjectPropertySheet.AttributeFormatter() { + @Override public String format(DomainObject item, - String attribute, - PageState state) { + String attribute, + PageState state) { GenericAddress address = (GenericAddress) item; if (address != null && address.getIsoCountryCode() != null) { return GenericAddress diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertyForm.java index 3aa505ad1..88661f6b3 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertyForm.java @@ -82,9 +82,12 @@ public class GenericAddressPropertyForm extends BasicPageForm addSubmissionListener(this); } + /** + * Add the widgets specific to GenericAddress + */ @Override protected void addWidgets() { - super.addWidgets(); + super.addWidgets(); // Add the standard widgets from super class ParameterModel addressParam = new StringParameter(ADDRESS); addressParam.addParameterListener(new NotNullValidationListener()); @@ -149,15 +152,16 @@ public class GenericAddressPropertyForm extends BasicPageForm country.addValidationListener(new ParameterListener() { + @Override public void validate(ParameterEvent e) throws FormProcessException { ParameterData data = e.getParameterData(); String isoCode = (String) data.getValue(); s_log.debug("ISO code is : " + isoCode); if (isoCode == null || isoCode.length() == 0) { - data.addError((String) ContenttypesGlobalizationUtil + data.addError(ContenttypesGlobalizationUtil .globalize("cms.contenttypes.ui.address.error_iso_country") - .localize()); + ); } } @@ -172,6 +176,7 @@ public class GenericAddressPropertyForm extends BasicPageForm * * @param fse */ + @Override public void init(FormSectionEvent fse) { FormData data = fse.getFormData(); GenericAddress address = (GenericAddress) super.initBasicWidgets(fse); @@ -200,6 +205,7 @@ public class GenericAddressPropertyForm extends BasicPageForm * * @param fse */ + @Override public void process(FormSectionEvent fse) { FormData data = fse.getFormData(); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericArticlePropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericArticlePropertiesStep.java index 4686d6bfd..992b064b0 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericArticlePropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericArticlePropertiesStep.java @@ -89,6 +89,7 @@ public class GenericArticlePropertiesStep extends SimpleEditStep { ContentPage.LAUNCH_DATE, new DomainObjectPropertySheet.AttributeFormatter() { + @Override public String format(DomainObject item, String attribute, PageState state) { diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressPropertiesStep.java index 351251d64..17ef2d2de 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressPropertiesStep.java @@ -9,19 +9,12 @@ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.contenttypes.GenericAddress; -import com.arsdigita.cms.contenttypes.GenericContact; -import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; -import com.arsdigita.cms.util.GlobalizationUtil; -import com.arsdigita.domain.DomainObject; -import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; /** * @@ -37,7 +30,10 @@ public class GenericContactAddressPropertiesStep extends SimpleEditStep { private final WorkflowLockedComponentAccess addAddress; /** - * Creates a new instance of GenericContactAddressPropertiesStep + * Creates a new instance of GenericContactAddressPropertiesStep. + * + * @param itemModel + * @param parent */ public GenericContactAddressPropertiesStep(final ItemSelectionModel itemModel, final AuthoringKitWizard parent) { @@ -60,38 +56,6 @@ public class GenericContactAddressPropertiesStep extends SimpleEditStep { setDisplayComponent(getAddressPropertySheet(itemModel)); -// this.itemModel = itemModel; -// -// BasicPageForm attachAddressSheet = new GenericContactAttachAddressPropertyForm(itemModel, -// this); -// BasicPageForm reattachAddressSheet = new GenericContactAttachAddressPropertyForm(itemModel, -// this); -// BasicPageForm editAddressSheet = new GenericContactEditAddressPropertyForm(itemModel, this); -// BasicPageForm deleteAddressSheet = new GenericContactDeleteAddressForm( -// itemModel, this); -// -// add(ADD_ADDRESS_SHEET_NAME, -// ContenttypesGlobalizationUtil.globalize( -// "cms.contenttypes.ui.contact.attach_address"), -// new AttachAddressWorkflowLockedComponentAccess(attachAddressSheet, -// itemModel), -// attachAddressSheet.getSaveCancelSection().getCancelButton()); -// add(CHANGE_ADDRESS_SHEET_NAME, -// ContenttypesGlobalizationUtil.globalize( -// "cms.contenttypes.ui.contact.reattach_address"), -// new EditAddressWorkflowLockedComponentAccess(reattachAddressSheet, -// itemModel), -// reattachAddressSheet.getSaveCancelSection().getCancelButton()); -// -// add(DELETE_ADDRESS_SHEET_NAME, -// ContenttypesGlobalizationUtil.globalize( -// "cms.contenttypes.ui.contact.delete_address"), -// new EditAddressWorkflowLockedComponentAccess(deleteAddressSheet, -// itemModel), -// deleteAddressSheet.getSaveCancelSection().getCancelButton()); -// -// /* Set the displayComponent for this step */ -// setDisplayComponent(getAddressPropertySheet(itemModel)); } public static Component getAddressPropertySheet(final ItemSelectionModel itemModel) { @@ -99,171 +63,4 @@ public class GenericContactAddressPropertiesStep extends SimpleEditStep { return sheet; } - /** - * - * @param itemModel - * - * @return - */ -// public static Component getAddressPropertySheet(ItemSelectionModel itemModel) { -// -// DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( -// itemModel); -// -// sheet.add(ContenttypesGlobalizationUtil.globalize( -// "cms.contenttypes.ui.address.address"), -// "address." + GenericAddress.ADDRESS, -// new DomainObjectPropertySheet.AttributeFormatter() { -// -// @Override -// public String format(final DomainObject obj, -// final String attribute, -// final PageState state) { -// final GenericAddress address = ((GenericContact) obj).getAddress(); -// if ((address == null) || (address.getAddress() == null)) { -// return (String) GlobalizationUtil.globalize( -// "cms.ui.unknown").localize(); -// } else { -// return address.getAddress(); -// -// } -// } -// -// }); -// if (!GenericContact.getConfig().getHideAddressPostalCode()) { -// sheet.add(ContenttypesGlobalizationUtil.globalize( -// "cms.contenttypes.ui.address.postal_code"), -// "address." + GenericAddress.POSTAL_CODE, -// new DomainObjectPropertySheet.AttributeFormatter() { -// -// @Override -// public String format(final DomainObject obj, -// final String attribute, -// final PageState state) { -// final GenericAddress address = ((GenericContact) obj).getAddress(); -// if ((address == null) || (address.getPostalCode() == null)) { -// return (String) GlobalizationUtil.globalize( -// "cms.ui.unknown").localize(); -// } else { -// return address.getPostalCode(); -// -// } -// -// } -// -// }); -// } -// sheet.add(ContenttypesGlobalizationUtil.globalize( -// "cms.contenttypes.ui.address.city"), -// "address." + GenericAddress.CITY, -// new DomainObjectPropertySheet.AttributeFormatter() { -// -// @Override -// public String format(final DomainObject obj, -// final String attribute, -// final PageState state) { -// final GenericAddress address = ((GenericContact) obj).getAddress(); -// if ((address == null) || (address.getCity() == null)) { -// return (String) GlobalizationUtil.globalize( -// "cms.ui.unknown").localize(); -// } else { -// return address.getCity(); -// -// } -// -// } -// -// }); -// if (!GenericContact.getConfig().getHideAddressState()) { -// sheet.add(ContenttypesGlobalizationUtil.globalize( -// "cms.contenttypes.ui.address.state"), -// "address." + GenericAddress.STATE, -// new DomainObjectPropertySheet.AttributeFormatter() { -// -// @Override -// public String format(final DomainObject obj, -// final String attribute, -// final PageState state) { -// final GenericAddress address = ((GenericContact) obj).getAddress(); -// if ((address == null) || (address.getState() == null)) { -// return (String) GlobalizationUtil.globalize( -// "cms.ui.unknown").localize(); -// } else { -// return address.getState(); -// -// } -// -// } -// -// }); -// } -// -// if (!GenericContact.getConfig().getHideAddressCountry()) { -// sheet.add(ContenttypesGlobalizationUtil.globalize( -// "cms.contenttypes.ui.address.iso_country_code"), -// "address." + GenericAddress.ISO_COUNTRY_CODE, -// new DomainObjectPropertySheet.AttributeFormatter() { -// -// @Override -// public String format(DomainObject item, -// String attribute, -// PageState state) { -// GenericAddress address = ((GenericContact) item).getAddress(); -// if (address != null && address.getIsoCountryCode() != null) { -// return GenericAddress.getCountryNameFromIsoCode(address. -// getIsoCountryCode()); -// } else { -// return (String) GlobalizationUtil.globalize( -// "cms.ui.unknown").localize(); -// } -// } -// -// }); -// } -// -// return sheet; -// -// } -// -// public static Component getEmptyBaseAddressPropertySheet( -// ItemSelectionModel itemModel) { -// return new Label( -// (ContenttypesGlobalizationUtil.globalize( -// "cms.contenttypes.ui.contact.emptyAddress"))); -// } -// -// private class EditAddressWorkflowLockedComponentAccess -// extends WorkflowLockedComponentAccess { -// -// public EditAddressWorkflowLockedComponentAccess(Component c, -// ItemSelectionModel i) { -// super(c, i); -// } -// -// @Override -// public boolean isVisible(PageState state) { -// GenericContact contact = (GenericContact) itemModel. -// getSelectedObject(state); -// -// return contact.hasAddress(); -// } -// -// } -// -// private class AttachAddressWorkflowLockedComponentAccess extends WorkflowLockedComponentAccess { -// -// public AttachAddressWorkflowLockedComponentAccess(Component c, -// ItemSelectionModel i) { -// super(c, i); -// } -// -// @Override -// public boolean isVisible(PageState state) { -// GenericContact contact = (GenericContact) itemModel. -// getSelectedObject(state); -// -// return !contact.hasAddress(); -// } -// -// } } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressSheet.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressSheet.java index 2194a44aa..7e66806f8 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressSheet.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressSheet.java @@ -47,12 +47,12 @@ public class GenericContactAddressSheet extends Table implements TableActionList final TableColumnModel colModel = getColumnModel(); colModel.add(new TableColumn( 0, - new Label(""), + new Label(), TABLE_COL_EDIT)); colModel.add(new TableColumn( 1, - new Label(""), + new Label(), TABLE_COL_DEL)); setModelBuilder(new GenericContactAddressTableModelBuilder(itemModel)); @@ -63,11 +63,14 @@ public class GenericContactAddressSheet extends Table implements TableActionList addTableActionListener(this); } + /** + * + */ private class GenericContactAddressTableModelBuilder extends LockableImpl implements TableModelBuilder { - private ItemSelectionModel itemModel; + private final ItemSelectionModel itemModel; public GenericContactAddressTableModelBuilder(final ItemSelectionModel itemModel) { this.itemModel = itemModel; diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachAddressPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachAddressPropertyForm.java index f745d1c23..145edaacc 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachAddressPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachAddressPropertyForm.java @@ -2,7 +2,7 @@ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; +// import com.arsdigita.bebop.Label; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.SaveCancelSection; import com.arsdigita.bebop.event.FormInitListener; @@ -72,12 +72,14 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm @Override public void addWidgets() { - add(new Label(ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.contact.select_address"))); + // add(new Label(ContenttypesGlobalizationUtil.globalize( + // "cms.contenttypes.ui.contact.select_address"))); this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. findByAssociatedObjectType( "com.arsdigita.cms.contenttypes.GenericAddress")); - m_itemSearch.setDisableCreatePane(true); + m_itemSearch.setDisableCreatePane(true); + m_itemSearch.setLabel(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.contact.select_address")); add(this.m_itemSearch); } @@ -145,6 +147,11 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm } } + /** + * + * @param e + * @throws FormProcessException + */ @Override public void validate(FormSectionEvent e) throws FormProcessException { //Calling super.validate(e) here causes an exception because the super method checks things which not available @@ -154,10 +161,10 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm final FormData data = e.getFormData(); if (data.get(ITEM_SEARCH) == null) { - throw new FormProcessException((String) ContenttypesGlobalizationUtil. + throw new FormProcessException(ContenttypesGlobalizationUtil. globalize( - "cms.contenttypes.ui.contact.select_address.wrong_type"). - localize()); + "cms.contenttypes.ui.contact.select_address.wrong_type") + ); } GenericContact contact = (GenericContact) getItemSelectionModel(). @@ -173,14 +180,19 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm } } + /** + * + * @param e + * @throws FormProcessException + */ @Override public void submitted(FormSectionEvent e) throws FormProcessException { if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) { init(e); - throw new FormProcessException((String) ContenttypesGlobalizationUtil. + throw new FormProcessException(ContenttypesGlobalizationUtil. globalize( - "cms.contenttypes.ui.contact.select_address.cancelled"). - localize()); + "cms.contenttypes.ui.contact.select_address.cancelled") + ); } } } \ No newline at end of file diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachPersonPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachPersonPropertyForm.java index ef2fdf5b0..0f701efc4 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachPersonPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachPersonPropertyForm.java @@ -1,3 +1,21 @@ +/* + * Copyright (C) 2013 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.FormData; @@ -84,11 +102,13 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm @Override public void addWidgets() { - add(new Label(ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.contact.select_person"))); + //add(new Label(ContenttypesGlobalizationUtil.globalize( + // "cms.contenttypes.ui.contact.select_person"))); this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. findByAssociatedObjectType( "com.arsdigita.cms.contenttypes.GenericPerson")); + m_itemSearch.setLabel(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.contact.select_person")); m_itemSearch.setDisableCreatePane(true); add(this.m_itemSearch); @@ -128,6 +148,7 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm add(contactType); } + @Override public void init(FormSectionEvent fse) { FormData data = fse.getFormData(); PageState state = fse.getPageState(); @@ -142,6 +163,7 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm } } + @Override public void process(FormSectionEvent fse) { FormData data = fse.getFormData(); PageState state = fse.getPageState(); @@ -167,6 +189,7 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm try { getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() { + @Override public void prepare(PrintEvent e) { GenericContact contact = (GenericContact) getItemSelectionModel(). getSelectedObject(e.getPageState()); @@ -191,17 +214,16 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm @Override public void validate(FormSectionEvent e) throws FormProcessException { - //Calling super.validate(e) here causes an exception because the super method checks things which not available - //here. + //Calling super.validate(e) here causes an exception because the + //super method checks things which not available here. final PageState state = e.getPageState(); final FormData data = e.getFormData(); if (data.get(ITEM_SEARCH) == null) { - throw new FormProcessException((String) ContenttypesGlobalizationUtil. + throw new FormProcessException(ContenttypesGlobalizationUtil. globalize( - "cms.contenttypes.ui.contact.select_person.wrong_type"). - localize()); + "cms.contenttypes.ui.contact.select_person.wrong_type")); } GenericContact contact = (GenericContact) getItemSelectionModel(). @@ -211,19 +233,20 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm if (!(person.getContentBundle().hasInstance(contact.getLanguage(), Kernel.getConfig(). languageIndependentItems()))) { - data.addError( - "cms.contenttypes.ui.contact.select_person.no_suitable_language_variant"); + data.addError(ContenttypesGlobalizationUtil. + globalize( + "cms.contenttypes.ui.contact.select_person.no_suitable_language_variant")); } } + @Override public void submitted(FormSectionEvent e) throws FormProcessException { if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) { init(e); - throw new FormProcessException((String) ContenttypesGlobalizationUtil. + throw new FormProcessException(ContenttypesGlobalizationUtil. globalize( - "cms.contenttypes.ui.contact.select_person.cancelled"). - localize()); + "cms.contenttypes.ui.contact.select_person.cancelled")); } } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeleteAddressForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeleteAddressForm.java index 622bcf0c4..aeecf750f 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeleteAddressForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeleteAddressForm.java @@ -56,6 +56,7 @@ public class GenericContactDeleteAddressForm extends BasicPageForm implements Fo try { getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() { + @Override public void prepare(PrintEvent e) { GenericContact contact = (GenericContact) getItemSelectionModel() @@ -71,6 +72,7 @@ public class GenericContactDeleteAddressForm extends BasicPageForm implements Fo } } + @Override public final void process(final FormSectionEvent fse) throws FormProcessException { final PageState state = fse.getPageState(); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeletePersonForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeletePersonForm.java index 3d68a2d24..d8c6d8c6c 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeletePersonForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeletePersonForm.java @@ -41,6 +41,7 @@ public class GenericContactDeletePersonForm extends BasicPageForm addSaveCancelSection(); } + @Override public void init(FormSectionEvent fse) { } @@ -74,6 +75,7 @@ public class GenericContactDeletePersonForm extends BasicPageForm } } + @Override public final void process(final FormSectionEvent fse) throws FormProcessException { final PageState state = fse.getPageState(); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java index 09fc426d6..fb058f962 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java @@ -55,7 +55,9 @@ public class GenericContactEntriesTable extends Table implements TableActionList private ItemSelectionModel m_itemModel; /** - * Creates a new instance of GenericContactEntriesTable + * Creates a new instance of GenericContactEntriesTable. + * + * @param itemModel */ public GenericContactEntriesTable(final ItemSelectionModel itemModel) { @@ -109,6 +111,7 @@ public class GenericContactEntriesTable extends Table implements TableActionList m_itemModel = itemModel; } + @Override public TableModel makeModel(Table table, PageState state) { table.getRowSelectionModel().clearSelection(state); @@ -162,6 +165,7 @@ public class GenericContactEntriesTable extends Table implements TableActionList * Return the * @see com.arsdigita.bebop.table.TableModel#getElementAt(int) */ + @Override public Object getElementAt(int columnIndex) { switch (columnIndex) { case 0: @@ -295,6 +299,7 @@ public class GenericContactEntriesTable extends Table implements TableActionList * provide Implementation to TableActionListener method. * Does nothing in our case. */ + @Override public void headSelected(TableActionEvent e) { throw new UnsupportedOperationException("Not Implemented"); } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntryAddForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntryAddForm.java index a2b1f4d7b..1a11d5133 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntryAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntryAddForm.java @@ -54,7 +54,9 @@ public class GenericContactEntryAddForm extends BasicItemForm { private ItemSelectionModel m_itemModel; /** - * Creates a new instance of CategoryLocalizationAddForm + * Creates a new instance of CategoryLocalizationAddForm. + * + * @param itemModel */ public GenericContactEntryAddForm(ItemSelectionModel itemModel) { @@ -121,6 +123,7 @@ public class GenericContactEntryAddForm extends BasicItemForm { * * @param fse */ + @Override public void init(FormSectionEvent fse) { } @@ -129,6 +132,7 @@ public class GenericContactEntryAddForm extends BasicItemForm { * * @param fse */ + @Override public void process(FormSectionEvent fse) { FormData data = fse.getFormData(); GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(fse.getPageState()); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonPropertiesStep.java index 45bd12b5a..6589adae4 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonPropertiesStep.java @@ -50,7 +50,10 @@ public class GenericContactPersonPropertiesStep extends SimpleEditStep { // private WorkflowLockedComponentAccess delPerson; /** - * Creates a new instance of GenericContactPersonPropertiesStep + * Creates a new instance of GenericContactPersonPropertiesStep. + * + * @param itemModel + * @param parent */ public GenericContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonSheet.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonSheet.java index 26fa1a260..7279e1544 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonSheet.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonSheet.java @@ -72,7 +72,6 @@ public class GenericContactPersonSheet extends Table implements TableActionListe colModel.add(new TableColumn( 0, new Label(ContenttypesGlobalizationUtil.globalize( - // "cms.contenttypes.ui.contact.person").localize(), "cms.contenttypes.ui.genericcontact.person")), TABLE_COL_EDIT)); colModel.add(new TableColumn( diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitTab.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitTab.java index bfde050e9..f654563bc 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitTab.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitTab.java @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2011-2013 Universitaet 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.PageState; diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java index 523b6d130..21a71baea 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java @@ -36,7 +36,6 @@ import com.arsdigita.cms.ContentType; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.RelationAttribute; import com.arsdigita.cms.contenttypes.GenericContact; -import com.arsdigita.cms.contenttypes.GenericContactTypeCollection; import com.arsdigita.cms.contenttypes.GenericOrganizationContactTypeCollection; import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitContactCollection; @@ -46,8 +45,9 @@ import com.arsdigita.cms.ui.authoring.BasicItemForm; import com.arsdigita.globalization.GlobalizationHelper; import com.arsdigita.kernel.Kernel; import com.arsdigita.util.UncheckedWrapperException; + import java.util.TooManyListenersException; -import java.util.logging.Level; + import org.apache.log4j.Logger; /** @@ -79,15 +79,17 @@ public class GenericOrganizationalUnitContactAddForm @Override protected void addWidgets() { - add(new Label(ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.select_contact"))); + // add(new Label(ContenttypesGlobalizationUtil.globalize( + // "cms.contenttypes.ui.genericorgaunit.select_contact"))); m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. findByAssociatedObjectType(GenericContact.class .getName())); + m_itemSearch.setLabel(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericorgaunit.select_contact")); m_itemSearch.setDisableCreatePane(false); add(m_itemSearch); - selectedContactLabel = new Label(""); + selectedContactLabel = new Label(); add(selectedContactLabel); ParameterModel contactTypeParam = new StringParameter( @@ -213,8 +215,8 @@ public class GenericOrganizationalUnitContactAddForm if ((editStep.getSelectedContact() == null) && (data.get(ITEM_SEARCH) == null)) { - data.addError( - "cms.contenttypes.ui.genericorgaunit.select_contact.no_contact_selected"); + data.addError((ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericorgaunit.select_contact.no_contact_selected"))); return; } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java index 18cdc608a..7568a1b0e 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java @@ -35,7 +35,6 @@ import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.SecurityManager; import com.arsdigita.cms.contenttypes.GenericContact; -import com.arsdigita.cms.contenttypes.GenericContactTypeCollection; import com.arsdigita.cms.contenttypes.GenericOrganizationContactTypeCollection; import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitContactCollection; @@ -92,22 +91,22 @@ public class GenericOrganizationalUnitContactTable extends Table implements tabModel.add(new TableColumn( 2, ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.contact.edit").localize(), + "cms.contenttypes.ui.genericorgaunit.contact.edit"), TABLE_COL_EDIT_ASSOC)); tabModel.add(new TableColumn( 3, ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.contact.action").localize(), + "cms.contenttypes.ui.genericorgaunit.contact.action"), TABLE_COL_DEL)); tabModel.add(new TableColumn( 4, ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.contact.up").localize(), + "cms.contenttypes.ui.genericorgaunit.contact.up"), TABLE_COL_UP)); tabModel.add(new TableColumn( 5, ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.contact.down").localize(), + "cms.contenttypes.ui.genericorgaunit.contact.down"), TABLE_COL_DOWN)); setModelBuilder( @@ -230,6 +229,7 @@ public class GenericOrganizationalUnitContactTable extends Table implements } } + @Override public Object getKeyAt(int columnIndex) { return m_contact.getID(); } @@ -239,6 +239,7 @@ public class GenericOrganizationalUnitContactTable extends Table implements extends LockableImpl implements TableCellRenderer { + @Override public Component getComponent( Table table, PageState state, @@ -293,6 +294,7 @@ public class GenericOrganizationalUnitContactTable extends Table implements extends LockableImpl implements TableCellRenderer { + @Override public Component getComponent( Table table, PageState state, @@ -343,10 +345,10 @@ public class GenericOrganizationalUnitContactTable extends Table implements orgaunit); if (canDelete) { ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) ContenttypesGlobalizationUtil. + link.setConfirmation(ContenttypesGlobalizationUtil. globalize( - "cms.contenttypes.ui.genericorgaunit.confirm_delete"). - localize()); + "cms.contenttypes.ui.genericorgaunit.confirm_delete") + ); return link; } else { return new Label(value.toString()); @@ -369,7 +371,7 @@ public class GenericOrganizationalUnitContactTable extends Table implements if (0 == row) { s_log.debug("Row is first row in table, don't show up-link"); - return new Label(""); + return new Label(); } else { ControlLink link = new ControlLink("up"); return link; @@ -399,7 +401,7 @@ public class GenericOrganizationalUnitContactTable extends Table implements if ((contacts.size() - 1) == row) { s_log.debug("Row is last row in table, don't show down-link"); - return new Label(""); + return new Label(); } else { ControlLink link = new ControlLink("down"); return link; diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java index 1bf0b925f..33c9a33ea 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java @@ -78,16 +78,18 @@ public class GenericOrganizationalUnitPersonAddForm @Override protected void addWidgets() { - add(new Label(ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.select_person"))); + // add(new Label(ContenttypesGlobalizationUtil.globalize( + // "cms.contenttypes.ui.genericorgaunit.select_person"))); m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. findByAssociatedObjectType(getPersonType())); /*m_itemSearch.getItemField().addValidationListener( new NotNullValidationListener());*/ + m_itemSearch.setLabel(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericorgaunit.select_person")); m_itemSearch.setDisableCreatePane(false); add(this.m_itemSearch); - selectedPersonNameLabel = new Label(""); + selectedPersonNameLabel = new Label(); add(selectedPersonNameLabel); ParameterModel roleParam = new StringParameter( diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java index 46a443ade..24a052c82 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java @@ -149,10 +149,12 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements size())); } + @Override public int getColumnCount() { return m_table.getColumnModel().size(); } + @Override public boolean nextRow() { boolean ret; @@ -167,6 +169,7 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements return ret; } + @Override public Object getElementAt(int columnIndex) { switch (columnIndex) { case 0: @@ -208,6 +211,7 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements } } + @Override public Object getKeyAt(int columnIndex) { return m_person.getID(); } @@ -217,6 +221,7 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements private class EditCellRenderer extends LockableImpl implements TableCellRenderer { + @Override public Component getComponent( Table table, PageState state, @@ -307,6 +312,7 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements private class DeleteCellRenderer extends LockableImpl implements TableCellRenderer { + @Override public Component getComponent( Table table, PageState state, @@ -325,10 +331,9 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements orgaunit); if (canEdit) { ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) ContenttypesGlobalizationUtil. + link.setConfirmation(ContenttypesGlobalizationUtil. globalize( - "cms.contenttypes.ui.genericorgaunit.persons.confirm_delete"). - localize()); + "cms.contenttypes.ui.genericorgaunit.persons.confirm_delete")); return link; } else { return new Label(value.toString()); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSubordinateOrgaUnitAddForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSubordinateOrgaUnitAddForm.java index 97ae033ba..6a2f73a98 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSubordinateOrgaUnitAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSubordinateOrgaUnitAddForm.java @@ -45,7 +45,7 @@ public class GenericOrganizationalUnitSubordinateOrgaUnitAddForm implements FormProcessListener, FormInitListener { - private ItemSearchWidget itemSearch; + private final ItemSearchWidget itemSearch; private final String ITEM_SEARCH = "subordinateOrgaUnits"; private final GenericOrgaUnitSubordinateOrgaUnitAddFormCustomizer customizer; @@ -60,6 +60,8 @@ public class GenericOrganizationalUnitSubordinateOrgaUnitAddForm ITEM_SEARCH, ContentType.findByAssociatedObjectType( customizer.getSubordinateOrgaUnitType())); + // Customizer methods have to be refactored, avoiding Strings + // itemSearch.setLabel(null); itemSearch.setDisableCreatePane(true); add(itemSearch); } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonAliasPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonAliasPropertiesStep.java index 867583d50..f6491ad66 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonAliasPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonAliasPropertiesStep.java @@ -69,9 +69,6 @@ public class GenericPersonAliasPropertiesStep extends SimpleEditStep { final BasicPageForm setAliasSheet = new GenericPersonAliasSetForm( itemModel, this); - /*final BasicPageForm changeAliasSheet = - new GenericPersonAliasSetForm(itemModel, - this);*/ final BasicPageForm deleteAliasSheet = new GenericPersonAliasDeleteForm( itemModel, this); @@ -82,13 +79,6 @@ public class GenericPersonAliasPropertiesStep extends SimpleEditStep { new GenericPersonAliasSetWorkflowLockedComponentAccess(setAliasSheet, itemModel), setAliasSheet.getSaveCancelSection().getCancelButton()); - /*add(CHANGE_ALIAS_SHEET_NAME, - (String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.person.change_alias").localize(), - new GenericPersonAliasEditWorkflowLockedComponentAccess( - changeAliasSheet, - itemModel), - changeAliasSheet.getSaveCancelSection().getCancelButton());*/ add(DELETE_ALIAS_SHEET_NAME, ContenttypesGlobalizationUtil.globalize( "cms.contenttypes.ui.person.delete_alias"), diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java index 5292c9759..35bea2f88 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java @@ -358,7 +358,9 @@ public class LinkPropertyForm extends FormSection * data * * @param event the FormSectionEvent + * @throws com.arsdigita.bebop.FormProcessException */ + @Override public void validate(FormSectionEvent event) throws FormProcessException { PageState state = event.getPageState(); @@ -472,7 +474,9 @@ public class LinkPropertyForm extends FormSection * Init listener. For edit actions, fills the form with current data * * @param fse the FormSectionEvent + * @throws com.arsdigita.bebop.FormProcessException */ + @Override public void init(FormSectionEvent fse) throws FormProcessException { FormData data = fse.getFormData(); PageState state = fse.getPageState(); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkTable.java index da12ba9ce..2d2e4fc44 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkTable.java @@ -256,7 +256,7 @@ public class LinkTable extends Table { downLabel.setClassAttr("linkSort"); return new ControlLink(downLabel); } else { - return new Label(""); + return new Label(); } } else { throw new UncheckedWrapperException("column out of bounds"); @@ -325,6 +325,7 @@ public class LinkTable extends Table { } } + @Override public void headSelected(TableActionEvent e) { } } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkTableModelBuilder.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkTableModelBuilder.java index e973c9ef1..4dea8da66 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkTableModelBuilder.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkTableModelBuilder.java @@ -48,6 +48,7 @@ public abstract class LinkTableModelBuilder * @param t The Table for the current page. * @param s The PageState for the current request */ + @Override public TableModel makeModel(Table t, PageState s) { s_log.debug("LinkTableModelBuilder.makemodel"); @@ -83,6 +84,7 @@ public abstract class LinkTableModelBuilder m_link = null; } + @Override public boolean nextRow() { s_log.debug(String.format("m_links.size() = %d", m_links.size())); @@ -99,15 +101,18 @@ public abstract class LinkTableModelBuilder } } + @Override public int getColumnCount() { return (int) m_links.size(); } + @Override public Object getElementAt(int columnIndex) { return m_link; } + @Override public Object getKeyAt(int columnIndex) { return m_link.getID(); } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/ResettableContainer.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/ResettableContainer.java index 3a0341d8e..d068daa5e 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/ResettableContainer.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/ResettableContainer.java @@ -79,6 +79,7 @@ public class ResettableContainer extends SimpleContainer implements Resettable { * @pre (pc != null) * @post (m_components.contains(pc)) **/ + @Override public void add(Component pc) { add(pc, true); } @@ -91,6 +92,7 @@ public class ResettableContainer extends SimpleContainer implements Resettable { * should override the add method if they wish to provide special * handling of constraints. **/ + @Override public void add(Component pc, int constraints) { add(pc); } @@ -99,6 +101,7 @@ public class ResettableContainer extends SimpleContainer implements Resettable { * Adds the component to this pane with the specified default * visibility. * + * @param pc * @param defaultVisibility The default visibility of this component * @pre (pc != null) **/ @@ -155,6 +158,7 @@ public class ResettableContainer extends SimpleContainer implements Resettable { * * @param state The state of the current request. **/ + @Override public void reset(PageState state) { // Reset all resettable components automatically Iterator iter = m_resettableComponents.iterator(); @@ -169,6 +173,7 @@ public class ResettableContainer extends SimpleContainer implements Resettable { * * @param p The page this container belongs to. **/ + @Override public void register(Page p) { Iterator iter = m_componentsNotVisibleByDefault.iterator(); while (iter.hasNext()) { diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/SelectFilter.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/SelectFilter.java index e33884873..0b8eec35d 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/SelectFilter.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/SelectFilter.java @@ -75,6 +75,7 @@ public class SelectFilter implements Filter { this.queryProperty = queryProperty; } + @Override public String getFilter() { if ((value == null) || value.isEmpty()) { if (allOptionIsDefault) { diff --git a/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchWidget.java b/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchWidget.java index 3a17cfb69..f068ae35c 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchWidget.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchWidget.java @@ -244,6 +244,7 @@ public class ItemSearchWidget extends FormSection + " cms.ui.item_search.selected")); selectedItemLabel.addPrintListener(new PrintListener() { + @Override public void prepare(final PrintEvent event) { final Label target = (Label) event.getTarget(); target.setLabel(GlobalizationUtil.globalize( @@ -254,6 +255,7 @@ public class ItemSearchWidget extends FormSection final Label searchLabel = new Label(searchLabelText); searchLabel.addPrintListener(new PrintListener() { + @Override public void prepare(final PrintEvent event) { final Label target = (Label) event.getTarget(); target.setLabel(searchLabelText); @@ -403,6 +405,7 @@ public class ItemSearchWidget extends FormSection return m_item; } + @Override public void init(FormSectionEvent e) throws FormProcessException { PageState s = e.getPageState(); try { diff --git a/ccm-core/src/com/arsdigita/bebop/FormSection.java b/ccm-core/src/com/arsdigita/bebop/FormSection.java index c8933a9c5..f255a7a38 100755 --- a/ccm-core/src/com/arsdigita/bebop/FormSection.java +++ b/ccm-core/src/com/arsdigita/bebop/FormSection.java @@ -62,7 +62,7 @@ import org.apache.log4j.Logger; * * @version $Id: FormSection.java 287 2005-02-22 00:29:02Z sskracic $ */ -public class FormSection extends SimpleComponent implements Container { +public class FormSection extends DescriptiveComponent implements Container { /** Internal logger instance to faciliate debugging. Enable logging output * by editing /WEB-INF/conf/log4j.properties int the runtime environment diff --git a/ccm-core/src/com/arsdigita/bebop/form/Date.java b/ccm-core/src/com/arsdigita/bebop/form/Date.java index 4aa4dcabc..29482892f 100755 --- a/ccm-core/src/com/arsdigita/bebop/form/Date.java +++ b/ccm-core/src/com/arsdigita/bebop/form/Date.java @@ -60,18 +60,30 @@ public class Date extends Widget implements BebopConstants { private int m_year_end; private Locale m_locale; - // Inner classes for the fragment widgets + /** + * Inner class for the year fragment + */ protected class YearFragment extends SingleSelect { protected Date parent; private boolean autoCurrentYear; //Decide wether to set the current year if year is null + /** + * Constructor. + * @param name + * @param parent + */ public YearFragment(String name, Date parent) { super(name); this.parent = parent; setHint(GlobalizationUtil.globalize("bebop.date.year.hint")); } + /** + * + * @param ps + * @return + */ @Override protected ParameterData getParameterData(PageState ps) { Object value = getValue(ps); @@ -81,10 +93,19 @@ public class Date extends Widget implements BebopConstants { return new ParameterData(getParameterModel(), value); } + /** + * + * @param autoCurrentYear + */ public void setAutoCurrentYear(final boolean autoCurrentYear) { this.autoCurrentYear = autoCurrentYear; } + /** + * + * @param ps + * @return + */ @Override public Object getValue(PageState ps) { ParameterModel model = parent.getParameterModel(); @@ -104,6 +125,9 @@ public class Date extends Widget implements BebopConstants { } + /** + * + */ protected class MonthFragment extends SingleSelect { protected Date parent; @@ -135,6 +159,9 @@ public class Date extends Widget implements BebopConstants { } + /** + * + */ protected class DayFragment extends TextField { protected Date parent; @@ -199,6 +226,10 @@ public class Date extends Widget implements BebopConstants { } + /** + * Constructor. + * @param name + */ public Date(String name) { this(new DateParameter(name)); } @@ -245,7 +276,9 @@ public class Date extends Widget implements BebopConstants { /** * Returns a string naming the type of this widget. + * @return */ + @Override public String getType() { return "date"; } @@ -253,23 +286,31 @@ public class Date extends Widget implements BebopConstants { /** * Sets the MAXLENGTH attribute for the INPUT tag used to render this form * element. + * @param length */ public void setMaxLength(int length) { setAttribute("MAXLENGTH", String.valueOf(length)); } + @Override public boolean isCompound() { return true; } /** * The XML tag for this derived class of Widget. + * @return */ @Override protected String getElementTag() { return BEBOP_DATE; } + /** + * + * @param ps + * @param parent + */ @Override public void generateWidget(PageState ps, Element parent) { @@ -357,7 +398,7 @@ public class Date extends Widget implements BebopConstants { * pointer is already set. To explicity change the _form pointer the developer must first call * setForm(null) * - * @param the Form Object for this Widget. + * @param f the Form Object for this Widget. * * @exception IllegalStateException if form already set. */ diff --git a/ccm-core/src/com/arsdigita/bebop/form/DateTime.java b/ccm-core/src/com/arsdigita/bebop/form/DateTime.java index 159610ab3..7664c390d 100755 --- a/ccm-core/src/com/arsdigita/bebop/form/DateTime.java +++ b/ccm-core/src/com/arsdigita/bebop/form/DateTime.java @@ -40,6 +40,7 @@ public class DateTime extends Widget implements BebopConstants { /** * Construct a new DateTime. The model must be a DateTimeParameter + * @param model */ public DateTime(ParameterModel model) { this(model, false); @@ -47,6 +48,8 @@ public class DateTime extends Widget implements BebopConstants { /** * Construct a new DateTime. The model must be a DateTimeParameter + * @param model + * @param showSeconds */ public DateTime(ParameterModel model, boolean showSeconds) { super(model); @@ -71,7 +74,9 @@ public class DateTime extends Widget implements BebopConstants { /** * Returns a string naming the type of this widget. + * @return */ + @Override public String getType() { return "dateTime"; }