commit a8118bab5e08fa96b5ac4eb9e24b83769c1f4229
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Tue Oct 18 17:55:13 2016 +0200

    ref #5458 remove distribution selection view

diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/presenter/dbstatus/DistributionSelectionPresenter.java b/src/main/java/eu/etaxonomy/cdm/vaadin/presenter/dbstatus/DistributionSelectionPresenter.java
deleted file mode 100644
index d5cb04d1..00000000
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/presenter/dbstatus/DistributionSelectionPresenter.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package eu.etaxonomy.cdm.vaadin.presenter.dbstatus;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-
-import com.vaadin.ui.UI;
-
-import eu.etaxonomy.cdm.api.service.IClassificationService;
-import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
-import eu.etaxonomy.cdm.api.service.IVocabularyService;
-import eu.etaxonomy.cdm.model.common.DefinedTermBase;
-import eu.etaxonomy.cdm.model.common.TermType;
-import eu.etaxonomy.cdm.model.common.TermVocabulary;
-import eu.etaxonomy.cdm.model.location.NamedArea;
-import eu.etaxonomy.cdm.model.name.Rank;
-import eu.etaxonomy.cdm.model.taxon.Classification;
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.vaadin.util.CdmSpringContextHelper;
-import eu.etaxonomy.cdm.vaadin.util.DistributionEditorUtil;
-import eu.etaxonomy.cdm.vaadin.view.dbstatus.DistributionSelectionView;
-import eu.etaxonomy.cdm.vaadin.view.dbstatus.DistributionTableView;
-
-public class DistributionSelectionPresenter {
-
-	private DistributionSelectionView view;
-
-	public DistributionSelectionPresenter(DistributionSelectionView dsv) {
-		this.view = dsv;
-		view.addListener(this);
-		view.dataBinding();
-	}
-
-	public void buttonClick(TaxonNode taxonNode, TermVocabulary<NamedArea> term, Set<NamedArea> selectedAreas) {
-		DistributionTableView dtv = new DistributionTableView();
-		new DistributionTablePresenter(dtv);
-		UI.getCurrent().getNavigator().addView("table", dtv);
-
-		DistributionEditorUtil.openDistributionView(taxonNode, term, selectedAreas);
-	}
-
-	public List<TaxonNode> getTaxonNodeList() {
-		List<TaxonNode> nodes = new ArrayList<TaxonNode>();
-
-		IClassificationService classificationService = CdmSpringContextHelper.getClassificationService();
-		ITaxonNodeService taxonNodeService = CdmSpringContextHelper.getTaxonNodeService();
-		List<Classification> classificationList = classificationService.listClassifications(null, null, null, NODE_INIT_STRATEGY());
-		for (Classification classification : classificationList) {
-			nodes.add(classification.getRootNode());
-		}
-		for (Classification classification : classificationList) {
-			List<TaxonNode> allNodesForClassification = taxonNodeService.listAllNodesForClassification(classification, null, null);
-			for (TaxonNode taxonNode : allNodesForClassification) {
-				if(taxonNode.getTaxon()!=null && taxonNode.getTaxon().getName()!=null && taxonNode.getTaxon().getName().getRank()!=null){
-					Rank rank = taxonNode.getTaxon().getName().getRank();
-					if(rank.isHigher(Rank.SPECIES()) || rank.equals(Rank.SPECIES())){
-						nodes.add(taxonNode);
-					}
-				}
-			}
-		}
-		return nodes;
-	}
-
-	public List<TermVocabulary<DefinedTermBase>> getNamedAreaList() {
-
-		IVocabularyService vocabularyService = CdmSpringContextHelper.getVocabularyService();
-		List<TermVocabulary<DefinedTermBase>> termList = vocabularyService.findByTermType(TermType.NamedArea);
-		return termList;
-	}
-
-	 private List<String> NODE_INIT_STRATEGY(){
-	        return Arrays.asList(new String[]{
-	            "taxon.sec",
-	            "taxon.name",
-	            "classification"
-	    });}
-}
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/dbstatus/DistributionSelectionView.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/dbstatus/DistributionSelectionView.java
deleted file mode 100644
index 7d9b64da..00000000
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/dbstatus/DistributionSelectionView.java
+++ /dev/null
@@ -1,212 +0,0 @@
-package eu.etaxonomy.cdm.vaadin.view.dbstatus;
-
-import java.util.List;
-import java.util.Set;
-
-import com.vaadin.data.Container;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.data.Property.ValueChangeListener;
-import com.vaadin.data.util.IndexedContainer;
-import com.vaadin.event.ShortcutAction.KeyCode;
-import com.vaadin.navigator.View;
-import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
-import com.vaadin.ui.Alignment;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
-import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.ListSelect;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.Tree;
-import com.vaadin.ui.VerticalLayout;
-
-import eu.etaxonomy.cdm.model.common.DefinedTermBase;
-import eu.etaxonomy.cdm.model.common.TermVocabulary;
-import eu.etaxonomy.cdm.model.location.NamedArea;
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.vaadin.container.NamedAreaContainer;
-import eu.etaxonomy.cdm.vaadin.container.TaxonNodeContainer;
-import eu.etaxonomy.cdm.vaadin.presenter.dbstatus.DistributionSelectionPresenter;
-
-public class DistributionSelectionView extends CustomComponent implements View, ClickListener{
-
-    private VerticalLayout mainLayout;
-    private Panel panel_1;
-    private VerticalLayout verticalLayout_2;
-    private Button button_proceed;
-    private ComboBox classificationBox;
-    private ComboBox distributionAreaBox;
-    private ListSelect namedAreaList;
-    private Tree taxonTree;
-    private Label labelInstruction;
-    private Label labelNoClassification;
-
-    private static final long serialVersionUID = 1L;
-	private DistributionSelectionPresenter distListener;
-	/**
-	 * 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 DistributionSelectionView(){
-		buildMainLayout();
-		setCompositionRoot(mainLayout);
-		setStyleName("login");
-		button_proceed.addClickListener(this);
-		button_proceed.setClickShortcut(KeyCode.ENTER, null);
-	}
-
-
-	public void addListener(DistributionSelectionPresenter listener) {
-		distListener = listener;
-	}
-
-	@Override
-	public void buttonClick(ClickEvent event) {
-		TaxonNode taxonNode = (TaxonNode) taxonTree.getValue();
-		if(taxonNode==null){
-			taxonNode = (TaxonNode) classificationBox.getValue();
-		}
-		TermVocabulary<NamedArea> term = (TermVocabulary<NamedArea>)distributionAreaBox.getValue();
-		Set<NamedArea> selectedAreas = (Set<NamedArea>) namedAreaList.getValue();
-		distListener.buttonClick(taxonNode, term, selectedAreas);
-	}
-
-	public void dataBinding(){
-		classificationBox.setItemCaptionPropertyId(TaxonNodeContainer.LABEL);
-		classificationBox.setContainerDataSource(new TaxonNodeContainer(null));
-		classificationBox.setImmediate(true);
-		classificationBox.addValueChangeListener(new ValueChangeListener() {
-			@Override
-			public void valueChange(ValueChangeEvent event) {
-				TaxonNode parentNode = (TaxonNode) event.getProperty().getValue();
-				if(parentNode!=null){
-					taxonTree.setContainerDataSource(new TaxonNodeContainer(parentNode));
-				}
-				else{
-					taxonTree.setContainerDataSource(null);
-				}
-				labelNoClassification.setVisible(parentNode==null);
-			}
-		});
-        taxonTree.setItemCaptionPropertyId(TaxonNodeContainer.LABEL);
-
-        distributionAreaBox.addValueChangeListener(new ValueChangeListener() {
-
-			@Override
-			public void valueChange(ValueChangeEvent event) {
-				TermVocabulary<NamedArea> vocabulary = (TermVocabulary<NamedArea>) event.getProperty().getValue();
-				NamedAreaContainer container = new NamedAreaContainer(vocabulary);
-				namedAreaList.setContainerDataSource(container);
-			}
-		});
-
-		List<TermVocabulary<DefinedTermBase>> namedAreaList = distListener.getNamedAreaList();
-		Container d = new IndexedContainer(namedAreaList);
-		distributionAreaBox.setContainerDataSource(d);
-	}
-
-	@Override
-	public void enter(ViewChangeEvent event) {
-	}
-
-    private VerticalLayout buildMainLayout() {
-        // common part: create layout
-        mainLayout = new VerticalLayout();
-        mainLayout.setImmediate(false);
-        mainLayout.setWidth("100%");
-        mainLayout.setHeight("100%");
-        mainLayout.setMargin(false);
-
-        // top-level component properties
-        setWidth("100.0%");
-        setHeight("100.0%");
-
-        // panel_1
-        panel_1 = buildPanel_1();
-        mainLayout.addComponent(panel_1);
-        mainLayout.setComponentAlignment(panel_1, new Alignment(48));
-
-        return mainLayout;
-    }
-
-
-    private Panel buildPanel_1() {
-        // common part: create layout
-        panel_1 = new Panel();
-        panel_1.setImmediate(false);
-        panel_1.setWidth("-1px");
-        panel_1.setHeight("-1px");
-
-        // verticalLayout_2
-        verticalLayout_2 = buildVerticalLayout_2();
-        panel_1.setContent(verticalLayout_2);
-
-        return panel_1;
-    }
-
-
-    private VerticalLayout buildVerticalLayout_2() {
-        // common part: create layout
-        verticalLayout_2 = new VerticalLayout();
-        verticalLayout_2.setImmediate(false);
-        verticalLayout_2.setWidth("-1px");
-        verticalLayout_2.setHeight("-1px");
-        verticalLayout_2.setMargin(true);
-        verticalLayout_2.setSpacing(true);
-
-        labelInstruction = new Label();
-        labelInstruction.setImmediate(false);
-        labelInstruction.setWidth("213px");
-        labelInstruction.setHeight("-1px");
-        labelInstruction.setValue("Please choose a Classification and/or taxon and a distribution area to proceed.");
-        verticalLayout_2.addComponent(labelInstruction);
-
-        // classificationBox
-        classificationBox = new ComboBox();
-        classificationBox.setCaption("Classification: ");
-        classificationBox.setImmediate(false);
-        classificationBox.setWidth("200px");
-        classificationBox.setHeight("-1px");
-        verticalLayout_2.addComponent(classificationBox);
-
-        // distributionAreaBox
-        distributionAreaBox = new ComboBox();
-        distributionAreaBox.setCaption("Distribution Area");
-        distributionAreaBox.setWidth("200px");
-        distributionAreaBox.setHeight("-1px");
-        verticalLayout_2.addComponent(distributionAreaBox);
-
-        // named areas
-        namedAreaList = new ListSelect();
-        namedAreaList.setCaption("Areas");
-        namedAreaList.setWidth("200px");
-        namedAreaList.setHeight("-1px");
-        namedAreaList.setMultiSelect(true);
-        verticalLayout_2.addComponent(namedAreaList);
-
-        // taxon tree
-        taxonTree = new Tree("Taxonomy");
-        taxonTree.setWidth("200px");
-        verticalLayout_2.addComponent(taxonTree);
-        labelNoClassification = new Label(" - Please select a classification - ");
-        verticalLayout_2.addComponent(labelNoClassification);
-        verticalLayout_2.setComponentAlignment(labelNoClassification, Alignment.BOTTOM_RIGHT);
-
-        // button_proceed
-        button_proceed = new Button();
-        button_proceed.setCaption("Proceed");
-        button_proceed.setImmediate(true);
-        button_proceed.setWidth("-1px");
-        button_proceed.setHeight("-1px");
-        verticalLayout_2.addComponent(button_proceed);
-        verticalLayout_2.setComponentAlignment(button_proceed, new Alignment(10));
-
-        return verticalLayout_2;
-    }
-
-}
