[portal-commits] JBoss Portal SVN: r9121 - branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Tue Nov 27 05:41:31 EST 2007


Author: thomas.heute at 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/core/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/portal/core/admin/ui/actions/PortalObjectDisplayNameAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalObjectDisplayNameAction.java	                        (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/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 <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class PortalObjectDisplayNameAction
+{
+
+   private PortalObject selectedObject;
+   
+   private Locale newLocale;
+   
+   private String newText;
+   
+   public void addDisplayName()
+   {
+      LocalizedString localizedString = selectedObject.getDisplayName();
+      Map map = localizedString.getValues();
+      map.put(newLocale, new LocalizedString.Value(newLocale, newText));
+      LocalizedString newLocalizedString = new LocalizedString(map, Locale.ENGLISH);
+      selectedObject.setDisplayName(newLocalizedString);
+   }
+   
+   
+}
+




More information about the portal-commits mailing list