summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-03-29 08:46:43 (EDT)
committerManik Kishore2012-06-19 07:24:32 (EDT)
commitabca8a1a0917d94da4c592007f7c993413ee732a (patch)
tree9a51baae9b78cfefe840f248d45ab3783391214c
parentd162b89b473ebd10f60619c6d4150eb53f90aaa7 (diff)
downloadorg.eclipse.stardust.ui.web-abca8a1a0917d94da4c592007f7c993413ee732a.zip
org.eclipse.stardust.ui.web-abca8a1a0917d94da4c592007f7c993413ee732a.tar.gz
org.eclipse.stardust.ui.web-abca8a1a0917d94da4c592007f7c993413ee732a.tar.bz2
Jira-ID: CRNT-24328
1)Added TrafficLightComparator class in TrafficLightViewManagerBean.java which handles the condition to skip sorting of "Total" and "Undefined" values in categoryName column. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@55070 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/TrafficLightViewManagerBean.java51
1 files changed, 50 insertions, 1 deletions
diff --git a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/TrafficLightViewManagerBean.java b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/TrafficLightViewManagerBean.java
index fa62bbf..b7138ad 100644
--- a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/TrafficLightViewManagerBean.java
+++ b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/TrafficLightViewManagerBean.java
@@ -14,6 +14,7 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -294,7 +295,7 @@ public void init()
TableColumnSelectorPopup colSelecpopup = new TableColumnSelectorPopup(columnModel);
trafficLightViewTable = new SortableTable<TrafficLightViewUserObject>(
- colSelecpopup, null, new SortableTableComparator<TrafficLightViewUserObject>(
+ colSelecpopup, null, new TrafficLightComparator(
"categoryName", true));
trafficLightViewTable.setList(trafficLightViewList);
@@ -1310,4 +1311,52 @@ public void init()
{
return notPassedActivityTableInitialized;
}
+
+ /**
+ *
+ * @author Sidharth.Singh
+ *
+ */
+ public class TrafficLightComparator extends SortableTableComparator<TrafficLightViewUserObject>
+ {
+
+ public TrafficLightComparator(String sortColumnProperty, boolean ascending)
+ {
+ super(sortColumnProperty, ascending);
+ }
+
+ @Override
+ public int compare(TrafficLightViewUserObject o1, TrafficLightViewUserObject o2)
+ {
+ if (getMessages().getString("category.undefined").equals(o1.getCategoryName())
+ && getMessages().getString("category.total").equals(o2.getCategoryName()))
+ {
+ return -1;
+ }
+ else if (getMessages().getString("category.total").equals(o1.getCategoryName())
+ && getMessages().getString("category.undefined").equals(o2.getCategoryName()))
+ {
+ if (ascending)
+ return 1;
+ else
+ return -1;
+ }
+ else if (getMessages().getString("category.undefined").equals(o1.getCategoryName())
+ || getMessages().getString("category.total").equals(o1.getCategoryName()))
+ {
+ return 1;
+ }
+ else if (getMessages().getString("category.undefined").equals(o2.getCategoryName())
+ || getMessages().getString("category.total").equals(o2.getCategoryName()))
+ {
+ return -1;
+ }
+ else
+ {
+ return super.compare(o1, o2);
+ }
+ }
+
+ }
+
}