Author: julien(a)jboss.com
Date: 2008-06-01 11:32:27 -0400 (Sun, 01 Jun 2008)
New Revision: 10890
Added:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PaneNode.java
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContent.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PageNode.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/WindowNode.java
Log:
added pane node impl
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContent.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContent.java 2008-06-01
15:12:54 UTC (rev 10889)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContent.java 2008-06-01
15:32:27 UTC (rev 10890)
@@ -23,6 +23,10 @@
package org.jboss.portal.presentation.portal.content.markup;
import org.jboss.portal.presentation.portal.model.WindowNode;
+import org.jboss.portal.presentation.model.content.WindowContent;
+import org.jboss.portal.presentation.client.PresentationClient;
+import org.jboss.portal.presentation.server.PresentationServerException;
+import org.jboss.portal.portlet.PortletInvoker;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
@@ -43,4 +47,9 @@
{
return markup;
}
+
+ public WindowContent render(WindowNode window, PresentationClient client,
PortletInvoker portletInvoker) throws PresentationServerException
+ {
+ return new WindowContent(0, "blah", "markup");
+ }
}
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PageNode.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PageNode.java 2008-06-01
15:12:54 UTC (rev 10889)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PageNode.java 2008-06-01
15:32:27 UTC (rev 10890)
@@ -25,6 +25,10 @@
import org.jboss.portal.presentation.model.ui.UIObject;
import org.jboss.portal.presentation.model.ui.UIPage;
+import java.util.Collection;
+import java.util.List;
+import java.util.ArrayList;
+
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
@@ -40,4 +44,30 @@
{
return UIPage.class;
}
+
+ public Collection<WindowNode> getWindows()
+ {
+ List<WindowNode> windows = new ArrayList<WindowNode>();
+
+ //
+ collectWindows(this, windows);
+
+ //
+ return windows;
+ }
+
+ private void collectWindows(StructuralNode node, List<WindowNode> windows)
+ {
+ if (node instanceof WindowNode)
+ {
+ windows.add((WindowNode)node);
+ }
+ else if (node instanceof PaneNode)
+ {
+ for (StructuralNode child : node.getChildren())
+ {
+ collectWindows(child, windows);
+ }
+ }
+ }
}
Added:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PaneNode.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PaneNode.java
(rev 0)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PaneNode.java 2008-06-01
15:32:27 UTC (rev 10890)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.portal.model;
+
+import org.jboss.portal.presentation.model.ui.UIObject;
+import org.jboss.portal.presentation.model.ui.UIPane;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PaneNode extends StructuralNode
+{
+
+ public PaneNode(String name, StructuralStateContextImpl structuralStateContext)
+ {
+ super(name, structuralStateContext);
+ }
+
+ public Class<? extends UIObject> getType()
+ {
+ return UIPane.class;
+ }
+}
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/WindowNode.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/WindowNode.java 2008-06-01
15:12:54 UTC (rev 10889)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/WindowNode.java 2008-06-01
15:32:27 UTC (rev 10890)
@@ -49,6 +49,20 @@
return UIWindow.class;
}
+ public PageNode getPage()
+ {
+ for (StructuralNode current = getParent();current != null;current =
current.getParent())
+ {
+ if (current instanceof PageNode)
+ {
+ return (PageNode)current;
+ }
+ }
+
+ //
+ return null;
+ }
+
public void setContent(Content content)
{
this.content = content;
@@ -61,9 +75,6 @@
public static abstract class Content
{
- public WindowContent render(WindowNode window, PresentationClient client,
PortletInvoker portletInvoker) throws PresentationServerException
- {
- return new WindowContent(0, "blah", "markup");
- }
+ public abstract WindowContent render(WindowNode window, PresentationClient client,
PortletInvoker portletInvoker) throws PresentationServerException;
}
}