Author: julien(a)jboss.com
Date: 2007-12-03 19:58:53 -0500 (Mon, 03 Dec 2007)
New Revision: 9262
Added:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/AbstractStructuralStateChangeListener.java
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateChangeListener.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/state/structural/MockModelTestCase.java
Log:
added remove(String id) method in StructuralStateChangeListener
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java 2007-12-04
00:54:41 UTC (rev 9261)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java 2007-12-04
00:58:53 UTC (rev 9262)
@@ -69,6 +69,11 @@
// Update its structural view
tmp.structuralObject = object;
}
+
+ public void remove(String id)
+ {
+ objects.remove(id);
+ }
};
private static StructuralObject getRootState(StructuralStateContext loader)
Added:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/AbstractStructuralStateChangeListener.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/AbstractStructuralStateChangeListener.java
(rev 0)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/AbstractStructuralStateChangeListener.java 2007-12-04
00:58:53 UTC (rev 9262)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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.presentation.model.state.structural;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AbstractStructuralStateChangeListener implements
StructuralStateChangeListener
+{
+ public void update(StructuralObject object)
+ {
+ }
+
+ public void remove(String id)
+ {
+ }
+}
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateChangeListener.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateChangeListener.java 2007-12-04
00:54:41 UTC (rev 9261)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateChangeListener.java 2007-12-04
00:58:53 UTC (rev 9262)
@@ -28,5 +28,17 @@
*/
public interface StructuralStateChangeListener
{
+ /**
+ * Updates the structural object.
+ *
+ * @param object the object to update
+ */
void update(StructuralObject object);
+
+ /**
+ * Removes the structural object with the specified id.
+ *
+ * @param id the id to remove
+ */
+ void remove(String id);
}
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/state/structural/MockModelTestCase.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/state/structural/MockModelTestCase.java 2007-12-04
00:54:41 UTC (rev 9261)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/state/structural/MockModelTestCase.java 2007-12-04
00:58:53 UTC (rev 9262)
@@ -26,15 +26,16 @@
import org.jboss.portal.presentation.model.UIContext;
import org.jboss.portal.presentation.model.UIPortal;
import org.jboss.portal.presentation.model.state.StaleStateException;
+import
org.jboss.portal.presentation.model.state.structural.AbstractStructuralStateChangeListener;
import org.jboss.portal.presentation.model.state.structural.StructuralObject;
import org.jboss.portal.presentation.model.state.structural.StructuralState;
import
org.jboss.portal.presentation.model.state.structural.StructuralStateChangeListener;
import org.jboss.portal.presentation.model.state.structural.StructuralStateContext;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.HashMap;
/**
* Test that the mock model we are using behaves in an expected manner
@@ -55,7 +56,7 @@
private Map<String, StructuralObject> universe;
/** . */
- private final StructuralStateChangeListener listener = new
StructuralStateChangeListener()
+ private final StructuralStateChangeListener listener = new
AbstractStructuralStateChangeListener()
{
public void update(StructuralObject object)
{