Author: julien(a)jboss.com
Date: 2007-02-26 18:54:28 -0500 (Mon, 26 Feb 2007)
New Revision: 6415
Removed:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/LazyPortalObjectTreeNode.java
Log:
removed unused LazyPortalObjectTreeNode class now
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/LazyPortalObjectTreeNode.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/LazyPortalObjectTreeNode.java 2007-02-26
23:39:02 UTC (rev 6414)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/LazyPortalObjectTreeNode.java 2007-02-26
23:54:28 UTC (rev 6415)
@@ -1,188 +0,0 @@
-/******************************************************************************
- * 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.portlet.management;
-
-import org.apache.myfaces.custom.tree2.TreeNode;
-import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 6250 $
- */
-public class LazyPortalObjectTreeNode implements TreeNode
-{
-
- /** The serialVersionUID */
- private static final long serialVersionUID = 7253085860667670643L;
-
- public static LazyPortalObjectTreeNode newInstance(PortalObject object)
- {
- if (object.isDashboard())
- {
- return new DashboardNode(object);
- }
- else
- {
- return new LazyPortalObjectTreeNode(object);
- }
- }
-
- private static class DashboardNode extends LazyPortalObjectTreeNode
- {
- public DashboardNode(PortalObject object)
- {
- super(object);
- }
-
- public List getChildren()
- {
- return Collections.EMPTY_LIST;
- }
-
- public boolean isLeaf()
- {
- return true;
- }
-
- public int getChildCount()
- {
- return 0;
- }
- }
-
- /** . */
- private PortalObject object;
-
- /** . */
- private List children;
-
- /** . */
- private String description;
-
- /** . */
- private String type;
-
- protected LazyPortalObjectTreeNode(PortalObject object)
- {
- this.object = object;
- this.description = object.getName();
- switch (object.getType())
- {
- case PortalObject.TYPE_CONTEXT:
- type = "context";
- break;
- case PortalObject.TYPE_PORTAL:
- type = "portal";
- break;
- case PortalObject.TYPE_PAGE:
- type = "page";
- break;
- case PortalObject.TYPE_WINDOW:
- type = "window";
- break;
- }
- }
-
- public boolean isLeaf()
- {
- return object.getChildren().size() == 0;
- }
-
- public void setLeaf(boolean b)
- {
- throw new UnsupportedOperationException();
- }
-
- public List getChildren()
- {
- if (children == null)
- {
- children = new ArrayList(object.getChildren());
- Collections.sort(children, new Comparator()
- {
- public int compare(Object o1, Object o2)
- {
- PortalObject po1 = (PortalObject)o1;
- PortalObject po2 = (PortalObject)o2;
- int high1 = po1.getType();
- int high2 = po2.getType();
- if (high1 == high2)
- {
- return po1.getName().compareTo(po2.getName());
- }
- else
- {
- return high1 - high2;
- }
- }
- });
- for (int i = 0; i < children.size(); i++)
- {
- PortalObject child = (PortalObject)children.get(i);
- children.set(i, LazyPortalObjectTreeNode.newInstance(child));
- }
- }
- return children;
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setType(String name)
- {
- throw new UnsupportedOperationException();
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public void setDescription(String name)
- {
- throw new UnsupportedOperationException();
- }
-
- public String getIdentifier()
- {
- return object.getId().toString(PortalObjectId.LEGACY_BASE64_FORMAT);
- }
-
- public void setIdentifier(String name)
- {
- throw new UnsupportedOperationException();
- }
-
- public int getChildCount()
- {
- return object.getChildren().size();
- }
-}