From a2d02f8a0a7a6687da76286d3361a4446c27cac4 Mon Sep 17 00:00:00 2001 From: pb Date: Wed, 9 Jul 2014 09:09:20 +0000 Subject: [PATCH] Last part of adaptation to setLabel attribute in widgets. git-svn-id: https://svn.libreccm.org/ccm/trunk@2744 8810af33-2d31-482b-a856-94f89814c4df --- ...zationalUnitSubordinateOrgaUnitsTable.java | 7 +- .../ui/SciPublicationsMovieDirectorForm.java | 10 +- ...SciPublicationsMovieExtraXMLGenerator.java | 1 + ...ublicationsMovieProductionCompanyForm.java | 13 +- ...ublicationsMovieProductionCompanyStep.java | 3 +- ...PublicationsPlayProductionTheaterForm.java | 15 +- ...PublicationsPlayProductionTheaterStep.java | 3 +- .../ui/SciPublicationsPlayPropertyForm.java | 3 +- .../ui/ResearchReportPropertiesStep.java | 15 +- .../ui/ResearchReportPropertyForm.java | 12 +- .../ui/CollectedVolumeArticlesTable.java | 5 +- .../ui/ExpertiseOrdererSheet.java | 6 +- .../ui/ExpertiseOrganizationSheet.java | 7 +- ...ationGenericOrganizationalUnitAddForm.java | 5 +- ...cationGenericOrganizationalUnitsTable.java | 22 +- .../ui/PublicationPropertyForm.java | 23 +- .../ui/PublicationSeriesAddForm.java | 10 +- .../ui/PublicationSeriesPropertyStep.java | 4 +- .../ui/PublicationSeriesTable.java | 24 +- ...ublicationWithPublisherPropertiesStep.java | 22 +- .../PublicationWithPublisherPropertyForm.java | 29 +- ...licationWithPublisherSetPublisherForm.java | 14 +- ...icationWithPublisherSetPublisherSheet.java | 29 +- ...licationWithPublisherSetPublisherStep.java | 4 +- .../cms/contenttypes/ui/PublisherCreate.java | 8 +- .../ui/PublisherPropertiesStep.java | 21 +- .../ui/PublisherPropertyForm.java | 10 +- .../ui/PublisherPublicationsStep.java | 6 +- .../ui/PublisherPublicationsTable.java | 19 +- .../contenttypes/ui/ReviewPropertiesStep.java | 19 +- .../ui/SciAuthorPropertiesStep.java | 4 +- .../ui/SeriesEditshipAddForm.java | 15 +- .../contenttypes/ui/SeriesEditshipStep.java | 4 +- .../contenttypes/ui/SeriesEditshipTable.java | 35 +-- .../contenttypes/ui/SeriesPropertiesStep.java | 11 +- .../contenttypes/ui/SeriesPropertyForm.java | 4 +- .../contenttypes/ui/SeriesVolumeAddForm.java | 10 +- .../contenttypes/ui/SeriesVolumesTable.java | 30 +- .../ui/UnPublishedOrganizationForm.java | 9 +- .../ui/UnPublishedOrganizationSheet.java | 22 +- .../ui/UnPublishedOrganizationStep.java | 4 +- .../ui/UnPublishedPropertiesStep.java | 25 +- .../ui/UnPublishedPropertyForm.java | 14 +- .../ui/WorkingPaperPropertiesStep.java | 20 +- .../ui/WorkingPaperPropertyForm.java | 5 +- .../ui/SciDepartmentDescriptionEditForm.java | 6 +- .../ui/SciDepartmentDescriptionStep.java | 11 +- .../ui/SciDepartmentMemberTable.java | 4 +- .../ui/SciDepartmentProjectsStep.java | 23 +- .../ui/SciDepartmentPropertiesStep.java | 17 +- .../ui/SciDepartmentPropertyForm.java | 11 +- .../ui/SciDepartmentSubDepartmentsStep.java | 6 +- .../ui/SciDepartmentSuperDepartmentsStep.java | 6 +- .../ui/SciProjectDepartmentsStep.java | 4 +- .../ui/SciDepartmentInstitutesStep.java | 4 +- .../ui/SciInstituteDepartmentsStep.java | 4 +- .../ui/SciInstituteDescriptionEditForm.java | 6 +- .../ui/SciInstituteDescriptionStep.java | 8 +- .../ui/SciInstituteMembersStep.java | 13 +- .../ui/SciInstituteProjectsStep.java | 4 +- .../ui/SciInstitutePropertiesStep.java | 14 +- .../ui/SciInstitutePropertyForm.java | 5 +- .../ui/SciProjectInstitutesStep.java | 4 +- .../ui/SciProjectDescriptionEditForm.java | 9 +- .../ui/SciProjectDescriptionTextEditForm.java | 6 +- .../ui/SciProjectFundingEditForm.java | 8 +- .../SciProjectInvolvedOrganizationsStep.java | 2 +- .../ui/SciProjectMembersStep.java | 9 +- .../ui/SciProjectPropertiesStep.java | 18 +- .../ui/SciProjectPropertyForm.java | 14 +- .../ui/SciProjectSponsorForm.java | 14 +- .../ui/SciProjectSponsorSheet.java | 16 +- .../ui/SciProjectSponsorStep.java | 2 +- .../ui/SciProjectSubProjectsStep.java | 4 +- .../ui/SciProjectSuperProjectsStep.java | 2 +- .../arsdigita/shortcuts/ui/ShortcutForm.java | 279 +++++++++--------- .../com/arsdigita/subsite/ui/SiteForm.java | 22 +- .../arsdigita/themedirector/ui/ThemeForm.java | 13 - 78 files changed, 603 insertions(+), 546 deletions(-) diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSubordinateOrgaUnitsTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSubordinateOrgaUnitsTable.java index 6993cce9a..88ddc4727 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSubordinateOrgaUnitsTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSubordinateOrgaUnitsTable.java @@ -56,9 +56,8 @@ import org.apache.log4j.Logger; public class GenericOrganizationalUnitSubordinateOrgaUnitsTable extends Table { - private final Logger logger = - Logger.getLogger( - GenericOrganizationalUnitSubordinateOrgaUnitsTable.class); + private final Logger logger = Logger.getLogger( + GenericOrganizationalUnitSubordinateOrgaUnitsTable.class); private final String TABLE_COL_EDIT = "table_col_edit"; private final String TABLE_COL_DEL = "table_col_del"; private final String TABLE_COL_UP = "table_col_up"; @@ -69,7 +68,9 @@ public class GenericOrganizationalUnitSubordinateOrgaUnitsTable public GenericOrganizationalUnitSubordinateOrgaUnitsTable( final ItemSelectionModel itemModel, final GenericOrgaUnitSubordinateOrgaUnitsTableCustomizer customizer) { + super(); + this.itemModel = itemModel; this.customizer = customizer; diff --git a/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsMovieDirectorForm.java b/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsMovieDirectorForm.java index eb95c3793..f6071dedd 100644 --- a/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsMovieDirectorForm.java +++ b/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsMovieDirectorForm.java @@ -50,14 +50,18 @@ public class SciPublicationsMovieDirectorForm extends BasicItemForm implements F @Override public void addWidgets() { + final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil - = new SciPublicationsDramaticArtsGlobalisationUtil(); - add(new Label(globalisationUtil.globalize("publications.dramaticarts.ui.movie.director"))); + = new SciPublicationsDramaticArtsGlobalisationUtil(); + itemSearch = new ItemSearchWidget( ITEM_SEARCH, ContentType.findByAssociatedObjectType( GenericPerson.BASE_DATA_OBJECT_TYPE)); itemSearch.setEditAfterCreate(false); + itemSearch.setLabel(globalisationUtil.globalize( + "publications.dramaticarts.ui.movie.director")); add(itemSearch); + } @Override @@ -89,7 +93,7 @@ public class SciPublicationsMovieDirectorForm extends BasicItemForm implements F //final PageState state = event.getPageState(); final FormData data = event.getFormData(); final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil - = new SciPublicationsDramaticArtsGlobalisationUtil(); + = new SciPublicationsDramaticArtsGlobalisationUtil(); if (data.get(ITEM_SEARCH) == null) { data.addError(globalisationUtil.globalize( diff --git a/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsMovieExtraXMLGenerator.java b/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsMovieExtraXMLGenerator.java index 214e3514e..3633bd9aa 100644 --- a/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsMovieExtraXMLGenerator.java +++ b/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsMovieExtraXMLGenerator.java @@ -62,6 +62,7 @@ public class SciPublicationsMovieExtraXMLGenerator implements ExtraXMLGenerator } } + @Override public void addGlobalStateParams(final Page page) { //nothing } diff --git a/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsMovieProductionCompanyForm.java b/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsMovieProductionCompanyForm.java index 488d70fc1..5af5078c7 100644 --- a/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsMovieProductionCompanyForm.java +++ b/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsMovieProductionCompanyForm.java @@ -55,13 +55,14 @@ public class SciPublicationsMovieProductionCompanyForm @Override public void addWidgets() { final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil - = new SciPublicationsDramaticArtsGlobalisationUtil(); - add(new Label(globalisationUtil.globalize( - "publications.dramaticarts.ui.movie.production_company"))); + = new SciPublicationsDramaticArtsGlobalisationUtil(); + itemSearch = new ItemSearchWidget( ITEM_SEARCH, ContentType.findByAssociatedObjectType( GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE)); itemSearch.setEditAfterCreate(false); + itemSearch.setLabel(globalisationUtil.globalize( + "publications.dramaticarts.ui.movie.production_company")); add(itemSearch); } @@ -81,8 +82,8 @@ public class SciPublicationsMovieProductionCompanyForm .getSelectedObject(state); if (getSaveCancelSection().getSaveButton().isSelected(state)) { - final GenericOrganizationalUnit productionCompany = (GenericOrganizationalUnit) data - .get(ITEM_SEARCH); + final GenericOrganizationalUnit productionCompany + = (GenericOrganizationalUnit) data.get(ITEM_SEARCH); movie.setProductionCompany(productionCompany); itemSearch.publishCreatedItem(data, productionCompany); } @@ -95,7 +96,7 @@ public class SciPublicationsMovieProductionCompanyForm //final PageState state = event.getPageState(); final FormData data = event.getFormData(); final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil - = new SciPublicationsDramaticArtsGlobalisationUtil(); + = new SciPublicationsDramaticArtsGlobalisationUtil(); if (data.get(ITEM_SEARCH) == null) { data.addError(globalisationUtil.globalize( diff --git a/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsMovieProductionCompanyStep.java b/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsMovieProductionCompanyStep.java index 599ffb11f..ad7701f39 100644 --- a/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsMovieProductionCompanyStep.java +++ b/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsMovieProductionCompanyStep.java @@ -54,8 +54,7 @@ public class SciPublicationsMovieProductionCompanyStep extends SimpleEditStep { setProductionCompanyForm.getSaveCancelSection().getCancelButton()); final SciPublicationsMovieProductionCompanySheet sheet - = new SciPublicationsMovieProductionCompanySheet( - itemModel); + = new SciPublicationsMovieProductionCompanySheet(itemModel); setDisplayComponent(sheet); } diff --git a/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsPlayProductionTheaterForm.java b/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsPlayProductionTheaterForm.java index f76a24178..18d1aaa54 100644 --- a/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsPlayProductionTheaterForm.java +++ b/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsPlayProductionTheaterForm.java @@ -55,13 +55,16 @@ public class SciPublicationsPlayProductionTheaterForm @Override public void addWidgets() { final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil - = new SciPublicationsDramaticArtsGlobalisationUtil(); - add(new Label(globalisationUtil.globalize( - "publications.dramaticarts.play.ui.productiontheater"))); + = new SciPublicationsDramaticArtsGlobalisationUtil(); + itemSearch = new ItemSearchWidget( - ITEM_SEARCH, ContentType.findByAssociatedObjectType( - GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE)); + ITEM_SEARCH, + ContentType.findByAssociatedObjectType( + GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE) + ); itemSearch.setEditAfterCreate(false); + itemSearch.setLabel(globalisationUtil.globalize( + "publications.dramaticarts.play.ui.productiontheater")); add(itemSearch); } @@ -95,7 +98,7 @@ public class SciPublicationsPlayProductionTheaterForm //final PageState state = event.getPageState(); final FormData data = event.getFormData(); final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil - = new SciPublicationsDramaticArtsGlobalisationUtil(); + = new SciPublicationsDramaticArtsGlobalisationUtil(); if (data.get(ITEM_SEARCH) == null) { data.addError(globalisationUtil.globalize( diff --git a/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsPlayProductionTheaterStep.java b/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsPlayProductionTheaterStep.java index 8f280567a..5ea98cb86 100644 --- a/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsPlayProductionTheaterStep.java +++ b/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsPlayProductionTheaterStep.java @@ -54,8 +54,7 @@ public class SciPublicationsPlayProductionTheaterStep extends SimpleEditStep { setProductionTheaterForm.getSaveCancelSection().getCancelButton()); final SciPublicationsPlayProductionTheaterSheet sheet - = new SciPublicationsPlayProductionTheaterSheet( - itemModel); + = new SciPublicationsPlayProductionTheaterSheet(itemModel); setDisplayComponent(sheet); } diff --git a/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsPlayPropertyForm.java b/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsPlayPropertyForm.java index 4d6425ce5..aae0cd54e 100644 --- a/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsPlayPropertyForm.java +++ b/ccm-sci-publications-dramaticarts/src/com/arsdigita/cms/contenttypes/ui/SciPublicationsPlayPropertyForm.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.FormSectionEvent; @@ -65,7 +64,7 @@ public class SciPublicationsPlayPropertyForm final TextField firstProdYear = new TextField(firstProdYearParam); firstProdYear.setMaxLength(4); firstProdYear.setLabel(globalisationUtil.globalize("publications.dramaticarts.ui.play.first_production_year")); - add(new Label(globalisationUtil.globalize("publications.dramaticarts.ui.play.first_production_year"))); + // add(new Label(globalisationUtil.globalize("publications.dramaticarts.ui.play.first_production_year"))); add(firstProdYear); } diff --git a/ccm-sci-publications-researchreport/src/com/arsdigita/cms/contenttypes/ui/ResearchReportPropertiesStep.java b/ccm-sci-publications-researchreport/src/com/arsdigita/cms/contenttypes/ui/ResearchReportPropertiesStep.java index b21b36925..9838fb7a8 100644 --- a/ccm-sci-publications-researchreport/src/com/arsdigita/cms/contenttypes/ui/ResearchReportPropertiesStep.java +++ b/ccm-sci-publications-researchreport/src/com/arsdigita/cms/contenttypes/ui/ResearchReportPropertiesStep.java @@ -46,23 +46,26 @@ public class ResearchReportPropertiesStep extends UnPublishedPropertiesStep { } @Override - protected void addBasicProperties(final ItemSelectionModel itemModel, final AuthoringKitWizard parent) { - final SimpleEditStep basicProperties = new SimpleEditStep(itemModel, parent, EDIT_SHEET_NAME); + protected void addBasicProperties(final ItemSelectionModel itemModel, + final AuthoringKitWizard parent) { + final SimpleEditStep basicProperties = new SimpleEditStep(itemModel, + parent, + EDIT_SHEET_NAME); final BasicPageForm editBasicSheet = new ResearchReportPropertyForm(itemModel, this); basicProperties.add( EDIT_SHEET_NAME, - (String) PublicationGlobalizationUtil.globalize("publications.ui.publication.edit_basic_sheet"). - localize(), + PublicationGlobalizationUtil.globalize( + "publications.ui.publication.edit_basic_sheet"), new WorkflowLockedComponentAccess(editBasicSheet, itemModel), editBasicSheet.getSaveCancelSection().getCancelButton()); basicProperties.setDisplayComponent(getResearchReportPropertiesSheet(itemModel)); getSegmentedPanel().addSegment( - new Label((String) PublicationGlobalizationUtil. - globalize("publications.ui.publication.basic_properties").localize()), + new Label(PublicationGlobalizationUtil. + globalize("publications.ui.publication.basic_properties")), basicProperties); } diff --git a/ccm-sci-publications-researchreport/src/com/arsdigita/cms/contenttypes/ui/ResearchReportPropertyForm.java b/ccm-sci-publications-researchreport/src/com/arsdigita/cms/contenttypes/ui/ResearchReportPropertyForm.java index 0d0a44f65..4997ae6c0 100644 --- a/ccm-sci-publications-researchreport/src/com/arsdigita/cms/contenttypes/ui/ResearchReportPropertyForm.java +++ b/ccm-sci-publications-researchreport/src/com/arsdigita/cms/contenttypes/ui/ResearchReportPropertyForm.java @@ -19,10 +19,8 @@ */ package com.arsdigita.cms.contenttypes.ui; -import com.arsdigita.bebop.FormProcessException; 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.cms.ItemSelectionModel; @@ -30,9 +28,10 @@ import com.arsdigita.cms.ItemSelectionModel; * * @author Jens Pelzetter */ -public class ResearchReportPropertyForm extends UnPublishedPropertyForm implements FormInitListener, - FormProcessListener, - FormSubmissionListener{ +public class ResearchReportPropertyForm extends UnPublishedPropertyForm + implements FormInitListener, + FormProcessListener, + FormSubmissionListener{ public static final String ID = "ResearchReportEdit"; @@ -40,7 +39,8 @@ public class ResearchReportPropertyForm extends UnPublishedPropertyForm implemen this(itemModel, null); } - public ResearchReportPropertyForm(final ItemSelectionModel itemModel, ResearchReportPropertiesStep step) { + public ResearchReportPropertyForm(final ItemSelectionModel itemModel, + ResearchReportPropertiesStep step) { super(itemModel, step); addSubmissionListener(this); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/CollectedVolumeArticlesTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/CollectedVolumeArticlesTable.java index 1bbb4a5fa..7031d064c 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/CollectedVolumeArticlesTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/CollectedVolumeArticlesTable.java @@ -165,9 +165,8 @@ public class CollectedVolumeArticlesTable case 0: return m_article.getTitle(); case 1: - return PublicationGlobalizationUtil.globalize( - "publications.ui.collected_volume.article.remove"). - localize(); + return new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.collected_volume.article.remove")); default: return null; } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrdererSheet.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrdererSheet.java index 2a7c15019..182ebf2da 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrdererSheet.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrdererSheet.java @@ -134,18 +134,20 @@ public class ExpertiseOrdererSheet return ret; } + @Override public Object getElementAt(final int columnIndex) { switch (columnIndex) { case 0: return orga.getTitle(); case 1: - return PublicationGlobalizationUtil.globalize( - "publications.ui.expertise.orderer.remove").localize(); + return new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.expertise.orderer.remove")); default: return null; } } + @Override public Object getKeyAt(final int columnIndex) { return orga.getID(); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrganizationSheet.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrganizationSheet.java index 07af929ce..d90aa6f87 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrganizationSheet.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrganizationSheet.java @@ -134,19 +134,20 @@ public class ExpertiseOrganizationSheet return ret; } + @Override public Object getElementAt(final int columnIndex) { switch (columnIndex) { case 0: return orga.getTitle(); case 1: - return PublicationGlobalizationUtil.globalize( - "publications.ui.expertise.organization.remove"). - localize(); + return new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.expertise.organization.remove")); default: return null; } } + @Override public Object getKeyAt(final int columnIndex) { return orga.getID(); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationGenericOrganizationalUnitAddForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationGenericOrganizationalUnitAddForm.java index e3b0c1351..f71476071 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationGenericOrganizationalUnitAddForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationGenericOrganizationalUnitAddForm.java @@ -54,12 +54,15 @@ public class PublicationGenericOrganizationalUnitAddForm @Override public void addWidgets() { - add(new Label(PublicationGlobalizationUtil.globalize("publications.ui.orgaunit.select"))); + itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. findByAssociatedObjectType(GenericOrganizationalUnit.class. getName())); itemSearch.setDisableCreatePane(true); + itemSearch.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.orgaunit.select")); add(itemSearch); + } @Override diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationGenericOrganizationalUnitsTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationGenericOrganizationalUnitsTable.java index b26385665..989ec2cbc 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationGenericOrganizationalUnitsTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationGenericOrganizationalUnitsTable.java @@ -65,13 +65,13 @@ public class PublicationGenericOrganizationalUnitsTable extends Table { final TableColumnModel columnModel = getColumnModel(); columnModel.add(new TableColumn( 0, - PublicationGlobalizationUtil.globalize( - "publications.ui.orgaunits.columns.name").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.orgaunits.columns.name")), TABLE_COL_EDIT)); columnModel.add(new TableColumn( 1, - PublicationGlobalizationUtil.globalize( - "publications.ui.orgaunits.columns.remove").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.orgaunits.columns.remove")), TABLE_COL_DEL)); setModelBuilder(new ModelBuilder(itemModel)); @@ -92,6 +92,7 @@ public class PublicationGenericOrganizationalUnitsTable extends Table { this.itemModel = itemModel; } + @Override public TableModel makeModel(final Table table, final PageState state) { table.getRowSelectionModel().clearSelection(state); @@ -115,10 +116,12 @@ public class PublicationGenericOrganizationalUnitsTable extends Table { orgaunits = publication.getOrganizationalUnits(); } + @Override public int getColumnCount() { return table.getColumnModel().size(); } + @Override public boolean nextRow() { boolean ret; @@ -131,18 +134,20 @@ public class PublicationGenericOrganizationalUnitsTable extends Table { return ret; } + @Override public Object getElementAt(final int columnIndex) { switch (columnIndex) { case 0: return orgaunits.getTitle(); case 1: - return PublicationGlobalizationUtil.globalize( - "publications.ui.orgaunits.remove").localize(); + return new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.orgaunits.remove")); default: return null; } } + @Override public Object getKeyAt(final int columnIndex) { return orgaunits.getID(); } @@ -217,9 +222,8 @@ public class PublicationGenericOrganizationalUnitsTable extends Table { if (canEdit) { final ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) PublicationGlobalizationUtil. - globalize("publications.ui.orgaunits.remove.confirm"). - localize()); + link.setConfirmation(PublicationGlobalizationUtil.globalize( + "publications.ui.orgaunits.remove.confirm")); return link; } else { final Label label = new Label(""); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationPropertyForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationPropertyForm.java index ee3a42fb2..1d4bf0e55 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationPropertyForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationPropertyForm.java @@ -79,32 +79,31 @@ public class PublicationPropertyForm @Override protected void addWidgets() { + super.addWidgets(); - add(new Label(PublicationGlobalizationUtil.globalize( - "publications.ui.publication.year_of_publication"))); final ParameterModel yearOfPublicationParam = new IntegerParameter( Publication.YEAR_OF_PUBLICATION); final TextField yearOfPublication = new TextField(yearOfPublicationParam); yearOfPublication.setMaxLength(4); //yearOfPublication.addValidationListener(new NotNullValidationListener()); //yearOfPublication.addValidationListener(new NotEmptyValidationListener()); + yearOfPublication.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.publication.year_of_publication")); add(yearOfPublication); - add(new Label(PublicationGlobalizationUtil.globalize( - "publications.ui.publication.first_published"))); final ParameterModel firstPublishedParam = new IntegerParameter(Publication.FIRST_PUBLISHED); final TextField firstPublished = new TextField(firstPublishedParam); + firstPublished.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.publication.first_published")); add(firstPublished); - - add(new Label(PublicationGlobalizationUtil.globalize("publications.ui.publication.language"))); final ParameterModel langParam = new StringParameter(Publication.LANG); - //final TextField lang = new TextField(langParam); final SingleSelect lang = new SingleSelect(langParam); final Locale[] locales = Locale.getAvailableLocales(); lang.addOption(new Option("", "")); Arrays.sort(locales, new Comparator() { + @Override public int compare(final Locale locale1, final Locale locale2) { return locale1.getDisplayName().compareTo(locale2.getDisplayName()); } @@ -125,10 +124,10 @@ public class PublicationPropertyForm }); lang.addOption(new Option(locale.toString(), optionLabel)); } + lang.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.publication.language")); add(lang); - add(new Label(PublicationGlobalizationUtil.globalize( - "publications.ui.publication.abstract"))); ParameterModel abstractParam = new StringParameter(Publication.ABSTRACT); TextArea abstractArea; if (config.getEnableAbstractHTML()) { @@ -138,10 +137,10 @@ public class PublicationPropertyForm } abstractArea.setCols(60); abstractArea.setRows(18); + abstractArea.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.publication.abstract")); add(abstractArea); - add(new Label(PublicationGlobalizationUtil.globalize( - "publications.ui.publication.misc"))); ParameterModel miscParam = new StringParameter(Publication.MISC); TextArea misc; if (config.getEnableMiscHTML()) { @@ -149,6 +148,8 @@ public class PublicationPropertyForm } else { misc = new TextArea(miscParam); } + misc.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.publication.misc")); misc.setCols(60); misc.setRows(18); add(misc); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesAddForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesAddForm.java index e33b64fc4..b22df4130 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesAddForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesAddForm.java @@ -29,7 +29,6 @@ import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.Folder; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contenttypes.Publication; import com.arsdigita.cms.contenttypes.PublicationsConfig; @@ -72,19 +71,20 @@ public class PublicationSeriesAddForm @Override protected void addWidgets() { - add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.series.select_series").localize())); + m_itemSearch = new ItemSearchWidget( ITEM_SEARCH, ContentType.findByAssociatedObjectType(Series.class.getName())); m_itemSearch.setDefaultCreationFolder(config.getDefaultSeriesFolder()); + m_itemSearch.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.series.select_series")); add(m_itemSearch); - add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.series.volume_of_series").localize())); ParameterModel volumeOfSeriesParam = new StringParameter( VolumeInSeriesCollection.VOLUME_OF_SERIES); volumeOfSeries = new TextField(volumeOfSeriesParam); + volumeOfSeries.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.series.volume_of_series")); add(volumeOfSeries); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesPropertyStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesPropertyStep.java index 580b311cb..19bddc4e0 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesPropertyStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesPropertyStep.java @@ -44,8 +44,8 @@ public class PublicationSeriesPropertyStep extends SimpleEditStep { BasicItemForm addSeriesSheet = new PublicationSeriesAddForm(itemModel); add(ADD_SERIES_SHEET_NAME, - (String) PublicationGlobalizationUtil.globalize( - "publications.ui.series.add_series").localize(), + PublicationGlobalizationUtil.globalize( + "publications.ui.series.add_series"), new WorkflowLockedComponentAccess(addSeriesSheet, itemModel), addSeriesSheet.getSaveCancelSection().getCancelButton()); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesTable.java index 29e4c90b6..4c306630d 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesTable.java @@ -31,7 +31,6 @@ import com.arsdigita.bebop.table.TableColumn; import com.arsdigita.bebop.table.TableColumnModel; import com.arsdigita.bebop.table.TableModel; import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.SecurityManager; @@ -43,7 +42,7 @@ import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.dispatcher.ObjectNotFoundException; import com.arsdigita.util.LockableImpl; import java.math.BigDecimal; -import java.util.Iterator; + import org.apache.log4j.Logger; /** @@ -69,15 +68,18 @@ public class PublicationSeriesTable final TableColumnModel colModel = getColumnModel(); colModel.add(new TableColumn( 0, - PublicationGlobalizationUtil.globalize("publications.ui.series.title").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.series.title")), TABLE_COL_EDIT)); colModel.add(new TableColumn( 1, - PublicationGlobalizationUtil.globalize("publications.ui.series.number").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.series.number")), TABLE_COL_NUMBER)); colModel.add(new TableColumn( 2, - PublicationGlobalizationUtil.globalize("publications.ui.series.remove").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.series.remove")), TABLE_COL_DEL)); setModelBuilder( @@ -153,8 +155,8 @@ public class PublicationSeriesTable case 1: return m_series.getTitle(); case 2: - return PublicationGlobalizationUtil.globalize( - "publications.ui.series.remove").localize(); + return new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.series.remove")); default: return null; } @@ -256,7 +258,7 @@ public class PublicationSeriesTable seriesCol.close(); if (volumeOfSeries == null) { - return new Label(""); + return new Label(); } else { return new Label(volumeOfSeries); } @@ -288,10 +290,8 @@ public class PublicationSeriesTable if (canDelete) { ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) PublicationGlobalizationUtil. - globalize( - "publications.ui.series.confirm_remove"). - localize()); + link.setConfirmation(PublicationGlobalizationUtil.globalize( + "publications.ui.series.confirm_remove")); return link; } else { Label label = new Label(value.toString()); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherPropertiesStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherPropertiesStep.java index be06396c8..fd595559c 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherPropertiesStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherPropertiesStep.java @@ -80,22 +80,21 @@ public class PublicationWithPublisherPropertiesStep BasicPageForm editBasicSheet = new PublicationWithPublisherPropertyForm(itemModel, this); - basicProperties.add(EDIT_SHEET_NAME, - (String) PublicationGlobalizationUtil.globalize( - "publications.ui.publication.edit_basic_sheet"). - localize(), new WorkflowLockedComponentAccess(editBasicSheet, - itemModel), - editBasicSheet.getSaveCancelSection(). - getCancelButton()); + basicProperties.add( + EDIT_SHEET_NAME, + PublicationGlobalizationUtil.globalize( + "publications.ui.publication.edit_basic_sheet"), + new WorkflowLockedComponentAccess(editBasicSheet,itemModel), + editBasicSheet.getSaveCancelSection().getCancelButton()); basicProperties.setDisplayComponent( getPublicationWithPublisherPropertySheet( itemModel)); getSegmentedPanel().addSegment( - new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.publication.basic_properties"). - localize()), basicProperties); + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.publication.basic_properties")), + basicProperties); } @Override @@ -104,6 +103,7 @@ public class PublicationWithPublisherPropertiesStep super.addSteps(itemModel, parent); addStep(new PublicationWithPublisherSetPublisherStep(itemModel, parent), - "publications.ui.with_publisher.publisher"); + PublicationGlobalizationUtil.globalize( + "publications.ui.with_publisher.publisher")); } } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherPropertyForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherPropertyForm.java index 6d865b464..88c67b2fb 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherPropertyForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherPropertyForm.java @@ -69,10 +69,9 @@ public class PublicationWithPublisherPropertyForm @Override protected void addWidgets() { + super.addWidgets(); - add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.with_publisher.isbn").localize())); ParameterModel isbnParam = new StringParameter( PublicationWithPublisher.ISBN); TextField isbn = new TextField(isbnParam); @@ -105,38 +104,36 @@ public class PublicationWithPublisherPropertyForm } } }); + isbn.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.with_publisher.isbn")); add(isbn); - add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.collected_volume.volume").localize())); ParameterModel volumeParam = new IntegerParameter( PublicationWithPublisher.VOLUME); TextField volume = new TextField(volumeParam); + volume.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.collected_volume.volume")); add(volume); - add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.collected_volume.number_of_volumes"). - localize())); - ParameterModel numberOfVolumesParam = - new IntegerParameter( - PublicationWithPublisher.NUMBER_OF_VOLUMES); + ParameterModel numberOfVolumesParam = new IntegerParameter( + PublicationWithPublisher.NUMBER_OF_VOLUMES); TextField numberOfVolumes = new TextField(numberOfVolumesParam); + numberOfVolumes.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.collected_volume.number_of_volumes")); add(numberOfVolumes); - add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.collected_volume.number_of_pages"). - localize())); ParameterModel numberOfPagesParam = new IntegerParameter( PublicationWithPublisher.NUMBER_OF_PAGES); TextField numberOfPages = new TextField(numberOfPagesParam); + numberOfPages.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.collected_volume.number_of_pages")); add(numberOfPages); - add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.collected_volume.edition"). - localize())); ParameterModel editionModel = new StringParameter( PublicationWithPublisher.EDITION); TextField edition = new TextField(editionModel); + edition.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.collected_volume.edition")); add(edition); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherForm.java index 36cb51256..cdee31395 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherForm.java @@ -26,7 +26,6 @@ import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.Folder; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contenttypes.PublicationWithPublisher; import com.arsdigita.cms.contenttypes.PublicationsConfig; @@ -34,7 +33,7 @@ import com.arsdigita.cms.contenttypes.Publisher; import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.authoring.BasicItemForm; import com.arsdigita.kernel.Kernel; -import java.math.BigDecimal; + /** * @@ -61,13 +60,14 @@ public class PublicationWithPublisherSetPublisherForm @Override public void addWidgets() { - add(new Label(PublicationGlobalizationUtil.globalize( - "publications.ui.with_publisher.publisher"))); - itemSearch = - new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType(Publisher.class. - getName())); + + itemSearch = new ItemSearchWidget(ITEM_SEARCH, + ContentType.findByAssociatedObjectType( + Publisher.class.getName())); itemSearch.setDefaultCreationFolder(config.getDefaultPublisherFolder()); itemSearch.setEditAfterCreate(false); + itemSearch.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.with_publisher.publisher")); add(itemSearch); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherSheet.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherSheet.java index fab146f41..6ea68ad22 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherSheet.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherSheet.java @@ -64,13 +64,13 @@ public class PublicationWithPublisherSetPublisherSheet TableColumnModel columnModel = getColumnModel(); columnModel.add(new TableColumn( 0, - PublicationGlobalizationUtil.globalize( - "publications.ui.with_publisher.publisher").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.with_publisher.publisher")), TABLE_COL_EDIT)); columnModel.add(new TableColumn( 1, - PublicationGlobalizationUtil.globalize( - "publications.ui.with_publisher.publisher.remove").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.with_publisher.publisher.remove")), TABLE_COL_DEL)); setModelBuilder(new PublicationWithPublisherSetPublisherSheetModelBuilder( @@ -107,8 +107,8 @@ public class PublicationWithPublisherSetPublisherSheet private class PublicationWithPublisherSetPublisherSheetModel implements TableModel { - private Table table; - private Publisher publisher; + private final Table table; + private final Publisher publisher; private boolean m_done; public PublicationWithPublisherSetPublisherSheetModel(final Table table, @@ -123,10 +123,12 @@ public class PublicationWithPublisherSetPublisherSheet } } + @Override public int getColumnCount() { return table.getColumnModel().size(); } + @Override public boolean nextRow() { boolean ret; @@ -140,19 +142,20 @@ public class PublicationWithPublisherSetPublisherSheet return ret; } + @Override public Object getElementAt(final int columnIndex) { switch (columnIndex) { case 0: return publisher.getTitle(); case 1: - return PublicationGlobalizationUtil.globalize( - "publications.ui.with_publisher.publisher.remove"). - localize(); + return new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.with_publisher.publisher.remove")); default: return null; } } + @Override public Object getKeyAt(final int columnIndex) { return publisher.getID(); } @@ -239,10 +242,8 @@ public class PublicationWithPublisherSetPublisherSheet if (canEdit) { ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) PublicationGlobalizationUtil. - globalize( - "publications.ui.with_publisher.publisher.remove.confirm"). - localize()); + link.setConfirmation(PublicationGlobalizationUtil.globalize( + "publications.ui.with_publisher.publisher.remove.confirm")); return link; } else { Label label = new Label(value.toString()); @@ -251,6 +252,7 @@ public class PublicationWithPublisherSetPublisherSheet } } + @Override public void cellSelected(final TableActionEvent event) { PageState state = event.getPageState(); @@ -267,6 +269,7 @@ public class PublicationWithPublisherSetPublisherSheet } + @Override public void headSelected(final TableActionEvent event) { //Nothing to do } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherStep.java index 5b1c6ea81..1b20d25de 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherStep.java @@ -46,8 +46,8 @@ public class PublicationWithPublisherSetPublisherStep extends SimpleEditStep { BasicItemForm setPublisherForm = new PublicationWithPublisherSetPublisherForm( itemModel); add(SET_PUBLICATION_PUBLISHER_STEP, - (String) PublicationGlobalizationUtil.globalize( - "publications.ui.with_publisher.setPublisher").localize(), + PublicationGlobalizationUtil.globalize( + "publications.ui.with_publisher.setPublisher"), new WorkflowLockedComponentAccess(setPublisherForm, itemModel), setPublisherForm.getSaveCancelSection().getCancelButton()); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherCreate.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherCreate.java index 02e4e4ad4..8252d1459 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherCreate.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherCreate.java @@ -58,6 +58,7 @@ public class PublisherCreate extends PageCreate { @Override protected void addWidgets() { + ContentType type = getItemSelectionModel().getContentType(); m_workflowSection = new ApplyWorkflowFormSection(type); add(m_workflowSection, ColumnPanel.INSERT); @@ -70,8 +71,6 @@ public class PublisherCreate extends PageCreate { PublisherPropertyForm.addMandatoryFieldWidgets(this); if (!ContentSection.getConfig().getHideLaunchDate()) { - add(new Label(GlobalizationUtil.globalize( - "cms.ui.authoring.page_launch_date"))); ParameterModel launchDateParam = new DateParameter(LAUNCH_DATE); com.arsdigita.bebop.form.Date launchDate = new com.arsdigita.bebop.form.Date( @@ -82,13 +81,16 @@ public class PublisherCreate extends PageCreate { // if launch date is required, help user by suggesting today's date launchDateParam.setDefaultValue(new Date()); } + launchDate.setLabel(GlobalizationUtil.globalize( + "cms.ui.authoring.page_launch_date")); add(launchDate); } } @Override public void validate(FormSectionEvent fse) throws FormProcessException { - //We don't call super.validate(fse); here because the name (URL fragment) of a publisher is generated in a different manner + //We don't call super.validate(fse); here because the name + //(URL fragment) of a publisher is generated in a different manner //than the name (URL fragment) of other content items. Folder folder = m_parent.getFolder(fse.getPageState()); Assert.exists(folder); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPropertiesStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPropertiesStep.java index 2ca270201..7c809f510 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPropertiesStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPropertiesStep.java @@ -43,8 +43,8 @@ public class PublisherPropertiesStep public static Component getPublisherPropertySheet( ItemSelectionModel itemModel) { - DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) getGenericOrganizationalUnitPropertySheet( - itemModel); + DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) + getGenericOrganizationalUnitPropertySheet(itemModel); sheet.add(PublicationGlobalizationUtil.globalize( "publications.ui.publisher.name"), @@ -65,20 +65,19 @@ public class PublisherPropertiesStep EDIT_SHEET_NAME); BasicPageForm editBasicSheet = new PublisherPropertyForm(itemModel, this); - basicProperties.add(EDIT_SHEET_NAME, - (String) PublicationGlobalizationUtil.globalize( - "publications.ui.publisher.edit_basic_properties").localize(), - new WorkflowLockedComponentAccess(editBasicSheet, - itemModel), - editBasicSheet.getSaveCancelSection(). - getCancelButton()); + basicProperties.add( + EDIT_SHEET_NAME, + PublicationGlobalizationUtil.globalize( + "publications.ui.publisher.edit_basic_properties"), + new WorkflowLockedComponentAccess(editBasicSheet,itemModel), + editBasicSheet.getSaveCancelSection().getCancelButton()); basicProperties.setDisplayComponent( getPublisherPropertySheet(itemModel)); getSegmentedPanel().addSegment( - new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.publisher.basic_properties").localize()), + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.publisher.basic_properties")), basicProperties); } } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPropertyForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPropertyForm.java index c5816aacc..4b7ceab9e 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPropertyForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPropertyForm.java @@ -69,19 +69,21 @@ public class PublisherPropertyForm } public static void addMandatoryFieldWidgets(FormSection form) { - form.add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.publisher.name").localize())); + ParameterModel nameParam = new StringParameter(PUBLISHER_NAME); TextField name = new TextField(nameParam); + name.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.publisher.name")); name.addValidationListener(new NotNullValidationListener()); name.addValidationListener(new NotEmptyValidationListener()); form.add(name); - form.add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.publisher.place").localize())); ParameterModel placeParam = new StringParameter(PLACE); TextField place = new TextField(placeParam); + place.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.publisher.place")); form.add(place); + } @Override diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPublicationsStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPublicationsStep.java index 4dde539e8..75ee047a6 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPublicationsStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPublicationsStep.java @@ -29,7 +29,8 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep; */ public class PublisherPublicationsStep extends SimpleEditStep { - public PublisherPublicationsStep(final ItemSelectionModel itemModel, final AuthoringKitWizard parent) { + public PublisherPublicationsStep(final ItemSelectionModel itemModel, + final AuthoringKitWizard parent) { this(itemModel, parent, null); } @@ -38,7 +39,8 @@ public class PublisherPublicationsStep extends SimpleEditStep { final String prefix) { super(itemModel, parent, prefix); - final PublisherPublicationsTable publicationsTable = new PublisherPublicationsTable(itemModel); + final PublisherPublicationsTable publicationsTable = + new PublisherPublicationsTable(itemModel); setDisplayComponent(publicationsTable); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPublicationsTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPublicationsTable.java index 882fdd581..d54f29173 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPublicationsTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPublicationsTable.java @@ -56,20 +56,24 @@ public class PublisherPublicationsTable extends Table { this.itemModel = itemModel; - setEmptyView(new Label(PublicationGlobalizationUtil.globalize("publisher.ui.publications.none"))); + setEmptyView(new Label(PublicationGlobalizationUtil.globalize( + "publisher.ui.publications.none"))); final TableColumnModel columnModel = getColumnModel(); columnModel.add(new TableColumn( 0, - PublicationGlobalizationUtil.globalize("publisher.ui.publications.name").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publisher.ui.publications.name")), TABLE_COL_EDIT)); columnModel.add(new TableColumn( 1, - PublicationGlobalizationUtil.globalize("publisher.ui.publications.columns.year").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publisher.ui.publications.columns.year")), TABLE_COL_YEAR)); columnModel.add(new TableColumn( 2, - PublicationGlobalizationUtil.globalize("publisher.ui.publications.columns.type").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publisher.ui.publications.columns.type")), TABLE_COL_TYPE)); setModelBuilder(new ModelBuilder(itemModel)); @@ -85,6 +89,7 @@ public class PublisherPublicationsTable extends Table { this.itemModel = itemModel; } + @Override public TableModel makeModel(final Table table, final PageState state) { table.getRowSelectionModel().clearSelection(state); @@ -97,8 +102,8 @@ public class PublisherPublicationsTable extends Table { private class Model implements TableModel { - private Table table; - private PublicationBundleCollection publications; + private final Table table; + private final PublicationBundleCollection publications; public Model(final Table table, final PageState state, final Publisher publisher) { this.table = table; @@ -110,6 +115,7 @@ public class PublisherPublicationsTable extends Table { return table.getColumnModel().size(); } + @Override public boolean nextRow() { boolean ret; @@ -145,6 +151,7 @@ public class PublisherPublicationsTable extends Table { private class EditCellRenderer extends LockableImpl implements TableCellRenderer { + @Override public Component getComponent(final Table table, final PageState state, final Object value, diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ReviewPropertiesStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ReviewPropertiesStep.java index 546988132..a9ce61bef 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ReviewPropertiesStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ReviewPropertiesStep.java @@ -98,21 +98,20 @@ public class ReviewPropertiesStep extends ArticleInJournalPropertiesStep { BasicPageForm editBasicSheet = new ReviewPropertyForm(itemModel, this); - basicProperties.add(EDIT_SHEET_NAME, - (String) PublicationGlobalizationUtil.globalize( - "publications.ui.review.edit_basic_sheet"). - localize(), new WorkflowLockedComponentAccess(editBasicSheet, - itemModel), - editBasicSheet.getSaveCancelSection(). - getCancelButton()); + basicProperties.add( + EDIT_SHEET_NAME, + PublicationGlobalizationUtil.globalize( + "publications.ui.review.edit_basic_sheet"), + new WorkflowLockedComponentAccess(editBasicSheet,itemModel), + editBasicSheet.getSaveCancelSection().getCancelButton()); basicProperties.setDisplayComponent( getReviewPropertySheet(itemModel)); getSegmentedPanel().addSegment( - new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.publication.basic_properties"). - localize()), basicProperties); + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.publication.basic_properties")), + basicProperties); } } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SciAuthorPropertiesStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SciAuthorPropertiesStep.java index f07ee6e84..8ef1b9d9c 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SciAuthorPropertiesStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SciAuthorPropertiesStep.java @@ -43,8 +43,8 @@ public class SciAuthorPropertiesStep extends SimpleEditStep { BasicPageForm editSheet; editSheet = new SciAuthorPropertyForm(itemModel, this); add(EDIT_SHEET_NAME, - (String) PublicationGlobalizationUtil.globalize( - "sciauthor.ui.edit_basic_properties").localize(), + PublicationGlobalizationUtil.globalize( + "sciauthor.ui.edit_basic_properties"), new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.getSaveCancelSection().getCancelButton()); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipAddForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipAddForm.java index 8fea45e1d..d896c50fc 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipAddForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipAddForm.java @@ -80,17 +80,18 @@ public class SeriesEditshipAddForm @Override protected void addWidgets() { - add(new Label(PublicationGlobalizationUtil.globalize( - "publications.ui.series.editship.selectEditors"))); + m_itemSearch = new ItemSearchWidget( ITEM_SEARCH, ContentType.findByAssociatedObjectType(GenericPerson.class. getName())); m_itemSearch.setDefaultCreationFolder(config.getDefaultAuthorsFolder()); m_itemSearch.setEditAfterCreate(false); + m_itemSearch.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.series.editship.selectEditors")); add(m_itemSearch); - selectedEditorLabel = new Label(""); + selectedEditorLabel = new Label(); add(selectedEditorLabel); final ParameterModel fromSkipMonthParam = @@ -105,8 +106,6 @@ public class SeriesEditshipAddForm Hidden fromSkipDay = new Hidden(fromSkipDayParam); add(fromSkipDay); - add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.series.editship.from").localize())); IncompleteDateParameter fromParam = new IncompleteDateParameter( EditshipCollection.FROM); @@ -116,6 +115,8 @@ public class SeriesEditshipAddForm fromParam); Calendar today = new GregorianCalendar(); from.setYearRange(1900, today.get(Calendar.YEAR)); + from.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.series.editship.from")); add(from); final ParameterModel toSkipMonthParam = @@ -129,8 +130,6 @@ public class SeriesEditshipAddForm Hidden toSkipDay = new Hidden(toSkipDayParam); add(toSkipDay); - add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.series.editship.to").localize())); IncompleteDateParameter toParam = new IncompleteDateParameter( EditshipCollection.TO); @@ -139,6 +138,8 @@ public class SeriesEditshipAddForm com.arsdigita.bebop.form.Date to = new com.arsdigita.bebop.form.Date( toParam); to.setYearRange(1900, today.get(Calendar.YEAR)); + to.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.series.editship.to")); add(to); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipStep.java index 8840f516f..e02557abc 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipStep.java @@ -51,8 +51,8 @@ public class SeriesEditshipStep extends SimpleEditStep { BasicItemForm addEditorSheet = new SeriesEditshipAddForm(itemModel, this); add(ADD_EDITOR_SHEET_NAME, - (String) PublicationGlobalizationUtil.globalize( - "publications.ui.series.add_editship").localize(), + PublicationGlobalizationUtil.globalize( + "publications.ui.series.add_editship"), new WorkflowLockedComponentAccess(addEditorSheet, itemModel), addEditorSheet.getSaveCancelSection().getCancelButton()); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipTable.java index 1b1795a33..9c80a95a4 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipTable.java @@ -77,26 +77,26 @@ public class SeriesEditshipTable extends Table implements TableActionListener { TableColumnModel colModel = getColumnModel(); colModel.add(new TableColumn( 0, - PublicationGlobalizationUtil.globalize( - "publications.ui.series.editship.name").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.series.editship.name")), TABLE_COL_EDIT)); colModel.add(new TableColumn( 1, - PublicationGlobalizationUtil.globalize( - "publications.ui.series.editship.from").localize())); + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.series.editship.from")))); colModel.add(new TableColumn( 2, - PublicationGlobalizationUtil.globalize( - "publications.ui.series.editship.to").localize())); + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.series.editship.to")))); colModel.add(new TableColumn( 3, - PublicationGlobalizationUtil.globalize( - "publications.ui.series.editship.edit").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.series.editship.edit")), TABLE_COL_EDIT_EDITSHIP)); colModel.add(new TableColumn( 4, - PublicationGlobalizationUtil.globalize( - "publications.ui.series.editship.remove").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.series.editship.remove")), TABLE_COL_DEL)); /* Just in the case someone want's to sort editships manually..." */ /* colModel.add(new TableColumn( @@ -198,12 +198,11 @@ public class SeriesEditshipTable extends Table implements TableActionListener { m_editshipCollection.getTo()); } case 3: - return PublicationGlobalizationUtil.globalize( - "publications.ui.series.editship.edit").localize(); + return new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.series.editship.edit")); case 4: - return PublicationGlobalizationUtil.globalize( - "publications.ui.series.editship.remove"). - localize(); + return new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.series.editship.remove")); default: return null; } @@ -331,10 +330,8 @@ public class SeriesEditshipTable extends Table implements TableActionListener { if (canDelete) { ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) PublicationGlobalizationUtil. - globalize( - "publications.ui.series.editship.remove.confirm"). - localize()); + link.setConfirmation(PublicationGlobalizationUtil.globalize( + "publications.ui.series.editship.remove.confirm")); return link; } else { Label label = new Label(value.toString()); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesPropertiesStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesPropertiesStep.java index 6f6b2661f..500d8b451 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesPropertiesStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesPropertiesStep.java @@ -108,16 +108,15 @@ public class SeriesPropertiesStep extends SimpleEditStep { basicProperties.add( EDIT_SHEET_NAME, - (String) PublicationGlobalizationUtil.globalize( - "publications.ui.series.edit_basic_sheet").localize(), - new WorkflowLockedComponentAccess(editBasicSheet, - itemModel), + PublicationGlobalizationUtil.globalize( + "publications.ui.series.edit_basic_sheet"), + new WorkflowLockedComponentAccess(editBasicSheet,itemModel), editBasicSheet.getSaveCancelSection().getCancelButton()); basicProperties.setDisplayComponent(getSeriesPropertySheet(itemModel)); - segmentedPanel.addSegment(new Label((String) PublicationGlobalizationUtil. - globalize("publications.ui.series.basic_properties").localize()), + segmentedPanel.addSegment(new Label(PublicationGlobalizationUtil. + globalize("publications.ui.series.basic_properties")), basicProperties); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesPropertyForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesPropertyForm.java index bb7c64c69..b79cda761 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesPropertyForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesPropertyForm.java @@ -64,10 +64,10 @@ public class SeriesPropertyForm protected void addWidgets() { super.addWidgets(); - add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.series.abstract").localize())); ParameterModel abstractParam = new StringParameter(Series.ABSTRACT); TextArea abstractArea = new TextArea(abstractParam); + abstractArea.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.series.abstract")); abstractArea.setCols(60); abstractArea.setRows(18); add(abstractArea); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesVolumeAddForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesVolumeAddForm.java index 6d44bcc2a..a94edf1b2 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesVolumeAddForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesVolumeAddForm.java @@ -62,16 +62,17 @@ public class SeriesVolumeAddForm extends BasicItemForm { @Override protected void addWidgets() { - add(new Label(PublicationGlobalizationUtil.globalize( - "publications.ui.series.volumes.select_publication"))); + itemSearch = new ItemSearchWidget( ITEM_SEARCH, ContentType.findByAssociatedObjectType( Publication.class.getName())); itemSearch.setDisableCreatePane(true); + itemSearch.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.series.volumes.select_publication")); add(itemSearch); - selectedVolumeLabel = new Label(""); + selectedVolumeLabel = new Label(); selectedVolumeLabel.addPrintListener(new PrintListener() { @Override @@ -84,9 +85,10 @@ public class SeriesVolumeAddForm extends BasicItemForm { }); add(selectedVolumeLabel); - add(new Label(PublicationGlobalizationUtil.globalize("publications.ui.series.volume_of_series"))); ParameterModel volumeOfSeriesParam = new StringParameter(VolumeInSeriesCollection.VOLUME_OF_SERIES); volumeOfSeries = new TextField(volumeOfSeriesParam); + volumeOfSeries.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.series.volume_of_series")); add(volumeOfSeries); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesVolumesTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesVolumesTable.java index 52fd164dc..5b222d0f6 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesVolumesTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesVolumesTable.java @@ -72,22 +72,22 @@ public class SeriesVolumesTable extends Table { final TableColumnModel colModel = getColumnModel(); colModel.add(new TableColumn( 0, - PublicationGlobalizationUtil.globalize( - "publications.ui.series.volumes.name").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.series.volumes.name")), TABLE_COL_EDIT)); colModel.add(new TableColumn( 1, - PublicationGlobalizationUtil.globalize( - "publications.ui.series.volumes.volume_of_series").localize())); + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.series.volumes.volume_of_series")))); colModel.add(new TableColumn( 2, - PublicationGlobalizationUtil.globalize( - "publications.ui.series.volumes.edit_assoc").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.series.volumes.edit_assoc")), TABLE_COL_EDIT_ASSOC)); colModel.add(new TableColumn( 3, - PublicationGlobalizationUtil.globalize( - "publications.ui.series.volumes.remove").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.series.volumes.remove")), TABLE_COL_DEL)); setModelBuilder(new SeriesVolumesTableModelBuilder(itemModel)); @@ -154,11 +154,11 @@ public class SeriesVolumesTable extends Table { case 1: return volumesCollection.getVolumeOfSeries(); case 2: - return PublicationGlobalizationUtil.globalize( - "publications.ui.series.volumes.edit_assoc").localize(); + return new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.series.volumes.edit_assoc")); case 3: - return PublicationGlobalizationUtil.globalize( - "publication.ui.series.volumes.remove").localize(); + return new Label(PublicationGlobalizationUtil.globalize( + "publication.ui.series.volumes.remove")); default: return null; } @@ -285,10 +285,8 @@ public class SeriesVolumesTable extends Table { if (canDelete) { final ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) PublicationGlobalizationUtil. - globalize( - "publications.ui.series.volumes.remove.confirm"). - localize()); + link.setConfirmation(PublicationGlobalizationUtil.globalize( + "publications.ui.series.volumes.remove.confirm")); return link; } else { final Label label = new Label(value.toString()); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationForm.java index 04baf27a4..849196993 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationForm.java @@ -26,7 +26,6 @@ import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.Folder; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; import com.arsdigita.cms.contenttypes.PublicationsConfig; @@ -34,7 +33,7 @@ import com.arsdigita.cms.contenttypes.UnPublished; import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.authoring.BasicItemForm; import com.arsdigita.kernel.Kernel; -import java.math.BigDecimal; + /** * @@ -60,14 +59,16 @@ public class UnPublishedOrganizationForm @Override public void addWidgets() { - add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.unpublished.organization").localize())); + itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType( GenericOrganizationalUnit.class.getName())); itemSearch.setDefaultCreationFolder(config.getDefaultOrganizationsFolder()); itemSearch.setEditAfterCreate(false); + itemSearch.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.unpublished.organization")); add(itemSearch); + } @Override diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationSheet.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationSheet.java index ce284ccdc..0e053b56c 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationSheet.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationSheet.java @@ -64,13 +64,13 @@ public class UnPublishedOrganizationSheet TableColumnModel columnModel = getColumnModel(); columnModel.add(new TableColumn( 0, - PublicationGlobalizationUtil.globalize( - "publications.ui.unpublished.organization").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.unpublished.organization")), TABLE_COL_EDIT)); columnModel.add(new TableColumn( 1, - PublicationGlobalizationUtil.globalize( - "publications.ui.unpublished.organization.remove").localize(), + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.unpublished.organization.remove")), TABLE_COL_DELETE)); setModelBuilder(new UnPublishedOrganizationSheetModelBuilder(itemModel)); @@ -141,14 +141,14 @@ public class UnPublishedOrganizationSheet case 0: return orga.getTitle(); case 1: - return PublicationGlobalizationUtil.globalize( - "publications.ui.unpublished.organization.remove"). - localize(); + return new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.unpublished.organization.remove")); default: return null; } } + @Override public Object getKeyAt(int columnIndex) { return orga.getID(); } @@ -235,10 +235,8 @@ public class UnPublishedOrganizationSheet if (canEdit) { ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) PublicationGlobalizationUtil. - globalize( - "publications.ui.unpublished.organization.confirm_remove"). - localize()); + link.setConfirmation(PublicationGlobalizationUtil.globalize( + "publications.ui.unpublished.organization.confirm_remove")); return link; } else { Label label = new Label(value.toString()); @@ -247,6 +245,7 @@ public class UnPublishedOrganizationSheet } } + @Override public void cellSelected(final TableActionEvent event) { PageState state = event.getPageState(); @@ -260,6 +259,7 @@ public class UnPublishedOrganizationSheet } } + @Override public void headSelected(final TableActionEvent event) { //Nothing to do } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationStep.java index 7d461e5ac..b31954fba 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationStep.java @@ -45,8 +45,8 @@ public class UnPublishedOrganizationStep extends SimpleEditStep { BasicItemForm setOrgaForm = new UnPublishedOrganizationForm(itemModel); add(SET_UNPUBLISHED_ORGANIZATION_STEP, - (String) PublicationGlobalizationUtil.globalize( - "publications.ui.unpublished.setOrganization").localize(), + PublicationGlobalizationUtil.globalize( + "publications.ui.unpublished.setOrganization"), new WorkflowLockedComponentAccess(setOrgaForm, itemModel), setOrgaForm.getSaveCancelSection().getCancelButton()); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedPropertiesStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedPropertiesStep.java index 14d28c1e2..6b37c10f8 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedPropertiesStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedPropertiesStep.java @@ -71,21 +71,20 @@ public class UnPublishedPropertiesStep extends PublicationPropertiesStep { BasicPageForm editBasicSheet = new UnPublishedPropertyForm(itemModel, this); - basicProperties.add(EDIT_SHEET_NAME, - (String) PublicationGlobalizationUtil.globalize( - "publications.ui.unpublished.edit_basic_sheet"). - localize(), new WorkflowLockedComponentAccess(editBasicSheet, - itemModel), - editBasicSheet.getSaveCancelSection(). - getCancelButton()); + basicProperties.add( + EDIT_SHEET_NAME, + PublicationGlobalizationUtil.globalize( + "publications.ui.unpublished.edit_basic_sheet"), + new WorkflowLockedComponentAccess(editBasicSheet,itemModel), + editBasicSheet.getSaveCancelSection().getCancelButton()); basicProperties.setDisplayComponent( getUnPublishedPropertySheet(itemModel)); getSegmentedPanel().addSegment( - new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.publication.basic_properties"). - localize()), basicProperties); + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.publication.basic_properties")), + basicProperties); } @Override @@ -93,8 +92,8 @@ public class UnPublishedPropertiesStep extends PublicationPropertiesStep { AuthoringKitWizard parent) { super.addSteps(itemModel, parent); - addStep(new UnPublishedOrganizationStep(itemModel, - parent), - "publications.ui.unpublished.organization"); + addStep(new UnPublishedOrganizationStep(itemModel,parent), + PublicationGlobalizationUtil.globalize( + "publications.ui.unpublished.organization")); } } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedPropertyForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedPropertyForm.java index 2f0b46df1..2694c5132 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedPropertyForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedPropertyForm.java @@ -62,28 +62,30 @@ public class UnPublishedPropertyForm @Override protected void addWidgets() { + super.addWidgets(); - add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.unpublished.place").localize())); ParameterModel placeParam = new StringParameter(InternetArticle.PLACE); TextField place = new TextField(placeParam); + place.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.unpublished.place")); add(place); - add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.unpublished.number").localize())); ParameterModel numberParam = new StringParameter(UnPublished.NUMBER); TextField number = new TextField(numberParam); + number.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.unpublished.number")); add(number); - add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.unpublished.number_of_pages").localize())); ParameterModel numberOfPagesParam = new IntegerParameter(UnPublished.NUMBER_OF_PAGES); TextField numberOfPages = new TextField(numberOfPagesParam); + numberOfPages.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.unpublished.number_of_pages")); add(numberOfPages); + } @Override diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/WorkingPaperPropertiesStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/WorkingPaperPropertiesStep.java index 448a40660..cd9d37191 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/WorkingPaperPropertiesStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/WorkingPaperPropertiesStep.java @@ -66,21 +66,20 @@ public class WorkingPaperPropertiesStep extends UnPublishedPropertiesStep { BasicPageForm editBasicSheet = new WorkingPaperPropertyForm(itemModel, this); - basicProperties.add(EDIT_SHEET_NAME, - (String) PublicationGlobalizationUtil.globalize( - "publications.ui.workingpaper.edit_basic_sheet"). - localize(), new WorkflowLockedComponentAccess(editBasicSheet, - itemModel), - editBasicSheet.getSaveCancelSection(). - getCancelButton()); + basicProperties.add( + EDIT_SHEET_NAME, + PublicationGlobalizationUtil.globalize( + "publications.ui.workingpaper.edit_basic_sheet"), + new WorkflowLockedComponentAccess(editBasicSheet,itemModel), + editBasicSheet.getSaveCancelSection().getCancelButton()); basicProperties.setDisplayComponent( getWorkingPaperPropertySheet(itemModel)); getSegmentedPanel().addSegment( - new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.publication.basic_properties"). - localize()), basicProperties); + new Label(PublicationGlobalizationUtil.globalize( + "publications.ui.publication.basic_properties")), + basicProperties); } private static class ReviewedFormatter @@ -91,6 +90,7 @@ public class WorkingPaperPropertiesStep extends UnPublishedPropertiesStep { super(); } + @Override public String format(DomainObject obj, String attribute, PageState state) { if ((get(obj, attribute) != null) && (get(obj, attribute) instanceof Boolean) diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/WorkingPaperPropertyForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/WorkingPaperPropertyForm.java index 0c6231feb..6fbe6127a 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/WorkingPaperPropertyForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/WorkingPaperPropertyForm.java @@ -59,12 +59,13 @@ public class WorkingPaperPropertyForm @Override protected void addWidgets() { + super.addWidgets(); - add(new Label(PublicationGlobalizationUtil.globalize( - "publications.ui.workingpaper.reviewed"))); reviewed = new CheckboxGroup("reviewedGroup"); reviewed.addOption(new Option(REVIEWED, "")); + reviewed.setLabel(PublicationGlobalizationUtil.globalize( + "publications.ui.workingpaper.reviewed")); add(reviewed); } diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionEditForm.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionEditForm.java index 30b7b56a6..e7881e759 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionEditForm.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionEditForm.java @@ -53,8 +53,7 @@ public class SciDepartmentDescriptionEditForm @Override public void addWidgets() { - add(new Label(SciDepartmentGlobalizationUtil.globalize( - "scidepartment.ui.description"))); + final ParameterModel descParam = new StringParameter( SciDepartment.DEPARTMENT_DESCRIPTION); final TextArea desc; @@ -63,9 +62,12 @@ public class SciDepartmentDescriptionEditForm } else { desc = new TextArea(descParam); } + desc.setLabel(SciDepartmentGlobalizationUtil.globalize( + "scidepartment.ui.description")); desc.setCols(75); desc.setRows(25); add(desc); + } @Override diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionStep.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionStep.java index 6f5497369..8509847ba 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionStep.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionStep.java @@ -51,17 +51,16 @@ public class SciDepartmentDescriptionStep extends SimpleEditStep { final BasicItemForm editDescFrom = new SciDepartmentDescriptionEditForm( itemModel); add(EDIT_DEPARTMENT_DESC_SHEET_NAME, - (String) SciDepartmentGlobalizationUtil.globalize( - "scidepartment.ui.desc.edit").localize(), + SciDepartmentGlobalizationUtil.globalize( + "scidepartment.ui.desc.edit"), new WorkflowLockedComponentAccess(editDescFrom, itemModel), editDescFrom.getSaveCancelSection().getCancelButton()); final SciDepartmentDescriptionUploadForm updateDescForm = - new SciDepartmentDescriptionUploadForm( - itemModel); + new SciDepartmentDescriptionUploadForm(itemModel); add(UPDATE_DEPARTMENT_DESC_SHEET_NAME, - (String) SciDepartmentGlobalizationUtil.globalize( - "scidepartment.ui.desc.upload").localize(), + SciDepartmentGlobalizationUtil.globalize( + "scidepartment.ui.desc.upload"), new WorkflowLockedComponentAccess(updateDescForm, itemModel), updateDescForm.getSaveCancelSection().getCancelButton()); diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberTable.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberTable.java index 6e206b254..2fffa75c0 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberTable.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberTable.java @@ -23,8 +23,8 @@ import com.arsdigita.cms.contenttypes.SciDepartment; /** * Table displaying the members of an SciDepartment. Based on the - * {@link GenericOrganizationalUnitPersonsTable} it overwrites only the methods provided by the - * superclass for customising the form. + * {@link GenericOrganizationalUnitPersonsTable} it overwrites only the methods + * provided by the superclass for customising the form. * * @author Jens Pelzetter * @version $Id$ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsStep.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsStep.java index abd62f462..fad41465b 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsStep.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsStep.java @@ -46,41 +46,48 @@ public class SciDepartmentProjectsStep extends SimpleEditStep { super(itemModel, parent, prefix); final BasicItemForm addProjectSheet = - new GenericOrganizationalUnitSubordinateOrgaUnitAddForm( - itemModel, - new GenericOrgaUnitSubordinateOrgaUnitAddFormCustomizer() { + new GenericOrganizationalUnitSubordinateOrgaUnitAddForm( + itemModel, + new GenericOrgaUnitSubordinateOrgaUnitAddFormCustomizer() { + @Override public String getSelectSubordinateOrgaUnitLabel() { return (String) SciDepartmentGlobalizationUtil.globalize( "scidepartment.ui.projects.select").localize(); } + @Override public String getSubordinateOrgaUnitType() { return "com.arsdigita.cms.contenttypes.SciProject"; } + @Override public String getAssocType() { return ASSOC_TYPE; } + @Override public String getNothingSelectedMessage() { return (String) SciDepartmentGlobalizationUtil.globalize( "scidepartment.ui.projects.select.nothing"). localize(); } + @Override public String getNoSuitableLanguageVariantMessage() { return (String) SciDepartmentGlobalizationUtil.globalize( "scidepartment.ui.projects.no_suitable_language_variant"). localize(); } + @Override public String getAddingToItselfMessage() { return (String) SciDepartmentGlobalizationUtil.globalize( "scidepartment.ui.projects.adding_to_itself"). localize(); } + @Override public String getAlreadyAddedMessage() { return (String) SciDepartmentGlobalizationUtil.globalize( "scidepartment.ui.projects.already_added"). @@ -88,15 +95,15 @@ public class SciDepartmentProjectsStep extends SimpleEditStep { } }); add(ADD_PROJECT_SHEET_NAME, - (String) SciDepartmentGlobalizationUtil.globalize( - "scidepartment.ui.projects.add").localize(), + SciDepartmentGlobalizationUtil.globalize( + "scidepartment.ui.projects.add"), new WorkflowLockedComponentAccess(addProjectSheet, itemModel), addProjectSheet.getSaveCancelSection().getCancelButton()); final GenericOrganizationalUnitSubordinateOrgaUnitsTable projectsTable = - new GenericOrganizationalUnitSubordinateOrgaUnitsTable( - itemModel, - new GenericOrgaUnitSubordinateOrgaUnitsTableCustomizer() { + new GenericOrganizationalUnitSubordinateOrgaUnitsTable( + itemModel, + new GenericOrgaUnitSubordinateOrgaUnitsTableCustomizer() { public String getEmptyViewLabel() { return (String) SciDepartmentGlobalizationUtil.globalize( diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java index 78a4d41b9..487b025b8 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java @@ -68,20 +68,19 @@ public class SciDepartmentPropertiesStep final BasicPageForm editBasicSheet = new SciDepartmentPropertyForm( itemModel, this); - basicProperties.add(EDIT_SHEET_NAME, - (String) SciDepartmentGlobalizationUtil.globalize( - "scidepartment.ui.edit_basic_sheet").localize(), - new WorkflowLockedComponentAccess(editBasicSheet, - itemModel), - editBasicSheet.getSaveCancelSection(). - getCancelButton()); + basicProperties.add( + EDIT_SHEET_NAME, + SciDepartmentGlobalizationUtil.globalize( + "scidepartment.ui.edit_basic_sheet"), + new WorkflowLockedComponentAccess(editBasicSheet,itemModel), + editBasicSheet.getSaveCancelSection().getCancelButton()); basicProperties.setDisplayComponent(getSciDepartmentPropertySheet( itemModel)); getSegmentedPanel().addSegment( - new Label((String) SciDepartmentGlobalizationUtil.globalize( - "scidepartment.ui.edit_basic_properties").localize()), + new Label(SciDepartmentGlobalizationUtil.globalize( + "scidepartment.ui.edit_basic_properties")), basicProperties); } diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertyForm.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertyForm.java index ad327783a..6b7f2e9d4 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertyForm.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertyForm.java @@ -62,16 +62,17 @@ public class SciDepartmentPropertyForm @Override public void addWidgets() { + super.addWidgets(); - add(new Label(SciDepartmentGlobalizationUtil.globalize( - "scidepartment.ui.shortdesc"))); ParameterModel shortDescParam = new StringParameter( SciDepartment.DEPARTMENT_SHORT_DESCRIPTION); TextArea shortDesc = new TextArea(shortDescParam); - shortDesc.addValidationListener( - new StringInRangeValidationListener(0, - config.getShortDescMaxLength())); + shortDesc.addValidationListener(new StringInRangeValidationListener( + 0, + config.getShortDescMaxLength())); + shortDesc.setLabel(SciDepartmentGlobalizationUtil.globalize( + "scidepartment.ui.shortdesc")); shortDesc.setCols(75); shortDesc.setRows(5); add(shortDesc); diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsStep.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsStep.java index a79198045..6e3fbdcb8 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsStep.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsStep.java @@ -91,9 +91,9 @@ public class SciDepartmentSubDepartmentsStep extends SimpleEditStep { } }); add(ADD_SUBDEPARTMENT_SHEET_NAME, - (String) SciDepartmentGlobalizationUtil.globalize( - "scidepartment.ui.subdepartment.add").localize(), - new WorkflowLockedComponentAccess(addSubDepartmentSheet, itemModel), + SciDepartmentGlobalizationUtil.globalize( + "scidepartment.ui.subdepartment.add"), + new WorkflowLockedComponentAccess(addSubDepartmentSheet,itemModel), addSubDepartmentSheet.getSaveCancelSection().getCancelButton()); final GenericOrganizationalUnitSubordinateOrgaUnitsTable subDepartmentTable = diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentsStep.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentsStep.java index 430aa7c51..4e4cb43ac 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentsStep.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentsStep.java @@ -91,9 +91,9 @@ public class SciDepartmentSuperDepartmentsStep extends SimpleEditStep { } }); add(ADD_SUPER_DEPARTMENT_SHEET_NAME, - (String) SciDepartmentGlobalizationUtil.globalize( - "scidepartment.ui.superdepartment.add").localize(), - new WorkflowLockedComponentAccess(addSuperDepartmentSheet, itemModel), + SciDepartmentGlobalizationUtil.globalize( + "scidepartment.ui.superdepartment.add"), + new WorkflowLockedComponentAccess(addSuperDepartmentSheet,itemModel), addSuperDepartmentSheet.getSaveCancelSection().getCancelButton()); final GenericOrganizationalUnitSuperiorOrgaUnitsTable superDeparmentsTable = diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsStep.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsStep.java index 3af756cc9..32d13462d 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsStep.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsStep.java @@ -87,8 +87,8 @@ public class SciProjectDepartmentsStep extends SimpleEditStep { }); add(ADD_DEPARTMENT_SHEET_NAME, - (String) SciDepartmentGlobalizationUtil.globalize( - "sciproject.ui.department.add").localize(), + SciDepartmentGlobalizationUtil.globalize( + "sciproject.ui.department.add"), new WorkflowLockedComponentAccess(addDepartmentSheet, itemModel), addDepartmentSheet.getSaveCancelSection().getCancelButton()); diff --git a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentInstitutesStep.java b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentInstitutesStep.java index 4fa4ae38e..97d672b49 100644 --- a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentInstitutesStep.java +++ b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentInstitutesStep.java @@ -78,8 +78,8 @@ public class SciDepartmentInstitutesStep extends SimpleEditStep { }); add(ADD_INSTITUTE_SHEET_NAME, - (String) SciInstituteGlobalizationUtil.globalize( - "scidepartment.ui.institute.add").localize(), + SciInstituteGlobalizationUtil.globalize( + "scidepartment.ui.institute.add"), new WorkflowLockedComponentAccess(addInstituteSheet, itemModel), addInstituteSheet.getSaveCancelSection().getCancelButton()); diff --git a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteDepartmentsStep.java b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteDepartmentsStep.java index c4a06f350..16e53ecfa 100644 --- a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteDepartmentsStep.java +++ b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteDepartmentsStep.java @@ -73,8 +73,8 @@ public class SciInstituteDepartmentsStep extends SimpleEditStep { }); add(ADD_DEPARTMENT_SHEET_NAME, - (String) SciInstituteGlobalizationUtil.globalize( - "sciinstitute.ui.departments.add").localize(), + SciInstituteGlobalizationUtil.globalize( + "sciinstitute.ui.departments.add"), new WorkflowLockedComponentAccess(addDepartmentSheet, itemModel), addDepartmentSheet.getSaveCancelSection().getCancelButton()); diff --git a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteDescriptionEditForm.java b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteDescriptionEditForm.java index fadf2dce6..13ac17e06 100644 --- a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteDescriptionEditForm.java +++ b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteDescriptionEditForm.java @@ -34,8 +34,7 @@ public class SciInstituteDescriptionEditForm @Override public void addWidgets() { - add(new Label(SciInstituteGlobalizationUtil.globalize( - "sciinstitute.ui.description"))); + final ParameterModel descParam = new StringParameter( SciInstitute.INSTITUTE_DESCRIPTION); final TextArea desc; @@ -44,9 +43,12 @@ public class SciInstituteDescriptionEditForm } else { desc = new TextArea(descParam); } + desc.setLabel(SciInstituteGlobalizationUtil.globalize( + "sciinstitute.ui.description")); desc.setCols(75); desc.setRows(25); add(desc); + } @Override diff --git a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteDescriptionStep.java b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteDescriptionStep.java index 7adafe760..b07f01998 100644 --- a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteDescriptionStep.java +++ b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteDescriptionStep.java @@ -33,8 +33,8 @@ public class SciInstituteDescriptionStep extends SimpleEditStep { final BasicItemForm editDescFrom = new SciInstituteDescriptionEditForm( itemModel); add(EDIT_INSTITUTE_DESC_SHEET_NAME, - (String) SciInstituteGlobalizationUtil.globalize( - "sciinstitute.ui.desc.edit").localize(), + SciInstituteGlobalizationUtil.globalize( + "sciinstitute.ui.desc.edit"), new WorkflowLockedComponentAccess(editDescFrom, itemModel), editDescFrom.getSaveCancelSection().getCancelButton()); @@ -42,8 +42,8 @@ public class SciInstituteDescriptionStep extends SimpleEditStep { new SciInstituteDescriptionUploadForm( itemModel); add(UPDATE_INSTITUTE_DESC_SHEET_NAME, - (String) SciInstituteGlobalizationUtil.globalize( - "sciinstitute.ui.desc.upload").localize(), + SciInstituteGlobalizationUtil.globalize( + "sciinstitute.ui.desc.upload"), new WorkflowLockedComponentAccess(updateDescForm, itemModel), updateDescForm.getSaveCancelSection().getCancelButton()); diff --git a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteMembersStep.java b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteMembersStep.java index e4568dcbc..6653624cc 100644 --- a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteMembersStep.java +++ b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteMembersStep.java @@ -36,9 +36,9 @@ public class SciInstituteMembersStep final BasicItemForm addMemberSheet = new SciInstituteMemberAddForm( itemModel, this); add(ADD_INSTITUTE_MEMBER_STEP, - (String) SciInstituteGlobalizationUtil.globalize( - "sciinstitute.ui.members.add").localize(), - new WorkflowLockedComponentAccess(addMemberSheet, itemModel), + SciInstituteGlobalizationUtil.globalize( + "sciinstitute.ui.members.add"), + new WorkflowLockedComponentAccess(addMemberSheet,itemModel), addMemberSheet.getSaveCancelSection().getCancelButton()); final SciInstituteMembersTable memberTable = @@ -47,30 +47,37 @@ public class SciInstituteMembersStep setDisplayComponent(memberTable); } + @Override public GenericPerson getSelectedPerson() { return selectedPerson; } + @Override public void setSelectedPerson(final GenericPerson selectedPerson) { this.selectedPerson = selectedPerson; } + @Override public String getSelectedPersonRole() { return selectedPersonRole; } + @Override public void setSelectedPersonRole(final String selectedPersonRole) { this.selectedPersonRole = selectedPersonRole; } + @Override public String getSelectedPersonStatus() { return selectedPersonStatus; } + @Override public void setSelectedPersonStatus(final String selectedPersonStatus) { this.selectedPersonStatus = selectedPersonStatus; } + @Override public void showEditComponent(final PageState state) { showComponent(state, ADD_INSTITUTE_MEMBER_STEP); } diff --git a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteProjectsStep.java b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteProjectsStep.java index d573e2f8b..93b70790d 100644 --- a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteProjectsStep.java +++ b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteProjectsStep.java @@ -72,8 +72,8 @@ public class SciInstituteProjectsStep extends SimpleEditStep { } }); add(ADD_INSTITUTE_SHEET_NAME, - (String) SciInstituteGlobalizationUtil.globalize( - "sciinstitute.ui.projects.add").localize(), + SciInstituteGlobalizationUtil.globalize( + "sciinstitute.ui.projects.add"), new WorkflowLockedComponentAccess(addProjectSheet, itemModel), addProjectSheet.getSaveCancelSection().getCancelButton()); diff --git a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstitutePropertiesStep.java b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstitutePropertiesStep.java index ef4427d9b..36149af69 100644 --- a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstitutePropertiesStep.java +++ b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstitutePropertiesStep.java @@ -50,19 +50,17 @@ public class SciInstitutePropertiesStep itemModel, this); basicProperties.add(EDIT_SHEET_NAME, - (String) SciInstituteGlobalizationUtil.globalize( - "sciinstitute.ui.edit_basic_sheet").localize(), - new WorkflowLockedComponentAccess(editBasicSheet, - itemModel), - editBasicSheet.getSaveCancelSection(). - getCancelButton()); + SciInstituteGlobalizationUtil.globalize( + "sciinstitute.ui.edit_basic_sheet"), + new WorkflowLockedComponentAccess(editBasicSheet,itemModel), + editBasicSheet.getSaveCancelSection().getCancelButton()); basicProperties.setDisplayComponent(getSciInstitutePropertySheet( itemModel)); getSegmentedPanel().addSegment( - new Label((String) SciInstituteGlobalizationUtil.globalize( - "sciinstitute.ui.edit_basic_properties").localize()), + new Label(SciInstituteGlobalizationUtil.globalize( + "sciinstitute.ui.edit_basic_properties")), basicProperties); } diff --git a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstitutePropertyForm.java b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstitutePropertyForm.java index e7781be25..7abb24bf3 100644 --- a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstitutePropertyForm.java +++ b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstitutePropertyForm.java @@ -43,16 +43,17 @@ public class SciInstitutePropertyForm @Override public void addWidgets() { + super.addWidgets(); - add(new Label(SciInstituteGlobalizationUtil.globalize( - "sciinstitute.ui.shortdesc"))); ParameterModel shortDescParam = new StringParameter( SciInstitute.INSTITUTE_SHORT_DESCRIPTION); TextArea shortDesc = new TextArea(shortDescParam); shortDesc.addValidationListener( new StringInRangeValidationListener(0, config.getShortDescMaxLength())); + shortDesc.setLabel(SciInstituteGlobalizationUtil.globalize( + "sciinstitute.ui.shortdesc")); shortDesc.setCols(75); shortDesc.setRows(5); add(shortDesc); diff --git a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciProjectInstitutesStep.java b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciProjectInstitutesStep.java index bc1c3b388..0bd1372b7 100644 --- a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciProjectInstitutesStep.java +++ b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciProjectInstitutesStep.java @@ -75,8 +75,8 @@ public class SciProjectInstitutesStep extends SimpleEditStep { }); add(ADD_INSTITUTE_SHEET_NAME, - (String) SciInstituteGlobalizationUtil.globalize( - "sciproject.ui.institut.add").localize(), + SciInstituteGlobalizationUtil.globalize( + "sciproject.ui.institut.add"), new WorkflowLockedComponentAccess(addInstitutesSheet, itemModel), addInstitutesSheet.getSaveCancelSection().getCancelButton()); diff --git a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionEditForm.java b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionEditForm.java index f1fb89440..8a4d144ba 100644 --- a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionEditForm.java +++ b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionEditForm.java @@ -49,8 +49,7 @@ public class SciProjectDescriptionEditForm @Override protected void addWidgets() { - add(new Label(SciProjectGlobalizationUtil.globalize( - "sciproject.ui.description"))); + final ParameterModel descParam = new StringParameter( SciProject.PROJECT_DESCRIPTION); final TextArea desc; @@ -59,6 +58,8 @@ public class SciProjectDescriptionEditForm } else { desc = new TextArea(descParam); } + desc.setLabel(SciProjectGlobalizationUtil.globalize( + "sciproject.ui.description")); desc.setCols(75); desc.setRows(25); add(desc); @@ -88,9 +89,11 @@ public class SciProjectDescriptionEditForm }); add(sponsorLabel); - add(new Label(SciProjectGlobalizationUtil.globalize("sciproject.ui.choose_sponsor"))); + //add(new Label(SciProjectGlobalizationUtil.globalize("sciproject.ui.choose_sponsor"))); sponsorSearch = new ItemSearchWidget(SPONSOR_SEARCH, ContentType. findByAssociatedObjectType(CONFIG.getSponsorType())); + sponsorSearch.setLabel(SciProjectGlobalizationUtil.globalize( + "sciproject.ui.choose_sponsor")); add(sponsorSearch); } diff --git a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionTextEditForm.java b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionTextEditForm.java index b703f0dc7..e9fc8c4cc 100644 --- a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionTextEditForm.java +++ b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionTextEditForm.java @@ -32,8 +32,7 @@ public class SciProjectDescriptionTextEditForm extends BasicItemForm implements @Override public void addWidgets() { - add(new Label(SciProjectGlobalizationUtil.globalize( - "sciproject.ui.description"))); + final ParameterModel descParam = new StringParameter( SciProject.PROJECT_DESCRIPTION); final TextArea desc; @@ -42,9 +41,12 @@ public class SciProjectDescriptionTextEditForm extends BasicItemForm implements } else { desc = new TextArea(descParam); } + desc.setLabel(SciProjectGlobalizationUtil.globalize( + "sciproject.ui.description")); desc.setCols(75); desc.setRows(25); add(desc); + } @Override diff --git a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectFundingEditForm.java b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectFundingEditForm.java index 5b0fb571f..580b3ad4a 100644 --- a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectFundingEditForm.java +++ b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectFundingEditForm.java @@ -54,8 +54,6 @@ public class SciProjectFundingEditForm extends BasicItemForm implements FormProc public void addWidgets() { if (CONFIG.getEnableFunding()) { - add(new Label(SciProjectGlobalizationUtil.globalize( - "sciproject.ui.funding"))); final ParameterModel fundingParam = new StringParameter( SciProject.FUNDING); final TextArea funding; @@ -64,20 +62,22 @@ public class SciProjectFundingEditForm extends BasicItemForm implements FormProc } else { funding = new TextArea(fundingParam); } + funding.setLabel(SciProjectGlobalizationUtil.globalize( + "sciproject.ui.funding")); funding.setCols(75); funding.setRows(8); add(funding); } if (CONFIG.getEnableFundingVolume()) { - add(new Label(SciProjectGlobalizationUtil.globalize( - "sciproject.ui.funding.volume"))); final ParameterModel fundingVolumeParam = new StringParameter( SciProject.FUNDING_VOLUME); final TextField fundingVolume = new TextField(fundingVolumeParam); fundingVolume.addValidationListener(new StringInRangeValidationListener( 0, CONFIG.getFundingVolumeLength())); + fundingVolume.setLabel(SciProjectGlobalizationUtil.globalize( + "sciproject.ui.funding.volume")); add(fundingVolume); } } diff --git a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectInvolvedOrganizationsStep.java b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectInvolvedOrganizationsStep.java index ebdaa2580..142d06c32 100644 --- a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectInvolvedOrganizationsStep.java +++ b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectInvolvedOrganizationsStep.java @@ -73,7 +73,7 @@ public class SciProjectInvolvedOrganizationsStep extends SimpleEditStep { } }); add(ADD_INVOLVED_ORGANIZATION_STEP, - (String) SciProjectGlobalizationUtil.globalize("sciproject.ui.involved_orgas.add").localize(), + SciProjectGlobalizationUtil.globalize("sciproject.ui.involved_orgas.add"), new WorkflowLockedComponentAccess(addInvolvedOrgaSheet, itemModel), addInvolvedOrgaSheet.getSaveCancelSection().getCancelButton()); diff --git a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectMembersStep.java b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectMembersStep.java index 2a061681f..642e59c50 100644 --- a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectMembersStep.java +++ b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectMembersStep.java @@ -38,7 +38,7 @@ implements GenericOrganizationalUnitPersonSelector{ final BasicItemForm addMemberSheet = new SciProjectMemberAddForm( itemModel, this); add(ADD_PROJECT_MEMBER_SHEET_NAME, - (String) SciProjectGlobalizationUtil.globalize("sciproject.ui.members.add").localize(), + SciProjectGlobalizationUtil.globalize("sciproject.ui.members.add"), new WorkflowLockedComponentAccess(addMemberSheet, itemModel), addMemberSheet.getSaveCancelSection().getCancelButton()); @@ -47,30 +47,37 @@ implements GenericOrganizationalUnitPersonSelector{ setDisplayComponent(memberTable); } + @Override public GenericPerson getSelectedPerson() { return selectedPerson; } + @Override public void setSelectedPerson(final GenericPerson selectedPerson) { this.selectedPerson = selectedPerson; } + @Override public String getSelectedPersonRole() { return selectedPersonRole; } + @Override public void setSelectedPersonRole(final String selectedPersonRole) { this.selectedPersonRole = selectedPersonRole; } + @Override public String getSelectedPersonStatus() { return selectedPersonStatus; } + @Override public void setSelectedPersonStatus(final String selectedPersonStatus) { this.selectedPersonStatus = selectedPersonStatus; } + @Override public void showEditComponent(final PageState state) { showComponent(state, ADD_PROJECT_MEMBER_SHEET_NAME); } diff --git a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertiesStep.java b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertiesStep.java index c0c76c508..8b7bbe49d 100644 --- a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertiesStep.java +++ b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertiesStep.java @@ -133,21 +133,19 @@ public class SciProjectPropertiesStep itemModel, this); - basicProperties.add(EDIT_SHEET_NAME, - (String) SciProjectGlobalizationUtil.globalize( - "sciproject.ui.edit_basic_sheet").localize(), - new WorkflowLockedComponentAccess(editBasicSheet, - itemModel), - editBasicSheet.getSaveCancelSection(). - getCancelButton()); + basicProperties.add( + EDIT_SHEET_NAME, + SciProjectGlobalizationUtil.globalize( + "sciproject.ui.edit_basic_sheet"), + new WorkflowLockedComponentAccess(editBasicSheet,itemModel), + editBasicSheet.getSaveCancelSection().getCancelButton()); basicProperties.setDisplayComponent( getSciProjectPropertySheet(itemModel)); getSegmentedPanel().addSegment( - new Label((String) SciProjectGlobalizationUtil.globalize( - "sciproject.ui.edit_basic_properties"). - localize()), + new Label(SciProjectGlobalizationUtil.globalize( + "sciproject.ui.edit_basic_properties")), basicProperties); } diff --git a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertyForm.java b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertyForm.java index aa4c62259..98ee45254 100644 --- a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertyForm.java +++ b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertyForm.java @@ -49,6 +49,7 @@ public class SciProjectPropertyForm @Override public void addWidgets() { + super.addWidgets(); final ParameterModel beginSkipMonthParam = @@ -61,14 +62,14 @@ public class SciProjectPropertyForm final Hidden beginSkipDay = new Hidden(beginSkipDayParam); add(beginSkipDay); - add(new Label(SciProjectGlobalizationUtil.globalize( - "sciproject.ui.begin"))); final IncompleteDateParameter beginParam = new IncompleteDateParameter(SciProject.BEGIN); beginParam.allowSkipMonth(true); beginParam.allowSkipDay(true); final Calendar today = new GregorianCalendar(); final Date begin = new Date(beginParam); + begin.setLabel(SciProjectGlobalizationUtil.globalize( + "sciproject.ui.begin")); begin.setAutoCurrentYear(false); begin.setYearRange(1970, (today.get(Calendar.YEAR) + 2)); add(begin); @@ -81,26 +82,27 @@ public class SciProjectPropertyForm final ParameterModel endSkipDayParam = new BooleanParameter( SciProject.END_SKIP_DAY); final Hidden endSkipDay = new Hidden(endSkipDayParam); + // endSkipDay.setLabel(null); add(endSkipDay); - add(new Label(SciProjectGlobalizationUtil.globalize( - "sciproject.ui.end"))); final IncompleteDateParameter endParam = new IncompleteDateParameter(SciProject.END); endParam.allowSkipMonth(true); endParam.allowSkipDay(true); Date end = new Date(endParam); end.setAutoCurrentYear(false); end.setYearRange(1970, (today.get(Calendar.YEAR) + 8)); + end.setLabel(SciProjectGlobalizationUtil.globalize( + "sciproject.ui.end")); add(end); - add(new Label(SciProjectGlobalizationUtil.globalize( - "sciproject.ui.shortdesc"))); ParameterModel shortDescParam = new StringParameter( SciProject.PROJECT_SHORT_DESCRIPTION); TextArea shortDesc = new TextArea(shortDescParam); shortDesc.addValidationListener( new StringInRangeValidationListener(0, config.getShortDescMaxLength())); + shortDesc.setLabel(SciProjectGlobalizationUtil.globalize( + "sciproject.ui.shortdesc")); shortDesc.setCols(75); shortDesc.setRows(5); add(shortDesc); diff --git a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSponsorForm.java b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSponsorForm.java index 1123753f5..731da4331 100644 --- a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSponsorForm.java +++ b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSponsorForm.java @@ -13,12 +13,10 @@ import com.arsdigita.cms.ContentType; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.contenttypes.SciProjectConfig; import com.arsdigita.cms.contenttypes.SciProjectSponsorCollection; import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.authoring.BasicItemForm; import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.kernel.Kernel; /** * @@ -46,17 +44,20 @@ public class SciProjectSponsorForm extends BasicItemForm implements FormInitList @Override public void addWidgets() { - add(new Label(SciProjectGlobalizationUtil.globalize("sciproject.ui.sponsor"))); + itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType( GenericOrganizationalUnit.class.getName())); itemSearch.setEditAfterCreate(false); + itemSearch.setLabel(SciProjectGlobalizationUtil.globalize( + "sciproject.ui.sponsor")); add(itemSearch); - selectedSponsorLabel = new Label(""); + selectedSponsorLabel = new Label(); add(selectedSponsorLabel); - add(new Label(SciProjectGlobalizationUtil.globalize("sciproject.ui.sponsor_fundingcode"))); fundingCode = new TextField(FUNDING_CODE); + fundingCode.setLabel(SciProjectGlobalizationUtil.globalize( + "sciproject.ui.sponsor_fundingcode")); add(fundingCode); } @@ -159,7 +160,8 @@ public class SciProjectSponsorForm extends BasicItemForm implements FormInitList if ((((SciProjectSponsorStep) editStep).getSelectedSponsor() == null) && (data.get(ITEM_SEARCH) == null)) { - data.addError(SciProjectGlobalizationUtil.globalize("sciproject.ui.sponsor_no_sponsor_selected")); + data.addError(SciProjectGlobalizationUtil.globalize( + "sciproject.ui.sponsor_no_sponsor_selected")); return; } diff --git a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSponsorSheet.java b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSponsorSheet.java index 927790555..2e3de75db 100644 --- a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSponsorSheet.java +++ b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSponsorSheet.java @@ -143,11 +143,11 @@ public class SciProjectSponsorSheet extends Table { case 1: return sponsors.getFundingCode(); case 2: - return SciProjectGlobalizationUtil.globalize( - "sciproject.ui.sponsor.edit_assoc").localize(); + return new Label(SciProjectGlobalizationUtil.globalize( + "sciproject.ui.sponsor.edit_assoc")); case 3: - return SciProjectGlobalizationUtil.globalize( - "sciproject.ui.sponsor.remove").localize(); + return new Label(SciProjectGlobalizationUtil.globalize( + "sciproject.ui.sponsor.remove")); default: return null; } @@ -251,8 +251,8 @@ public class SciProjectSponsorSheet extends Table { sponsor); if (canEdit) { final ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciProjectGlobalizationUtil.globalize( - "sciproject.ui.sponsor.remove.confirm").localize()); + link.setConfirmation(SciProjectGlobalizationUtil.globalize( + "sciproject.ui.sponsor.remove.confirm")); return link; } else { return new Label(""); @@ -273,7 +273,7 @@ public class SciProjectSponsorSheet extends Table { int row, int col) { if (0 == row) { - final Label label = new Label(""); + final Label label = new Label(); return label; } else { final ControlLink link = new ControlLink("up"); @@ -301,7 +301,7 @@ public class SciProjectSponsorSheet extends Table { final SciProjectSponsorCollection sponsors = project.getSponsors(); if ((sponsors.size() - 1) == row) { - final Label label = new Label(""); + final Label label = new Label(); return label; } else { final ControlLink link = new ControlLink("down"); diff --git a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSponsorStep.java b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSponsorStep.java index fa8d6e3b8..c8d6dbd53 100644 --- a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSponsorStep.java +++ b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSponsorStep.java @@ -31,7 +31,7 @@ public class SciProjectSponsorStep extends SimpleEditStep { final BasicItemForm sponsorForm = new SciProjectSponsorForm(itemModel, this); add(SCIPROJECT_SPONSOR_STEP, - (String) SciProjectGlobalizationUtil.globalize("sciproject.ui.sponsor.add").localize(), + SciProjectGlobalizationUtil.globalize("sciproject.ui.sponsor.add"), new WorkflowLockedComponentAccess(sponsorForm, itemModel), sponsorForm.getSaveCancelSection().getCancelButton()); diff --git a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubProjectsStep.java b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubProjectsStep.java index 8133e36c9..f3b336fa3 100644 --- a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubProjectsStep.java +++ b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubProjectsStep.java @@ -70,8 +70,8 @@ public class SciProjectSubProjectsStep extends SimpleEditStep { } }); add(ADD_SUBPROJECT_SHEET_NAME, - (String) SciProjectGlobalizationUtil.globalize( - "sciproject.ui.subproject.add").localize(), + SciProjectGlobalizationUtil.globalize( + "sciproject.ui.subproject.add"), new WorkflowLockedComponentAccess(addSubProjectSheet, itemModel), addSubProjectSheet.getSaveCancelSection().getCancelButton()); diff --git a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectsStep.java b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectsStep.java index 668c3094f..1055c5dbd 100644 --- a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectsStep.java +++ b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectsStep.java @@ -66,7 +66,7 @@ public class SciProjectSuperProjectsStep extends SimpleEditStep { } }); add(ADD_SUPERPROJECT_SHEET_NAME, - (String) SciProjectGlobalizationUtil.globalize("sciproject.ui.superproject.add").localize(), + SciProjectGlobalizationUtil.globalize("sciproject.ui.superproject.add"), new WorkflowLockedComponentAccess(addSuperProjectSheet, itemModel), addSuperProjectSheet.getSaveCancelSection().getCancelButton()); diff --git a/ccm-shortcuts/src/com/arsdigita/shortcuts/ui/ShortcutForm.java b/ccm-shortcuts/src/com/arsdigita/shortcuts/ui/ShortcutForm.java index baca2ec6e..f2b1e6e49 100755 --- a/ccm-shortcuts/src/com/arsdigita/shortcuts/ui/ShortcutForm.java +++ b/ccm-shortcuts/src/com/arsdigita/shortcuts/ui/ShortcutForm.java @@ -16,7 +16,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ - package com.arsdigita.shortcuts.ui; import java.math.BigDecimal; @@ -48,185 +47,189 @@ import org.apache.oro.text.perl.MalformedPerl5PatternException; public class ShortcutForm extends Form { - private static final Category log = Category.getInstance(ShortcutForm.class - .getName()); + private static final Category log = Category.getInstance(ShortcutForm.class + .getName()); - private ACSObjectSelectionModel m_selected_shortcut; + private ACSObjectSelectionModel m_selected_shortcut; - private TextField m_url; + private TextField m_url; - private TextField m_redirect; + private TextField m_redirect; - private final Submit m_submit; + private final Submit m_submit; - public ShortcutForm(ACSObjectSelectionModel selected_shortcut) { - super("ShortcutForm"); - m_selected_shortcut = selected_shortcut; + public ShortcutForm(ACSObjectSelectionModel selected_shortcut) { + super("ShortcutForm"); + m_selected_shortcut = selected_shortcut; - TrimmedStringParameter urlKeyParameter = new TrimmedStringParameter( - "url"); - urlKeyParameter.addParameterListener(new NotEmptyValidationListener()); - m_url = new TextField(urlKeyParameter); + TrimmedStringParameter urlKeyParameter = new TrimmedStringParameter( + "url"); + urlKeyParameter.addParameterListener(new NotEmptyValidationListener()); + m_url = new TextField(urlKeyParameter); - TrimmedStringParameter redirectParameter = new TrimmedStringParameter( - "redirect"); - redirectParameter - .addParameterListener(new NotEmptyValidationListener()); + TrimmedStringParameter redirectParameter = new TrimmedStringParameter( + "redirect"); + redirectParameter + .addParameterListener(new NotEmptyValidationListener()); - m_redirect = new TextField(redirectParameter); + m_redirect = new TextField(redirectParameter); - urlKeyParameter.addParameterListener(new ParameterListener() { + urlKeyParameter.addParameterListener(new ParameterListener() { @Override - public void validate(ParameterEvent e) throws FormProcessException { - ParameterData data = e.getParameterData(); + public void validate(ParameterEvent e) throws FormProcessException { + ParameterData data = e.getParameterData(); - String key = (String) data.getValue(); - if (key == null) - return; // Something else will handle - // this + String key = (String) data.getValue(); + if (key == null) { + return; // Something else will handle + } // this - Perl5Util perl = new Perl5Util(); - try { - if (!perl.match("/^(\\/[-a-zA-Z0-9_.]+)+\\/?$/", key)) { - data.addError(GlobalizationUtil.globalize( + Perl5Util perl = new Perl5Util(); + try { + if (!perl.match("/^(\\/[-a-zA-Z0-9_.]+)+\\/?$/", key)) { + data.addError(GlobalizationUtil.globalize( "shortcuts.ui.invalid_key_descr")); - throw new FormProcessException( + throw new FormProcessException( "Invalid key", GlobalizationUtil.globalize("shortcuts.ui.invalid_key") - ); - } - } catch (MalformedPerl5PatternException ex) { - throw new UncheckedWrapperException("bad regex", ex); - } - } - }); + ); + } + } catch (MalformedPerl5PatternException ex) { + throw new UncheckedWrapperException("bad regex", ex); + } + } + }); - redirectParameter.addParameterListener(new ParameterListener() { + redirectParameter.addParameterListener(new ParameterListener() { @Override - public void validate(ParameterEvent e) throws FormProcessException { - ParameterData data = e.getParameterData(); + public void validate(ParameterEvent e) throws FormProcessException { + ParameterData data = e.getParameterData(); - String url = (String) data.getValue(); - if (url == null) - return; // Something else will handle - // this + String url = (String) data.getValue(); + if (url == null) { + return; // Something else will handle + } // this - url = url.toLowerCase(); + url = url.toLowerCase(); - // Absolute local url is ok - if (url.startsWith("/")) - return; + // Absolute local url is ok + if (url.startsWith("/")) { + return; + } - // Fully qualified url is ok - if (url.startsWith("http://")) - return; + // Fully qualified url is ok + if (url.startsWith("http://")) { + return; + } - // And secure ones too - if (url.startsWith("https://")) - return; + // And secure ones too + if (url.startsWith("https://")) { + return; + } - data - .addError("You must enter an absolute path " - + "(starting with '/') or a fully " - + "qualified URL (starting with 'http://' or 'https://')"); - throw new FormProcessException("invalid URL"); - } - }); + data + .addError("You must enter an absolute path " + + "(starting with '/') or a fully " + + "qualified URL (starting with 'http://' or 'https://')"); + throw new FormProcessException("invalid URL"); + } + }); - add(new Label("URL Key:")); - add(m_url); - add(new Label("Redirect:")); - add(m_redirect); + add(new Label("URL Key:")); + add(m_url); + add(new Label("Redirect:")); + add(m_redirect); - m_submit = new Submit("Save Shortcut"); - add(m_submit); + m_submit = new Submit("Save Shortcut"); + add(m_submit); - addInitListener(new ShortcutInitListener()); - addProcessListener(new ShortcutFormProcessListener()); - addValidationListener(new ShortcutFormValidationListener()); - } + addInitListener(new ShortcutInitListener()); + addProcessListener(new ShortcutFormProcessListener()); + addValidationListener(new ShortcutFormValidationListener()); + } - private class ShortcutInitListener implements FormInitListener { - @Override - public void init(FormSectionEvent ev) throws FormProcessException { - PageState state = ev.getPageState(); - BigDecimal shortcutKey = (BigDecimal) m_selected_shortcut - .getSelectedKey(state); - if (shortcutKey == null) { - log.debug("init form for empty shortcut"); - m_url.setValue(state, null); - m_redirect.setValue(state, null); - } else { - log.debug("init form for shortcut " + shortcutKey); - Shortcut shortcut = new Shortcut(shortcutKey); - m_url.setValue(state, shortcut.getUrlKey()); - m_redirect.setValue(state, shortcut.getRedirect()); - } - } - } - - private class ShortcutFormValidationListener implements - FormValidationListener { + private class ShortcutInitListener implements FormInitListener { @Override - public void validate(FormSectionEvent e) throws FormProcessException { + public void init(FormSectionEvent ev) throws FormProcessException { + PageState state = ev.getPageState(); + BigDecimal shortcutKey = (BigDecimal) m_selected_shortcut + .getSelectedKey(state); + if (shortcutKey == null) { + log.debug("init form for empty shortcut"); + m_url.setValue(state, null); + m_redirect.setValue(state, null); + } else { + log.debug("init form for shortcut " + shortcutKey); + Shortcut shortcut = new Shortcut(shortcutKey); + m_url.setValue(state, shortcut.getUrlKey()); + m_redirect.setValue(state, shortcut.getRedirect()); + } + } + } - PageState state = e.getPageState(); + private class ShortcutFormValidationListener implements + FormValidationListener { - // get currently edited shortcut - BigDecimal shortcutKey = (BigDecimal) m_selected_shortcut - .getSelectedKey(state); + @Override + public void validate(FormSectionEvent e) throws FormProcessException { - String key = ShortcutUtil.cleanURLKey((String) m_url - .getValue(state)); + PageState state = e.getPageState(); - if (shortcutKey == null) { - String target = ShortcutUtil.getTarget(key); - if (target != null) { - m_url.addError(GlobalizationUtil.globalize( - "shortcuts.ui.key_already_exists")); - throw new FormProcessException( - "duplicate key", - GlobalizationUtil.globalize("shortcuts.ui.duplicate_key") + // get currently edited shortcut + BigDecimal shortcutKey = (BigDecimal) m_selected_shortcut + .getSelectedKey(state); + + String key = ShortcutUtil.cleanURLKey((String) m_url + .getValue(state)); + + if (shortcutKey == null) { + String target = ShortcutUtil.getTarget(key); + if (target != null) { + m_url.addError(GlobalizationUtil.globalize( + "shortcuts.ui.key_already_exists")); + throw new FormProcessException( + "duplicate key", + GlobalizationUtil.globalize("shortcuts.ui.duplicate_key") ); - } - } + } + } - int index = key.indexOf("/", 2); - String base = key.substring(0, index + 1); - } - } + int index = key.indexOf("/", 2); + String base = key.substring(0, index + 1); + } + } - private class ShortcutFormProcessListener implements FormProcessListener { + private class ShortcutFormProcessListener implements FormProcessListener { @Override - public void process(FormSectionEvent e) throws FormProcessException { + public void process(FormSectionEvent e) throws FormProcessException { - PageState state = e.getPageState(); + PageState state = e.getPageState(); - BigDecimal shortcutKey = (BigDecimal) m_selected_shortcut.getSelectedKey(state); + BigDecimal shortcutKey = (BigDecimal) m_selected_shortcut.getSelectedKey(state); - String url = ShortcutUtil.cleanURLKey((String) m_url.getValue(state)); - String redirect = (String) m_redirect.getValue(state); - - if (shortcutKey == null) { - log.info("save new shortcut " + url); - Shortcut shortcut = Shortcut.create(url, redirect); - shortcut.save(); - } else { - log.info("save updated shortcut " + shortcutKey + " " + url); - Shortcut shortcut = new Shortcut(shortcutKey); - shortcut.setUrlKey(url); - shortcut.setRedirect(redirect); - shortcut.save(); - } + String url = ShortcutUtil.cleanURLKey((String) m_url.getValue(state)); + String redirect = (String) m_redirect.getValue(state); - ShortcutUtil.repopulateShortcuts(); + if (shortcutKey == null) { + log.info("save new shortcut " + url); + Shortcut shortcut = Shortcut.create(url, redirect); + shortcut.save(); + } else { + log.info("save updated shortcut " + shortcutKey + " " + url); + Shortcut shortcut = new Shortcut(shortcutKey); + shortcut.setUrlKey(url); + shortcut.setRedirect(redirect); + shortcut.save(); + } - m_redirect.setValue(state, ""); - m_url.setValue(state, ""); - m_selected_shortcut.clearSelection(state); - } - } + ShortcutUtil.repopulateShortcuts(); + + m_redirect.setValue(state, ""); + m_url.setValue(state, ""); + m_selected_shortcut.clearSelection(state); + } + } } diff --git a/ccm-subsite/src/com/arsdigita/subsite/ui/SiteForm.java b/ccm-subsite/src/com/arsdigita/subsite/ui/SiteForm.java index 23521764a..9f378d989 100755 --- a/ccm-subsite/src/com/arsdigita/subsite/ui/SiteForm.java +++ b/ccm-subsite/src/com/arsdigita/subsite/ui/SiteForm.java @@ -121,7 +121,7 @@ public class SiteForm extends Form { m_title.setMetaDataAttribute("title", "Title"); m_title.setHint(SubsiteGlobalizationUtil.globalize("subsite.ui.title.hint")); m_title.setSize(40); - add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.title.label"))); + m_title.setLabel(SubsiteGlobalizationUtil.globalize("subsite.ui.title.label")); add(m_title); // adds title input field to form @@ -132,7 +132,7 @@ public class SiteForm extends Form { m_hostname.setMetaDataAttribute("title", "Hostname"); m_hostname.setSize(40); m_hostname.setHint(SubsiteGlobalizationUtil.globalize("subsite.ui.hostname.hint")); - add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.hostname.label"))); + m_hostname.setLabel(SubsiteGlobalizationUtil.globalize("subsite.ui.hostname.label")); add(m_hostname); // adds hostname input field to form @@ -144,7 +144,8 @@ public class SiteForm extends Form { m_description.setRows(4); m_description.setHint(SubsiteGlobalizationUtil.globalize( "subsite.ui.description.hint")); - add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.description.label"))); + m_description.setLabel(SubsiteGlobalizationUtil.globalize( + "subsite.ui.description.label")); add(m_description); // adds description input field to form @@ -161,7 +162,8 @@ public class SiteForm extends Form { } catch (TooManyListenersException ex) { throw new UncheckedWrapperException("This cannot happen", ex); } - add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.customfrontpage.label"))); + m_customFrontpageApp.setLabel(SubsiteGlobalizationUtil.globalize( + "subsite.ui.customfrontpage.label")); add(m_customFrontpageApp); // adds selectfield start page to form @@ -174,7 +176,7 @@ public class SiteForm extends Form { } catch (TooManyListenersException ex) { throw new UncheckedWrapperException("This cannot happen", ex); } - add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.theme.label"))); + m_themes.setLabel(SubsiteGlobalizationUtil.globalize("subsite.ui.theme.label")); add(m_themes); // adds themes selection box to form @@ -183,11 +185,11 @@ public class SiteForm extends Form { m_styleDir.setMetaDataAttribute("title", "XSLT Directory (Other)"); m_styleDir.setSize(40); m_styleDir.setHint(globalize("subsite.ui.styledir.hint") ); - add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.styledir.label"))); + m_styleDir.setLabel(SubsiteGlobalizationUtil.globalize("subsite.ui.styledir.label")); add(m_styleDir); // adds inputfield style dir to form - /* Setup selection box for cagtegory domain */ + /* Setup selection box for category domain */ m_rootCategory = (CategoryPicker) Classes.newInstance( Subsite.getConfig().getRootCategoryPicker(), new Class[]{String.class}, @@ -196,8 +198,12 @@ public class SiteForm extends Form { ((Widget) m_rootCategory).setMetaDataAttribute("title", "Root category"); ((Widget) m_rootCategory).setHint(SubsiteGlobalizationUtil.globalize( "subsite.ui.root_category.hint")); + ((Widget) m_rootCategory).setLabel(SubsiteGlobalizationUtil.globalize( + "subsite.ui.root_category.label")); + } else { + add(new Label(SubsiteGlobalizationUtil.globalize( + "subsite.ui.root_category.label"))); } - add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.root_category.label"))); add(m_rootCategory); // adds domain category selection box to form m_buttons = new SaveCancelSection(); diff --git a/ccm-themedirector/src/com/arsdigita/themedirector/ui/ThemeForm.java b/ccm-themedirector/src/com/arsdigita/themedirector/ui/ThemeForm.java index 0c8ba8d62..0e1ec769e 100755 --- a/ccm-themedirector/src/com/arsdigita/themedirector/ui/ThemeForm.java +++ b/ccm-themedirector/src/com/arsdigita/themedirector/ui/ThemeForm.java @@ -37,26 +37,20 @@ import com.arsdigita.bebop.parameters.GlobalizedParameterListener; import com.arsdigita.bebop.parameters.NotEmptyValidationListener; import com.arsdigita.bebop.parameters.ParameterData; import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.bebop.Label; import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.SessionManager; import com.arsdigita.util.UncheckedWrapperException; -//import com.arsdigita.util.IO; import com.arsdigita.themedirector.ThemeDirectorConstants; import com.arsdigita.themedirector.ThemeDirector; import com.arsdigita.themedirector.util.GlobalizationUtil; -//import com.arsdigita.themedirector.util.ManifestReader; import com.arsdigita.subsite.Subsite; import com.arsdigita.subsite.Site; import com.arsdigita.toolbox.ui.Cancellable; import com.arsdigita.web.Web; import java.io.File; -//import java.io.FileOutputStream; import java.io.IOException; -//import java.io.InputStream; import org.apache.commons.io.FileUtils; -//import org.apache.commons.io.filefilter.DirectoryFileFilter; import org.apache.log4j.Logger; @@ -105,19 +99,14 @@ public class ThemeForm extends Form implements Cancellable, ThemeDirectorConstan m_theme = theme; // Initialize ThemeSelectionModel // Add the Title input field -// add(new Label(GlobalizationUtil.globalize("theme.title"))); m_title = new TextField(new StringParameter("title")); - // Experimental. We are migrating the Label if a widget as part of the - // widgets's xml properties. m_title.setLabel(GlobalizationUtil.globalize("theme.title")); m_title.addValidationListener(new NotEmptyValidationListener()); m_title.setHint(GlobalizationUtil.globalize("theme.title_hint")); m_title.setSize(40); add(m_title); -// add(new Label(GlobalizationUtil.globalize("theme.description"))); m_description = new TextArea(new StringParameter("description")); - // Experimental, see above m_description.setLabel(GlobalizationUtil.globalize("theme.description")); m_description.setCols(40); m_description.setRows(4); @@ -125,9 +114,7 @@ public class ThemeForm extends Form implements Cancellable, ThemeDirectorConstan .globalize("theme.description_hint")); add(m_description); -// add(new Label(GlobalizationUtil.globalize("theme.url"))); m_url = new TextField(new StringParameter("url")); - // Experimental, see above m_url.setLabel(GlobalizationUtil.globalize("theme.url")); m_url.addValidationListener(new NotEmptyValidationListener()); m_url.addValidationListener(new URLFormValidationListener());