Author: thomas.heute(a)jboss.com
Date: 2008-06-30 10:24:03 -0400 (Mon, 30 Jun 2008)
New Revision: 11208
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/api/node/PortalNodeImpl.java
Log:
JBPORTAL-2021: Tab Order does not work
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/api/node/PortalNodeImpl.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/api/node/PortalNodeImpl.java 2008-06-30
14:08:18 UTC (rev 11207)
+++
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/api/node/PortalNodeImpl.java 2008-06-30
14:24:03 UTC (rev 11208)
@@ -278,19 +278,7 @@
case PortalObject.TYPE_PORTAL:
return 1;
case PortalObject.TYPE_PAGE:
- String orderProperty = object.getDeclaredProperty(ORDER);
- if (orderProperty == null)
- {
- return 2.999f;
- }
- try
- {
- return Float.parseFloat("2." + orderProperty);
- }
- catch (NumberFormatException e)
- {
- return 2.999f;
- }
+ return 2;
case PortalObject.TYPE_WINDOW:
return 3;
default:
@@ -308,6 +296,35 @@
float weight2 = node2.getWeight();
if (weight1 == weight2)
{
+ if (PortalObject.TYPE_PAGE == node1.getType())
+ {
+ String orderProperty1S = (String)node1.getProperties().get(ORDER);
+ String orderProperty2S = (String)node2.getProperties().get(ORDER);
+
+ if (orderProperty1S != null && orderProperty2S !=null)
+ {
+ float orderProperty1 = -1;
+ float orderProperty2 = -1;
+
+ try
+ {
+ orderProperty1 = Float.parseFloat(orderProperty1S);
+ orderProperty2 = Float.parseFloat(orderProperty2S);
+ if (orderProperty1 > orderProperty2)
+ {
+ return 1;
+ }
+ else if (orderProperty1 < orderProperty2)
+ {
+ return -1;
+ }
+ }
+ catch (NumberFormatException e)
+ {
+ // ignore
+ }
+ }
+ }
return node1.getName().compareTo(node2.getName());
}
else if (weight1 < weight2)
Show replies by date