From 81d36161ce5367fa7aa9a5d99dc8b80eacfa7cdf Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <nicolas.capponi@forgerock.com>
Date: Fri, 24 Jan 2014 14:43:46 +0000
Subject: [PATCH] Checkpoint commit for OPENDJ-1288 :    Migrate I18n and logging support to i18n framework and SLF4J

---
 opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/datamodel/TaskTableModel.java |   39 ++++++++++++++++++++-------------------
 1 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/datamodel/TaskTableModel.java b/opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/datamodel/TaskTableModel.java
index e77fbaf..6ae9a88 100644
--- a/opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/datamodel/TaskTableModel.java
+++ b/opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/datamodel/TaskTableModel.java
@@ -22,6 +22,7 @@
  *
  *
  *      Copyright 2009 Sun Microsystems, Inc.
+ *      Portions Copyright 2014 ForgeRock AS
  */
 package org.opends.guitools.controlpanel.datamodel;
 
@@ -38,7 +39,7 @@
 
 import org.opends.guitools.controlpanel.ui.ColorAndFontConstants;
 import org.opends.guitools.controlpanel.util.Utilities;
-import org.opends.messages.Message;
+import org.forgerock.i18n.LocalizableMessage;
 import org.opends.quicksetup.util.Utils;
 import org.opends.server.backends.task.TaskState;
 import org.opends.server.tools.tasks.TaskEntry;
@@ -54,15 +55,15 @@
   private Set<TaskEntry> data = new HashSet<TaskEntry>();
   private ArrayList<TaskEntry> dataSourceArray = new ArrayList<TaskEntry>();
 
-  LinkedHashSet<Message> displayedAttributes = new LinkedHashSet<Message>();
-  final LinkedHashSet<Message> defaultAttributes = new LinkedHashSet<Message>();
+  LinkedHashSet<LocalizableMessage> displayedAttributes = new LinkedHashSet<LocalizableMessage>();
+  final LinkedHashSet<LocalizableMessage> defaultAttributes = new LinkedHashSet<LocalizableMessage>();
   {
     defaultAttributes.add(INFO_TASKINFO_FIELD_ID.get());
     defaultAttributes.add(INFO_TASKINFO_FIELD_TYPE.get());
     defaultAttributes.add(INFO_TASKINFO_FIELD_STATUS.get());
     defaultAttributes.add(INFO_CTRL_PANEL_TASK_CANCELABLE.get());
   }
-  LinkedHashSet<Message> allAttributes = new LinkedHashSet<Message>();
+  LinkedHashSet<LocalizableMessage> allAttributes = new LinkedHashSet<LocalizableMessage>();
   {
     allAttributes.addAll(defaultAttributes);
     allAttributes.add(INFO_TASKINFO_FIELD_SCHEDULED_START.get());
@@ -148,7 +149,7 @@
    * Sets the operations displayed by this table model.
    * @param attributes the attributes displayed by this table model.
    */
-  public void setAttributes(LinkedHashSet<Message> attributes)
+  public void setAttributes(LinkedHashSet<LocalizableMessage> attributes)
   {
     if (!allAttributes.containsAll(attributes))
     {
@@ -160,7 +161,7 @@
     int columnCount = attributes.size();
     columnNames = new String[columnCount];
     int i = 0;
-    for (Message attribute : attributes)
+    for (LocalizableMessage attribute : attributes)
     {
       columnNames[i] = getHeader(attribute, 15);
       i++;
@@ -172,7 +173,7 @@
    */
   public Class<?> getColumnClass(int column)
   {
-    return Message.class;
+    return LocalizableMessage.class;
   }
 
   /**
@@ -187,13 +188,13 @@
    */
   public Object getValueAt(int row, int column)
   {
-    Message value;
+    LocalizableMessage value;
     column = getFixedOrderColumn(column);
     TaskEntry taskEntry = get(row);
     switch (column)
     {
     case 0:
-      value = Message.raw(taskEntry.getId());
+      value = LocalizableMessage.raw(taskEntry.getId());
       break;
     case 1:
       value = taskEntry.getType();
@@ -217,7 +218,7 @@
         value = taskEntry.getScheduleTab();
       } else {
         value = taskEntry.getScheduledStartTime();
-        if (value == null || value.equals(Message.EMPTY))
+        if (value == null || value.equals(LocalizableMessage.EMPTY))
         {
           value = INFO_TASKINFO_IMMEDIATE_EXECUTION.get();
         }
@@ -286,7 +287,7 @@
    * Returns the set of attributes ordered.
    * @return the set of attributes ordered.
    */
-  public LinkedHashSet<Message> getDisplayedAttributes()
+  public LinkedHashSet<LocalizableMessage> getDisplayedAttributes()
   {
     return displayedAttributes;
   }
@@ -295,7 +296,7 @@
    * Returns the set of attributes ordered.
    * @return the set of attributes ordered.
    */
-  public LinkedHashSet<Message> getAllAttributes()
+  public LinkedHashSet<LocalizableMessage> getAllAttributes()
   {
     return allAttributes;
   }
@@ -374,8 +375,8 @@
   {
     int fixedOrderColumn = 0;
     int i=0;
-    Message colMsg = null;
-    for (Message msg : displayedAttributes)
+    LocalizableMessage colMsg = null;
+    for (LocalizableMessage msg : displayedAttributes)
     {
       if (i == column)
       {
@@ -384,7 +385,7 @@
       }
       i++;
     }
-    for (Message msg : allAttributes)
+    for (LocalizableMessage msg : allAttributes)
     {
       if (msg.equals(colMsg))
       {
@@ -395,9 +396,9 @@
     return fixedOrderColumn;
   }
 
-  private Message getValue(List<String> values, Message valueIfEmpty)
+  private LocalizableMessage getValue(List<String> values, LocalizableMessage valueIfEmpty)
   {
-    Message msg;
+    LocalizableMessage msg;
     if (values.isEmpty())
     {
       msg = valueIfEmpty;
@@ -407,12 +408,12 @@
       String s = Utils.getStringFromCollection(values, "<br>");
       if (values.size() > 1)
       {
-        msg = Message.raw(
+        msg = LocalizableMessage.raw(
             "<html>"+Utilities.applyFont(s, ColorAndFontConstants.tableFont));
       }
       else
       {
-        msg = Message.raw(s);
+        msg = LocalizableMessage.raw(s);
       }
     }
     return msg;

--
Gitblit v1.10.0