Author: julien(a)jboss.com
Date: 2007-08-14 20:13:20 -0400 (Tue, 14 Aug 2007)
New Revision: 7927
Modified:
trunk/core/src/bin/portal-core-war/themes/renaissance/portal_style.css
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivDecorationRenderer.java
Log:
JBPORTAL-1630 : WindowState and Mode comparator severely broken
Modified: trunk/core/src/bin/portal-core-war/themes/renaissance/portal_style.css
===================================================================
--- trunk/core/src/bin/portal-core-war/themes/renaissance/portal_style.css 2007-08-15
00:09:04 UTC (rev 7926)
+++ trunk/core/src/bin/portal-core-war/themes/renaissance/portal_style.css 2007-08-15
00:13:20 UTC (rev 7927)
@@ -673,9 +673,9 @@
}
.portlet-mode-admin {
- background-image: url( images/ico_edit.gif );
+ background-image: url( images/ico_admin.gif );
background-repeat: no-repeat;
- width: 28px;
+ width: 16px;
height: 16px;
float: left;
display: inline;
Modified:
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivDecorationRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivDecorationRenderer.java 2007-08-15
00:09:04 UTC (rev 7926)
+++
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivDecorationRenderer.java 2007-08-15
00:13:20 UTC (rev 7927)
@@ -82,13 +82,15 @@
return;
}
+ //
if (modesOrStates instanceof List)
{
List list = (List)modesOrStates;
- Collections.sort(list, COMPARATOR);
+ Collections.sort(list, new ModeAndStateComparator());
modesOrStates = list;
}
+ //
for (Iterator i = modesOrStates.iterator(); i.hasNext();)
{
ActionRendererContext action = (ActionRendererContext)i.next();
@@ -106,42 +108,43 @@
}
}
- private static final Comparator COMPARATOR = new ModeAndStateComparator();
-
private static class ModeAndStateComparator implements Comparator
{
- private static final Map modeOrState2Index = new HashMap();
- static
+ /** . */
+ private final Map modeOrState2Index = new HashMap();
+
+ /** . */
+ private int lastModeIndex = 1;
+
+ /** . */
+ private int lastStateIndex = 101;
+
+ public ModeAndStateComparator()
{
- modeOrState2Index.put(Mode.EDIT, new Integer(98));
- modeOrState2Index.put(Mode.HELP, new Integer(99));
- modeOrState2Index.put(Mode.VIEW, new Integer(100));
- modeOrState2Index.put(Mode.ADMIN, new Integer(101));
- modeOrState2Index.put(WindowState.MINIMIZED, new Integer(198));
- modeOrState2Index.put(WindowState.NORMAL, new Integer(199));
- modeOrState2Index.put(WindowState.MAXIMIZED, new Integer(200));
+ modeOrState2Index.put(Mode.EDIT.toString(), new Integer(97));
+ modeOrState2Index.put(Mode.HELP.toString(), new Integer(98));
+ modeOrState2Index.put(Mode.VIEW.toString(), new Integer(99));
+ modeOrState2Index.put(Mode.ADMIN.toString(), new Integer(100));
+ modeOrState2Index.put(WindowState.MINIMIZED.toString(), new Integer(198));
+ modeOrState2Index.put(WindowState.NORMAL.toString(), new Integer(199));
+ modeOrState2Index.put(WindowState.MAXIMIZED.toString(), new Integer(200));
}
- private static int lastModeIndex = 1;
- private static int lastStateIndex = 101;
-
public int compare(Object o1, Object o2)
{
ActionRendererContext action1 = (ActionRendererContext)o1;
ActionRendererContext action2 = (ActionRendererContext)o2;
- Object origin1 = action1.getFamily();
- Object origin2 = action2.getFamily();
+ //
+ Object origin1 = action1.getName();
+ Object origin2 = action2.getName();
- if (origin1.equals(origin2))
- {
- return 0;
- }
-
+ //
int index1 = getIndexFor(origin1);
int index2 = getIndexFor(origin2);
+ //
return index1 - index2;
}
Show replies by date