From portal-commits at lists.jboss.org Tue Nov 27 05:41:31 2007 Content-Type: multipart/mixed; boundary="===============5230419013252996555==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9121 - branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions. Date: Tue, 27 Nov 2007 05:41:31 -0500 Message-ID: --===============5230419013252996555== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2007-11-27 05:41:30 -0500 (Tue, 27 Nov 2007) New Revision: 9121 Added: branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/co= re/admin/ui/actions/PortalObjectDisplayNameAction.java Log: JBPORTAL-1805: Let a user define multiple display-name for a portal object = in the admin portlet Draft for Wesley Added: branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/porta= l/core/admin/ui/actions/PortalObjectDisplayNameAction.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/c= ore/admin/ui/actions/PortalObjectDisplayNameAction.java = (rev 0) +++ branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/c= ore/admin/ui/actions/PortalObjectDisplayNameAction.java 2007-11-27 10:41:30= UTC (rev 9121) @@ -0,0 +1,55 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.core.admin.ui.actions; + +import java.util.Locale; +import java.util.Map; + +import org.jboss.portal.common.i18n.LocalizedString; +import org.jboss.portal.core.model.portal.PortalObject; + +/** + * @author Thomas Heute + * @version $Revision$ + */ +public class PortalObjectDisplayNameAction +{ + + private PortalObject selectedObject; + = + private Locale newLocale; + = + private String newText; + = + public void addDisplayName() + { + LocalizedString localizedString =3D selectedObject.getDisplayName(); + Map map =3D localizedString.getValues(); + map.put(newLocale, new LocalizedString.Value(newLocale, newText)); + LocalizedString newLocalizedString =3D new LocalizedString(map, Loca= le.ENGLISH); + selectedObject.setDisplayName(newLocalizedString); + } + = + = +} + --===============5230419013252996555==--