changeset 761:4d3eb8604ae1

Clean up Eclipse plugin API This commit refactors the c.r.t.eclipse plugin to clearly mark certain packages as internal in their name and make only the base package API. This package contains only a few classes required by other Thermostat Eclipse plugins, mainly SWTComponent and ThermostatConstants. In doing this refactoring, all internal packages no longer export their packages to the chart.common plugin. Moving forward where we will be adding other plugins in addition to chart.common, it does not make sense to add each plugin to the list of x-friends. Reviewed-by: jerboaa Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2012-October/003995.html
author Elliott Baron <ebaron@redhat.com>
date Wed, 31 Oct 2012 13:52:01 -0400
parents 19303187ae24
children 51df90801800
files eclipse/com.redhat.thermostat.eclipse.chart.common/META-INF/MANIFEST.MF eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/HostCpuViewPart.java eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/HostMemoryViewPart.java eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/RefViewPart.java eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/SWTHostCpuView.java eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/SWTHostMemoryView.java eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/SWTVmCpuView.java eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/SWTVmGcView.java eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/VmCpuViewPart.java eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/VmGcViewPart.java eclipse/com.redhat.thermostat.eclipse.test/META-INF/MANIFEST.MF eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/model/HostVmsTreeContentProviderTest.java eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/model/HostsVmsLabelProviderTest.java eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/AbstractRefViewPartTest.java eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/ThermostatPerspectiveTest.java eclipse/com.redhat.thermostat.eclipse/META-INF/MANIFEST.MF eclipse/com.redhat.thermostat.eclipse/plugin.xml eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/Activator.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/ConnectionConfiguration.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/LoggerFacility.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/SWTComponent.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/controllers/ConnectDBAction.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/controllers/ConnectionJobListener.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/Activator.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/ConnectionConfiguration.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/controllers/ConnectDBAction.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/controllers/ConnectionJobListener.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/jobs/ConnectDbJob.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/model/HostsVmsLabelProvider.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/model/HostsVmsTreeContentProvider.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/model/HostsVmsTreeRoot.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/views/HostOverviewViewPart.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/views/HostsVmsTreeViewPart.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/views/ThermostatPerspectiveFactory.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/jobs/ConnectDbJob.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/model/HostsVmsLabelProvider.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/model/HostsVmsTreeContentProvider.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/model/HostsVmsTreeRoot.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/views/HostOverviewViewPart.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/views/HostsVmsTreeViewPart.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/views/SWTComponent.java eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/views/ThermostatPerspectiveFactory.java
diffstat 42 files changed, 1432 insertions(+), 1429 deletions(-) [+]
line wrap: on
line diff
--- a/eclipse/com.redhat.thermostat.eclipse.chart.common/META-INF/MANIFEST.MF	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.common/META-INF/MANIFEST.MF	Wed Oct 31 13:52:01 2012 -0400
@@ -19,8 +19,6 @@
  com.redhat.thermostat.common.storage,
  com.redhat.thermostat.common.utils,
  com.redhat.thermostat.eclipse,
- com.redhat.thermostat.eclipse.model,
- com.redhat.thermostat.eclipse.views,
  org.jfree.chart,
  org.jfree.chart.axis,
  org.jfree.chart.event,
--- a/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/HostCpuViewPart.java	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/HostCpuViewPart.java	Wed Oct 31 13:52:01 2012 -0400
@@ -42,7 +42,7 @@
 import com.redhat.thermostat.common.dao.HostInfoDAO;
 import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
