SecurityPropertyEdit korrigiert, akzeptiert nun auch GlobalizedMessage für Label.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2209 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2013-06-15 00:07:05 +00:00
parent 35f35e428f
commit e8a7eb4967
15 changed files with 95 additions and 72 deletions

View File

@ -65,7 +65,7 @@ public class AgendaPropertiesStep extends SimpleEditStep {
editSheet = new AgendaPropertyForm(itemModel, this); editSheet = new AgendaPropertyForm(itemModel, this);
add(EDIT_SHEET_NAME, add(EDIT_SHEET_NAME,
"Edit", GlobalizationUtil.globalize("cms.ui.edit"),
new WorkflowLockedComponentAccess(editSheet, itemModel), new WorkflowLockedComponentAccess(editSheet, itemModel),
editSheet.getSaveCancelSection().getCancelButton() ); editSheet.getSaveCancelSection().getCancelButton() );

View File

@ -34,6 +34,7 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
import com.arsdigita.cms.ImageAsset; import com.arsdigita.cms.ImageAsset;
import com.arsdigita.cms.Service; import com.arsdigita.cms.Service;
import com.arsdigita.cms.util.GlobalizationUtil;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -62,7 +63,7 @@ public class OrganizationImageStep extends SimpleEditStep {
// as soon as SecuityPropertyEditor is refactored to accept a Label or a // as soon as SecuityPropertyEditor is refactored to accept a Label or a
// GlobalizedMessage, the Label String has to be globalized! // GlobalizedMessage, the Label String has to be globalized!
add( IMAGE_SHEET_NAME, add( IMAGE_SHEET_NAME,
"Change (OrgImageStep)", GlobalizationUtil.globalize("cms.ui.edit"),
new WorkflowLockedComponentAccess(new OrganizationImageForm( new WorkflowLockedComponentAccess(new OrganizationImageForm(
"OrganizationImageForm", itemModel, this), "OrganizationImageForm", itemModel, this),
itemModel)); itemModel));

View File

@ -26,7 +26,7 @@ import com.arsdigita.cms.contenttypes.util.OrganizationGlobalizationUtil;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.cms.ui.authoring.WorkflowLockedComponentAccess; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
@ -51,7 +51,8 @@ public class OrganizationPropertiesStep
BasicPageForm editSheet; BasicPageForm editSheet;
editSheet = new OrganizationPropertyForm( itemModel, this); editSheet = new OrganizationPropertyForm( itemModel, this);
add( EDIT_SHEET_NAME, "Edit", add( EDIT_SHEET_NAME,
GlobalizationUtil.globalize("cms.ui.edit"),
new WorkflowLockedComponentAccess(editSheet, itemModel), new WorkflowLockedComponentAccess(editSheet, itemModel),
editSheet.getSaveCancelSection().getCancelButton() ); editSheet.getSaveCancelSection().getCancelButton() );

View File

@ -60,24 +60,25 @@ public class GenericContactAddressPropertiesStep extends SimpleEditStep {
itemModel, this); itemModel, this);
add(ADD_ADDRESS_SHEET_NAME, add(ADD_ADDRESS_SHEET_NAME,
(String) ContenttypesGlobalizationUtil.globalize( ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.contact.attach_address").localize(), "cms.contenttypes.ui.contact.attach_address"),
new AttachAddressWorkflowLockedComponentAccess(attachAddressSheet, new AttachAddressWorkflowLockedComponentAccess(attachAddressSheet,
itemModel), itemModel),
attachAddressSheet.getSaveCancelSection().getCancelButton()); attachAddressSheet.getSaveCancelSection().getCancelButton());
add(CHANGE_ADDRESS_SHEET_NAME, (String) ContenttypesGlobalizationUtil. add(CHANGE_ADDRESS_SHEET_NAME,
globalize("cms.contenttypes.ui.contact.reattach_address"). ContenttypesGlobalizationUtil.globalize(
localize(), new EditAddressWorkflowLockedComponentAccess( "cms.contenttypes.ui.contact.reattach_address"),
reattachAddressSheet, itemModel), reattachAddressSheet. new EditAddressWorkflowLockedComponentAccess(reattachAddressSheet,
getSaveCancelSection().getCancelButton()); itemModel),
reattachAddressSheet.getSaveCancelSection().getCancelButton());
/*add(EDIT_ADDRESS_SHEET_NAME, (String) ContenttypesGlobalizationUtil. /*add(EDIT_ADDRESS_SHEET_NAME, (String) ContenttypesGlobalizationUtil.
globalize("cms.contenttypes.ui.contact.edit_address").localize(), globalize("cms.contenttypes.ui.contact.edit_address").localize(),
new EditAddressWorkflowLockedComponentAccess(editAddressSheet, new EditAddressWorkflowLockedComponentAccess(editAddressSheet,
itemModel), itemModel),
editAddressSheet.getSaveCancelSection().getCancelButton());*/ editAddressSheet.getSaveCancelSection().getCancelButton());*/
add(DELETE_ADDRESS_SHEET_NAME, add(DELETE_ADDRESS_SHEET_NAME,
(String) ContenttypesGlobalizationUtil.globalize( ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.contact.delete_address").localize(), "cms.contenttypes.ui.contact.delete_address"),
new EditAddressWorkflowLockedComponentAccess(deleteAddressSheet, new EditAddressWorkflowLockedComponentAccess(deleteAddressSheet,
itemModel), itemModel),
deleteAddressSheet.getSaveCancelSection().getCancelButton()); deleteAddressSheet.getSaveCancelSection().getCancelButton());
@ -87,6 +88,11 @@ public class GenericContactAddressPropertiesStep extends SimpleEditStep {
} }
/**
*
* @param itemModel
* @return
*/
public static Component getAddressPropertySheet(ItemSelectionModel itemModel) { public static Component getAddressPropertySheet(ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(

View File

@ -27,6 +27,7 @@ import com.arsdigita.cms.contenttypes.GenericPersonContactCollection;
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.ItemSearchWidget;
import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.globalization.GlobalizationHelper; import com.arsdigita.globalization.GlobalizationHelper;
import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.Kernel;
import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.util.UncheckedWrapperException;
@ -82,6 +83,7 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm
@Override @Override
public void addWidgets() { public void addWidgets() {
add(new Label(ContenttypesGlobalizationUtil.globalize( add(new Label(ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.contact.select_person"))); "cms.contenttypes.ui.contact.select_person")));
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
@ -97,7 +99,7 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm
SingleSelect contactType = new SingleSelect(contactTypeParam); SingleSelect contactType = new SingleSelect(contactTypeParam);
contactType.addValidationListener(new NotNullValidationListener()); contactType.addValidationListener(new NotNullValidationListener());
contactType.addOption(new Option("", contactType.addOption(new Option("",
new Label(ContenttypesGlobalizationUtil new Label(GlobalizationUtil
.globalize("cms.ui.select_one")))); .globalize("cms.ui.select_one"))));
// Add the Options to the SingleSelect widget // Add the Options to the SingleSelect widget

View File

@ -61,9 +61,8 @@ public class GenericContactEntriesPropertiesStep extends SimpleEditStep {
BasicItemForm addContactEntrySheet = new GenericContactEntryAddForm(itemModel); BasicItemForm addContactEntrySheet = new GenericContactEntryAddForm(itemModel);
add(ADD_CONTACT_ENTRY_SHEET_NAME, add(ADD_CONTACT_ENTRY_SHEET_NAME,
(String)ContenttypesGlobalizationUtil ContenttypesGlobalizationUtil.globalize(
.globalize("cms.contenttypes.ui.contact.add_contactEntry") "cms.contenttypes.ui.contact.add_contactEntry"),
.localize(),
new WorkflowLockedComponentAccess(addContactEntrySheet, new WorkflowLockedComponentAccess(addContactEntrySheet,
itemModel), itemModel),
addContactEntrySheet.getSaveCancelSection().getCancelButton()); addContactEntrySheet.getSaveCancelSection().getCancelButton());

View File

@ -84,12 +84,12 @@ public class GenericContactEntriesTable extends Table implements TableActionList
2, 2,
ContenttypesGlobalizationUtil.globalize( ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.contact.contactEntry.description") "cms.contenttypes.ui.contact.contactEntry.description")
.localize())); ));
tab_model.add(new TableColumn( tab_model.add(new TableColumn(
3, 3,
ContenttypesGlobalizationUtil.globalize( ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.contact.contactEntry.action") "cms.contenttypes.ui.contact.contactEntry.action")
.localize(), ,
TABLE_COL_DEL)); TABLE_COL_DEL));
setModelBuilder(new ContactTableModelBuilder(itemModel)); setModelBuilder(new ContactTableModelBuilder(itemModel));
@ -194,7 +194,6 @@ public class GenericContactEntriesTable extends Table implements TableActionList
0, MAX_DESC_LENGTH) 0, MAX_DESC_LENGTH)
: m_contactEntry.getDescription(); : m_contactEntry.getDescription();
case 3: case 3:
// return GlobalizationUtil.globalize("cms.ui.delete").localize();
return GlobalizationUtil.globalize("cms.ui.delete"); return GlobalizationUtil.globalize("cms.ui.delete");
default: default:
return null; return null;

View File

@ -64,7 +64,9 @@ public class GenericContactEntryAddForm extends BasicItemForm {
ParameterModel contactEntryKeyParam = new StringParameter(GenericContactEntry.KEY); ParameterModel contactEntryKeyParam = new StringParameter(GenericContactEntry.KEY);
SingleSelect contactEntryKey = new SingleSelect(contactEntryKeyParam); SingleSelect contactEntryKey = new SingleSelect(contactEntryKeyParam);
contactEntryKey.addValidationListener(new NotNullValidationListener()); contactEntryKey.addValidationListener(new NotNullValidationListener());
contactEntryKey.addOption(new Option("", new Label((String)GlobalizationUtil.globalize("cms.ui.select_one").localize()))); contactEntryKey.addOption(new
Option("", new Label(GlobalizationUtil.globalize(
"cms.ui.select_one")) ));
// Add the Options to the SingleSelect widget // Add the Options to the SingleSelect widget
GenericContactEntryKeys keyList = new GenericContactEntryKeys(); GenericContactEntryKeys keyList = new GenericContactEntryKeys();
@ -103,7 +105,8 @@ public class GenericContactEntryAddForm extends BasicItemForm {
// save only if save button was pressed // save only if save button was pressed
if (contact != null if (contact != null
&& getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) { && getSaveCancelSection().getSaveButton()
.isSelected(fse.getPageState())) {
GenericContactEntry contactEntry = new GenericContactEntry(contact, GenericContactEntry contactEntry = new GenericContactEntry(contact,
(String)data.get(GenericContactEntry.KEY), (String)data.get(GenericContactEntry.KEY),

View File

@ -28,8 +28,8 @@ public class GenericContactPersonPropertiesStep extends SimpleEditStep {
public static final String CHANGE_PERSON_SHEET_NAME = "changePerson"; public static final String CHANGE_PERSON_SHEET_NAME = "changePerson";
public static final String DELETE_PERSON_SHEET_NAME = "deletePerson"; public static final String DELETE_PERSON_SHEET_NAME = "deletePerson";
private WorkflowLockedComponentAccess addPerson; private WorkflowLockedComponentAccess addPerson;
private WorkflowLockedComponentAccess editPerson; // private WorkflowLockedComponentAccess editPerson;
private WorkflowLockedComponentAccess delPerson; // private WorkflowLockedComponentAccess delPerson;
/** /**
* Creates a new instance of GenericContactPersonPropertiesStep * Creates a new instance of GenericContactPersonPropertiesStep
@ -48,9 +48,8 @@ public class GenericContactPersonPropertiesStep extends SimpleEditStep {
GenericContactAttachPersonPropertyForm(itemModel, this); GenericContactAttachPersonPropertyForm(itemModel, this);
addPerson = new WorkflowLockedComponentAccess(addPersonSheet, itemModel); addPerson = new WorkflowLockedComponentAccess(addPersonSheet, itemModel);
add(ADD_PERSON_SHEET_NAME, add(ADD_PERSON_SHEET_NAME,
(String) ContenttypesGlobalizationUtil ContenttypesGlobalizationUtil.globalize(
.globalize("cms.contenttypes.ui.contact.attach_person") "cms.contenttypes.ui.contact.attach_person"),
.localize(),
addPerson, addPerson,
addPersonSheet.getSaveCancelSection().getCancelButton()); addPersonSheet.getSaveCancelSection().getCancelButton());
@ -65,6 +64,7 @@ public class GenericContactPersonPropertiesStep extends SimpleEditStep {
} }
public static Component getEmptyPersonPropertySheet(ItemSelectionModel itemModel) { public static Component getEmptyPersonPropertySheet(ItemSelectionModel itemModel) {
return new Label(((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.emptyPerson").localize())); return new Label((ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.contact.emptyPerson") ));
} }
} }

View File

@ -73,9 +73,8 @@ public class GenericContactPropertiesStep extends SimpleEditStep {
BasicPageForm editBasicSheet = new GenericContactPropertyForm(itemModel, this); BasicPageForm editBasicSheet = new GenericContactPropertyForm(itemModel, this);
basicProperties.add( basicProperties.add(
EDIT_BASIC_SHEET_NAME, EDIT_BASIC_SHEET_NAME,
(String) ContenttypesGlobalizationUtil ContenttypesGlobalizationUtil.globalize(
.globalize("cms.contenttypes.ui.contact.edit_basic_properties") "cms.contenttypes.ui.contact.edit_basic_properties"),
.localize(),
new WorkflowLockedComponentAccess( new WorkflowLockedComponentAccess(
editBasicSheet, editBasicSheet,
itemModel), itemModel),
@ -140,20 +139,10 @@ public class GenericContactPropertiesStep extends SimpleEditStep {
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"), "name"); sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"), "name");
if (!ContentSection.getConfig().getHideLaunchDate()) { if (!ContentSection.getConfig().getHideLaunchDate()) {
sheet.add(GlobalizationUtil
sheet.add(GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date"), .globalize("cms.contenttypes.ui.launch_date"),
ContentPage.LAUNCH_DATE, ContentPage.LAUNCH_DATE,
new DomainObjectPropertySheet.AttributeFormatter() { new LaunchDateAttributeFormatter() );
public String format(DomainObject obj, String attribute, PageState state) {
ContentPage page = (ContentPage) obj;
if (page.getLaunchDate() != null) {
return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate());
} else {
return (String) GlobalizationUtil.globalize("cms.ui.unknown").localize();
}
}
});
} }
return sheet; return sheet;

View File

@ -45,8 +45,8 @@ public class GenericContactTypePropertiesStep extends SimpleEditStep {
BasicItemForm addContactTypeSheet = new GenericContactTypeAddForm(itemModel); BasicItemForm addContactTypeSheet = new GenericContactTypeAddForm(itemModel);
add(ADD_CONTACT_SHEET_NAME, add(ADD_CONTACT_SHEET_NAME,
(String) ContenttypesGlobalizationUtil.globalize( ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.person.add_contacttype").localize(), "cms.contenttypes.ui.person.add_contacttype"),
new WorkflowLockedComponentAccess(addContactTypeSheet, itemModel), new WorkflowLockedComponentAccess(addContactTypeSheet, itemModel),
addContactTypeSheet.getSaveCancelSection().getCancelButton()); addContactTypeSheet.getSaveCancelSection().getCancelButton());

View File

@ -37,6 +37,8 @@ import com.arsdigita.search.ui.QueryGenerator;
import com.arsdigita.search.QuerySpecification; import com.arsdigita.search.QuerySpecification;
import com.arsdigita.toolbox.ui.LayoutPanel; import com.arsdigita.toolbox.ui.LayoutPanel;
import org.apache.log4j.Logger;
/** /**
* Contains a form for specifying search parameters, as well as a * Contains a form for specifying search parameters, as well as a
* {@link com.arsdigita.search.ui.ResultsPane} which will perform the search and * {@link com.arsdigita.search.ui.ResultsPane} which will perform the search and
@ -46,11 +48,10 @@ import com.arsdigita.toolbox.ui.LayoutPanel;
* @version $Id: ItemSearchSection.java 1940 2009-05-29 07:15:05Z terry $ * @version $Id: ItemSearchSection.java 1940 2009-05-29 07:15:05Z terry $
*/ */
public class ItemSearchSection extends FormSection public class ItemSearchSection extends FormSection
implements Resettable, QueryGenerator { implements Resettable, QueryGenerator {
private static final org.apache.log4j.Logger s_log = private static final Logger s_log = org.apache.log4j.Logger.getLogger(
org.apache.log4j.Logger. ItemSearchSection.class);
getLogger(ItemSearchSection.class);
public static final String SINGLE_TYPE_PARAM = "single_type"; public static final String SINGLE_TYPE_PARAM = "single_type";
private ItemQueryComponent m_query; private ItemQueryComponent m_query;
private Component m_results; private Component m_results;
@ -158,6 +159,7 @@ public class ItemSearchSection extends FormSection
} }
// Hide results by default // Hide results by default
@Override
public void register(Page p) { public void register(Page p) {
super.register(p); super.register(p);
p.setVisibleDefault(m_results, false); p.setVisibleDefault(m_results, false);

View File

@ -54,11 +54,14 @@ public class ItemSearchSectionInline extends ItemSearchSection {
/** /**
* Construct a new <code>ItemSearchSectionInline</code> component * Construct a new <code>ItemSearchSectionInline</code> component
* *
* @param name
* @param context the context for the retrieved items. Should be * @param context the context for the retrieved items. Should be
* {@link ContentItem#DRAFT} or {@link ContentItem#LIVE} * {@link ContentItem#DRAFT} or {@link ContentItem#LIVE}
* @param limitToContentSection limit the search to the current content section * @param limitToContentSection limit the search to the current content section
*/ */
public ItemSearchSectionInline(String name, String context, boolean limitToContentSection) { public ItemSearchSectionInline(String name,
String context,
boolean limitToContentSection) {
super(name, context, limitToContentSection); super(name, context, limitToContentSection);
m_name = name; m_name = name;
m_item = new OIDParameter(name + "_itemOID"); m_item = new OIDParameter(name + "_itemOID");
@ -66,7 +69,16 @@ public class ItemSearchSectionInline extends ItemSearchSection {
addResultsPane(this); addResultsPane(this);
} }
public ItemSearchSectionInline(String name, String context, /**
* Constructor.
*
* @param name
* @param context
* @param limitToContentSection
* @param type
*/
public ItemSearchSectionInline(String name,
String context,
boolean limitToContentSection, boolean limitToContentSection,
ContentType type) { ContentType type) {
super(name, context, limitToContentSection, type); super(name, context, limitToContentSection, type);

View File

@ -47,6 +47,7 @@ import com.arsdigita.cms.ContentCenterServlet;
import com.arsdigita.cms.lifecycle.LifecycleDefinition; import com.arsdigita.cms.lifecycle.LifecycleDefinition;
import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.globalization.GlobalizedMessage;
import com.arsdigita.web.ParameterMap; import com.arsdigita.web.ParameterMap;
import com.arsdigita.web.URL; import com.arsdigita.web.URL;
import com.arsdigita.workflow.simple.Workflow; import com.arsdigita.workflow.simple.Workflow;
@ -60,7 +61,9 @@ import org.apache.log4j.Logger;
* @version $Id: ItemSearchWidget.java 1166 2006-06-14 11:45:15Z fabrice $ * @version $Id: ItemSearchWidget.java 1166 2006-06-14 11:45:15Z fabrice $
*/ */
public class ItemSearchWidget extends FormSection public class ItemSearchWidget extends FormSection
implements BebopConstants, FormSubmissionListener, FormInitListener { implements BebopConstants,
FormSubmissionListener,
FormInitListener {
private static final Logger s_log = Logger.getLogger(ItemSearchWidget.class); private static final Logger s_log = Logger.getLogger(ItemSearchWidget.class);
//private Hidden m_selected; //private Hidden m_selected;
@ -83,8 +86,10 @@ public class ItemSearchWidget extends FormSection
private ParameterModel m_searchModel; private ParameterModel m_searchModel;
private boolean disableCreatePane = false; private boolean disableCreatePane = false;
private boolean editAfterCreate = true; private boolean editAfterCreate = true;
private String searchLabelText = (String) GlobalizationUtil.globalize("cms.ui.item_search.search").localize(); private GlobalizedMessage searchLabelText = GlobalizationUtil.globalize(
private String selectedLabelText = (String) GlobalizationUtil.globalize("cms.ui.item_search.selected").localize(); "cms.ui.item_search.search");
private GlobalizedMessage selectedLabelText = GlobalizationUtil.globalize(
"cms.ui.item_search.selected");
public static final String BEBOP_ITEM_SEARCH = "bebop:itemSearch"; public static final String BEBOP_ITEM_SEARCH = "bebop:itemSearch";
public static final String SEARCH = "search"; public static final String SEARCH = "search";
public static final boolean LIMIT_TO_CONTENT_SECTION = false; public static final boolean LIMIT_TO_CONTENT_SECTION = false;
@ -108,7 +113,7 @@ public class ItemSearchWidget extends FormSection
private ItemSearchWidget parent; private ItemSearchWidget parent;
public SearchFragment(String name, ItemSearchWidget parent) { public SearchFragment(String name, ItemSearchWidget parent) {
super(name, "Search"); super(name, GlobalizationUtil.globalize("cms.ui.search"));
this.parent = parent; this.parent = parent;
this.setAttribute("onClick", "return " + parent.m_selected.getName(). //+ parent.m_item.getName(). this.setAttribute("onClick", "return " + parent.m_selected.getName(). //+ parent.m_item.getName().
replace('.', '_') + "Popup(this.form)"); replace('.', '_') + "Popup(this.form)");
@ -129,10 +134,11 @@ public class ItemSearchWidget extends FormSection
private ItemSearchWidget parent; private ItemSearchWidget parent;
public ClearFragment(String name, ItemSearchWidget parent) { public ClearFragment(String name, ItemSearchWidget parent) {
super(name, "Clear"); super(name, GlobalizationUtil.globalize("cms.ui.clear"));
this.parent = parent; this.parent = parent;
this.setAttribute("onClick", "this.form." + parent.m_selected.getName() + ".value = \"\";" this.setAttribute("onClick", "this.form." + parent.m_selected.getName()
+ "this.form." + parent.m_item.getName() + ".value = \"\";" + ".value = \"\";" + "this.form."
+ parent.m_item.getName() + ".value = \"\";"
+ "return false;"); + "return false;");
this.setAttribute("value", "Clear"); this.setAttribute("value", "Clear");
} }
@ -208,7 +214,8 @@ public class ItemSearchWidget extends FormSection
*param *param
* contentType * contentType
*/ */
public ItemSearchWidget(final ParameterModel model, final ContentType contentType) { public ItemSearchWidget(final ParameterModel model,
final ContentType contentType) {
super(new BoxPanel(BoxPanel.VERTICAL)); super(new BoxPanel(BoxPanel.VERTICAL));
if (!(model instanceof ItemSearchParameter)) { if (!(model instanceof ItemSearchParameter)) {
@ -234,12 +241,14 @@ public class ItemSearchWidget extends FormSection
m_contentType = contentType; m_contentType = contentType;
//m_selected = new Hidden(model); //m_selected = new Hidden(model);
m_selected = new ItemFragment(model, this); m_selected = new ItemFragment(model, this);
final Label selectedItemLabel = new Label(selectedLabelText); final Label selectedItemLabel = new Label(GlobalizationUtil.globalize(""
+ " cms.ui.item_search.selected"));
selectedItemLabel.addPrintListener(new PrintListener() { selectedItemLabel.addPrintListener(new PrintListener() {
public void prepare(final PrintEvent event) { public void prepare(final PrintEvent event) {
final Label target = (Label) event.getTarget(); final Label target = (Label) event.getTarget();
target.setLabel(selectedLabelText); target.setLabel(GlobalizationUtil.globalize(
"cms.ui.item_search.selected"));
} }
}); });
@ -492,19 +501,19 @@ public class ItemSearchWidget extends FormSection
} }
} }
public String getSearchLabelText() { public GlobalizedMessage getSearchLabelText() {
return searchLabelText; return searchLabelText;
} }
public void setSearchLabelText(final String searchLabelText) { public void setSearchLabelText(final GlobalizedMessage searchLabelText) {
this.searchLabelText = searchLabelText; this.searchLabelText = searchLabelText;
} }
public String getSelectedLabelText() { public GlobalizedMessage getSelectedLabelText() {
return selectedLabelText; return selectedLabelText;
} }
public void setSelectedLabelText(final String selectedLabelText) { public void setSelectedLabelText(final GlobalizedMessage selectedLabelText) {
this.selectedLabelText = selectedLabelText; this.selectedLabelText = selectedLabelText;
} }

View File

@ -41,10 +41,10 @@ import java.util.Iterator;
import java.util.Map; import java.util.Map;
/** /**
* Extends {@link com.arsdigita.bebop.PropertyEditor} to provide * Extends {@link com.arsdigita.bebop.PropertyEditor} to provide access control
* access control features. Each link may be associated with a {@link * features. Each link may be associated with a {@link
* com.arsdigita.toolbox.ui.ComponentAccess} object; if the current * com.arsdigita.toolbox.ui.ComponentAccess} object; if the current does not
* does not have sufficient privileges, the link will be hidden. * have sufficient privileges, the link will be hidden.
* <p> * <p>
* The simple use pattern for this component is as follows: * The simple use pattern for this component is as follows:
* *