geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [08/18] incubator-geode git commit: GEODE-80: Imported databrowser from geode-1.0.0-SNAPSHOT-2.src.tar
Date Mon, 06 Jul 2015 21:47:33 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2ccf3da/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/DSView.java
----------------------------------------------------------------------
diff --git a/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/DSView.java b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/DSView.java
new file mode 100644
index 0000000..3e84dfb
--- /dev/null
+++ b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/DSView.java
@@ -0,0 +1,794 @@
+/*=========================================================================
+ * (c)Copyright 2002-2011, GemStone Systems, Inc. All Rights Reserved.
+ * 1260 NW Waterhouse Ave., Suite 200, Beaverton, OR 97006
+ * All Rights Reserved.
+ * =======================================================================*/
+package com.gemstone.gemfire.mgmt.DataBrowser.ui;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.ColumnPixelData;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.HelpEvent;
+import org.eclipse.swt.events.HelpListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+
+import com.gemstone.gemfire.mgmt.DataBrowser.app.DataBrowserApp;
+import com.gemstone.gemfire.mgmt.DataBrowser.app.State;
+import com.gemstone.gemfire.mgmt.DataBrowser.controller.DSSnapShot;
+import com.gemstone.gemfire.mgmt.DataBrowser.model.IMemberEvent;
+import com.gemstone.gemfire.mgmt.DataBrowser.model.member.GemFireMember;
+import com.gemstone.gemfire.mgmt.DataBrowser.model.member.MemberCrashedEvent;
+import com.gemstone.gemfire.mgmt.DataBrowser.model.member.MemberJoinedEvent;
+import com.gemstone.gemfire.mgmt.DataBrowser.model.member.MemberLeftEvent;
+import com.gemstone.gemfire.mgmt.DataBrowser.model.member.MemberUpdatedEvent;
+import com.gemstone.gemfire.mgmt.DataBrowser.model.region.GemFireRegion;
+import com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.NewCQWindow;
+import com.gemstone.gemfire.mgmt.DataBrowser.utils.LogUtil;
+import com.gemstone.gemfire.mgmt.DataBrowser.utils.StringMatcher;
+
+/**
+ * @author mghosh
+ *
+ */
+public class DSView extends Composite {
+
+  static State                  appState_          = DataBrowserApp
+                                                       .getInstance()
+                                                       .getState();
+  TreeViewer                    dsExplorerView_;
+  Text                          regionPatternCtrl_; 
+
+  // -- DS Explorer settings
+  boolean                       fOpenFullyExpanded = false;
+
+  private ArrayList<DSSnapShot> connectedDSs_      = null;
+
+  private PatternFilter         filter_;  
+  private MenuManager           tableMenuManager_;
+  private NewCQWindow           newCQWindowAction_;
+  private DSTreeContentProvider treeContentProv_;
+  private MemberTableContentProvider memberContentProv_;
+  private TableViewer memberViewer_;
+  private Button newCQButton;
+
+  /**
+   * @param parent
+   * @param style
+   */
+  public DSView(Composite parent, int style) {
+    super(parent, style);
+    registerForMessages();
+    
+    GridLayout gLayout = new GridLayout();
+    gLayout.marginHeight = 0;
+    gLayout.marginWidth = 0;
+    setLayout(gLayout);
+    
+    SashForm sash = new SashForm(this, SWT.FLAT | SWT.VERTICAL );
+    sash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+    FillLayout lytSash = new FillLayout();
+    lytSash.type = SWT.HORIZONTAL;
+    lytSash.marginWidth = 0;
+    lytSash.marginHeight = 0;
+    sash.setLayout(lytSash);
+    
+    Composite p1 = new Composite(sash, style);
+    gLayout = new GridLayout();
+    gLayout.numColumns = 1;
+    gLayout.marginHeight = 0;
+    gLayout.marginWidth = 0;
+    p1.setLayout(gLayout);
+    createRegionPatternControl(p1);
+    createDSExplorerView(p1);
+    
+    
+    Composite p2 = new Composite(sash, style);
+    gLayout = new GridLayout();
+    gLayout.marginHeight = 0;
+    gLayout.marginWidth = 0;
+    gLayout.numColumns = 1;
+    p2.setLayout(gLayout);
+    createMemberList(p2);
+    
+    sash.pack();
+    this.pack();
+  }
+
+  
+  private void createRegionPatternControl(Composite parent) {
+    regionPatternCtrl_ = new Text(parent, SWT.LEFT | SWT.SINGLE | SWT.BORDER);
+    
+    GridData gData = new GridData(SWT.FILL, SWT.VERTICAL, true, false);
+    gData.verticalSpan = 1 ;
+    regionPatternCtrl_.setLayoutData(gData);
+  }
+  
+  private void createMemberList(Composite parent) {
+    memberViewer_ = new TableViewer(parent);
+    
+    TableLayout lytTable = new TableLayout();
+    
+    lytTable.addColumnData(new ColumnPixelData(250, true));
+    
+    memberViewer_.getTable().setLayout(lytTable);
+    memberViewer_.getTable().setHeaderVisible(true);
+    memberViewer_.getTable().setLinesVisible(true);
+    
+    GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+    memberViewer_.getTable().setLayoutData(gd);
+    
+    TableColumn col = new TableColumn(memberViewer_.getTable(), SWT.NONE, 0);
+    col.setText("Members");
+    
+    memberContentProv_ = new MemberTableContentProvider(this);
+    
+    memberViewer_.setContentProvider(memberContentProv_);
+    memberViewer_.setLabelProvider(new MemberTableLabelProvider(this));
+
+    memberViewer_.getTable().addSelectionListener(new SelectionAdapter() {
+      @Override
+      public void widgetSelected(SelectionEvent e) {
+        TableItem item = (TableItem)e.item;        
+        GemFireMember member = (GemFireMember)item.getData();
+        if (member != null && member.isNotifyBySubscriptionEnabled()) {
+          IContributionItem menuItem = tableMenuManager_.find(newCQWindowAction_.getId());
+          if (null == menuItem) {
+           tableMenuManager_.add(newCQWindowAction_);
+          }
+          newCQButton.setEnabled(true);
+        } else {
+          tableMenuManager_.remove(newCQWindowAction_.getId());
+          newCQButton.setEnabled(false);
+        }
+      }
+    });
+    
+    tableMenuManager_ = new MenuManager();
+    memberViewer_.getTable().setMenu(tableMenuManager_.createContextMenu(memberViewer_.getTable()));
+    newCQWindowAction_ = new NewCQWindow();
+
+    ActionContributionItem cqActionItem = new ActionContributionItem(newCQWindowAction_);
+    cqActionItem.fill(parent);
+    newCQButton = (Button) cqActionItem.getWidget();
+    newCQButton.setText("New Continuous Query");
+    newCQButton.setEnabled(false);
+  }
+
+  private void installFilter() {
+    regionPatternCtrl_.addModifyListener(new ModifyListener() {
+      public void modifyText(ModifyEvent e) {
+        String text = ((Text) e.widget).getText();
+        setMatcherString(text, true);
+      }
+    });
+  }
+
+  protected void setMatcherString(String pattern, boolean update) {
+    if (pattern.length() == 0) {
+      filter_.setPattern(null);
+    } else {
+      filter_.setPattern(pattern);
+    }
+
+    if (update)
+      stringMatcherUpdated();
+  }
+
+  protected void stringMatcherUpdated() {
+    // refresh viewer to re-filter
+    dsExplorerView_.getControl().setRedraw(false);
+    dsExplorerView_.refresh();
+    dsExplorerView_.expandAll();
+    selectFirstMatch();
+    dsExplorerView_.getControl().setRedraw(true);
+  }
+  
+  protected Object selectFirstMatch() {
+    Tree tree = dsExplorerView_.getTree();
+    Object element = findElement(tree.getItems());
+    if (element != null) {
+      dsExplorerView_.setSelection(new StructuredSelection(element), true);
+    } else
+      dsExplorerView_.setSelection(StructuredSelection.EMPTY);
+    
+    return element;
+  }
+
+  private GemFireRegionRepresentation findElement(TreeItem[] items) {
+    ILabelProvider labelProvider = (ILabelProvider) dsExplorerView_
+        .getLabelProvider();
+    for (int i = 0; i < items.length; i++) {
+      GemFireRegionRepresentation element = (GemFireRegionRepresentation)items[i].getData();
+      StringMatcher matcher = filter_.getPattern();
+      if (matcher == null)
+        return element;
+
+      if (element != null) {
+        String label = labelProvider.getText(element);
+        if (matcher.match(label))
+          return element;
+      }
+    }
+    return null;
+  }
+
+
+  // -----------------------------------------------------------------
+  //
+  // DSTree view stuff
+  //
+  // -----------------------------------------------------------------
+  private void createDSExplorerView(Composite parent) {
+    dsExplorerView_ = new TreeViewer(parent, SWT.FLAT | SWT.VIRTUAL
+        | SWT.BORDER);
+    GridData gData = new GridData(SWT.FILL, SWT.FILL, true, true);
+    gData.verticalSpan = 10 ;
+    dsExplorerView_.getTree().setLayoutData(gData);
+    // this.treeViewer_.getTree().setHeaderVisible( true );
+    this.treeContentProv_ = new DSTreeContentProvider(dsExplorerView_);
+    dsExplorerView_.setContentProvider(treeContentProv_);
+    dsExplorerView_.setLabelProvider(new DSTreeLabelProvider(this));
+    dsExplorerView_.setInput(viewInput);
+
+    // -- setup listeners
+    dsExplorerView_.addHelpListener(new DSViewHelpLstnr(this));
+    this.filter_ = new PatternFilter();
+    this.filter_.setIncludeLeadingWildcard(true);
+    this.filter_.setUseCache(true);
+    dsExplorerView_.addFilter(this.filter_);
+
+    // -- toggle this on user prefs
+    if (true == fOpenFullyExpanded)
+      dsExplorerView_.expandAll();
+
+    installFilter();
+    
+    dsExplorerView_.getTree().addSelectionListener(new TreeSelectionAdapter());
+  }
+
+  public Control getTree() {
+    return dsExplorerView_.getTree();
+  }
+
+  static private class DSTreeContentProvider implements ITreeContentProvider {
+
+    private TreeViewer viewer_;
+
+    public DSTreeContentProvider(TreeViewer vwr) {
+      viewer_ = vwr;
+    }
+
+    public Object[] getChildren(Object element) {
+      Object[] o = new Object[0];
+      if (element instanceof DSViewInput) {
+        DSViewInput input = (DSViewInput) element;
+        GemFireRegionRepresentation[] regions = input.getRegions();
+        o = regions;
+      } else if (element instanceof GemFireRegionRepresentation) {
+        GemFireRegionRepresentation reg = (GemFireRegionRepresentation)element;
+        o = reg.getSubRegions();
+      }
+
+      return o;
+    }
+
+    public Object[] getElements(Object element) {
+      Object[] oRet = new Object[0];
+      if (element instanceof DSViewInput) {
+        DSViewInput input = (DSViewInput) element;
+        GemFireRegionRepresentation[] regions = input.getRegions();
+        oRet = regions;
+      
+      }else if (element instanceof GemFireRegionRepresentation) {
+        GemFireRegionRepresentation reg = (GemFireRegionRepresentation)element;
+        oRet = reg.getSubRegions();
+      }
+      
+      return oRet;
+    }
+
+    public boolean hasChildren(Object element) {
+      boolean fRet = false;
+      if (element instanceof DSViewInput) {
+        DSViewInput input = (DSViewInput) element;
+        fRet = (0 != input.getRegions().length) ? true : false;
+      } else if (element instanceof GemFireRegionRepresentation) {
+        GemFireRegionRepresentation reg = (GemFireRegionRepresentation)element;
+        return ( reg.getSubRegions().length > 0);        
+      }
+
+      return fRet;
+    }
+
+    public Object getParent(Object element) {
+      Object oRet = null;
+      /*
+       * if (element instanceof GemFireMember) { oRet = null; } else if (element
+       * instanceof Region) { oRet = ((Region) element).getDsMember(); }
+       */
+
+      return oRet;
+    }
+
+    public void dispose() {
+    }
+
+    public void inputChanged(Viewer viewer, Object old_input, Object new_input) {
+    }
+  }
+
+  static private class DSTreeLabelProvider extends LabelProvider {
+    static String  imgPathMember = "/com/gemstone/gemfire/mgmt/DataBrowser/resources/icons/DSMember.ico";
+    static String  imgPathRegion = "/com/gemstone/gemfire/mgmt/DataBrowser/resources/icons/Region.ico";
+
+    private DSView dsvParent_    = null;
+
+    DSTreeLabelProvider(DSView dsv) {
+      dsvParent_ = dsv;
+    }
+
+    @Override
+    public String getText(Object element) {
+      /*
+       * if (element instanceof Region) { return ((Region) element).getName(); }
+       */
+      String sLabel = "";
+      if (element instanceof GemFireRegionRepresentation) {
+        sLabel = ((GemFireRegionRepresentation)element).getName();
+      } else if (element instanceof GemFireMember) {
+        sLabel = ((GemFireMember) element).getRepresentationName();
+      } else if (element instanceof DSSnapShot) {
+        sLabel = "snapshot";
+      }
+
+      return sLabel;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
+     */
+    @Override
+    public Image getImage(Object element) {
+      Display dsply = dsvParent_.getDisplay();
+      String path = null;
+      // if (element instanceof Region) {
+      if (element instanceof String) {
+        path = DSTreeLabelProvider.imgPathRegion;
+      } else if (element instanceof GemFireMember) {
+        path = DSTreeLabelProvider.imgPathMember;
+      }
+
+      Image img = null;
+      if (null != path) {
+        InputStream isImage = null;
+        try {
+          isImage = getClass().getResourceAsStream(path);
+
+          if (null != isImage) {
+            img = new Image(dsply, isImage);
+          }
+        } catch (SWTException xptn) {
+          // MGH - we simply show no icon
+          // handler for org.eclipse.swt.graphics.Image ctor
+          // we continue an try to add the other nodes
+          LogUtil
+              .error(
+                  "Unable to create icon for item in DSTreeLabelProvider " + getText(element) + ". No icon will be rendered.", xptn);
+          img = null;
+        } catch (SWTError err) {
+          // MGH - we simply show no icon
+          LogUtil
+              .error(
+                  "Unable to create icon for item in DSTreeLabelProvider " + getText(element) + ". No icon will be rendered.", err);
+          img = null;
+        } finally {
+          if (null != isImage) {
+            try {
+              isImage.close();
+            } catch (IOException xptn) {
+              LogUtil
+                  .error(
+                      "Error closing image resource input stream when creating icon for in DSTreeLabelProvider " + getText(element) + ". Ignoring error.", xptn);
+            }
+          }
+        }
+      }
+
+      return img;
+    }
+
+  } // DSTreeLabelProvider
+
+  // -----------------------------------------------------------------
+  //
+  // Common resizer handler
+  //
+  // -----------------------------------------------------------------
+  private static class DSViewHelpLstnr implements HelpListener {
+    DSView dsvParent_ = null;
+
+    DSViewHelpLstnr(DSView prnt) {
+      dsvParent_ = prnt;
+    }
+
+    public void helpRequested(HelpEvent e) {
+
+    }
+  }
+
+  private void registerForMessages() {
+    final DataBrowserApp app = DataBrowserApp.getInstance();
+    if (null != app) {
+      final MainAppWindow wnd = app.getMainWindow();
+
+      if (null != wnd) {
+        // TODO MGH - Perhaps we should log failure to register and continue!
+        wnd.addCustomMessageListener(CustomUIMessages.DS_CONNECTED, viewInput);
+        wnd.addCustomMessageListener(CustomUIMessages.UPDATE_MEMBER_EVENT,
+            viewInput);
+        wnd.addCustomMessageListener(
+            CustomUIMessages.QRY_MEMBER_SELECTED_FOR_QUERY_EXEC,
+            hndlrMemSelCustomMsgs);
+      }
+    }
+  }
+
+  private DSViewInput                     viewInput             = new DSViewInput();
+  private Member_Selection_custom_handler hndlrMemSelCustomMsgs = new Member_Selection_custom_handler();
+
+
+  private class Member_Selection_custom_handler implements
+      CustomMsgDispatcher.ICustomMessageListener {
+
+    Member_Selection_custom_handler() {
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @seecom.gemstone.gemfire.mgmt.DataBrowser.ui.CustomMsgDispatcher.
+     * ICustomMessageListener#handleEvent(java.lang.String, java.util.ArrayList,
+     * java.util.ArrayList)
+     */
+    public void handleEvent(String msg, ArrayList<Object> params,
+        ArrayList<Object> results) {
+
+      if (CustomUIMessages.QRY_MEMBER_SELECTED_FOR_QUERY_EXEC.equals(msg)) {
+        IStructuredSelection selection = (IStructuredSelection)DSView.this.memberViewer_.getSelection();
+        if(!selection.isEmpty()) {
+          results.add(selection.getFirstElement());
+          return;
+        } 
+        
+        //If only one member is available, then by default use it. No need for user intervention.
+        GemFireRegionRepresentation reg = (GemFireRegionRepresentation)memberViewer_.getInput();
+        if(reg != null) {
+          GemFireMember[] members = viewInput.getMembers(reg);          
+          if(members.length >= 1) {
+            results.add(members[0]);
+          }
+        }
+      } // CustomUIMessages.QRY_MEMBER_SELECTED_FOR_QUERY_EXEC
+    }
+
+  }
+
+  private class DSViewInput implements
+      CustomMsgDispatcher.ICustomMessageListener {
+
+    private DSSnapShot                      snapshot_;
+
+    private Map<GemFireRegionRepresentation, Set<GemFireMember>> regionMemberContainer_;
+    private Set<GemFireRegionRepresentation> rootRegions_;
+
+    public DSViewInput() {
+      regionMemberContainer_ = new HashMap<GemFireRegionRepresentation, Set<GemFireMember>>();
+      rootRegions_ = new HashSet<GemFireRegionRepresentation>();
+    }
+
+    public DSSnapShot getDSSnapShot() {
+      return snapshot_;
+    }
+
+    public GemFireRegionRepresentation[] getRegions() {
+      return rootRegions_.toArray(new GemFireRegionRepresentation[0]);
+    }
+
+    public GemFireMember[] getMembers(GemFireRegionRepresentation region) {
+      Set<GemFireMember> set = regionMemberContainer_.get(region);
+      if(set == null)
+        return new GemFireMember[0];
+
+      GemFireMember[] members = new GemFireMember[set.size()];
+
+      return set.toArray(members);
+    }
+
+    public void addMember(GemFireMember[] members) {
+      for (int j = 0; j < members.length; j++) {
+        GemFireMember member = members[j];
+        GemFireRegion[] rootRegions = member.getRootRegions();
+        
+        for( GemFireRegion reg : rootRegions) {
+          GemFireRegionRepresentation temp = addRegionToTree(member, reg, null);
+          rootRegions_.add(temp);
+        }
+      }
+      
+      GemFireRegionRepresentation rep = (GemFireRegionRepresentation)selectFirstMatch();
+      DSView.this.memberViewer_.setInput(rep);
+    }
+    
+    private GemFireRegionRepresentation addRegionToTree(GemFireMember member,
+        GemFireRegion reg, GemFireRegionRepresentation parent) {
+      GemFireRegionRepresentation root = updateRegionMemberContainer(member,
+          reg);
+
+      if (null != parent)
+        dsExplorerView_.add(parent, root);
+      else
+        dsExplorerView_.add(this, root);
+
+      GemFireRegion[] subRegions = reg.getSubRegions();
+
+      for (GemFireRegion sub : subRegions) {
+        GemFireRegionRepresentation temp = addRegionToTree(member, sub, root);
+        root.addSubRegion(temp);
+      }
+
+      return root;
+    }
+    
+    private GemFireRegionRepresentation updateRegionMemberContainer(GemFireMember member, GemFireRegion reg) {
+      String fullPath = reg.getFullPath();
+      String name = reg.getName();
+      GemFireRegionRepresentation rep = new GemFireRegionRepresentation(fullPath, name);
+      Set<GemFireMember> memSet = regionMemberContainer_.get(rep);
+      if (memSet == null) {
+        memSet = new HashSet<GemFireMember>();
+        regionMemberContainer_.put(rep, memSet);
+        memSet.add(member);        
+      } else {
+        if (!memSet.contains(member)) {
+         memSet.add(member);
+        }
+      }
+
+      return rep;
+    }
+
+    public void removeMember(GemFireMember[] members) {
+      for (int j = 0; j < members.length; j++) {
+        GemFireMember member = members[j];
+        GemFireRegion[] allRegions = member.getAllRegions();
+        
+        for(GemFireRegion reg : allRegions) {
+          GemFireRegionRepresentation rep = new GemFireRegionRepresentation(reg.getFullPath(),reg.getName());
+          Set<GemFireMember> memberSet = regionMemberContainer_.get(rep);
+          if(memberSet != null) {
+            memberSet.remove(member);
+            
+            if(memberSet.isEmpty()) {
+             regionMemberContainer_.remove(rep); 
+             rootRegions_.remove(rep);
+             dsExplorerView_.remove(this, new Object[]{rep});
+
+             //Send a Message to the Member Table to clear its contents.
+             DSView.this.memberViewer_.setInput(rep.getFullPath());
+            }
+          }
+        }
+      }
+    }
+
+    private void clear() {
+      regionMemberContainer_.clear();
+      regionMemberContainer_ = new HashMap<GemFireRegionRepresentation, Set<GemFireMember>>();
+      rootRegions_.clear();
+      rootRegions_ = new HashSet<GemFireRegionRepresentation>();
+      Object input = dsExplorerView_.getInput();
+      dsExplorerView_.setInput(input);
+      memberViewer_.setInput(new Object()); //We just want to clear the table.      
+      tableMenuManager_.remove(newCQWindowAction_.getId());
+      newCQButton.setEnabled(false);
+    }
+
+    private void dsConnected(DSSnapShot dss) {
+      snapshot_ = dss;
+      GemFireMember[] members = snapshot_.getMembers();
+      addMember(members);
+      dsExplorerView_.expandAll();
+      GemFireRegionRepresentation rep = (GemFireRegionRepresentation)selectFirstMatch();
+      DSView.this.memberViewer_.setInput(rep);      
+      tableMenuManager_.add(newCQWindowAction_);
+    }
+
+    public void handleEvent(String msg, ArrayList<Object> params,
+        ArrayList<Object> results) {
+      if (CustomUIMessages.UPDATE_MEMBER_EVENT.equals(msg)) {
+        if (true == params.isEmpty()) {
+          return;
+        }
+        for (int i = 0; i < params.size(); i++) {
+          Object oParam = params.get(i);
+          if (oParam instanceof IMemberEvent) {
+            IMemberEvent event = (IMemberEvent)oParam;
+            if (event instanceof MemberUpdatedEvent
+                || event instanceof MemberJoinedEvent) {
+              addMember(event.getMembers());
+            }
+            else if (event instanceof MemberLeftEvent
+                || event instanceof MemberCrashedEvent) {
+              removeMember(event.getMembers());
+            }
+          }
+        }
+        dsExplorerView_.expandAll();
+      } // CustomUIMessages.UPDATE_MEMBER_EVENT
+      else if (CustomUIMessages.DS_CONNECTED.equals(msg)) {
+        clear();
+        if (!params.isEmpty()) {
+          Object oParam = params.get(0);
+          if (oParam instanceof DSSnapShot) {
+            DSSnapShot dss = (DSSnapShot) oParam;
+            dsConnected(dss);
+          }
+        }
+      }
+    }
+  }
+  
+  private class TreeSelectionAdapter extends SelectionAdapter {
+    
+    @Override
+    public void widgetSelected(SelectionEvent e) {
+      TreeItem item = (TreeItem)e.item;
+      GemFireRegionRepresentation region = (GemFireRegionRepresentation)item.getData();
+        
+      DSView.this.memberViewer_.setInput(region);
+    }
+  }
+  
+  private static class MemberTableContentProvider implements IStructuredContentProvider {
+    private DSView view;
+
+    MemberTableContentProvider(DSView view) {
+      this.view = view;
+    }
+    
+    public Object[] getElements(Object inputElement) {
+      Object[] result = new Object[0];
+      
+      if(inputElement instanceof GemFireRegionRepresentation) {
+        GemFireRegionRepresentation temp = (GemFireRegionRepresentation)inputElement;
+        GemFireMember[] members = view.viewInput.getMembers(temp);
+        result = members;
+      }
+      
+      return result;
+    }
+
+    public void dispose() {
+    }
+
+    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+    }
+  }
+  
+  static private class MemberTableLabelProvider extends LabelProvider {
+    private static final String imgPath    = "/com/gemstone/gemfire/mgmt/DataBrowser/resources/icons/QueryResultsTablIcon.ico";
+    DSView                      dsvParent_ = null;
+
+    public MemberTableLabelProvider(DSView prnt) {
+      super();
+      dsvParent_ = prnt;
+    }
+
+    @Override
+    public String getText(Object element) {
+      String sLabel = "";
+
+      if (element instanceof GemFireMember) {
+        sLabel = ((GemFireMember)element).getRepresentationName();
+      }
+      return sLabel;
+    }
+
+    @Override
+    public Image getImage(Object element) {
+      return null;
+    }
+
+  } 
+
+  static class GemFireRegionRepresentation {
+    private String fullPath;
+    private String name;
+    private List<GemFireRegionRepresentation> subregions;
+    
+    public GemFireRegionRepresentation(String fullPath, String name) {
+      super();
+      this.fullPath = fullPath;
+      this.name = name;
+      this.subregions = new ArrayList<GemFireRegionRepresentation>();
+    }
+    
+    public String getFullPath() {
+      return fullPath;
+    }
+    
+    public String getName() {
+      return name;
+    }
+    
+    public void addSubRegion(GemFireRegionRepresentation sub) {
+      this.subregions.add(sub);
+    }
+    
+    public GemFireRegionRepresentation[] getSubRegions() {
+      return this.subregions.toArray(new GemFireRegionRepresentation[0]);
+    }
+    
+    @Override
+    public boolean equals(Object obj) {
+      if(!(obj instanceof GemFireRegionRepresentation))
+        return false;
+      
+      GemFireRegionRepresentation rep = (GemFireRegionRepresentation)obj;
+      return getFullPath().equals(rep.getFullPath());
+    }
+    
+    @Override
+    public int hashCode() {
+      return getFullPath().hashCode();
+    }
+    
+    @Override
+    public String toString() {
+      return getFullPath();
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2ccf3da/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/ExecutionPlanPanel.java
----------------------------------------------------------------------
diff --git a/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/ExecutionPlanPanel.java b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/ExecutionPlanPanel.java
new file mode 100644
index 0000000..4bed3fa
--- /dev/null
+++ b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/ExecutionPlanPanel.java
@@ -0,0 +1,38 @@
+/**
+ * 
+ */
+package com.gemstone.gemfire.mgmt.DataBrowser.ui;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.HelpListener;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author mghosh
+ * 
+ */
+public class ExecutionPlanPanel extends Composite {
+
+  /**
+   * @param parent
+   * @param style
+   */
+  public ExecutionPlanPanel(Composite parent, int style) {
+    super(parent, style);
+    setBackground(getDisplay().getSystemColor(SWT.COLOR_BLUE));
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see
+   * org.eclipse.swt.widgets.Control#addHelpListener(org.eclipse.swt.events.
+   * HelpListener)
+   */
+  @Override
+  public void addHelpListener(HelpListener listener) {
+    // TODO Auto-generated method stub
+    super.addHelpListener(listener);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2ccf3da/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/IDataBrowserPrefsPage.java
----------------------------------------------------------------------
diff --git a/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/IDataBrowserPrefsPage.java b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/IDataBrowserPrefsPage.java
new file mode 100644
index 0000000..260007f
--- /dev/null
+++ b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/IDataBrowserPrefsPage.java
@@ -0,0 +1,16 @@
+/**
+ * 
+ */
+package com.gemstone.gemfire.mgmt.DataBrowser.ui;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+
+/**
+ * @author mghosh
+ *
+ */
+public interface IDataBrowserPrefsPage {
+  public String getID();
+  public String getLabel();
+  public ImageDescriptor getImageDescriptor(); // throws SWTError;
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2ccf3da/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainAppWindow.java
----------------------------------------------------------------------
diff --git a/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainAppWindow.java b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainAppWindow.java
new file mode 100644
index 0000000..df257a3
--- /dev/null
+++ b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainAppWindow.java
@@ -0,0 +1,422 @@
+/*=========================================================================
+ * (c)Copyright 2002-2011, GemStone Systems, Inc. All Rights Reserved.
+ * 1260 NW Waterhouse Ave., Suite 200, Beaverton, OR 97006
+ * All Rights Reserved.
+ * =======================================================================*/
+package com.gemstone.gemfire.mgmt.DataBrowser.ui;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.action.CoolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.StatusLineManager;
+import org.eclipse.jface.window.ApplicationWindow;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+import com.gemstone.gemfire.mgmt.DataBrowser.app.DataBrowserApp;
+import com.gemstone.gemfire.mgmt.DataBrowser.connection.DSConfiguration;
+import com.gemstone.gemfire.mgmt.DataBrowser.controller.DSSnapShot;
+import com.gemstone.gemfire.mgmt.DataBrowser.controller.DataBrowserController;
+import com.gemstone.gemfire.mgmt.DataBrowser.model.member.GemFireMember;
+import com.gemstone.gemfire.mgmt.DataBrowser.ui.CustomMsgDispatcher.ICustomMessageListener;
+import com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ConnectToDS;
+
+/**
+ * @author mghosh
+ *
+ */
+public class MainAppWindow extends ApplicationWindow {
+  /*
+   * public static final String CSTM_MSG_SHOW_QUERY_TRACE_PANE =
+   * "Hide Query Trace Pane"; public static final String
+   * CSTM_MSG_SHOW_QUERY_STATISTICS_PANE = "Hide Query Log Pane";
+   * public static final String CSTM_MSG_SHOW_QUERY_MESSAGES_PANE =
+   * "Hide Query Messages Pane"; public static final String
+   * CSTM_MSG_SHOW_QUERY_EXECPLAN_PANE = "Hide Query ExecutionPlan Pane";
+   */
+
+  // -- some defaults used if needed
+  final static Display             display_           = new Display();
+  final static Shell               shell_             = new Shell(
+                                                          MainAppWindow.display_);
+  final static String              STR_TITLE_BASE     = "GemFire DataBrowser - ";
+  final static Color               colorWHITE         = new Color(
+                                                          MainAppWindow.display_,
+                                                          0xFF, 0xFF, 0xFF);
+  final static Color               colorPaneBkGrnd_   = MainAppWindow.colorWHITE;
+
+  final static CustomMsgDispatcher msgDispatcher_     = new CustomMsgDispatcher();
+
+  // ImageDescriptor imgMenuManager = null; //
+  // ImageDescriptor.createFromFile(...)
+  // -- UI element managers
+  MainWindowMenuManager            menuManager_       = null;
+  MainWindowCoolBarManager         coolBarManager_    = null;
+  MainWindowStatusLineManager      statusLineManager_ = null;
+
+  // -- 'control/feedback' elements : [cool/tool]bars, status, menus
+  Composite                        parentPane_        = null;
+  SashForm                         sash               = null;
+  DSView                           treeDS_            = null;
+  QueryView                        queryView_         = null;
+  ArrayList<CqAppWindow>           cQWindowList_      = null;
+
+  static Shell                     parentShell_       = null;
+  private DSConfiguration dsConfig;
+  /**
+   * @param parentShell
+   */
+  public MainAppWindow(Shell parentShl) {
+    super(parentShl);
+    setBlockOnOpen(true);
+    addMenuBar();
+    addCoolBar(SWT.NONE);
+    addStatusLine();
+    registerForDSConnectMsg();
+    registerForDSDisconnectMsg();
+  }
+
+  private boolean registerForDSConnectMsg() {
+    return registerForMessage(CustomUIMessages.DS_CONNECTED, hndlrCnxnMsgs);
+  }
+
+  private boolean registerForDSDisconnectMsg() {
+    return registerForMessage(CustomUIMessages.DS_DISCONNECTED, hndlrCnxnMsgs);
+  }
+
+  private boolean registerForMessage(String msg, ICustomMessageListener hndlr) {
+    return addCustomMessageListener(msg, hndlr);
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see org.eclipse.jface.window.Window#handleShellCloseEvent()
+   */
+  @Override
+  protected void handleShellCloseEvent() {
+    DataBrowserApp.getInstance().exit();
+    super.handleShellCloseEvent();
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see org.eclipse.jface.window.ApplicationWindow#createMenuManager()
+   */
+  @Override
+  protected MenuManager createMenuManager() {
+    if (null == menuManager_) {
+      menuManager_ = new MainWindowMenuManager(
+          "DataBrowserMainWindowMenuManager");
+    }
+
+    return menuManager_;
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see org.eclipse.jface.window.ApplicationWindow#createCoolBarManager(int)
+   */
+  @Override
+  protected CoolBarManager createCoolBarManager(int style) {
+    if (null == coolBarManager_) {
+      coolBarManager_ = new MainWindowCoolBarManager(SWT.FLAT);
+    }
+
+    return coolBarManager_;
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see org.eclipse.jface.window.ApplicationWindow#createStatusLineManager()
+   */
+  @Override
+  protected StatusLineManager createStatusLineManager() {
+    if (null == statusLineManager_) {
+      statusLineManager_ = new MainWindowStatusLineManager();
+    }
+
+    return statusLineManager_;
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see
+   * org.eclipse.jface.window.ApplicationWindow#configureShell(org.eclipse.swt
+   * .widgets.Shell)
+   */
+  @Override
+  protected void configureShell(Shell shell) {
+    super.configureShell(shell);
+
+    parentShell_ = (null == shell) ? MainAppWindow.shell_ : shell;
+
+    // -- set title
+    parentShell_.setText(MainAppWindow.STR_TITLE_BASE);
+
+    // -- set any visual attributes based on previously saved state and user
+    // prefs
+    // -- set location & size on screen
+    // shell.setBounds(x, y, width, height);
+    // -- set background
+    // shell.setBackground(color);
+    // shell.setBackgroundImage(image);
+//    StartupSplashUpdater ssu = new StartupSplashUpdater(this);
+//    SplashScreen ss = new SplashScreen(parentShell_.getDisplay(), ssu);
+//    ss.show();
+
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see org.eclipse.jface.window.ApplicationWindow#canHandleShellCloseEvent()
+   */
+  @Override
+  protected boolean canHandleShellCloseEvent() {
+    // TODO MGH: Check if any background ops are in progress before returning
+    return super.canHandleShellCloseEvent();
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see
+   * org.eclipse.jface.window.Window#createContents(org.eclipse.swt.widgets.
+   * Composite)
+   */
+  @Override
+  protected Control createContents(Composite parent) {
+    parentPane_ = parent;
+
+    createSash(parentPane_);
+    createLeftPane(sash);
+    createRightPane(sash);
+    sash.setWeights(new int[] { 30, 70 });
+    if(dsConfig != null){
+      ConnectToDS.connect(dsConfig);
+    }
+    return parentPane_;
+  }
+
+  public DSConfiguration getDsConfig() {
+    return dsConfig;
+  }
+
+  public void setDsConfig(DSConfiguration dsConfig) {
+    this.dsConfig = dsConfig;
+  }
+
+  private void createSash(Composite prnt) {
+    sash = new SashForm(prnt, SWT.FLAT | SWT.HORIZONTAL | SWT.CLIP_SIBLINGS);
+
+    FillLayout lytSash = new FillLayout();
+    lytSash.type = SWT.VERTICAL;
+    sash.setLayout(lytSash);
+  }
+
+  private void createLeftPane(SashForm prnt) {
+    treeDS_ = new DSView(prnt, SWT.FLAT);
+  }
+
+  private void createRightPane(SashForm prnt) {
+    queryView_ = new QueryView(prnt, SWT.FLAT);
+  }
+
+  // *****************************************************************
+  //
+  // Splash screen stuff
+  //
+  // *****************************************************************
+
+  private static class StartupSplashUpdater implements
+      SplashScreenProgressCallback {
+    // TODO MGH: This for demonstrative purposes.
+    private static final int    counterLimit = 1000;
+    private int                 currCounter  = StartupSplashUpdater.counterLimit;
+
+    @SuppressWarnings("unused")
+    private final MainAppWindow mainWindow_;
+
+    StartupSplashUpdater(MainAppWindow maw) {
+      mainWindow_ = maw;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * com.gemstone.gemfire.mgmt.DataBrowser.ui.SplashScreenProgressCallback
+     * #handleProgress(java.lang.Integer)
+     */
+    public ActionCode handleProgress(Integer[] percentComplete) {
+      int iStat = (100 - ((100 * currCounter) / StartupSplashUpdater.counterLimit));
+      percentComplete[0] = Integer.valueOf(iStat);
+      ActionCode ac = null;
+      if (iStat < 100)
+        ac = ActionCode.CONTINUE;
+      else
+        ac = ActionCode.END_SUCCESS;
+
+      currCounter--;
+
+      try {
+        Thread.sleep(0);
+      } catch (Throwable e) {
+        //TODO logging of error??
+      }
+
+      return ac;
+    }
+  } // StartupSplashUpdater
+
+  // ---------------------------------------------------------------
+  // App custom messages
+  // ---------------------------------------------------------------
+  /*
+   * public interface ICustomMessageListener { void handleEvent( String msg,
+   * ArrayList< Object > params, ArrayList< Object > results ); }
+   *
+   * static private ArrayList< String > customMessages_;
+   *
+   * static private HashMap< String, ArrayList< ICustomMessageListener > >
+   * customMsgHandlers_;
+   */
+  // -- Init custom message handling
+  static {
+    /*
+     * MainAppWindow.customMessages_ = new ArrayList< String >();
+     * MainAppWindow.customMessages_.add(
+     * MainAppWindow.CSTM_MSG_SHOW_QUERY_TRACE_PANE );
+     * MainAppWindow.customMessages_.add(
+     * MainAppWindow.CSTM_MSG_SHOW_QUERY_STATISTICS_PANE );
+     * MainAppWindow.customMessages_.add(
+     * MainAppWindow.CSTM_MSG_SHOW_QUERY_MESSAGES_PANE );
+     * MainAppWindow.customMessages_.add(
+     * MainAppWindow.CSTM_MSG_SHOW_QUERY_EXECPLAN_PANE );
+     */
+    /*
+     * MainAppWindow.customMsgHandlers_ = new HashMap< String, ArrayList<
+     * ICustomMessageListener > >(); for( String s :
+     * MainAppWindow.customMessages_ ) { MainAppWindow.customMsgHandlers_.put(
+     * s, new ArrayList< ICustomMessageListener >() ); }
+     */
+  }
+  @Override
+  public boolean close() {
+    if(cQWindowList_ != null){
+      for (int i = 0; i < cQWindowList_.size(); i++) {
+        CqAppWindow cqAppWindow = cQWindowList_.get(i);
+        cqAppWindow.close();
+      }
+      cQWindowList_.clear();
+      cQWindowList_ = null;
+    }
+
+    return super.close();
+  }
+
+  public void removeCqWindow(CqAppWindow win){
+    cQWindowList_.remove(win);
+  }
+
+  public void openNewCqWindow(GemFireMember member){
+    CqAppWindow cqAppWindow = new CqAppWindow(this, member);
+    if(cQWindowList_ == null)
+      cQWindowList_ = new ArrayList<CqAppWindow>();
+
+    cQWindowList_.add(cqAppWindow);
+
+    cqAppWindow.open();
+
+  }
+
+  public boolean addCustomMessageListener(String msg,
+      ICustomMessageListener lstnrNew) {
+    return MainAppWindow.msgDispatcher_.addCustomMessageListener(msg, lstnrNew);
+  }
+
+  // TODO MGH - eventually change the code elsewhere in the ui package to
+  // directly call the dispatcher
+  public void sendCustomMessage(String msg, ArrayList<Object> prms,
+      ArrayList<Object> res) {
+    if (null != msg) {
+      MainAppWindow.msgDispatcher_.sendCustomMessage(msg, prms, res);
+    }
+    if (msg.equalsIgnoreCase(CustomUIMessages.DS_CONNECTED)
+        || msg.equalsIgnoreCase(CustomUIMessages.DS_DISCONNECTED))
+      sendMessageToCqWindow(msg, prms, res);
+  }
+  
+  private void sendMessageToCqWindow(String msg, ArrayList<Object> prms,
+      ArrayList<Object> res) {
+    if(cQWindowList_ == null)
+      return;
+    if (null != msg) {
+      for (int i = 0; i < cQWindowList_.size(); i++) {
+        CqAppWindow cqAppWindow = cQWindowList_.get(i);
+        cqAppWindow.sendCustomMessage(msg, prms, res);
+      }
+    }
+  }
+
+  private TBMgr_CnxnMsgHndlr hndlrCnxnMsgs = new TBMgr_CnxnMsgHndlr();
+
+  static private class TBMgr_CnxnMsgHndlr implements
+      CustomMsgDispatcher.ICustomMessageListener {
+
+    TBMgr_CnxnMsgHndlr() {
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @seecom.gemstone.gemfire.mgmt.DataBrowser.ui.CustomMsgDispatcher.
+     * ICustomMessageListener#handleEvent(java.lang.String, java.util.ArrayList,
+     * java.util.ArrayList)
+     */
+    public void handleEvent(String msg, ArrayList<Object> params,
+        ArrayList<Object> results) {
+      if (false == params.isEmpty()) {
+        // -- MGH - only one param, a DSSSnapShot
+        Object oParam = params.get(0);
+
+        if (oParam instanceof DSSnapShot) {
+          if ((true == CustomUIMessages.DS_CONNECTED.equals(msg))) {
+            DataBrowserApp instance = DataBrowserApp.getInstance();
+            if (instance == null)
+              return;
+            DataBrowserController controller = instance.getController();
+            DSConfiguration currentConnection = controller
+                .getCurrentConnection();
+            String hostPort = "";
+            if (currentConnection != null) {
+              hostPort = currentConnection.getHost() + ":"
+                  + currentConnection.getPort();
+              
+              String version = currentConnection.getVersion();
+              if (version != null) {
+                hostPort += " - GemFire Version: " + version;
+              }
+            }
+
+            parentShell_.setText(MainAppWindow.STR_TITLE_BASE + hostPort);
+          } else if ((true == CustomUIMessages.DS_DISCONNECTED.equals(msg))) {
+            parentShell_.setText(MainAppWindow.STR_TITLE_BASE);
+          }
+        }
+      }
+    }
+  } // class TBMgr_CnxnMsgHndlr
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2ccf3da/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowCoolBarManager.java
----------------------------------------------------------------------
diff --git a/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowCoolBarManager.java b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowCoolBarManager.java
new file mode 100644
index 0000000..cec9d08
--- /dev/null
+++ b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowCoolBarManager.java
@@ -0,0 +1,149 @@
+/**
+ *
+ */
+package com.gemstone.gemfire.mgmt.DataBrowser.ui;
+
+
+//import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.CoolBarManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.CoolBar;
+import org.eclipse.swt.widgets.CoolItem;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+
+import com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.AbstractDataBrowserAction;
+
+/**
+ * @author mghosh
+ *
+ */
+public class MainWindowCoolBarManager extends CoolBarManager {
+
+  /**
+	 *
+	 */
+  public MainWindowCoolBarManager() {
+    init();
+  }
+
+  /**
+   * @param coolBar
+   */
+  public MainWindowCoolBarManager(CoolBar coolBar) {
+    super(coolBar);
+    init();
+  }
+
+  /**
+   * @param style
+   */
+  public MainWindowCoolBarManager(int style) {
+    super(style);
+    init();
+  }
+
+  protected void init() {
+    for (int i = 0; i < actionsTypes_.length; i++) {
+      MainWindowToolBarManager tbm = new MainWindowToolBarManager(SWT.FLAT, i);
+      this.add(tbm);
+    }
+  }
+
+  private Menu                          chevronMenu_  = null;
+
+  protected AbstractDataBrowserAction[][] actionsTypes_ = {
+      {
+      // -- File menu actions
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ConnectToDS(),
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.DisconnectFromDS(),
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.SpecifySecurity(),
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.Exit() },
+
+      // -- Query menu
+      { new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ExecuteQuery(),
+        new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ExportQueryResults(),},
+
+      // -- Help menu
+      { new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.HelpContents(),
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.AboutDataBrowser(), }, };
+
+  // ---------
+  private static class ChevronClickHandler extends SelectionAdapter {
+
+    MainWindowCoolBarManager manager_;
+
+    ChevronClickHandler(MainWindowCoolBarManager mgr) {
+      manager_ = mgr;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt
+     * .events.SelectionEvent)
+     */
+    @Override
+    public void widgetSelected(SelectionEvent event) {
+      //System.out.println("ChevronClickHandler.widgetSelected");
+      if (event.detail == SWT.ARROW) {
+        CoolItem item = (CoolItem) event.widget;
+        CoolBar coolBar = item.getParent();
+        Rectangle itemBounds = item.getBounds();
+        Point pt = coolBar.toDisplay(new Point(itemBounds.x, itemBounds.y));
+        itemBounds.x = pt.x;
+        itemBounds.y = pt.y;
+        ToolBar bar = (ToolBar) item.getControl();
+        ToolItem[] tools = bar.getItems();
+
+        int i = 0;
+        while (i < tools.length) {
+          Rectangle toolBounds = tools[i].getBounds();
+          pt = bar.toDisplay(new Point(toolBounds.x, toolBounds.y));
+          toolBounds.x = pt.x;
+          toolBounds.y = pt.y;
+
+          /*
+           * Figure out the visible portion of the tool by looking at the
+           * intersection of the tool bounds with the cool item bounds.
+           */
+          Rectangle intersection = itemBounds.intersection(toolBounds);
+
+          /*
+           * If the tool is not completely within the cool item bounds, then it
+           * is partially hidden, and all remaining tools are completely hidden.
+           */
+          if (!intersection.equals(toolBounds))
+            break;
+
+          i++;
+        }
+
+        /* Create a menu with items for each of the completely hidden buttons. */
+        if (null != manager_.chevronMenu_)
+          manager_.chevronMenu_.dispose();
+
+        manager_.chevronMenu_ = new Menu(coolBar);
+        for (int j = i; j < tools.length; j++) {
+          MenuItem menuItem = new MenuItem(manager_.chevronMenu_, SWT.PUSH);
+          menuItem.setText(tools[j].getText());
+        }
+
+        /* Drop down the menu below the chevron, with the left edges aligned. */
+        pt = coolBar.toDisplay(new Point(event.x, event.y));
+        manager_.chevronMenu_.setLocation(pt.x, pt.y);
+        manager_.chevronMenu_.setVisible(true);
+      }
+      // super.widgetSelected(event);
+    }
+
+  } // class ChevronClickHandler
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2ccf3da/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowMenuManager.java
----------------------------------------------------------------------
diff --git a/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowMenuManager.java b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowMenuManager.java
new file mode 100644
index 0000000..6eb9501
--- /dev/null
+++ b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowMenuManager.java
@@ -0,0 +1,161 @@
+/**
+ *
+ */
+package com.gemstone.gemfire.mgmt.DataBrowser.ui;
+
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.resource.ImageDescriptor;
+
+import com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.AbstractDataBrowserAction;
+import com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ActionVisualSeparator;
+
+/**
+ * @author mghosh
+ *
+ */
+public class MainWindowMenuManager extends MenuManager {
+/*
+  // -- load properties
+  static final String                   strPropFile         = "C:\\SVNSandbox\\DataBrowser\\trunk\\src\\com\\gemstone\\gemfire\\mgmt\\DataBrowser\\ui\\MainWindowMenuManager.properties";
+  static Properties                     props_              = new Properties();
+  static FileInputStream                fisProps_           = null;
+  static {
+    try {
+      MainWindowMenuManager.fisProps_ = new FileInputStream(
+          MainWindowMenuManager.strPropFile);
+      // props_.loadFromXML( fisProps_ );
+    } catch (IOException xptn) {
+      System.out.println(xptn.getLocalizedMessage());
+      System.out.println(xptn.toString());
+      System.exit(-1);
+    }
+  }
+*/
+  final static private int              NUM_MENU_BAR_ITEMS  = 4;
+  private String[]                      topLevelMenuLabels_ = {
+      "&File" , "&Query", "&Options", "&Help" };
+
+//  private String[]                      topLevelMenuLabels_ = {
+//      "&File", "&Edit", "&Query", "&Options", "&Window", "&Help" };
+  private AbstractDataBrowserAction[][] actionsTypes_       = {
+      {
+      // -- File menu actions
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ConnectToDS(),
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.DisconnectFromDS(),
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.SpecifySecurity(),
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ActionVisualSeparator(),
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.Exit(), },
+//      {
+//      // -- Edit Menu
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.Undo(),
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.Redo(),
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ActionVisualSeparator(),
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.Cut(),
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.Copy(),
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.Paste(),
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ActionVisualSeparator(),
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.SelectAll(), },
+      {
+      // -- Query menu
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ExecuteQuery(),
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ExportQueryResults(),},
+      {
+//      // -- Options menu actions
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ShowTraceTab(),
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ShowStatisticsTab(),
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ShowMessagesTab(),
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ActionVisualSeparator(),
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.Preferences(), },
+//      {
+//      // -- Window menu items
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.NewQueryWindow(),
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.TileQueryWindows(),
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.CascadeQueryWindows(),
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.CloseQueryWindow(),
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.CloseAllQueryWindows(),
+//      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ActionVisualSeparator(),
+//
+//      },
+      {
+      // -- Help menu items
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.HelpContents(),
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ActionVisualSeparator(),
+      // new org.eclipse.jface.action.Separator(),
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.AboutDataBrowser(), } };
+  private MenuManager[]                 menuMgrs_           = null;
+
+  /**
+	 *
+	 */
+  protected MainWindowMenuManager() {
+    init();
+  }
+
+  /**
+   * @param text
+   */
+
+  public MainWindowMenuManager(String text) {
+    super(text);
+    init();
+  }
+
+  /**
+   * @param text
+   * @param id
+   */
+  protected MainWindowMenuManager(String text, String id) {
+    super(text, id);
+    init();
+  }
+
+  /**
+   * @param text
+   * @param image
+   * @param id
+   */
+  protected MainWindowMenuManager(String text, ImageDescriptor image, String id) {
+    super(text, image, id);
+    init();
+  }
+
+  // TODO Pass in configuration data specifying the menus
+  public MainWindowMenuManager(String text, ImageDescriptor img) {
+    super(text, img, text);
+    init();
+  }
+
+  void init() {
+    menuMgrs_ = new MenuManager[MainWindowMenuManager.NUM_MENU_BAR_ITEMS];
+
+    for (int i = 0; i < MainWindowMenuManager.NUM_MENU_BAR_ITEMS; i++) {
+      menuMgrs_[i] = new MenuManager(topLevelMenuLabels_[i]);
+
+      menuMgrs_[i].addMenuListener(new IMenuListener(){
+        public void menuAboutToShow(IMenuManager manager) {
+          IContributionItem[] items = manager.getItems();
+          for (int j = 0; j < items.length; j++) {
+            items[j].update();
+          }
+        }
+      });
+
+      int iNumActions = actionsTypes_[i].length;
+      for (int j = 0; j < iNumActions; j++) {
+        AbstractDataBrowserAction adba = actionsTypes_[i][j];
+        if (adba instanceof ActionVisualSeparator) {
+          menuMgrs_[i].add(new Separator());
+        } else {
+          menuMgrs_[i].add(adba);
+        }
+      }
+
+      this.add(menuMgrs_[i]);
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2ccf3da/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowMenuManager.properties
----------------------------------------------------------------------
diff --git a/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowMenuManager.properties b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowMenuManager.properties
new file mode 100644
index 0000000..4ad54f3
--- /dev/null
+++ b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowMenuManager.properties
@@ -0,0 +1,21 @@
+<MenuBar>
+<Column>
+	<Label default="&File"></Label>
+	<Actions>
+		<action>com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ConnectToDS</action>
+		<action>com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.DisconnectFromDS</action>
+		<action type="separator"/>
+		<action>"exit"</action>
+	<Actions>
+</Column>
+<Column>
+	<Label default="&Edit"></Label>
+	<Actions>
+	</Actions>
+</Column>
+<Column>
+	<Label default="&Help"></Label>
+	<Actions>
+	</Actions>
+</Column>
+</MenuBar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2ccf3da/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowStatusLineManager.java
----------------------------------------------------------------------
diff --git a/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowStatusLineManager.java b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowStatusLineManager.java
new file mode 100644
index 0000000..618e49f
--- /dev/null
+++ b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowStatusLineManager.java
@@ -0,0 +1,21 @@
+/**
+ * 
+ */
+package com.gemstone.gemfire.mgmt.DataBrowser.ui;
+
+import org.eclipse.jface.action.StatusLineManager;
+
+/**
+ * @author mghosh
+ *
+ */
+public class MainWindowStatusLineManager extends StatusLineManager {
+
+	/**
+	 * 
+	 */
+	public MainWindowStatusLineManager() {
+		super();
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2ccf3da/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowToolBarManager.java
----------------------------------------------------------------------
diff --git a/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowToolBarManager.java b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowToolBarManager.java
new file mode 100644
index 0000000..07deabb
--- /dev/null
+++ b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWindowToolBarManager.java
@@ -0,0 +1,216 @@
+/**
+ * 
+ */
+package com.gemstone.gemfire.mgmt.DataBrowser.ui;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.ToolBar;
+
+import com.gemstone.gemfire.mgmt.DataBrowser.app.DataBrowserApp;
+import com.gemstone.gemfire.mgmt.DataBrowser.controller.DSSnapShot;
+import com.gemstone.gemfire.mgmt.DataBrowser.query.QueryResult;
+import com.gemstone.gemfire.mgmt.DataBrowser.ui.CustomMsgDispatcher.ICustomMessageListener;
+import com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.AbstractDataBrowserAction;
+
+/**
+ * @author mghosh
+ * 
+ */
+public class MainWindowToolBarManager extends ToolBarManager {
+
+  // MGH - If the order of the actions here is changed, change the indices for
+  // the connect and disconnect items
+  // in inner class TBMgr_CnxnMsgHndlr
+  private static final AbstractDataBrowserAction[][] actionsTypes_ = {
+      {
+      // -- File menu actions
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ConnectToDS(),
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.DisconnectFromDS(),
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.SpecifySecurity(),
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.Exit() },
+
+      // -- Query menu
+      { new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ExecuteQuery(), 
+        new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.ExportQueryResults(),},
+
+      // -- Help menu
+      { new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.HelpContents(),
+      new com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.AboutDataBrowser(), }, };
+
+
+  private final static IAction          actn_Connect = actionsTypes_[0][0];
+  private final static IAction          actn_Disconnect = actionsTypes_[0][1];
+  private final static IAction          actn_SpecifySecurity = actionsTypes_[0][2];
+  private final static IAction          actn_ExportResults = actionsTypes_[1][1];
+  private final static IAction          actn_ExecuteQuery = actionsTypes_[1][0];
+
+  /**
+	 * 
+	 */
+  @SuppressWarnings("unused")
+  private MainWindowToolBarManager() {
+    // TODO Auto-generated constructor stub
+  }
+
+  /**
+	 * 
+	 */
+  public MainWindowToolBarManager(int iOrdinal) {
+    // TODO Auto-generated constructor stub
+    init(iOrdinal);
+  }
+
+  /**
+   * @param style
+   */
+  public MainWindowToolBarManager(int style, int iOrdinal) {
+    super(style);
+    init(iOrdinal);
+    // TODO Auto-generated constructor stub
+  }
+
+  /**
+   * @param toolbar
+   */
+  public MainWindowToolBarManager(ToolBar toolbar, int iOrdinal) {
+    super(toolbar);
+    init(iOrdinal);
+    // TODO Auto-generated constructor stub
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see
+   * org.eclipse.jface.action.ToolBarManager#createControl(org.eclipse.swt.widgets
+   * .Composite)
+   */
+  @Override
+  public ToolBar createControl(Composite parent) {
+    if( null != find( MainWindowToolBarManager.actn_Connect.getId() )) {
+      this.registerForDSConnectMsg();
+    }
+    if( null != find( MainWindowToolBarManager.actn_Disconnect.getId() )) {
+      this.registerForDSDisconnectMsg();
+    }
+    if( null != find( MainWindowToolBarManager.actn_ExportResults.getId() )) {
+      this.registerForQueryExecution();
+    }
+    
+    if( null != find( MainWindowToolBarManager.actn_ExecuteQuery.getId() )) {
+      this.registerForDSConnectMsg();
+      this.registerForDSDisconnectMsg();
+    }
+
+    
+    return super.createControl(parent);
+  }
+
+  private void init(int iOrdinal) {
+    if (iOrdinal < MainWindowToolBarManager.actionsTypes_.length) {
+      int iNumActions = MainWindowToolBarManager.actionsTypes_[iOrdinal].length;
+      for (int j = 0; j < iNumActions; j++) {
+        // this.appendToGroup( "Group_" + i, this.actionsTypes_[i][j] );
+        this.add(MainWindowToolBarManager.actionsTypes_[iOrdinal][j]);
+      }
+    }
+  }
+
+  // TODO MGH - not sure whether this should go here or in the main window class
+  private boolean registerForDSConnectMsg() {
+    return registerForMessage( CustomUIMessages.DS_CONNECTED, hndlrCnxnMsgs );
+  }
+  
+  private boolean registerForDSDisconnectMsg() {
+    return registerForMessage( CustomUIMessages.DS_DISCONNECTED, hndlrCnxnMsgs );
+  }
+  
+  private boolean registerForQueryExecution() {
+    return registerForMessage( CustomUIMessages.QRY_MSG_ADD_QUERY_SINGLE_RESULT, hndlrCnxnMsgs );
+  }
+  
+  private boolean registerForMessage( String msg, ICustomMessageListener hndlr ) {
+    final DataBrowserApp app = DataBrowserApp.getInstance();
+    boolean fRegistered = false;
+    if (null != app) {
+      final MainAppWindow wnd = app.getMainWindow();
+
+      if (null != wnd) {
+        // TODO MGH - Perhaps we should log failure to register and continue!
+        fRegistered = wnd.addCustomMessageListener(
+            msg, hndlr);
+      }
+    }
+    
+    return fRegistered;
+  }
+
+  private TBMgr_CnxnMsgHndlr hndlrCnxnMsgs = new TBMgr_CnxnMsgHndlr(this);
+
+  static private class TBMgr_CnxnMsgHndlr implements
+      CustomMsgDispatcher.ICustomMessageListener {
+    final MainWindowToolBarManager parent_;
+
+    TBMgr_CnxnMsgHndlr(MainWindowToolBarManager prnt) {
+      parent_ = prnt;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @seecom.gemstone.gemfire.mgmt.DataBrowser.ui.CustomMsgDispatcher.
+     * ICustomMessageListener#handleEvent(java.lang.String, java.util.ArrayList,
+     * java.util.ArrayList)
+     */
+    public void handleEvent(String msg, ArrayList<Object> params,
+        ArrayList<Object> results) {
+      if (false == params.isEmpty()) {
+        // -- MGH - only one param, a DSSSnapShot
+        Object oParam = params.get(0);
+
+        if (oParam instanceof DSSnapShot) {
+          if (( true == CustomUIMessages.DS_CONNECTED.equals(msg)) || (CustomUIMessages.DS_DISCONNECTED.equals(msg))) {
+            IContributionItem itm = parent_.find(actn_Connect.getId());
+            if( null != itm ) {
+              itm.update(IAction.ENABLED);
+            }
+            
+            itm = parent_.find(actn_Disconnect.getId());
+            if( null != itm ) {
+              itm.update(IAction.ENABLED);
+            }
+            
+            itm = parent_.find(actn_SpecifySecurity.getId());
+            if( null != itm ) {
+              itm.update(IAction.ENABLED);
+            }
+            
+            itm = parent_.find(actn_ExportResults.getId());
+            if( null != itm ) {
+              itm.update(IAction.ENABLED);
+            }
+            
+            itm = parent_.find(actn_ExecuteQuery.getId());
+            if( null != itm ) {
+              itm.update(IAction.ENABLED);
+            }
+          }
+        }
+        if (oParam instanceof QueryResult) {
+          IContributionItem itm = parent_.find(actn_ExportResults.getId());
+          if( null != itm ) {
+            itm.update(IAction.ENABLED);
+          }
+        }
+      }
+    }
+
+
+  } // class TBMgr_CnxnMsgHndlr
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2ccf3da/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWndGlobalXptnHandler.java
----------------------------------------------------------------------
diff --git a/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWndGlobalXptnHandler.java b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWndGlobalXptnHandler.java
new file mode 100644
index 0000000..5d3a7d0
--- /dev/null
+++ b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MainWndGlobalXptnHandler.java
@@ -0,0 +1,31 @@
+/**
+ * 
+ */
+package com.gemstone.gemfire.mgmt.DataBrowser.ui;
+
+import org.eclipse.jface.window.Window.IExceptionHandler;
+
+import com.gemstone.gemfire.mgmt.DataBrowser.app.DataBrowserApp;
+
+/**
+ * @author mghosh
+ *
+ */
+public class MainWndGlobalXptnHandler implements IExceptionHandler {
+
+  /**
+   * 
+   */
+  public MainWndGlobalXptnHandler() {
+    // TODO Auto-generated constructor stub
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.jface.window.Window.IExceptionHandler#handleException(java.lang.Throwable)
+   */
+  public void handleException(Throwable t) {
+    // -- log, cleanup, and die
+    DataBrowserApp.getInstance().exit();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2ccf3da/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MessagePanel.java
----------------------------------------------------------------------
diff --git a/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MessagePanel.java b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MessagePanel.java
new file mode 100644
index 0000000..0c855f8
--- /dev/null
+++ b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/MessagePanel.java
@@ -0,0 +1,63 @@
+/**
+ * 
+ */
+package com.gemstone.gemfire.mgmt.DataBrowser.ui;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+import com.gemstone.gemfire.mgmt.DataBrowser.query.cq.event.ErrorEvent;
+import com.gemstone.gemfire.mgmt.DataBrowser.query.cq.event.ICQEvent;
+import com.gemstone.gemfire.mgmt.DataBrowser.utils.LogUtil;
+
+/**
+ * @author mghosh
+ * 
+ */
+public class MessagePanel extends Composite {
+
+  private Text exceptions;
+
+  /**
+   * @param parent
+   * @param style
+   */
+  public MessagePanel(Composite parent, int style) {
+    super(parent, style);
+    
+    GridLayout lytGrpDisc = new GridLayout();
+    lytGrpDisc.numColumns = 1;
+    this.setLayout(lytGrpDisc);
+    
+    exceptions = new Text(this, SWT.MULTI | SWT.READ_ONLY | SWT.LEFT | SWT.V_SCROLL);
+    GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
+    data.heightHint = 80;
+    exceptions.setLayoutData(data);
+  }
+
+  public void processCQEvet(ICQEvent cqEvent){
+    if(cqEvent instanceof ErrorEvent) {
+      if(cqEvent.getThrowable() != null) {
+         StringWriter sw = new StringWriter();
+         PrintWriter pw = new PrintWriter(sw);
+
+         cqEvent.getThrowable().printStackTrace(pw);  
+         exceptions.append(sw.toString());
+         
+         try {
+          pw.close();
+          sw.close();
+        } catch (IOException e) { 
+          LogUtil.error("Error while writing cq to message panel", e);
+        }
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2ccf3da/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/Messages.java
----------------------------------------------------------------------
diff --git a/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/Messages.java b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/Messages.java
new file mode 100644
index 0000000..2984198
--- /dev/null
+++ b/databrowser/src/com/gemstone/gemfire/mgmt/DataBrowser/ui/Messages.java
@@ -0,0 +1,22 @@
+package com.gemstone.gemfire.mgmt.DataBrowser.ui;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+  private static final String         BUNDLE_NAME     = "com.gemstone.gemfire.mgmt.DataBrowser.ui.messages";
+
+  private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+                                                          .getBundle(BUNDLE_NAME);
+
+  private Messages() {
+  }
+
+  public static String getString(String key) {
+    try {
+      return RESOURCE_BUNDLE.getString(key);
+    } catch (MissingResourceException e) {
+      return '!' + key + '!';
+    }
+  }
+}


Mime
View raw message