-import com.redhat.thermostat.eclipse.views.SWTComponent;
+import com.redhat.thermostat.eclipse.SWTComponent;
 
 public class HostCpuViewPart extends HostRefViewPart {
 
--- a/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/HostMemoryViewPart.java	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/HostMemoryViewPart.java	Wed Oct 31 13:52:01 2012 -0400
@@ -42,7 +42,7 @@
 import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.dao.MemoryStatDAO;
 import com.redhat.thermostat.common.utils.OSGIUtils;
-import com.redhat.thermostat.eclipse.views.SWTComponent;
+import com.redhat.thermostat.eclipse.SWTComponent;
 
 public class HostMemoryViewPart extends HostRefViewPart {
 
--- a/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/RefViewPart.java	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/RefViewPart.java	Wed Oct 31 13:52:01 2012 -0400
@@ -52,7 +52,6 @@
 
 import com.redhat.thermostat.common.dao.Ref;
 import com.redhat.thermostat.eclipse.ThermostatConstants;
-import com.redhat.thermostat.eclipse.views.HostsVmsTreeViewPart;
 
 public abstract class RefViewPart<T extends Ref> extends ViewPart implements ISelectionListener {
 
@@ -76,7 +75,7 @@
         // Check for an existing selection
         boolean selected = false;
         IViewPart part = getWorkbenchWindow().getActivePage().findView(ThermostatConstants.VIEW_ID_HOST_VM);
-        if (part != null && part instanceof HostsVmsTreeViewPart) {
+        if (part != null) {
             ISelection selection = part.getSite().getSelectionProvider().getSelection();
             if (selection instanceof IStructuredSelection) {
                 handleSelection(selection);
@@ -113,7 +112,7 @@
         // We must have received createPartControl
         if (parent != null && !parent.isDisposed()) {
             // Check if a HostRef has been selected
-            if (part instanceof HostsVmsTreeViewPart) {
+            if (part.getSite().getId().equals(ThermostatConstants.VIEW_ID_HOST_VM)) {
                 if (selection instanceof IStructuredSelection) {
                     handleSelection(selection);
                 }
--- a/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/SWTHostCpuView.java	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/SWTHostCpuView.java	Wed Oct 31 13:52:01 2012 -0400
@@ -68,8 +68,8 @@
 import com.redhat.thermostat.client.ui.ChartColors;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.model.DiscreteTimeData;
+import com.redhat.thermostat.eclipse.SWTComponent;
 import com.redhat.thermostat.eclipse.ThermostatConstants;
-import com.redhat.thermostat.eclipse.views.SWTComponent;
 
 public class SWTHostCpuView extends HostCpuView implements SWTComponent {
     public static final String TEST_ID_CPU_MODEL = "SWTHostCpuView.cpuModel";
--- a/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/SWTHostMemoryView.java	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/SWTHostMemoryView.java	Wed Oct 31 13:52:01 2012 -0400
@@ -75,8 +75,8 @@
 import com.redhat.thermostat.common.model.DiscreteTimeData;
 import com.redhat.thermostat.common.utils.DisplayableValues;
 import com.redhat.thermostat.common.utils.DisplayableValues.Scale;
+import com.redhat.thermostat.eclipse.SWTComponent;
 import com.redhat.thermostat.eclipse.ThermostatConstants;
-import com.redhat.thermostat.eclipse.views.SWTComponent;
 
 public class SWTHostMemoryView extends HostMemoryView implements SWTComponent {
     public static final String TEST_ID_TOTAL_MEM = "SWTHostMemoryView.totalMemory";
--- a/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/SWTVmCpuView.java	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/SWTVmCpuView.java	Wed Oct 31 13:52:01 2012 -0400
@@ -55,8 +55,8 @@
 import com.redhat.thermostat.client.locale.LocaleResources;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.model.DiscreteTimeData;
+import com.redhat.thermostat.eclipse.SWTComponent;
 import com.redhat.thermostat.eclipse.ThermostatConstants;
-import com.redhat.thermostat.eclipse.views.SWTComponent;
 
 public class SWTVmCpuView extends VmCpuView implements SWTComponent {
     
--- a/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/SWTVmGcView.java	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/SWTVmGcView.java	Wed Oct 31 13:52:01 2012 -0400
@@ -68,8 +68,8 @@
 import com.redhat.thermostat.client.ui.SampledDataset;
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.common.model.IntervalTimeData;
+import com.redhat.thermostat.eclipse.SWTComponent;
 import com.redhat.thermostat.eclipse.ThermostatConstants;
-import com.redhat.thermostat.eclipse.views.SWTComponent;
 
 public class SWTVmGcView extends VmGcView implements SWTComponent {
     
--- a/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/VmCpuViewPart.java	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/VmCpuViewPart.java	Wed Oct 31 13:52:01 2012 -0400
@@ -41,7 +41,7 @@
 import com.redhat.thermostat.common.dao.VmCpuStatDAO;
 import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
-import com.redhat.thermostat.eclipse.views.SWTComponent;
+import com.redhat.thermostat.eclipse.SWTComponent;
 
 public class VmCpuViewPart extends VmRefViewPart {
 
--- a/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/VmGcViewPart.java	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse.chart.common/src/com/redhat/thermostat/eclipse/chart/common/VmGcViewPart.java	Wed Oct 31 13:52:01 2012 -0400
@@ -42,7 +42,7 @@
 import com.redhat.thermostat.common.dao.VmMemoryStatDAO;
 import com.redhat.thermostat.common.dao.VmRef;
 import com.redhat.thermostat.common.utils.OSGIUtils;
-import com.redhat.thermostat.eclipse.views.SWTComponent;
+import com.redhat.thermostat.eclipse.SWTComponent;
 
 public class VmGcViewPart extends VmRefViewPart {
 
--- a/eclipse/com.redhat.thermostat.eclipse.test/META-INF/MANIFEST.MF	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse.test/META-INF/MANIFEST.MF	Wed Oct 31 13:52:01 2012 -0400
@@ -20,8 +20,8 @@
  com.redhat.thermostat.common.utils,
  com.redhat.thermostat.eclipse,
  com.redhat.thermostat.eclipse.chart.common,
- com.redhat.thermostat.eclipse.model,
- com.redhat.thermostat.eclipse.views,
+ com.redhat.thermostat.eclipse.internal.model,
+ com.redhat.thermostat.eclipse.internal.views,
  org.mockito,
  org.mockito.stubbing
 Export-Package: com.redhat.thermostat.eclipse.test.model,
--- a/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/model/HostVmsTreeContentProviderTest.java	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/model/HostVmsTreeContentProviderTest.java	Wed Oct 31 13:52:01 2012 -0400
@@ -53,8 +53,8 @@
 import com.redhat.thermostat.common.HostsVMsLoader;
 import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.dao.VmRef;
-import com.redhat.thermostat.eclipse.model.HostsVmsTreeContentProvider;
-import com.redhat.thermostat.eclipse.model.HostsVmsTreeRoot;
+import com.redhat.thermostat.eclipse.internal.model.HostsVmsTreeContentProvider;
+import com.redhat.thermostat.eclipse.internal.model.HostsVmsTreeRoot;
 
 public class HostVmsTreeContentProviderTest {
 
--- a/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/model/HostsVmsLabelProviderTest.java	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/model/HostsVmsLabelProviderTest.java	Wed Oct 31 13:52:01 2012 -0400
@@ -47,8 +47,8 @@
 
 import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.dao.VmRef;
-import com.redhat.thermostat.eclipse.model.HostsVmsLabelProvider;
-import com.redhat.thermostat.eclipse.model.HostsVmsTreeRoot;
+import com.redhat.thermostat.eclipse.internal.model.HostsVmsLabelProvider;
+import com.redhat.thermostat.eclipse.internal.model.HostsVmsTreeRoot;
 
 public class HostsVmsLabelProviderTest {
 
--- a/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/AbstractRefViewPartTest.java	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/AbstractRefViewPartTest.java	Wed Oct 31 13:52:01 2012 -0400
@@ -53,10 +53,10 @@
 
 import com.redhat.thermostat.common.dao.Ref;
 import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.eclipse.SWTComponent;
 import com.redhat.thermostat.eclipse.ThermostatConstants;
 import com.redhat.thermostat.eclipse.chart.common.RefViewPart;
-import com.redhat.thermostat.eclipse.views.HostsVmsTreeViewPart;
-import com.redhat.thermostat.eclipse.views.SWTComponent;
+import com.redhat.thermostat.eclipse.internal.views.HostsVmsTreeViewPart;
 
 public abstract class AbstractRefViewPartTest<T extends Ref> {
 
@@ -96,7 +96,8 @@
         // Selection mocks
         IWorkbenchPartSite site = mock(IWorkbenchPartSite.class);
         provider = mock(ISelectionProvider.class);
-    
+ 
+        when(site.getId()).thenReturn(ThermostatConstants.VIEW_ID_HOST_VM);
         when(site.getSelectionProvider()).thenReturn(provider);
         when(hostVMView.getSite()).thenReturn(site);
     }
--- a/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/ThermostatPerspectiveTest.java	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/views/ThermostatPerspectiveTest.java	Wed Oct 31 13:52:01 2012 -0400
@@ -50,7 +50,7 @@
 import org.junit.Test;
 
 import com.redhat.thermostat.eclipse.ThermostatConstants;
-import com.redhat.thermostat.eclipse.views.ThermostatPerspectiveFactory;
+import com.redhat.thermostat.eclipse.internal.views.ThermostatPerspectiveFactory;
 
 public class ThermostatPerspectiveTest {
     
--- a/eclipse/com.redhat.thermostat.eclipse/META-INF/MANIFEST.MF	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse/META-INF/MANIFEST.MF	Wed Oct 31 13:52:01 2012 -0400
@@ -1,7 +1,7 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Thermostat Eclipse Client
-Bundle-Activator: com.redhat.thermostat.eclipse.Activator
+Bundle-Activator: com.redhat.thermostat.eclipse.internal.Activator
 Bundle-SymbolicName: com.redhat.thermostat.eclipse;singleton:=true
 Bundle-Version: 0.5.0.qualifier
 Bundle-Vendor: Red Hat Inc.
@@ -21,6 +21,9 @@
  com.redhat.thermostat.launcher,
  com.redhat.thermostat.web.client,
  com.redhat.thermostat.web.common
-Export-Package: com.redhat.thermostat.eclipse;x-friends:="com.redhat.thermostat.eclipse.test,com.redhat.thermostat.eclipse.chart.common,com.redhat.thermostat.eclipse.test.ui",
- com.redhat.thermostat.eclipse.model;x-friends:="com.redhat.thermostat.eclipse.test,com.redhat.thermostat.eclipse.chart.common,com.redhat.thermostat.eclipse.test.ui",
- com.redhat.thermostat.eclipse.views;x-friends:="com.redhat.thermostat.eclipse.test,com.redhat.thermostat.eclipse.chart.common,com.redhat.thermostat.eclipse.test.ui"
+Export-Package: com.redhat.thermostat.eclipse,
+ com.redhat.thermostat.eclipse.internal;x-friends:="com.redhat.thermostat.eclipse.test,com.redhat.thermostat.eclipse.test.ui",
+ com.redhat.thermostat.eclipse.internal.controllers;x-friends:="com.redhat.thermostat.eclipse.test,com.redhat.thermostat.eclipse.test.ui",
+ com.redhat.thermostat.eclipse.internal.jobs;x-friends:="com.redhat.thermostat.eclipse.test,com.redhat.thermostat.eclipse.test.ui",
+ com.redhat.thermostat.eclipse.internal.model;x-friends:="com.redhat.thermostat.eclipse.test,com.redhat.thermostat.eclipse.test.ui",
+ com.redhat.thermostat.eclipse.internal.views;x-friends:="com.redhat.thermostat.eclipse.test,com.redhat.thermostat.eclipse.test.ui"
--- a/eclipse/com.redhat.thermostat.eclipse/plugin.xml	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse/plugin.xml	Wed Oct 31 13:52:01 2012 -0400
@@ -46,14 +46,14 @@
       </category>
       <view
             category="com.redhat.thermostat.eclipse.main"
-            class="com.redhat.thermostat.eclipse.views.HostsVmsTreeViewPart"
+            class="com.redhat.thermostat.eclipse.internal.views.HostsVmsTreeViewPart"
             id="com.redhat.thermostat.eclipse.vmtree"
             name="Hosts/VMs"
             restorable="true">
       </view>
       <view
             category="com.redhat.thermostat.eclipse.main"
-            class="com.redhat.thermostat.eclipse.views.HostOverviewViewPart"
+            class="com.redhat.thermostat.eclipse.internal.views.HostOverviewViewPart"
             id="com.redhat.thermostat.eclipse.mainContainer"
             name="Host Overview"
             restorable="true">
@@ -62,7 +62,7 @@
    <extension
          point="org.eclipse.ui.perspectives">
       <perspective
-            class="com.redhat.thermostat.eclipse.views.ThermostatPerspectiveFactory"
+            class="com.redhat.thermostat.eclipse.internal.views.ThermostatPerspectiveFactory"
             id="com.redhat.thermostat.eclipse.perspective"
             name="Thermostat">
       </perspective>
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/Activator.java	Wed Oct 31 10:27:59 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
- * Copyright 2012 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.eclipse;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-import com.redhat.thermostat.common.ThreadPoolTimerFactory;
-import com.redhat.thermostat.common.TimerFactory;
-import com.redhat.thermostat.common.appctx.ApplicationContext;
-import com.redhat.thermostat.common.storage.ConnectionException;
-import com.redhat.thermostat.common.utils.OSGIUtils;
-import com.redhat.thermostat.launcher.DbService;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
-    // The plug-in ID
-    public static final String PLUGIN_ID = "com.redhat.thermostat.eclipse"; //$NON-NLS-1$
-
-    // The shared instance
-    private static Activator plugin;
-
-    /**
-     * The constructor
-     */
-    public Activator() {
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
-     * )
-     */
-    public void start(BundleContext context) throws Exception {
-        super.start(context);
-        plugin = this;
-        
-        // Register a TimerFactory
-        TimerFactory timerFactory = new ThreadPoolTimerFactory(1);
-        ApplicationContext.getInstance().setTimerFactory(timerFactory);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
-     * )
-     */
-    public void stop(BundleContext context) throws Exception {
-        DbService dbService = OSGIUtils.getInstance().getService(DbService.class);
-        try {
-            dbService.disconnect();
-        } catch (ConnectionException e) {
-            e.printStackTrace();
-        }
-        dbService.getServiceRegistration().unregister();
-        plugin = null;
-        super.stop(context);
-    }
-
-    /**
-     * Returns the shared instance
-     * 
-     * @return the shared instance
-     */
-    public static Activator getDefault() {
-        return plugin;
-    }
-
-    /**
-     * 
-     * @return {@code true} when platform was started in debug mode (
-     *         {@code -debug} switch) and
-     *         {@code com.redhat.thermostat.eclipse/debug=true} is set in some
-     *         .options file either in $HOME/.options or $(pwd)/.options.
-     */
-    public static boolean inDebugMode() {
-        if (Platform.inDebugMode()) {
-            String debugOption = Platform.getDebugOption(PLUGIN_ID + "/debug"); //$NON-NLS-1$
-            if (debugOption != null && debugOption.equals("true")) { //$NON-NLS-1$
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public IWorkbenchPage getActivePage() {
-        return internalGetActivePage();
-    }
-
-    private IWorkbenchPage internalGetActivePage() {
-        IWorkbenchWindow window = getWorkbench().getActiveWorkbenchWindow();
-        if (window == null)
-            return null;
-        return window.getActivePage();
-    }
-
-    /**
-     * Returns an image descriptor for the image file at the given plug-in
-     * relative path
-     * 
-     * @param path
-     *            the path
-     * @return the image descriptor
-     */
-    public static ImageDescriptor getImageDescriptor(String path) {
-        return imageDescriptorFromPlugin(PLUGIN_ID, path);
-    }
-    
-    public boolean isDbConnected() {
-        DbService dbService = OSGIUtils.getInstance().getServiceAllowNull(DbService.class);
-        return dbService != null;
-    }
-
-}
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/ConnectionConfiguration.java	Wed Oct 31 10:27:59 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright 2012 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.eclipse;
-
-import com.redhat.thermostat.common.config.StartupConfiguration;
-
-public class ConnectionConfiguration implements StartupConfiguration {
-
-    private String dbUrl;
-    private String username;
-    private String password;
-    
-    public ConnectionConfiguration(String username, String password, String dbUrl) {
-        this.dbUrl = dbUrl;
-        this.username = username;
-        this.password = password;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    @Override
-    public String getDBConnectionString() {
-        return dbUrl;
-    }
-
-}
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/LoggerFacility.java	Wed Oct 31 10:27:59 2012 -0400
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/LoggerFacility.java	Wed Oct 31 13:52:01 2012 -0400
@@ -40,6 +40,8 @@
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 
+import com.redhat.thermostat.eclipse.internal.Activator;
+
 public class LoggerFacility {
 
     private ILog log;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/SWTComponent.java	Wed Oct 31 13:52:01 2012 -0400
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.eclipse;
+
+import org.eclipse.swt.widgets.Composite;
+
+import com.redhat.thermostat.client.core.views.UIComponent;
+
+public interface SWTComponent extends UIComponent {
+    
+    public void createControl(Composite parent);
+
+}
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/controllers/ConnectDBAction.java	Wed Oct 31 10:27:59 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright 2012 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.eclipse.controllers;
-
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.Action;
-
-public class ConnectDBAction extends Action {
-    
-    private Job connectJob;
-    
-    public ConnectDBAction(Job job) {
-        this.connectJob = job;
-    }
-    
-    @Override
-    public void run() {
-        connectJob.schedule();
-    }
-
-}
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/controllers/ConnectionJobListener.java	Wed Oct 31 10:27:59 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright 2012 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.eclipse.controllers;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
-import org.eclipse.jface.action.Action;
-
-import com.redhat.thermostat.eclipse.Activator;
-import com.redhat.thermostat.eclipse.views.HostsVmsTreeViewPart;
-
-public class ConnectionJobListener extends JobChangeAdapter {
-
-    private HostsVmsTreeViewPart view;
-    private Action connectAction;
-    
-    public ConnectionJobListener(Action connectAction, HostsVmsTreeViewPart view) {
-        this.view = view;
-        this.connectAction = connectAction;
-    }
-    
-    @Override
-    public void done(IJobChangeEvent event) {
-        IStatus result = event.getResult();
-        if (result.isOK()) {
-            connectAction.setImageDescriptor(Activator
-                    .getImageDescriptor("icons/online.png"));
-            connectAction.setEnabled(!Activator.getDefault().isDbConnected());
-            connectAction.setToolTipText("Online");
-            view.showHostVmsPage();
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/Activator.java	Wed Oct 31 13:52:01 2012 -0400
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.eclipse.internal;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+import com.redhat.thermostat.common.ThreadPoolTimerFactory;
+import com.redhat.thermostat.common.TimerFactory;
+import com.redhat.thermostat.common.appctx.ApplicationContext;
+import com.redhat.thermostat.common.storage.ConnectionException;
+import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.launcher.DbService;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+    // The plug-in ID
+    public static final String PLUGIN_ID = "com.redhat.thermostat.eclipse"; //$NON-NLS-1$
+
+    // The shared instance
+    private static Activator plugin;
+
+    /**
+     * The constructor
+     */
+    public Activator() {
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
+     * )
+     */
+    public void start(BundleContext context) throws Exception {
+        super.start(context);
+        plugin = this;
+        
+        // Register a TimerFactory
+        TimerFactory timerFactory = new ThreadPoolTimerFactory(1);
+        ApplicationContext.getInstance().setTimerFactory(timerFactory);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+     * )
+     */
+    public void stop(BundleContext context) throws Exception {
+        DbService dbService = OSGIUtils.getInstance().getService(DbService.class);
+        try {
+            dbService.disconnect();
+        } catch (ConnectionException e) {
+            e.printStackTrace();
+        }
+        dbService.getServiceRegistration().unregister();
+        plugin = null;
+        super.stop(context);
+    }
+
+    /**
+     * Returns the shared instance
+     * 
+     * @return the shared instance
+     */
+    public static Activator getDefault() {
+        return plugin;
+    }
+
+    /**
+     * 
+     * @return {@code true} when platform was started in debug mode (
+     *         {@code -debug} switch) and
+     *         {@code com.redhat.thermostat.eclipse/debug=true} is set in some
+     *         .options file either in $HOME/.options or $(pwd)/.options.
+     */
+    public static boolean inDebugMode() {
+        if (Platform.inDebugMode()) {
+            String debugOption = Platform.getDebugOption(PLUGIN_ID + "/debug"); //$NON-NLS-1$
+            if (debugOption != null && debugOption.equals("true")) { //$NON-NLS-1$
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public IWorkbenchPage getActivePage() {
+        return internalGetActivePage();
+    }
+
+    private IWorkbenchPage internalGetActivePage() {
+        IWorkbenchWindow window = getWorkbench().getActiveWorkbenchWindow();
+        if (window == null)
+            return null;
+        return window.getActivePage();
+    }
+
+    /**
+     * Returns an image descriptor for the image file at the given plug-in
+     * relative path
+     * 
+     * @param path
+     *            the path
+     * @return the image descriptor
+     */
+    public static ImageDescriptor getImageDescriptor(String path) {
+        return imageDescriptorFromPlugin(PLUGIN_ID, path);
+    }
+    
+    public boolean isDbConnected() {
+        DbService dbService = OSGIUtils.getInstance().getServiceAllowNull(DbService.class);
+        return dbService != null;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/ConnectionConfiguration.java	Wed Oct 31 13:52:01 2012 -0400
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.eclipse.internal;
+
+import com.redhat.thermostat.common.config.StartupConfiguration;
+
+public class ConnectionConfiguration implements StartupConfiguration {
+
+    private String dbUrl;
+    private String username;
+    private String password;
+    
+    public ConnectionConfiguration(String username, String password, String dbUrl) {
+        this.dbUrl = dbUrl;
+        this.username = username;
+        this.password = password;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    @Override
+    public String getDBConnectionString() {
+        return dbUrl;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/controllers/ConnectDBAction.java	Wed Oct 31 13:52:01 2012 -0400
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.eclipse.internal.controllers;
+
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.Action;
+
+public class ConnectDBAction extends Action {
+    
+    private Job connectJob;
+    
+    public ConnectDBAction(Job job) {
+        this.connectJob = job;
+    }
+    
+    @Override
+    public void run() {
+        connectJob.schedule();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/controllers/ConnectionJobListener.java	Wed Oct 31 13:52:01 2012 -0400
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.eclipse.internal.controllers;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.jface.action.Action;
+
+import com.redhat.thermostat.eclipse.internal.Activator;
+import com.redhat.thermostat.eclipse.internal.views.HostsVmsTreeViewPart;
+
+public class ConnectionJobListener extends JobChangeAdapter {
+
+    private HostsVmsTreeViewPart view;
+    private Action connectAction;
+    
+    public ConnectionJobListener(Action connectAction, HostsVmsTreeViewPart view) {
+        this.view = view;
+        this.connectAction = connectAction;
+    }
+    
+    @Override
+    public void done(IJobChangeEvent event) {
+        IStatus result = event.getResult();
+        if (result.isOK()) {
+            connectAction.setImageDescriptor(Activator
+                    .getImageDescriptor("icons/online.png"));
+            connectAction.setEnabled(!Activator.getDefault().isDbConnected());
+            connectAction.setToolTipText("Online");
+            view.showHostVmsPage();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/jobs/ConnectDbJob.java	Wed Oct 31 13:52:01 2012 -0400
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.eclipse.internal.jobs;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.osgi.framework.BundleContext;
+
+import com.redhat.thermostat.common.storage.ConnectionException;
+import com.redhat.thermostat.eclipse.LoggerFacility;
+import com.redhat.thermostat.eclipse.internal.Activator;
+import com.redhat.thermostat.eclipse.internal.ConnectionConfiguration;
+import com.redhat.thermostat.launcher.DbService;
+import com.redhat.thermostat.launcher.DbServiceFactory;
+
+public class ConnectDbJob extends Job {
+
+    private ConnectionConfiguration configuration;
+    
+    public ConnectDbJob(String name, ConnectionConfiguration configuration) {
+        super(name);
+        this.configuration = configuration;
+    }
+
+    @Override
+    protected IStatus run(IProgressMonitor monitor) {
+        monitor.beginTask(
+                "Connecting to " + configuration.getDBConnectionString(),
+                IProgressMonitor.UNKNOWN);
+        try {
+            connectToBackEnd();
+            return Status.OK_STATUS;
+        } catch (ConnectionException e) {
+            LoggerFacility.getInstance().log(IStatus.ERROR,
+                    "Could not connect to DB", e);
+            return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not connect to DB", e);
+        }
+    }
+    
+    /*
+     * Establish a DB connection.
+     */
+    private void connectToBackEnd() throws ConnectionException {
+        DbServiceFactory dbServiceFactory = new DbServiceFactory();
+        DbService dbService = dbServiceFactory.createDbService(configuration.getUsername(),
+                configuration.getPassword(), configuration.getDBConnectionString());
+        dbService.connect();
+        // register service in order to indicate that we are connected
+        BundleContext ctxt = Activator.getDefault().getBundle().getBundleContext();
+        ctxt.registerService(DbService.class, dbService, null);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/model/HostsVmsLabelProvider.java	Wed Oct 31 13:52:01 2012 -0400
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.eclipse.internal.model;
+
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.common.dao.VmRef;
+
+public class HostsVmsLabelProvider extends LabelProvider {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
+     */
+    @Override
+    public Image getImage(Object element) {
+        return null;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
+     */
+    @Override
+    public String getText(Object element) {
+        if (element instanceof HostRef) {
+            return ((HostRef) element).getHostName();
+        } else if (element instanceof VmRef) {
+            return ((VmRef) element).getName();
+        } else {
+            throw unknownElement(element);
+        }
+    }
+
+    private RuntimeException unknownElement(Object element) {
+        return new RuntimeException("Unknown type of element in tree of type "
+                + element.getClass().getName());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/model/HostsVmsTreeContentProvider.java	Wed Oct 31 13:52:01 2012 -0400
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.eclipse.internal.model;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+import com.redhat.thermostat.common.HostsVMsLoader;
+import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.common.dao.VmRef;
+
+public class HostsVmsTreeContentProvider implements ITreeContentProvider {
+
+    private static final Object[] EMPTY_LIST = new Object[0];
+
+    private HostsVMsLoader loader;
+    private Map<VmRef, HostRef> reverseLookupMap;
+    private HostsVmsTreeRoot root;
+
+    public HostsVmsTreeContentProvider(HostsVMsLoader loader) {
+        this.loader = loader;
+        this.reverseLookupMap = buildReverseLookupMap();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+     */
+    @Override
+    public void dispose() {
+        // nothing
+    }
+
+    @Override
+    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+        if (newInput instanceof HostsVmsTreeRoot) {
+            root = (HostsVmsTreeRoot) newInput;
+        }
+        // refresh reverse look-up
+        this.reverseLookupMap = buildReverseLookupMap();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.
+     * Object)
+     */
+    @Override
+    public Object[] getElements(Object root) {
+        return getChildren(root);
+    }
+
+    @Override
+    public Object[] getChildren(Object parentElement) {
+        if (parentElement instanceof HostsVmsTreeRoot) {
+            return loader.getHosts().toArray();
+        } else if (parentElement instanceof HostRef) {
+            HostRef hostRef = (HostRef) parentElement;
+            return loader.getVMs(hostRef).toArray();
+        } else {
+            return EMPTY_LIST;
+        }
+    }
+
+    @Override
+    public Object getParent(Object element) {
+        if (element instanceof HostsVmsTreeRoot) {
+            return null;
+        } else if (element instanceof HostRef) {
+            return root;
+        } else if (element instanceof VmRef) {
+            return this.reverseLookupMap.get(element);
+        }
+        return null;
+    }
+
+    @Override
+    public boolean hasChildren(Object element) {
+        if (element instanceof HostsVmsTreeRoot) {
+            return loader.getHosts().size() > 0;
+        } else if (element instanceof HostRef) {
+            HostRef host = (HostRef) element;
+            return loader.getVMs(host).size() > 0;
+        } else {
+            // VM refs don't have children
+            return false;
+        }
+    }
+
+    private Map<VmRef, HostRef> buildReverseLookupMap() {
+        Map<VmRef, HostRef> lookupMap = new HashMap<>();
+        for (HostRef ref : loader.getHosts()) {
+            for (VmRef vmRef : loader.getVMs(ref)) {
+                lookupMap.put(vmRef, ref);
+            }
+        }
+        return lookupMap;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/model/HostsVmsTreeRoot.java	Wed Oct 31 13:52:01 2012 -0400
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.eclipse.internal.model;
+
+/**
+ * A dummy root object, since the Hosts don't have a real root.
+ */
+public class HostsVmsTreeRoot {
+    // nothing
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/views/HostOverviewViewPart.java	Wed Oct 31 13:52:01 2012 -0400
@@ -0,0 +1,407 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.eclipse.internal.views;
+
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.PageBook;
+import org.eclipse.ui.part.ViewPart;
+
+import com.redhat.thermostat.common.dao.HostInfoDAO;
+import com.redhat.thermostat.common.dao.HostRef;
+import com.redhat.thermostat.common.dao.NetworkInterfaceInfoDAO;
+import com.redhat.thermostat.common.dao.Ref;
+import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.common.model.HostInfo;
+import com.redhat.thermostat.common.model.NetworkInterfaceInfo;
+import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.eclipse.ThermostatConstants;
+import com.redhat.thermostat.eclipse.internal.Activator;
+
+public class HostOverviewViewPart extends ViewPart {
+
+    private static final int FIRST_COLUMN_WIDTH = 150;
+    private final String STR_UNKNOWN = "UNKNOWN";
+    private PageBook pageBook;
+    // VM page
+    private Composite vmPage;
+    private Label vmName;
+    private Composite notConnectedPage;
+    // Main compositie
+    private ScrolledComposite mainScrollPage;
+    private Label hostname;
+    private Label procModel;
+    private Label procCoreCount;
+    private Label totalMemory;
+    private TableViewer networkInterfaces;
+    private Label osName;
+    private Label osKernel;
+    private ISelection oldSelection = null;
+
+    // The listener we register with the selection service in order to listen
+    // for
+    // VmTreeView selection changes.
+    private ISelectionListener listener = new ISelectionListener() {
+        public void selectionChanged(IWorkbenchPart sourcepart,
+                ISelection selection) {
+            // only react upon hosts/vms tree changes. Then only if the selected
+            // element
+            // actually changed
+            if (sourcepart instanceof HostsVmsTreeViewPart
+                    && !selection.equals(oldSelection)) {
+                oldSelection = selection;
+                Ref ref = getRefFromSelection(selection);
+                if (Activator.getDefault().isDbConnected()) {
+                    if (ref != null) {
+                        updateText(ref);
+                        if (ref instanceof HostRef) {
+                            showPage(mainScrollPage);
+                        } else {
+                            showPage(vmPage);
+                        }
+                    }
+                } else {
+                    showPage(notConnectedPage);
+                }
+            }
+        }
+    };
+
+    private void showPage(final Control page) {
+        PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+            @Override
+            public void run() {
+                if (page instanceof ScrolledComposite) {
+                    ((ScrolledComposite) page).getContent().pack();
+                } else {
+                    page.pack();
+                }
+                pageBook.showPage(page);
+            }
+        });
+    }
+
+    @Override
+    public void createPartControl(Composite parent) {
+        pageBook = new PageBook(parent, SWT.NONE);
+        mainScrollPage = new ScrolledComposite(pageBook, SWT.NONE
+                | SWT.V_SCROLL | SWT.H_SCROLL);
+        Composite main = new Composite(mainScrollPage, SWT.NONE);
+        mainScrollPage.setContent(main);
+        vmPage = new Composite(pageBook, SWT.NONE);
+
+        vmName = new Label(vmPage, SWT.NONE);
+        vmPage.setLayout(new RowLayout());
+
+        notConnectedPage = new Composite(pageBook, SWT.NONE);
+        notConnectedPage.setLayout(new RowLayout());
+
+        // ----------------------------------------
+        // Not connected page
+        // ----------------------------------------
+        Label notConn = new Label(notConnectedPage, SWT.NONE);
+        notConn.setText("Not connected to storage");
+
+        // ----------------------------------------
+        // Main overview page
+        // ----------------------------------------
+        main.setLayout(new GridLayout());
+
+        // Basics
+        Label lblBasics = new Label(main, SWT.NONE);
+        lblBasics.setText("Basics"); // TODO: Externalize
+        Font stdFont = lblBasics.getFont();
+        Font boldFont = new Font(stdFont.getDevice(),
+                stdFont.getFontData()[0].getName(),
+                stdFont.getFontData()[0].getHeight(), SWT.BOLD);
+        lblBasics.setFont(boldFont);
+        Composite basicsComps = new Composite(main, SWT.NONE);
+        GridLayout gridlayout = new GridLayout(2, false);
+        basicsComps.setLayout(gridlayout);
+        Label lblHostName = new Label(basicsComps, SWT.NONE);
+        lblHostName.setText("Hostname");
+        GridData hostNameGridData = new GridData(SWT.RIGHT, SWT.CENTER, false,
+                false);
+        hostNameGridData.widthHint = FIRST_COLUMN_WIDTH;
+        lblHostName.setLayoutData(hostNameGridData);
+        hostname = new Label(basicsComps, SWT.NONE);
+        hostname.setText(STR_UNKNOWN);
+        hostname.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true));
+
+        // Hardware
+        Label lblHardware = new Label(main, SWT.NONE);
+        lblHardware.setText("Hardware");
+        lblHardware.setFont(boldFont);
+        Composite hardwareComps = new Composite(main, SWT.NONE);
+        hardwareComps.setLayout(gridlayout);
+        Label lblProcModel = new Label(hardwareComps, SWT.NONE);
+        lblProcModel.setText("Processor Model");
+        GridData procModelGridData = new GridData(SWT.RIGHT, SWT.CENTER, false,
+                false);
+        procModelGridData.widthHint = FIRST_COLUMN_WIDTH;
+        lblProcModel.setLayoutData(procModelGridData);
+        procModel = new Label(hardwareComps, SWT.NONE);
+        procModel.setText(STR_UNKNOWN);
+        procModel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true));
+        Label lblProcCount = new Label(hardwareComps, SWT.NONE);
+        lblProcCount.setText("Processor Count");
+        GridData procCountGridData = new GridData(SWT.RIGHT, SWT.CENTER, false,
+                false);
+        procCountGridData.widthHint = FIRST_COLUMN_WIDTH;
+        lblProcCount.setLayoutData(procCountGridData);
+        procCoreCount = new Label(hardwareComps, SWT.NONE);
+        procCoreCount.setText(STR_UNKNOWN);
+        procCoreCount.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true,
+                true));
+        Label lblTotalMemory = new Label(hardwareComps, SWT.NONE);
+        lblTotalMemory.setText("Total Memory");
+        GridData totalMemGridData = new GridData(SWT.RIGHT, SWT.CENTER, false,
+                false);
+        totalMemGridData.widthHint = FIRST_COLUMN_WIDTH;
+        lblTotalMemory.setLayoutData(totalMemGridData);
+        lblTotalMemory.pack();
+        totalMemory = new Label(hardwareComps, SWT.NONE);
+        totalMemory.setText(STR_UNKNOWN);
+        totalMemory
+                .setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true));
+        Label lblNetwork = new Label(hardwareComps, SWT.NONE);
+        lblNetwork.setText("Network");
+        GridData networkLayout = new GridData(SWT.RIGHT, SWT.TOP, true, true);
+        networkLayout.widthHint = FIRST_COLUMN_WIDTH;
+        lblNetwork.setLayoutData(networkLayout);
+        networkInterfaces = new TableViewer(hardwareComps, SWT.BORDER);
+        createNetworkTableViewer(networkInterfaces);
+
+        // Software
+        Label lblSoftware = new Label(main, SWT.NONE);
+        lblSoftware.setText("Software");
+        lblSoftware.setFont(boldFont);
+        Composite softwareComps = new Composite(main, SWT.NONE);
+        softwareComps.setLayout(gridlayout);
+        Label lblOsName = new Label(softwareComps, SWT.NONE);
+        lblOsName.setText("OS Name");
+        GridData osNameGridData = new GridData(SWT.RIGHT, SWT.CENTER, false,
+                false);
+        osNameGridData.widthHint = FIRST_COLUMN_WIDTH;
+        lblOsName.setLayoutData(osNameGridData);
+        osName = new Label(softwareComps, SWT.NONE);
+        osName.setText(STR_UNKNOWN);
+        osName.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true));
+        Label lblKernel = new Label(softwareComps, SWT.NONE);
+        lblKernel.setText("OS Kernel");
+        GridData osKernelGridData = new GridData(SWT.RIGHT, SWT.CENTER, false,
+                false);
+        osKernelGridData.widthHint = FIRST_COLUMN_WIDTH;
+        lblKernel.setLayoutData(osKernelGridData);
+        osKernel = new Label(softwareComps, SWT.NONE);
+        osKernel.setText(STR_UNKNOWN);
+        osKernel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true));
+
+        // Listen for VMtree changes
+        getSite().getWorkbenchWindow().getSelectionService()
+        .addSelectionListener(listener);
+        if (Activator.getDefault().isDbConnected()) {
+        	// Explicitly get the selected element from the VmsTreeViewPart
+        	IViewPart part = getSite().getWorkbenchWindow().getActivePage().findView(ThermostatConstants.VIEW_ID_HOST_VM);
+        	if (part != null && part instanceof HostsVmsTreeViewPart) {
+        		ISelection selection = part.getSite().getSelectionProvider().getSelection();
+        		Ref ref = getRefFromSelection(selection);
+        		if (ref != null) {
+        			updateText(ref);
+        			if (ref instanceof HostRef) {
+        				showPage(mainScrollPage);
+        			} else {
+        				showPage(vmPage);
+        			}
+        		} else {
+        			// FIXME: probably want to show something else, e.g. select x in
+        			// VM tree
+        			showPage(notConnectedPage);
+        		}
+        	} else {
+        		showPage(notConnectedPage);
+        	}
+        } else {
+            showPage(notConnectedPage);
+        }
+    }
+
+    @Override
+    public void setFocus() {
+        pageBook.setFocus();
+    }
+
+    private void updateText(Ref ref) {
+        if (ref instanceof HostRef) {
+            updateText((HostRef) ref);
+        } else {
+            updateText((VmRef) ref);
+        }
+    }
+
+    private void updateText(final HostRef hostRef) {
+        HostInfoDAO hostInfoDAO = OSGIUtils.getInstance().getService(
+                HostInfoDAO.class);
+        final HostInfo hostInfo = hostInfoDAO.getHostInfo(hostRef);
+        final NetworkInterfaceInfoDAO networkInfoDAO = OSGIUtils.getInstance()
+                .getService(NetworkInterfaceInfoDAO.class);
+        PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+            @Override
+            public void run() {
+                hostname.setText(hostRef.getHostName());
+                osName.setText(hostInfo.getOsName());
+                procModel.setText(hostInfo.getCpuModel());
+                procCoreCount.setText(Integer.toString(hostInfo.getCpuCount()));
+                osKernel.setText(hostInfo.getOsKernel());
+                totalMemory.setText(Long.toString(hostInfo.getTotalMemory()));
+                // set content for the network iface table
+                networkInterfaces.setInput(networkInfoDAO.getNetworkInterfaces(
+                        hostRef).toArray());
+            }
+        });
+    }
+
+    private void updateText(final VmRef vmRef) {
+        PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+            @Override
+            public void run() {
+                vmName.setText(vmRef.getName());
+            }
+        });
+    }
+
+    private Ref getRefFromSelection(ISelection selection) {
+        if (selection instanceof IStructuredSelection) {
+            IStructuredSelection ss = (IStructuredSelection) selection;
+            // FIXME: hostsVms tree should only allow single selections
+            for (Object item : ss.toArray()) {
+                if (item instanceof Ref) {
+                    return (Ref) item;
+                }
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public void dispose() {
+        // important: We need do unregister our listener when the view is
+        // disposed
+        getSite().getWorkbenchWindow().getSelectionService()
+                .removeSelectionListener(listener);
+        super.dispose();
+    }
+
+    private void createNetworkTableViewer(TableViewer viewer) {
+        createColumns(viewer.getControl().getParent(), viewer);
+        final Table table = viewer.getTable();
+        table.setHeaderVisible(true);
+        table.setLinesVisible(true);
+
+        viewer.setContentProvider(new ArrayContentProvider());
+        // create empty table
+        viewer.setInput(new Object[0]);
+    }
+
+    // This will create the columns for the table
+    private void createColumns(final Composite parent, final TableViewer viewer) {
+        String[] titles = { "Interface", "IPv4 Address", "IPv6 Address" };
+        int[] bounds = { 80, 150, 150 };
+
+        // First column is iface name
+        TableViewerColumn col = createTableViewerColumn(viewer, titles[0],
+                bounds[0], 0);
+        col.setLabelProvider(new ColumnLabelProvider() {
+            @Override
+            public String getText(Object element) {
+                NetworkInterfaceInfo iface = (NetworkInterfaceInfo) element;
+                return iface.getInterfaceName();
+            }
+        });
+
+        // Second column is IPv4
+        col = createTableViewerColumn(viewer, titles[1], bounds[1], 1);
+        col.setLabelProvider(new ColumnLabelProvider() {
+            @Override
+            public String getText(Object element) {
+                NetworkInterfaceInfo iface = (NetworkInterfaceInfo) element;
+                return iface.getIp4Addr();
+            }
+        });
+
+        // IPv6
+        col = createTableViewerColumn(viewer, titles[2], bounds[2], 2);
+        col.setLabelProvider(new ColumnLabelProvider() {
+            @Override
+            public String getText(Object element) {
+                NetworkInterfaceInfo iface = (NetworkInterfaceInfo) element;
+                return iface.getIp6Addr();
+            }
+        });
+    }
+
+    private TableViewerColumn createTableViewerColumn(TableViewer viewer,
+            String title, int bound, final int colNumber) {
+        final TableViewerColumn viewerColumn = new TableViewerColumn(viewer,
+                SWT.NONE);
+        final TableColumn column = viewerColumn.getColumn();
+        column.setText(title);
+        column.setWidth(bound);
+        column.setResizable(true);
+        column.setMoveable(false);
+        return viewerColumn;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/views/HostsVmsTreeViewPart.java	Wed Oct 31 13:52:01 2012 -0400
@@ -0,0 +1,168 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.eclipse.internal.views;
+
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.PageBook;
+import org.eclipse.ui.part.ViewPart;
+
+import com.redhat.thermostat.common.DefaultHostsVMsLoader;
+import com.redhat.thermostat.common.HostsVMsLoader;
+import com.redhat.thermostat.common.dao.HostInfoDAO;
+import com.redhat.thermostat.common.dao.VmInfoDAO;
+import com.redhat.thermostat.common.utils.OSGIUtils;
+import com.redhat.thermostat.eclipse.internal.Activator;
+import com.redhat.thermostat.eclipse.internal.ConnectionConfiguration;
+import com.redhat.thermostat.eclipse.internal.controllers.ConnectDBAction;
+import com.redhat.thermostat.eclipse.internal.controllers.ConnectionJobListener;
+import com.redhat.thermostat.eclipse.internal.jobs.ConnectDbJob;
+import com.redhat.thermostat.eclipse.internal.model.HostsVmsLabelProvider;
+import com.redhat.thermostat.eclipse.internal.model.HostsVmsTreeContentProvider;
+import com.redhat.thermostat.eclipse.internal.model.HostsVmsTreeRoot;
+
+/**
+ * 
+ * The main class for the VM tree view of the Thermostat Eclipse client.
+ * 
+ */
+public class HostsVmsTreeViewPart extends ViewPart {
+
+    private Action connectAction;
+    // Hosts and VMs viewer
+    private TreeViewer treeViewer;
+    // viewer for the connect viewing.
+    private Composite connectPage;
+    // Container for tree and connect
+    private PageBook pageBook;
+
+    public HostsVmsTreeViewPart() {
+        // FIXME: Get these values from preferences
+        ConnectionConfiguration configuration = new ConnectionConfiguration("dummyUser", "dummyPassword", "mongodb://127.0.0.1:27518");
+        Job connectJob = new ConnectDbJob(
+                "Connecting to Thermostat storage...", configuration);
+        connectJob.setSystem(true);
+        connectAction = new ConnectDBAction(connectJob);
+        connectAction.setImageDescriptor(Activator
+                .getImageDescriptor("icons/offline.png"));
+        connectJob.addJobChangeListener(new ConnectionJobListener(connectAction, this));
+    }
+    
+    public void showConnectionPage() {
+        PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+            @Override
+            public void run() {
+                pageBook.showPage(connectPage);
+            }
+        });
+    }
+
+    public void showHostVmsPage() {
+        HostInfoDAO hostDAO = OSGIUtils.getInstance().getService(
+                HostInfoDAO.class);
+        VmInfoDAO vmsDAO = OSGIUtils.getInstance().getService(
+                VmInfoDAO.class);
+        final HostsVMsLoader loader = new DefaultHostsVMsLoader(hostDAO,
+                vmsDAO, false);
+
+        PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+
+            @Override
+            public void run() {
+                treeViewer.setContentProvider(new HostsVmsTreeContentProvider(
+                        loader));
+                treeViewer.setLabelProvider(new HostsVmsLabelProvider());
+                treeViewer.setUseHashlookup(true);
+                treeViewer.setInput(new HostsVmsTreeRoot());
+                pageBook.showPage(treeViewer.getControl());
+            }
+
+        });
+    }
+
+    @Override
+    public void createPartControl(final Composite parent) {
+        IToolBarManager mgr = getViewSite().getActionBars().getToolBarManager();
+        mgr.add(connectAction);
+
+        pageBook = new PageBook(parent, SWT.NONE);
+
+        // Prepare Hosts/VMs tree
+        treeViewer = new TreeViewer(pageBook, SWT.NONE);
+        // register the tree as selection provider
+        getSite().setSelectionProvider(treeViewer);
+
+        // Prepare connect page
+        RowLayout layout = new RowLayout();
+        layout.wrap = true;
+        connectPage = new Composite(pageBook, SWT.NONE);
+        connectPage.setLayout(layout);
+        Label test = new Label(connectPage, SWT.NONE);
+        test.setText("Not connected... ");
+        Link link = new Link(connectPage, SWT.NONE);
+        // FIXME: Externalize
+        link.setText("<a>Connect</a>");
+        link.addListener(SWT.Selection, new Listener() {
+            @Override
+            public void handleEvent(Event event) {
+                connectAction.run();
+            }
+        });
+        // Show appropriate page
+        if (Activator.getDefault().isDbConnected()) {
+            showHostVmsPage();
+        } else {
+            showConnectionPage();
+        }
+    }
+
+    @Override
+    public void setFocus() {
+        pageBook.setFocus();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/internal/views/ThermostatPerspectiveFactory.java	Wed Oct 31 13:52:01 2012 -0400
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.eclipse.internal.views;
+
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+import com.redhat.thermostat.eclipse.ThermostatConstants;
+
+public class ThermostatPerspectiveFactory implements IPerspectiveFactory {
+    
+    public static final String FOLDER_LEFT = "left";
+    public static final String FOLDER_RIGHT = "right";
+
+    @Override
+    public void createInitialLayout(IPageLayout layout) {
+        defineActions(layout);
+        defineLayout(layout);
+    }
+
+    private void defineLayout(IPageLayout layout) {
+        IFolderLayout left = layout.createFolder(FOLDER_LEFT, IPageLayout.LEFT, 0.25f, layout.getEditorArea());
+        left.addView(ThermostatConstants.VIEW_ID_HOST_VM);
+        
+        IFolderLayout right = layout.createFolder(FOLDER_RIGHT, IPageLayout.RIGHT, 0.5f, layout.getEditorArea());
+        right.addView(ThermostatConstants.VIEW_ID_HOST_OVERVIEW);
+        right.addView(ThermostatConstants.VIEW_ID_HOST_CPU);
+        right.addView(ThermostatConstants.VIEW_ID_HOST_MEMORY);
+        right.addView(ThermostatConstants.VIEW_ID_VM_CPU);
+        right.addView(ThermostatConstants.VIEW_ID_VM_GC);
+        
+        layout.setEditorAreaVisible(false);
+    }
+
+    private void defineActions(IPageLayout layout) {
+        layout.addShowViewShortcut(ThermostatConstants.VIEW_ID_HOST_VM);
+        layout.addShowViewShortcut(ThermostatConstants.VIEW_ID_HOST_OVERVIEW);
+        layout.addShowViewShortcut(ThermostatConstants.VIEW_ID_HOST_CPU);
+        layout.addShowViewShortcut(ThermostatConstants.VIEW_ID_HOST_MEMORY);
+        layout.addShowViewShortcut(ThermostatConstants.VIEW_ID_VM_CPU);
+        layout.addShowViewShortcut(ThermostatConstants.VIEW_ID_VM_GC);
+    }
+
+}
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/jobs/ConnectDbJob.java	Wed Oct 31 10:27:59 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
- * Copyright 2012 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.eclipse.jobs;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.osgi.framework.BundleContext;
-
-import com.redhat.thermostat.common.storage.ConnectionException;
-import com.redhat.thermostat.eclipse.Activator;
-import com.redhat.thermostat.eclipse.ConnectionConfiguration;
-import com.redhat.thermostat.eclipse.LoggerFacility;
-import com.redhat.thermostat.launcher.DbService;
-import com.redhat.thermostat.launcher.DbServiceFactory;
-
-public class ConnectDbJob extends Job {
-
-    private ConnectionConfiguration configuration;
-    
-    public ConnectDbJob(String name, ConnectionConfiguration configuration) {
-        super(name);
-        this.configuration = configuration;
-    }
-
-    @Override
-    protected IStatus run(IProgressMonitor monitor) {
-        monitor.beginTask(
-                "Connecting to " + configuration.getDBConnectionString(),
-                IProgressMonitor.UNKNOWN);
-        try {
-            connectToBackEnd();
-            return Status.OK_STATUS;
-        } catch (ConnectionException e) {
-            LoggerFacility.getInstance().log(IStatus.ERROR,
-                    "Could not connect to DB", e);
-            return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not connect to DB", e);
-        }
-    }
-    
-    /*
-     * Establish a DB connection.
-     */
-    private void connectToBackEnd() throws ConnectionException {
-        DbServiceFactory dbServiceFactory = new DbServiceFactory();
-        DbService dbService = dbServiceFactory.createDbService(configuration.getUsername(),
-                configuration.getPassword(), configuration.getDBConnectionString());
-        dbService.connect();
-        // register service in order to indicate that we are connected
-        BundleContext ctxt = Activator.getDefault().getBundle().getBundleContext();
-        ctxt.registerService(DbService.class, dbService, null);
-    }
-
-}
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/model/HostsVmsLabelProvider.java	Wed Oct 31 10:27:59 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright 2012 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.eclipse.model;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
-
-public class HostsVmsLabelProvider extends LabelProvider {
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
-     */
-    @Override
-    public Image getImage(Object element) {
-        return null;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
-     */
-    @Override
-    public String getText(Object element) {
-        if (element instanceof HostRef) {
-            return ((HostRef) element).getHostName();
-        } else if (element instanceof VmRef) {
-            return ((VmRef) element).getName();
-        } else {
-            throw unknownElement(element);
-        }
-    }
-
-    private RuntimeException unknownElement(Object element) {
-        return new RuntimeException("Unknown type of element in tree of type "
-                + element.getClass().getName());
-    }
-
-}
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/model/HostsVmsTreeContentProvider.java	Wed Oct 31 10:27:59 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-/*
- * Copyright 2012 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.eclipse.model;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-import com.redhat.thermostat.common.HostsVMsLoader;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.VmRef;
-
-public class HostsVmsTreeContentProvider implements ITreeContentProvider {
-
-    private static final Object[] EMPTY_LIST = new Object[0];
-
-    private HostsVMsLoader loader;
-    private Map<VmRef, HostRef> reverseLookupMap;
-    private HostsVmsTreeRoot root;
-
-    public HostsVmsTreeContentProvider(HostsVMsLoader loader) {
-        this.loader = loader;
-        this.reverseLookupMap = buildReverseLookupMap();
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.viewers.IContentProvider#dispose()
-     */
-    @Override
-    public void dispose() {
-        // nothing
-    }
-
-    @Override
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-        if (newInput instanceof HostsVmsTreeRoot) {
-            root = (HostsVmsTreeRoot) newInput;
-        }
-        // refresh reverse look-up
-        this.reverseLookupMap = buildReverseLookupMap();
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.
-     * Object)
-     */
-    @Override
-    public Object[] getElements(Object root) {
-        return getChildren(root);
-    }
-
-    @Override
-    public Object[] getChildren(Object parentElement) {
-        if (parentElement instanceof HostsVmsTreeRoot) {
-            return loader.getHosts().toArray();
-        } else if (parentElement instanceof HostRef) {
-            HostRef hostRef = (HostRef) parentElement;
-            return loader.getVMs(hostRef).toArray();
-        } else {
-            return EMPTY_LIST;
-        }
-    }
-
-    @Override
-    public Object getParent(Object element) {
-        if (element instanceof HostsVmsTreeRoot) {
-            return null;
-        } else if (element instanceof HostRef) {
-            return root;
-        } else if (element instanceof VmRef) {
-            return this.reverseLookupMap.get(element);
-        }
-        return null;
-    }
-
-    @Override
-    public boolean hasChildren(Object element) {
-        if (element instanceof HostsVmsTreeRoot) {
-            return loader.getHosts().size() > 0;
-        } else if (element instanceof HostRef) {
-            HostRef host = (HostRef) element;
-            return loader.getVMs(host).size() > 0;
-        } else {
-            // VM refs don't have children
-            return false;
-        }
-    }
-
-    private Map<VmRef, HostRef> buildReverseLookupMap() {
-        Map<VmRef, HostRef> lookupMap = new HashMap<>();
-        for (HostRef ref : loader.getHosts()) {
-            for (VmRef vmRef : loader.getVMs(ref)) {
-                lookupMap.put(vmRef, ref);
-            }
-        }
-        return lookupMap;
-    }
-}
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/model/HostsVmsTreeRoot.java	Wed Oct 31 10:27:59 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright 2012 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.eclipse.model;
-
-/**
- * A dummy root object, since the Hosts don't have a real root.
- */
-public class HostsVmsTreeRoot {
-    // nothing
-}
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/views/HostOverviewViewPart.java	Wed Oct 31 10:27:59 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,407 +0,0 @@
-/*
- * Copyright 2012 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.eclipse.views;
-
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.part.ViewPart;
-
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.HostRef;
-import com.redhat.thermostat.common.dao.NetworkInterfaceInfoDAO;
-import com.redhat.thermostat.common.dao.Ref;
-import com.redhat.thermostat.common.dao.VmRef;
-import com.redhat.thermostat.common.model.HostInfo;
-import com.redhat.thermostat.common.model.NetworkInterfaceInfo;
-import com.redhat.thermostat.common.utils.OSGIUtils;
-import com.redhat.thermostat.eclipse.Activator;
-import com.redhat.thermostat.eclipse.ThermostatConstants;
-
-public class HostOverviewViewPart extends ViewPart {
-
-    private static final int FIRST_COLUMN_WIDTH = 150;
-    private final String STR_UNKNOWN = "UNKNOWN";
-    private PageBook pageBook;
-    // VM page
-    private Composite vmPage;
-    private Label vmName;
-    private Composite notConnectedPage;
-    // Main compositie
-    private ScrolledComposite mainScrollPage;
-    private Label hostname;
-    private Label procModel;
-    private Label procCoreCount;
-    private Label totalMemory;
-    private TableViewer networkInterfaces;
-    private Label osName;
-    private Label osKernel;
-    private ISelection oldSelection = null;
-
-    // The listener we register with the selection service in order to listen
-    // for
-    // VmTreeView selection changes.
-    private ISelectionListener listener = new ISelectionListener() {
-        public void selectionChanged(IWorkbenchPart sourcepart,
-                ISelection selection) {
-            // only react upon hosts/vms tree changes. Then only if the selected
-            // element
-            // actually changed
-            if (sourcepart instanceof HostsVmsTreeViewPart
-                    && !selection.equals(oldSelection)) {
-                oldSelection = selection;
-                Ref ref = getRefFromSelection(selection);
-                if (Activator.getDefault().isDbConnected()) {
-                    if (ref != null) {
-                        updateText(ref);
-                        if (ref instanceof HostRef) {
-                            showPage(mainScrollPage);
-                        } else {
-                            showPage(vmPage);
-                        }
-                    }
-                } else {
-                    showPage(notConnectedPage);
-                }
-            }
-        }
-    };
-
-    private void showPage(final Control page) {
-        PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
-            @Override
-            public void run() {
-                if (page instanceof ScrolledComposite) {
-                    ((ScrolledComposite) page).getContent().pack();
-                } else {
-                    page.pack();
-                }
-                pageBook.showPage(page);
-            }
-        });
-    }
-
-    @Override
-    public void createPartControl(Composite parent) {
-        pageBook = new PageBook(parent, SWT.NONE);
-        mainScrollPage = new ScrolledComposite(pageBook, SWT.NONE
-                | SWT.V_SCROLL | SWT.H_SCROLL);
-        Composite main = new Composite(mainScrollPage, SWT.NONE);
-        mainScrollPage.setContent(main);
-        vmPage = new Composite(pageBook, SWT.NONE);
-
-        vmName = new Label(vmPage, SWT.NONE);
-        vmPage.setLayout(new RowLayout());
-
-        notConnectedPage = new Composite(pageBook, SWT.NONE);
-        notConnectedPage.setLayout(new RowLayout());
-
-        // ----------------------------------------
-        // Not connected page
-        // ----------------------------------------
-        Label notConn = new Label(notConnectedPage, SWT.NONE);
-        notConn.setText("Not connected to storage");
-
-        // ----------------------------------------
-        // Main overview page
-        // ----------------------------------------
-        main.setLayout(new GridLayout());
-
-        // Basics
-        Label lblBasics = new Label(main, SWT.NONE);
-        lblBasics.setText("Basics"); // TODO: Externalize
-        Font stdFont = lblBasics.getFont();
-        Font boldFont = new Font(stdFont.getDevice(),
-                stdFont.getFontData()[0].getName(),
-                stdFont.getFontData()[0].getHeight(), SWT.BOLD);
-        lblBasics.setFont(boldFont);
-        Composite basicsComps = new Composite(main, SWT.NONE);
-        GridLayout gridlayout = new GridLayout(2, false);
-        basicsComps.setLayout(gridlayout);
-        Label lblHostName = new Label(basicsComps, SWT.NONE);
-        lblHostName.setText("Hostname");
-        GridData hostNameGridData = new GridData(SWT.RIGHT, SWT.CENTER, false,
-                false);
-        hostNameGridData.widthHint = FIRST_COLUMN_WIDTH;
-        lblHostName.setLayoutData(hostNameGridData);
-        hostname = new Label(basicsComps, SWT.NONE);
-        hostname.setText(STR_UNKNOWN);
-        hostname.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true));
-
-        // Hardware
-        Label lblHardware = new Label(main, SWT.NONE);
-        lblHardware.setText("Hardware");
-        lblHardware.setFont(boldFont);
-        Composite hardwareComps = new Composite(main, SWT.NONE);
-        hardwareComps.setLayout(gridlayout);
-        Label lblProcModel = new Label(hardwareComps, SWT.NONE);
-        lblProcModel.setText("Processor Model");
-        GridData procModelGridData = new GridData(SWT.RIGHT, SWT.CENTER, false,
-                false);
-        procModelGridData.widthHint = FIRST_COLUMN_WIDTH;
-        lblProcModel.setLayoutData(procModelGridData);
-        procModel = new Label(hardwareComps, SWT.NONE);
-        procModel.setText(STR_UNKNOWN);
-        procModel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true));
-        Label lblProcCount = new Label(hardwareComps, SWT.NONE);
-        lblProcCount.setText("Processor Count");
-        GridData procCountGridData = new GridData(SWT.RIGHT, SWT.CENTER, false,
-                false);
-        procCountGridData.widthHint = FIRST_COLUMN_WIDTH;
-        lblProcCount.setLayoutData(procCountGridData);
-        procCoreCount = new Label(hardwareComps, SWT.NONE);
-        procCoreCount.setText(STR_UNKNOWN);
-        procCoreCount.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true,
-                true));
-        Label lblTotalMemory = new Label(hardwareComps, SWT.NONE);
-        lblTotalMemory.setText("Total Memory");
-        GridData totalMemGridData = new GridData(SWT.RIGHT, SWT.CENTER, false,
-                false);
-        totalMemGridData.widthHint = FIRST_COLUMN_WIDTH;
-        lblTotalMemory.setLayoutData(totalMemGridData);
-        lblTotalMemory.pack();
-        totalMemory = new Label(hardwareComps, SWT.NONE);
-        totalMemory.setText(STR_UNKNOWN);
-        totalMemory
-                .setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true));
-        Label lblNetwork = new Label(hardwareComps, SWT.NONE);
-        lblNetwork.setText("Network");
-        GridData networkLayout = new GridData(SWT.RIGHT, SWT.TOP, true, true);
-        networkLayout.widthHint = FIRST_COLUMN_WIDTH;
-        lblNetwork.setLayoutData(networkLayout);
-        networkInterfaces = new TableViewer(hardwareComps, SWT.BORDER);
-        createNetworkTableViewer(networkInterfaces);
-
-        // Software
-        Label lblSoftware = new Label(main, SWT.NONE);
-        lblSoftware.setText("Software");
-        lblSoftware.setFont(boldFont);
-        Composite softwareComps = new Composite(main, SWT.NONE);
-        softwareComps.setLayout(gridlayout);
-        Label lblOsName = new Label(softwareComps, SWT.NONE);
-        lblOsName.setText("OS Name");
-        GridData osNameGridData = new GridData(SWT.RIGHT, SWT.CENTER, false,
-                false);
-        osNameGridData.widthHint = FIRST_COLUMN_WIDTH;
-        lblOsName.setLayoutData(osNameGridData);
-        osName = new Label(softwareComps, SWT.NONE);
-        osName.setText(STR_UNKNOWN);
-        osName.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true));
-        Label lblKernel = new Label(softwareComps, SWT.NONE);
-        lblKernel.setText("OS Kernel");
-        GridData osKernelGridData = new GridData(SWT.RIGHT, SWT.CENTER, false,
-                false);
-        osKernelGridData.widthHint = FIRST_COLUMN_WIDTH;
-        lblKernel.setLayoutData(osKernelGridData);
-        osKernel = new Label(softwareComps, SWT.NONE);
-        osKernel.setText(STR_UNKNOWN);
-        osKernel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true));
-
-        // Listen for VMtree changes
-        getSite().getWorkbenchWindow().getSelectionService()
-        .addSelectionListener(listener);
-        if (Activator.getDefault().isDbConnected()) {
-        	// Explicitly get the selected element from the VmsTreeViewPart
-        	IViewPart part = getSite().getWorkbenchWindow().getActivePage().findView(ThermostatConstants.VIEW_ID_HOST_VM);
-        	if (part != null && part instanceof HostsVmsTreeViewPart) {
-        		ISelection selection = part.getSite().getSelectionProvider().getSelection();
-        		Ref ref = getRefFromSelection(selection);
-        		if (ref != null) {
-        			updateText(ref);
-        			if (ref instanceof HostRef) {
-        				showPage(mainScrollPage);
-        			} else {
-        				showPage(vmPage);
-        			}
-        		} else {
-        			// FIXME: probably want to show something else, e.g. select x in
-        			// VM tree
-        			showPage(notConnectedPage);
-        		}
-        	} else {
-        		showPage(notConnectedPage);
-        	}
-        } else {
-            showPage(notConnectedPage);
-        }
-    }
-
-    @Override
-    public void setFocus() {
-        pageBook.setFocus();
-    }
-
-    private void updateText(Ref ref) {
-        if (ref instanceof HostRef) {
-            updateText((HostRef) ref);
-        } else {
-            updateText((VmRef) ref);
-        }
-    }
-
-    private void updateText(final HostRef hostRef) {
-        HostInfoDAO hostInfoDAO = OSGIUtils.getInstance().getService(
-                HostInfoDAO.class);
-        final HostInfo hostInfo = hostInfoDAO.getHostInfo(hostRef);
-        final NetworkInterfaceInfoDAO networkInfoDAO = OSGIUtils.getInstance()
-                .getService(NetworkInterfaceInfoDAO.class);
-        PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
-            @Override
-            public void run() {
-                hostname.setText(hostRef.getHostName());
-                osName.setText(hostInfo.getOsName());
-                procModel.setText(hostInfo.getCpuModel());
-                procCoreCount.setText(Integer.toString(hostInfo.getCpuCount()));
-                osKernel.setText(hostInfo.getOsKernel());
-                totalMemory.setText(Long.toString(hostInfo.getTotalMemory()));
-                // set content for the network iface table
-                networkInterfaces.setInput(networkInfoDAO.getNetworkInterfaces(
-                        hostRef).toArray());
-            }
-        });
-    }
-
-    private void updateText(final VmRef vmRef) {
-        PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
-            @Override
-            public void run() {
-                vmName.setText(vmRef.getName());
-            }
-        });
-    }
-
-    private Ref getRefFromSelection(ISelection selection) {
-        if (selection instanceof IStructuredSelection) {
-            IStructuredSelection ss = (IStructuredSelection) selection;
-            // FIXME: hostsVms tree should only allow single selections
-            for (Object item : ss.toArray()) {
-                if (item instanceof Ref) {
-                    return (Ref) item;
-                }
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public void dispose() {
-        // important: We need do unregister our listener when the view is
-        // disposed
-        getSite().getWorkbenchWindow().getSelectionService()
-                .removeSelectionListener(listener);
-        super.dispose();
-    }
-
-    private void createNetworkTableViewer(TableViewer viewer) {
-        createColumns(viewer.getControl().getParent(), viewer);
-        final Table table = viewer.getTable();
-        table.setHeaderVisible(true);
-        table.setLinesVisible(true);
-
-        viewer.setContentProvider(new ArrayContentProvider());
-        // create empty table
-        viewer.setInput(new Object[0]);
-    }
-
-    // This will create the columns for the table
-    private void createColumns(final Composite parent, final TableViewer viewer) {
-        String[] titles = { "Interface", "IPv4 Address", "IPv6 Address" };
-        int[] bounds = { 80, 150, 150 };
-
-        // First column is iface name
-        TableViewerColumn col = createTableViewerColumn(viewer, titles[0],
-                bounds[0], 0);
-        col.setLabelProvider(new ColumnLabelProvider() {
-            @Override
-            public String getText(Object element) {
-                NetworkInterfaceInfo iface = (NetworkInterfaceInfo) element;
-                return iface.getInterfaceName();
-            }
-        });
-
-        // Second column is IPv4
-        col = createTableViewerColumn(viewer, titles[1], bounds[1], 1);
-        col.setLabelProvider(new ColumnLabelProvider() {
-            @Override
-            public String getText(Object element) {
-                NetworkInterfaceInfo iface = (NetworkInterfaceInfo) element;
-                return iface.getIp4Addr();
-            }
-        });
-
-        // IPv6
-        col = createTableViewerColumn(viewer, titles[2], bounds[2], 2);
-        col.setLabelProvider(new ColumnLabelProvider() {
-            @Override
-            public String getText(Object element) {
-                NetworkInterfaceInfo iface = (NetworkInterfaceInfo) element;
-                return iface.getIp6Addr();
-            }
-        });
-    }
-
-    private TableViewerColumn createTableViewerColumn(TableViewer viewer,
-            String title, int bound, final int colNumber) {
-        final TableViewerColumn viewerColumn = new TableViewerColumn(viewer,
-                SWT.NONE);
-        final TableColumn column = viewerColumn.getColumn();
-        column.setText(title);
-        column.setWidth(bound);
-        column.setResizable(true);
-        column.setMoveable(false);
-        return viewerColumn;
-    }
-}
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/views/HostsVmsTreeViewPart.java	Wed Oct 31 10:27:59 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-/*
- * Copyright 2012 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.eclipse.views;
-
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.part.ViewPart;
-
-import com.redhat.thermostat.common.DefaultHostsVMsLoader;
-import com.redhat.thermostat.common.HostsVMsLoader;
-import com.redhat.thermostat.common.dao.HostInfoDAO;
-import com.redhat.thermostat.common.dao.VmInfoDAO;
-import com.redhat.thermostat.common.utils.OSGIUtils;
-import com.redhat.thermostat.eclipse.Activator;
-import com.redhat.thermostat.eclipse.ConnectionConfiguration;
-import com.redhat.thermostat.eclipse.controllers.ConnectDBAction;
-import com.redhat.thermostat.eclipse.controllers.ConnectionJobListener;
-import com.redhat.thermostat.eclipse.jobs.ConnectDbJob;
-import com.redhat.thermostat.eclipse.model.HostsVmsLabelProvider;
-import com.redhat.thermostat.eclipse.model.HostsVmsTreeContentProvider;
-import com.redhat.thermostat.eclipse.model.HostsVmsTreeRoot;
-
-/**
- * 
- * The main class for the VM tree view of the Thermostat Eclipse client.
- * 
- */
-public class HostsVmsTreeViewPart extends ViewPart {
-
-    private Action connectAction;
-    // Hosts and VMs viewer
-    private TreeViewer treeViewer;
-    // viewer for the connect viewing.
-    private Composite connectPage;
-    // Container for tree and connect
-    private PageBook pageBook;
-
-    public HostsVmsTreeViewPart() {
-        // FIXME: Get these values from preferences
-        ConnectionConfiguration configuration = new ConnectionConfiguration("dummyUser", "dummyPassword", "mongodb://127.0.0.1:27518");
-        Job connectJob = new ConnectDbJob(
-                "Connecting to Thermostat storage...", configuration);
-        connectJob.setSystem(true);
-        connectAction = new ConnectDBAction(connectJob);
-        connectAction.setImageDescriptor(Activator
-                .getImageDescriptor("icons/offline.png"));
-        connectJob.addJobChangeListener(new ConnectionJobListener(connectAction, this));
-    }
-    
-    public void showConnectionPage() {
-        PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
-            @Override
-            public void run() {
-                pageBook.showPage(connectPage);
-            }
-        });
-    }
-
-    public void showHostVmsPage() {
-        HostInfoDAO hostDAO = OSGIUtils.getInstance().getService(
-                HostInfoDAO.class);
-        VmInfoDAO vmsDAO = OSGIUtils.getInstance().getService(
-                VmInfoDAO.class);
-        final HostsVMsLoader loader = new DefaultHostsVMsLoader(hostDAO,
-                vmsDAO, false);
-
-        PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
-
-            @Override
-            public void run() {
-                treeViewer.setContentProvider(new HostsVmsTreeContentProvider(
-                        loader));
-                treeViewer.setLabelProvider(new HostsVmsLabelProvider());
-                treeViewer.setUseHashlookup(true);
-                treeViewer.setInput(new HostsVmsTreeRoot());
-                pageBook.showPage(treeViewer.getControl());
-            }
-
-        });
-    }
-
-    @Override
-    public void createPartControl(final Composite parent) {
-        IToolBarManager mgr = getViewSite().getActionBars().getToolBarManager();
-        mgr.add(connectAction);
-
-        pageBook = new PageBook(parent, SWT.NONE);
-
-        // Prepare Hosts/VMs tree
-        treeViewer = new TreeViewer(pageBook, SWT.NONE);
-        // register the tree as selection provider
-        getSite().setSelectionProvider(treeViewer);
-
-        // Prepare connect page
-        RowLayout layout = new RowLayout();
-        layout.wrap = true;
-        connectPage = new Composite(pageBook, SWT.NONE);
-        connectPage.setLayout(layout);
-        Label test = new Label(connectPage, SWT.NONE);
-        test.setText("Not connected... ");
-        Link link = new Link(connectPage, SWT.NONE);
-        // FIXME: Externalize
-        link.setText("<a>Connect</a>");
-        link.addListener(SWT.Selection, new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-                connectAction.run();
-            }
-        });
-        // Show appropriate page
-        if (Activator.getDefault().isDbConnected()) {
-            showHostVmsPage();
-        } else {
-            showConnectionPage();
-        }
-    }
-
-    @Override
-    public void setFocus() {
-        pageBook.setFocus();
-    }
-
-}
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/views/SWTComponent.java	Wed Oct 31 10:27:59 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright 2012 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.eclipse.views;
-
-import org.eclipse.swt.widgets.Composite;
-
-import com.redhat.thermostat.client.core.views.UIComponent;
-
-public interface SWTComponent extends UIComponent {
-    
-    public void createControl(Composite parent);
-
-}
--- a/eclipse/com.redhat.thermostat.eclipse/src/com/redhat/thermostat/eclipse/views/ThermostatPerspectiveFactory.java	Wed Oct 31 10:27:59 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright 2012 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.eclipse.views;
-
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-
-import com.redhat.thermostat.eclipse.ThermostatConstants;
-
-public class ThermostatPerspectiveFactory implements IPerspectiveFactory {
-    
-    public static final String FOLDER_LEFT = "left";
-    public static final String FOLDER_RIGHT = "right";
-
-    @Override
-    public void createInitialLayout(IPageLayout layout) {
-        defineActions(layout);
-        defineLayout(layout);
-    }
-
-    private void defineLayout(IPageLayout layout) {
-        IFolderLayout left = layout.createFolder(FOLDER_LEFT, IPageLayout.LEFT, 0.25f, layout.getEditorArea());
-        left.addView(ThermostatConstants.VIEW_ID_HOST_VM);
-        
-        IFolderLayout right = layout.createFolder(FOLDER_RIGHT, IPageLayout.RIGHT, 0.5f, layout.getEditorArea());
-        right.addView(ThermostatConstants.VIEW_ID_HOST_OVERVIEW);
-        right.addView(ThermostatConstants.VIEW_ID_HOST_CPU);
-        right.addView(ThermostatConstants.VIEW_ID_HOST_MEMORY);
-        right.addView(ThermostatConstants.VIEW_ID_VM_CPU);
-        right.addView(ThermostatConstants.VIEW_ID_VM_GC);
-        
-        layout.setEditorAreaVisible(false);
-    }
-
-    private void defineActions(IPageLayout layout) {
-        layout.addShowViewShortcut(ThermostatConstants.VIEW_ID_HOST_VM);
-        layout.addShowViewShortcut(ThermostatConstants.VIEW_ID_HOST_OVERVIEW);
-        layout.addShowViewShortcut(ThermostatConstants.VIEW_ID_HOST_CPU);
-        layout.addShowViewShortcut(ThermostatConstants.VIEW_ID_HOST_MEMORY);
-        layout.addShowViewShortcut(ThermostatConstants.VIEW_ID_VM_CPU);
-        layout.addShowViewShortcut(ThermostatConstants.VIEW_ID_VM_GC);
-    }
-
-}