commit 45da4f57715b37dd9c347f8139bf73f1a50601e3
Author: Cherian Mathew <c.mathew@bgbm.org>
Date:   Fri Apr 10 11:45:54 2015 +0000

    removed unnecessary StatusEditorView

diff --git a/.gitattributes b/.gitattributes
index df5b9464..37798771 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -47,7 +47,6 @@ src/main/java/eu/etaxonomy/cdm/vaadin/view/IAuthenticationComponent.java -text
 src/main/java/eu/etaxonomy/cdm/vaadin/view/INewTaxonBaseComponentListener.java -text
 src/main/java/eu/etaxonomy/cdm/vaadin/view/INewTaxonBaseComposite.java -text
 src/main/java/eu/etaxonomy/cdm/vaadin/view/IStatusComposite.java -text
-src/main/java/eu/etaxonomy/cdm/vaadin/view/StatusEditorView.java -text
 src/main/java/eu/etaxonomy/cdm/vaadin/view/dbstatus/DistributionSelectionView.java -text
 src/main/java/eu/etaxonomy/cdm/vaadin/view/dbstatus/DistributionTableView.java -text
 src/main/java/eu/etaxonomy/cdm/vaadin/view/dbstatus/IDistributionSelectionComponent.java -text
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/component/StatusComposite.java b/src/main/java/eu/etaxonomy/cdm/vaadin/component/StatusComposite.java
index a8dd6ad9..a957ab19 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/component/StatusComposite.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/component/StatusComposite.java
@@ -11,8 +11,10 @@ package eu.etaxonomy.cdm.vaadin.component;
 
 import java.sql.SQLException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Set;
+import java.util.UUID;
 
 import org.apache.log4j.Logger;
 
@@ -26,8 +28,12 @@ import com.vaadin.data.util.sqlcontainer.RowId;
 import com.vaadin.event.Action;
 import com.vaadin.event.FieldEvents;
 import com.vaadin.event.FieldEvents.TextChangeEvent;
+import com.vaadin.event.ItemClickEvent;
+import com.vaadin.event.ItemClickEvent.ItemClickListener;
 import com.vaadin.event.LayoutEvents.LayoutClickEvent;
 import com.vaadin.event.LayoutEvents.LayoutClickListener;
+import com.vaadin.navigator.View;
+import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
 import com.vaadin.server.FontAwesome;
 import com.vaadin.ui.Alignment;
 import com.vaadin.ui.Button;
@@ -52,8 +58,10 @@ import com.vaadin.ui.Window;
 import eu.etaxonomy.cdm.vaadin.container.IdAndUuid;
 import eu.etaxonomy.cdm.vaadin.container.LeafNodeTaxonContainer;
 import eu.etaxonomy.cdm.vaadin.presenter.NewTaxonBasePresenter;
+import eu.etaxonomy.cdm.vaadin.presenter.StatusPresenter;
 import eu.etaxonomy.cdm.vaadin.session.CdmChangeEvent;
 import eu.etaxonomy.cdm.vaadin.session.ICdmChangeListener;
+import eu.etaxonomy.cdm.vaadin.session.SelectionEvent;
 import eu.etaxonomy.cdm.vaadin.util.CdmVaadinSessionUtilities;
 import eu.etaxonomy.cdm.vaadin.view.IStatusComposite;
 
@@ -62,7 +70,7 @@ import eu.etaxonomy.cdm.vaadin.view.IStatusComposite;
  * @date 11 Mar 2015
  *
  */
-public class StatusComposite extends CustomComponent implements IStatusComposite, ICdmChangeListener {
+public class StatusComposite extends CustomComponent implements View, IStatusComposite, ICdmChangeListener {
 
     /*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */
 
@@ -128,6 +136,7 @@ public class StatusComposite extends CustomComponent implements IStatusComposite
         buildMainLayout();
         setCompositionRoot(mainLayout);
 
+        this.listener = new StatusPresenter();
         CdmVaadinSessionUtilities.getCurrentCdmDataChangeService().register(this);
         addUIListeners();
 
@@ -135,6 +144,12 @@ public class StatusComposite extends CustomComponent implements IStatusComposite
         initSearchTextField();
         initClearSearchButton();
         setEnabledAll(false);
+
+        init();
+    }
+
+    public void minimalize() {
+
     }
 
     public void init() {
@@ -333,6 +348,7 @@ public class StatusComposite extends CustomComponent implements IStatusComposite
         });
 
         addClassificationComboBoxListener();
+        addTaxaTreeTableListener();
         addAddComboBoxListener();
         addRemoveButtonListener();
         addSearchTextFieldListener();
@@ -359,6 +375,22 @@ public class StatusComposite extends CustomComponent implements IStatusComposite
         });
     }
 
