GUI -- refactored all the table views (server side) to use the new TableModel method of data generation.

Change-Id: Ib8a188ad432ff335db6cff1e49e08dbaf039436b
diff --git a/core/api/src/main/java/org/onosproject/ui/table/cell/AppIdFormatter.java b/core/api/src/main/java/org/onosproject/ui/table/cell/AppIdFormatter.java
new file mode 100644
index 0000000..f6ccf2c0
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/ui/table/cell/AppIdFormatter.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.onosproject.ui.table.cell;
+
+import org.onosproject.core.ApplicationId;
+import org.onosproject.ui.table.CellFormatter;
+
+/**
+ * Formats an application identifier as "(app-id) : (app-name)".
+ */
+public class AppIdFormatter extends AbstractCellFormatter {
+
+    @Override
+    protected String nonNullFormat(Object value) {
+        ApplicationId appId = (ApplicationId) value;
+        return appId.id() + " : " + appId.name();
+    }
+
+    /**
+     * An instance of this class.
+     */
+    public static final CellFormatter INSTANCE = new AppIdFormatter();
+}
diff --git a/core/api/src/main/java/org/onosproject/ui/table/cell/ConnectPointFormatter.java b/core/api/src/main/java/org/onosproject/ui/table/cell/ConnectPointFormatter.java
new file mode 100644
index 0000000..18f7233
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/ui/table/cell/ConnectPointFormatter.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.onosproject.ui.table.cell;
+
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.ui.table.CellFormatter;
+
+/**
+ * Formats a connect point as "(element-id)/(port)".
+ */
+public class ConnectPointFormatter extends AbstractCellFormatter {
+
+    @Override
+    protected String nonNullFormat(Object value) {
+        ConnectPoint cp = (ConnectPoint) value;
+        return cp.elementId() + "/" + cp.port();
+    }
+
+    /**
+     * An instance of this class.
+     */
+    public static final CellFormatter INSTANCE = new ConnectPointFormatter();
+}
diff --git a/core/api/src/main/java/org/onosproject/ui/table/cell/DefaultCellComparator.java b/core/api/src/main/java/org/onosproject/ui/table/cell/DefaultCellComparator.java
index 7846f89..fa49755 100644
--- a/core/api/src/main/java/org/onosproject/ui/table/cell/DefaultCellComparator.java
+++ b/core/api/src/main/java/org/onosproject/ui/table/cell/DefaultCellComparator.java
@@ -17,6 +17,8 @@
 
 package org.onosproject.ui.table.cell;
 
+import org.onosproject.ui.table.CellComparator;
+
 /**
  * A default cell comparator. Implements a lexicographical compare function
  * (i.e. string sorting). Uses the objects' toString() method and then
@@ -24,8 +26,14 @@
  * are considered "smaller" than any non-null value.
  */
 public class DefaultCellComparator extends AbstractCellComparator {
+
     @Override
     protected int nonNullCompare(Object o1, Object o2) {
         return o1.toString().compareTo(o2.toString());
     }
+
+    /**
+     * An instance of this class.
+     */
+    public static final CellComparator INSTANCE = new DefaultCellComparator();
 }
diff --git a/core/api/src/main/java/org/onosproject/ui/table/cell/DefaultCellFormatter.java b/core/api/src/main/java/org/onosproject/ui/table/cell/DefaultCellFormatter.java
index c030236..5e4f5ba 100644
--- a/core/api/src/main/java/org/onosproject/ui/table/cell/DefaultCellFormatter.java
+++ b/core/api/src/main/java/org/onosproject/ui/table/cell/DefaultCellFormatter.java
@@ -17,12 +17,20 @@
 
 package org.onosproject.ui.table.cell;
 
+import org.onosproject.ui.table.CellFormatter;
+
 /**
  * A default cell formatter. Uses the object's toString() method.
  */
 public class DefaultCellFormatter extends AbstractCellFormatter {
+
     @Override
     public String nonNullFormat(Object value) {
         return value.toString();
     }
+
+    /**
+     * An instance of this class.
+     */
+    public static final CellFormatter INSTANCE = new DefaultCellFormatter();
 }
diff --git a/core/api/src/main/java/org/onosproject/ui/table/cell/HexFormatter.java b/core/api/src/main/java/org/onosproject/ui/table/cell/HexFormatter.java
index d4aaade..8104f48 100644
--- a/core/api/src/main/java/org/onosproject/ui/table/cell/HexFormatter.java
+++ b/core/api/src/main/java/org/onosproject/ui/table/cell/HexFormatter.java
@@ -17,12 +17,20 @@
 
 package org.onosproject.ui.table.cell;
 
