Author: julien(a)jboss.com
Date: 2008-06-30 17:17:01 -0400 (Mon, 30 Jun 2008)
New Revision: 11225
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java
Removed:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPaneImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPane.java
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelAdapter.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UILayoutImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UILayout.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPage.java
Log:
a bit of reorg of the ui model
Copied:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java
(from rev 11220,
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java)
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java 2008-06-30
21:17:01 UTC (rev 11225)
@@ -0,0 +1,123 @@
+/******************************************************************************
+ * 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.ajax.client.model;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Panel;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.portal.presentation.ajax.client.Constants;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public abstract class AjaxLayout extends AjaxObject
+{
+
+ /** . */
+ private Label title;
+
+ /** . */
+ private Panel container;
+
+ /** . */
+ private Widget widget;
+
+ public AjaxLayout(String id, Map properties)
+ {
+ super(id, properties);
+
+ //
+ Label title = new Label("Pane " + id);
+ VerticalPanel widget = new VerticalPanel();
+ Panel container;
+
+ //
+ String layoutId = (String)getPropertyValue(Constants.LAYOUT_ID);
+
+ //
+ if (Constants.SIMPLE_LAYOUT.equals(layoutId))
+ {
+ String orientation =
(String)getPropertyValue(Constants.SIMPLE_LAYOUT_ORIENTATION);
+
+ //
+ if (orientation == null || !Constants.VERTICAL_ORIENTATION.equals(orientation))
+ {
+ container = new HorizontalPanel();
+ }
+ else
+ {
+ container = new VerticalPanel();
+ }
+ }
+ else
+ {
+ // todo
+ container = new VerticalPanel();
+ }
+
+ //
+ widget.add(title);
+ widget.add(container);
+
+ //
+ widget.setStyleName("pf-Pane");
+ title.setStyleName("pf-Title");
+ container.setStyleName("pf-Container");
+
+ //
+ this.title = title;
+ this.container = container;
+ this.widget = widget;
+ }
+
+ protected void doAddChild(AjaxObject child)
+ {
+ Widget childWidget = child.getWidget();
+
+ //
+ container.add(childWidget);
+ }
+
+ public Widget getWidget()
+ {
+ return widget;
+ }
+
+ protected void doRefresh()
+ {
+ for (Iterator i = getChildren().iterator();i.hasNext();)
+ {
+ AjaxObject child = (AjaxObject)i.next();
+
+ //
+ child.refresh();
+ }
+ }
+}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-06-30
20:59:30 UTC (rev 11224)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-06-30
21:17:01 UTC (rev 11225)
@@ -28,7 +28,7 @@
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
*/
-public class AjaxPage extends AjaxPane
+public class AjaxPage extends AjaxLayout
{
public AjaxPage(String id, Map properties)
{
Deleted:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java 2008-06-30
20:59:30 UTC (rev 11224)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java 2008-06-30
21:17:01 UTC (rev 11225)
@@ -1,123 +0,0 @@
-/******************************************************************************
- * 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.ajax.client.model;
-
-import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Panel;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.jboss.portal.presentation.ajax.client.Constants;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class AjaxPane extends AjaxObject
-{
-
- /** . */
- private Label title;
-
- /** . */
- private Panel container;
-
- /** . */
- private Widget widget;
-
- public AjaxPane(String id, Map properties)
- {
- super(id, properties);
-
- //
- Label title = new Label("Pane " + id);
- VerticalPanel widget = new VerticalPanel();
- Panel container;
-
- //
- String layoutId = (String)getPropertyValue(Constants.LAYOUT_ID);
-
- //
- if (Constants.SIMPLE_LAYOUT.equals(layoutId))
- {
- String orientation =
(String)getPropertyValue(Constants.SIMPLE_LAYOUT_ORIENTATION);
-
- //
- if (orientation == null || !Constants.VERTICAL_ORIENTATION.equals(orientation))
- {
- container = new HorizontalPanel();
- }
- else
- {
- container = new VerticalPanel();
- }
- }
- else
- {
- // todo
- container = new VerticalPanel();
- }
-
- //
- widget.add(title);
- widget.add(container);
-
- //
- widget.setStyleName("pf-Pane");
- title.setStyleName("pf-Title");
- container.setStyleName("pf-Container");
-
- //
- this.title = title;
- this.container = container;
- this.widget = widget;
- }
-
- protected void doAddChild(AjaxObject child)
- {
- Widget childWidget = child.getWidget();
-
- //
- container.add(childWidget);
- }
-
- public Widget getWidget()
- {
- return widget;
- }
-
- protected void doRefresh()
- {
- for (Iterator i = getChildren().iterator();i.hasNext();)
- {
- AjaxObject child = (AjaxObject)i.next();
-
- //
- child.refresh();
- }
- }
-}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java 2008-06-30
21:17:01 UTC (rev 11225)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.ajax.client.model;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AjaxPane extends AjaxLayout
+{
+ public AjaxPane(String id, Map properties)
+ {
+ super(id, properties);
+ }
+}
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelAdapter.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelAdapter.java 2008-06-30
20:59:30 UTC (rev 11224)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelAdapter.java 2008-06-30
21:17:01 UTC (rev 11225)
@@ -34,8 +34,8 @@
import org.jboss.portal.presentation.portal.model.node.PageNode;
import org.jboss.portal.presentation.portal.model.node.WindowNode;
import org.jboss.portal.presentation.model.ui.UIObject;
-import org.jboss.portal.presentation.model.ui.UILayout;
import org.jboss.portal.presentation.model.ui.UIWindow;
+import org.jboss.portal.presentation.model.ui.UIPane;
import org.jboss.portal.presentation.state.structural.StructuralState;
import org.jboss.portal.common.NotYetImplemented;
@@ -220,7 +220,7 @@
{
if (o instanceof NestedStructure)
{
- return UILayout.class;
+ return UIPane.class;
}
else if (o instanceof SimpleElement)
{
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UILayoutImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UILayoutImpl.java 2008-06-30
20:59:30 UTC (rev 11224)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UILayoutImpl.java 2008-06-30
21:17:01 UTC (rev 11225)
@@ -29,7 +29,7 @@
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
*/
-public class UILayoutImpl extends UIObjectImpl implements UILayout
+public abstract class UILayoutImpl extends UIObjectImpl implements UILayout
{
public UILayoutImpl(StructuralObject structuralObject, UIObjectContext context)
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java 2008-06-30
20:59:30 UTC (rev 11224)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java 2008-06-30
21:17:01 UTC (rev 11225)
@@ -28,7 +28,7 @@
import org.jboss.portal.presentation.model.ui.UIContext;
import org.jboss.portal.presentation.model.ui.UIPage;
import org.jboss.portal.presentation.model.ui.UIWindow;
-import org.jboss.portal.presentation.model.ui.UILayout;
+import org.jboss.portal.presentation.model.ui.UIPane;
import org.jboss.portal.presentation.state.StateException;
import org.jboss.portal.presentation.state.StateType;
import org.jboss.portal.presentation.state.structural.StructuralObject;
@@ -66,9 +66,9 @@
{
object = new UIPageImpl(structuralObject, objectContext);
}
- else if (type == UILayout.class)
+ else if (type == UIPane.class)
{
- object = new UILayoutImpl(structuralObject, objectContext);
+ object = new UIPaneImpl(structuralObject, objectContext);
}
else if (type == UIContext.class)
{
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPaneImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPaneImpl.java 2008-06-30
20:59:30 UTC (rev 11224)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPaneImpl.java 2008-06-30
21:17:01 UTC (rev 11225)
@@ -1,39 +0,0 @@
-/******************************************************************************
- * 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.impl.model.ui;
-
-import org.jboss.portal.presentation.model.ui.UIPane;
-import org.jboss.portal.presentation.state.structural.StructuralObject;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class UIPaneImpl extends UIObjectImpl implements UIPane
-{
-
- public UIPaneImpl(StructuralObject structuralObject, UIObjectContext context)
- {
- super(structuralObject, context);
- }
-}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIContext.java 2008-06-30
20:59:30 UTC (rev 11224)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIContext.java 2008-06-30
21:17:01 UTC (rev 11225)
@@ -23,6 +23,8 @@
package org.jboss.portal.presentation.model.ui;
/**
+ * A context is a special kind of page which denotes the root page.
+ *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UILayout.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UILayout.java 2008-06-30
20:59:30 UTC (rev 11224)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UILayout.java 2008-06-30
21:17:01 UTC (rev 11225)
@@ -23,6 +23,8 @@
package org.jboss.portal.presentation.model.ui;
/**
+ * A ui object having the role to layout children.
+ *
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
*/
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPage.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPage.java 2008-06-30
20:59:30 UTC (rev 11224)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPage.java 2008-06-30
21:17:01 UTC (rev 11225)
@@ -23,6 +23,9 @@
package org.jboss.portal.presentation.model.ui;
/**
+ * A page is a special kind of layout that can be displayed by itself and
+ * does not have an outer context.
+ *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPane.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPane.java 2008-06-30
20:59:30 UTC (rev 11224)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPane.java 2008-06-30
21:17:01 UTC (rev 11225)
@@ -1,31 +0,0 @@
-/******************************************************************************
- * 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.model.ui;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public interface UIPane extends UIObject
-{
-}