Author: chris.laprun(a)jboss.com
Date: 2009-02-18 19:37:54 -0500 (Wed, 18 Feb 2009)
New Revision: 12832
Added:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/HasDisplayName.java
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/instance/Instance.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java
Log:
- Extracted display name behavior from Instance and PortalObject into a HasDisplayName
interface.
Added:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/HasDisplayName.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/HasDisplayName.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/HasDisplayName.java 2009-02-19
00:37:54 UTC (rev 12832)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.model;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public interface HasDisplayName
+{
+ /**
+ * Return the localized string used to represent that object.
+ *
+ * @return the localized display name
+ */
+ LocalizedString getDisplayName();
+
+ /**
+ * Set the localized string used to represent that object.
+ *
+ * @param localizedString the localized display name
+ */
+ void setDisplayName(LocalizedString localizedString);
+}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/instance/Instance.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/instance/Instance.java 2009-02-19
00:10:12 UTC (rev 12831)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/instance/Instance.java 2009-02-19
00:37:54 UTC (rev 12832)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, 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. *
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.core.model.instance;
-import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.core.model.HasDisplayName;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.invocation.PortletInvocation;
@@ -38,7 +38,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public interface Instance
+public interface Instance extends HasDisplayName
{
/** The attribute name under which the instance id can be accessed. */
String INSTANCE_ID_ATTRIBUTE = "instanceid";
@@ -51,20 +51,6 @@
String getId();
/**
- * Return the display name
- *
- * @return the display name
- */
- LocalizedString getDisplayName();
-
- /**
- * Set the display name
- *
- * @param localizedString
- */
- void setDisplayName(LocalizedString localizedString);
-
- /**
* Return the runtime metadata for this portlet.
*
* @return the info
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java 2009-02-19
00:10:12 UTC (rev 12831)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java 2009-02-19
00:37:54 UTC (rev 12832)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, 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. *
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.core.model.portal;
-import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.core.model.HasDisplayName;
import java.util.Collection;
import java.util.Map;
@@ -33,7 +33,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public interface PortalObject extends Comparable
+public interface PortalObject extends Comparable, HasDisplayName
{
/** Portal property name that indicates the name of the default portal to lookup. */
@@ -86,22 +86,8 @@
* @return the object name
*/
String getName();
-
- /**
- * Return the localized string used to represent that object.
- *
- * @return the localized display name
- */
- LocalizedString getDisplayName();
/**
- * Set the localized string used to represent that object.
- *
- * @param localizedString the localized display name
- */
- void setDisplayName(LocalizedString localizedString);
-
- /**
* Returns the listener id or null if there is none.
*
* @return the listener
@@ -146,7 +132,7 @@
/**
* Returns the child of the specified type and with the given name or
<code>null</code> if it cannot be found.
*
- * @param name the child's name
+ * @param name the child's name
* @param expectedType the expected type of the child to be retrieved
* @param <T> a class extending PortalObject
* @return the named child or <code>null</code> if it cannot be found