+import org.onosproject.ui.table.CellFormatter;
+
 /**
- * Formats integer values as hex strings.
+ * Formats integer values as hex strings with a "0x" prefix.
  */
 public class HexFormatter extends AbstractCellFormatter {
+
     @Override
     protected String nonNullFormat(Object value) {
         return "0x" + Integer.toHexString((Integer) value);
     }
+
+    /**
+     * An instance of this class.
+     */
+    public static final CellFormatter INSTANCE = new HexFormatter();
 }
diff --git a/core/api/src/main/java/org/onosproject/ui/table/cell/HostLocationFormatter.java b/core/api/src/main/java/org/onosproject/ui/table/cell/HostLocationFormatter.java
new file mode 100644
index 0000000..9d6024d
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/ui/table/cell/HostLocationFormatter.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.onosproject.ui.table.cell;
+
+import org.onosproject.net.HostLocation;
+import org.onosproject.ui.table.CellFormatter;
+
+/**
+ * Formats a host location as "(device-id)/(port)".
+ */
+public class HostLocationFormatter extends AbstractCellFormatter {
+
+    @Override
+    protected String nonNullFormat(Object value) {
+        HostLocation loc = (HostLocation) value;
+        return loc.deviceId() + "/" + loc.port();
+    }
+
+    /**
+     * An instance of this class.
+     */
+    public static final CellFormatter INSTANCE = new HostLocationFormatter();
+}
diff --git a/core/api/src/main/java/org/onosproject/ui/table/cell/IntComparator.java b/core/api/src/main/java/org/onosproject/ui/table/cell/IntComparator.java
index c399d53..ddd90eb 100644
--- a/core/api/src/main/java/org/onosproject/ui/table/cell/IntComparator.java
+++ b/core/api/src/main/java/org/onosproject/ui/table/cell/IntComparator.java
@@ -17,14 +17,22 @@
 
 package org.onosproject.ui.table.cell;
 
+import org.onosproject.ui.table.CellComparator;
+
 /**
  * An integer-based cell comparator.
  * Note that null values are acceptable and are considered "smaller" than
  * any non-null value.
  */
 public class IntComparator extends AbstractCellComparator {
+
     @Override
     protected int nonNullCompare(Object o1, Object o2) {
         return ((int) o1) - ((int) o2);
     }
+
+    /**
+     * An instance of this class.
+     */
+    public static final CellComparator INSTANCE = new IntComparator();
 }
diff --git a/core/api/src/main/java/org/onosproject/ui/table/cell/LongComparator.java b/core/api/src/main/java/org/onosproject/ui/table/cell/LongComparator.java
new file mode 100644
index 0000000..3234e50
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/ui/table/cell/LongComparator.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.onosproject.ui.table.cell;
+
+import org.onosproject.ui.table.CellComparator;
+
+/**
+ * A long-based cell comparator.
+ * Note that null values are acceptable and are considered "smaller" than
+ * any non-null value.
+ */
+public class LongComparator extends AbstractCellComparator {
+
+    @Override
+    protected int nonNullCompare(Object o1, Object o2) {
+        long diff = ((long) o1) - ((long) o2);
+        return diff == 0 ? 0 : (diff < 0 ? -1 : 1);
+    }
+
+    /**
+     * An instance of this class.
+     */
+    public static final CellComparator INSTANCE = new LongComparator();
+}
diff --git a/core/api/src/main/java/org/onosproject/ui/table/cell/TimeFormatter.java b/core/api/src/main/java/org/onosproject/ui/table/cell/TimeFormatter.java
new file mode 100644
index 0000000..e0aec9d
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/ui/table/cell/TimeFormatter.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.onosproject.ui.table.cell;
+
+import org.joda.time.DateTime;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+import org.onosproject.ui.table.CellFormatter;
+
+/**
+ * Formats time values using {@link DateTimeFormatter}.
+ */
+public class TimeFormatter extends AbstractCellFormatter {
+
+    private static final DateTimeFormatter DTF = DateTimeFormat.longTime();
+
+    @Override
+    protected String nonNullFormat(Object value) {
+        return DTF.print((DateTime) value);
+    }
+
+    /**
+     * An instance of this class.
+     */
+    public static final CellFormatter INSTANCE = new TimeFormatter();
+}