+    private void addTaxaTreeTableListener() {
+        taxaTreeTable.addItemClickListener(new ItemClickListener() {
+
+            @Override
+            public void itemClick(ItemClickEvent event) {
+
+                Object itemId = event.getItemId();
+                if(!listener.isSynonym(itemId)) {
+                    UUID taxonUuid = listener.getCurrentLeafNodeTaxonContainer().getUuid(itemId);
+                    CdmVaadinSessionUtilities.getCurrentSelectionService()
+                    .fireSelectionEvent(new SelectionEvent(Arrays.asList((Object)taxonUuid), StatusComposite.class), true);
+                }
+            }
+        });
+
+    }
 
     private void addAddComboBoxListener() {
         addComboBox.addValueChangeListener(new Property.ValueChangeListener() {
@@ -715,4 +747,13 @@ public class StatusComposite extends CustomComponent implements IStatusComposite
 
     }
 
+    /* (non-Javadoc)
+     * @see com.vaadin.navigator.View#enter(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)
+     */
+    @Override
+    public void enter(ViewChangeEvent event) {
+        // TODO Auto-generated method stub
+
+    }
+
 }
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/presenter/StatusPresenter.java b/src/main/java/eu/etaxonomy/cdm/vaadin/presenter/StatusPresenter.java
index 3fc17835..8ef1807c 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/presenter/StatusPresenter.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/presenter/StatusPresenter.java
@@ -12,17 +12,13 @@ package eu.etaxonomy.cdm.vaadin.presenter;
 import java.sql.SQLException;
 import java.util.UUID;
 
-import com.vaadin.data.util.sqlcontainer.query.generator.filter.QueryBuilder;
-
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.vaadin.container.CdmSQLContainer;
 import eu.etaxonomy.cdm.vaadin.container.LeafNodeTaxonContainer;
 import eu.etaxonomy.cdm.vaadin.util.CdmQueryFactory;
-import eu.etaxonomy.cdm.vaadin.util.CdmSQLStringDecorator;
 import eu.etaxonomy.cdm.vaadin.util.CdmSpringContextHelper;
-import eu.etaxonomy.cdm.vaadin.view.IStatusComposite;
 import eu.etaxonomy.cdm.vaadin.view.IStatusComposite.StatusComponentListener;
 
 /**
@@ -32,7 +28,7 @@ import eu.etaxonomy.cdm.vaadin.view.IStatusComposite.StatusComponentListener;
  */
 public class StatusPresenter implements StatusComponentListener {
 
-    private final IStatusComposite composite;
+
 
     private LeafNodeTaxonContainer container;
 
@@ -40,13 +36,7 @@ public class StatusPresenter implements StatusComponentListener {
 
     private int totalNoOfTaxa = 0;
 
-    public StatusPresenter(IStatusComposite composite) {
-        this.composite = composite;
-        composite.setListener(this);
-        // TODO: Need to evaluate the various sql dialects and make sure that these
-        // queries are compatible with all
-        QueryBuilder.setStringDecorator(new CdmSQLStringDecorator());
-
+    public StatusPresenter() {
         taxonService = CdmSpringContextHelper.getTaxonService();
     }
 
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/ui/StatusEditorUI.java b/src/main/java/eu/etaxonomy/cdm/vaadin/ui/StatusEditorUI.java
index 1d074780..80a1a44b 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/ui/StatusEditorUI.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/ui/StatusEditorUI.java
@@ -26,7 +26,7 @@ import com.vaadin.navigator.Navigator;
 import com.vaadin.server.VaadinServlet;
 import com.vaadin.ui.UI;
 
-import eu.etaxonomy.cdm.vaadin.view.StatusEditorView;
+import eu.etaxonomy.cdm.vaadin.component.StatusComposite;
 
 
 @Theme("valo")
@@ -50,8 +50,8 @@ public class StatusEditorUI extends AbstractAuthenticatedUI {
         setIgnoreAuthentication(true);
 
         getPage().setTitle("Status Editor");
-        StatusEditorView statusEditorView = new StatusEditorView();
-        UI.getCurrent().getNavigator().addView(FIRST_VIEW, statusEditorView);
+        StatusComposite statusEditor = new StatusComposite();
+        UI.getCurrent().getNavigator().addView(FIRST_VIEW, statusEditor);
 
     }
 
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/StatusEditorView.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/StatusEditorView.java
deleted file mode 100644
index 3387a89f..00000000
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/StatusEditorView.java
+++ /dev/null
@@ -1,82 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2015 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.cdm.vaadin.view;
-
-import com.vaadin.annotations.AutoGenerated;
-import com.vaadin.navigator.View;
-import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.GridLayout;
-
-import eu.etaxonomy.cdm.vaadin.component.StatusComposite;
-import eu.etaxonomy.cdm.vaadin.presenter.StatusPresenter;
-
-/**
- * @author cmathew
- * @date 11 Mar 2015
- *
- */
-public class StatusEditorView extends CustomComponent implements View {
-
-    /*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */
-
-    @AutoGenerated
-    private GridLayout mainLayout;
-    @AutoGenerated
-    private StatusComposite statusComposite;
-    /**
-     * The constructor should first build the main layout, set the
-     * composition root and then do any custom initialization.
-     *
-     * The constructor will not be automatically regenerated by the
-     * visual editor.
-     */
-    public StatusEditorView() {
-        buildMainLayout();
-        setCompositionRoot(mainLayout);
-
-        new StatusPresenter(statusComposite);
-        statusComposite.init();
-    }
-
-    @AutoGenerated
-    private GridLayout buildMainLayout() {
-        // common part: create layout
-        mainLayout = new GridLayout();
-        mainLayout.setImmediate(false);
-        mainLayout.setWidth("100%");
-        mainLayout.setHeight("100%");
-        mainLayout.setMargin(true);
-        mainLayout.setSpacing(true);
-
-        // top-level component properties
-        setWidth("100.0%");
-        setHeight("100.0%");
-
-        // statusComposite
-        statusComposite = new StatusComposite();
-        statusComposite.setImmediate(false);
-        statusComposite.setWidth("-1px");
-        statusComposite.setHeight("-1px");
-        mainLayout.addComponent(statusComposite, 0, 0);
-
-        return mainLayout;
-    }
-
-    /* (non-Javadoc)
-     * @see com.vaadin.navigator.View#enter(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)
-     */
-    @Override
-    public void enter(ViewChangeEvent event) {
-        // TODO Auto-generated method stub
-
-    }
-
-}
