commit 4bdae8e0df62b69d0ed30d7d25e6f96282ec1565
Author: Alexander Oppermann <a.oppermann@bgbm.org>
Date:   Mon Apr 27 11:15:05 2015 +0000

    * Fixed selection view and replaced twin selection component with combobox
    
    * fixed display issue with deproxy method

diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/component/DetailWindow.java b/src/main/java/eu/etaxonomy/cdm/vaadin/component/DetailWindow.java
index 5dfc0b52..c624c421 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/component/DetailWindow.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/component/DetailWindow.java
@@ -9,6 +9,7 @@ import com.vaadin.ui.CustomComponent;
 import com.vaadin.ui.Tree;
 import com.vaadin.ui.Window;
 
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.description.CategoricalData;
 import eu.etaxonomy.cdm.model.description.CommonTaxonName;
@@ -60,8 +61,8 @@ public class DetailWindow extends CustomComponent{
 			tree.setParent(deb.getFeature(), parent);
 			tree.setChildrenAllowed(deb.getFeature(), true);
 
-			if(deb instanceof CategoricalData){
-				CategoricalData cd = (CategoricalData) deb;
+			if(deb.isInstanceOf(CategoricalData.class)){
+				CategoricalData cd = CdmBase.deproxy(deb, CategoricalData.class);
 				if(cd.getStatesOnly().size() <= 1){
 					for(StateData st  : cd.getStateData()){
 						tree.addItem(st);
@@ -72,25 +73,23 @@ public class DetailWindow extends CustomComponent{
 				}else{
 					//TODO: implement recursion
 				}
-			}else if(deb instanceof TextData){
-				TextData td = (TextData) deb;
+			}else if(deb.isInstanceOf(TextData.class)){
+				TextData td = CdmBase.deproxy(deb,TextData.class);
 				tree.addItem(td);
 				tree.setItemCaption(td, td.getText(Language.GERMAN()));
 				tree.setParent(td, deb.getFeature());
 				tree.setChildrenAllowed(td, false);
-			}else if(deb instanceof CommonTaxonName){
-			    CommonTaxonName td = (CommonTaxonName) deb;
+			}else if(deb.isInstanceOf(CommonTaxonName.class)){
+			    CommonTaxonName td = CdmBase.deproxy(deb, CommonTaxonName.class);
 			    tree.addItem(td);
 			    tree.setItemCaption(td, td.getName());
 			    tree.setParent(td, deb.getFeature());
 			    tree.setChildrenAllowed(td, false);
-			}else if(deb instanceof Distribution){
-				Distribution db = (Distribution) deb;
-
+			}else if(deb.isInstanceOf(Distribution.class)){
+				Distribution db = CdmBase.deproxy(deb, Distribution.class);
 				tree.addItem(db.toString());
 				tree.setParent(db.toString(), deb.getFeature());
 				tree.setChildrenAllowed(db.toString(), true);
-
 				tree.addItem(db.getStatus().toString());
 				tree.setParent(db.getStatus().toString(), db.toString());
 				tree.setChildrenAllowed(db.getStatus().toString(), false);
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
index 1950d945..ae4f5af1 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/dbstatus/DistributionSelectionView.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/dbstatus/DistributionSelectionView.java
@@ -9,14 +9,13 @@ 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.Accordion;
 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.OptionGroup;
 import com.vaadin.ui.Panel;
 import com.vaadin.ui.VerticalLayout;
 
@@ -28,28 +27,24 @@ public class DistributionSelectionView extends CustomComponent implements IDistr
 
 	/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */
 
-	/**
+	@AutoGenerated
+    private VerticalLayout mainLayout;
+    @AutoGenerated
+    private Panel panel_1;
+    @AutoGenerated
+    private VerticalLayout verticalLayout_2;
+    @AutoGenerated
+    private Button button_proceed;
+    @AutoGenerated
+    private ComboBox distributionAreaBox;
+    @AutoGenerated
+    private ComboBox classificationBox;
+    @AutoGenerated
+    private Label label_1;
+    /**
 	 *
 	 */
 	private static final long serialVersionUID = 1L;
-	@AutoGenerated
-	private VerticalLayout mainLayout;
-	@AutoGenerated
-	private Panel panel_1;
-	@AutoGenerated
-	private VerticalLayout verticalLayout_2;
-	@AutoGenerated
-	private Button button_proceed;
-	@AutoGenerated
-	private Accordion accordion;
-	@AutoGenerated
-	private OptionGroup distributionSelection;
-
-
-    @AutoGenerated
-	private OptionGroup classificationSelection;
-	@AutoGenerated
-	private Label label_1;
 	private DistributionSelectionComponentListener distListener;
 	/**
 	 * The constructor should first build the main layout, set the
@@ -74,9 +69,9 @@ public class DistributionSelectionView extends CustomComponent implements IDistr
 
 	@Override
 	public void buttonClick(ClickEvent event) {
-		if(classificationSelection != null && distributionSelection != null){
-			Classification classification = (Classification) classificationSelection.getValue();
-			TermVocabulary<DefinedTermBase> term = (TermVocabulary<DefinedTermBase>)distributionSelection.getValue();
+		if(classificationBox != null && distributionAreaBox != null){
+			Classification classification = (Classification) classificationBox.getValue();
+			TermVocabulary<DefinedTermBase> term = (TermVocabulary<DefinedTermBase>)distributionAreaBox.getValue();
 			try {
 				distListener.buttonClick(classification, term);
 			} catch (SQLException e) {
@@ -90,9 +85,11 @@ public class DistributionSelectionView extends CustomComponent implements IDistr
 		List<Classification> classificationList = distListener.getClassificationList();
 		List<TermVocabulary<DefinedTermBase>> namedAreaList = distListener.getNamedAreaList();
 		Container c = new IndexedContainer(classificationList);
-		classificationSelection.setContainerDataSource(c);
+		classificationBox.setContainerDataSource(c);
+//		classificationSelection.setContainerDataSource(c);
 		Container d = new IndexedContainer(namedAreaList);
-		distributionSelection.setContainerDataSource(d);
+		distributionAreaBox.setContainerDataSource(d);
+//		distributionSelection.setContainerDataSource(d);
 	}
 
 	@Override
@@ -100,99 +97,87 @@ public class DistributionSelectionView extends CustomComponent implements IDistr
 	}
 
 	@AutoGenerated
-	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 VerticalLayout buildMainLayout() {
+        // common part: create layout
+        mainLayout = new VerticalLayout();
+        mainLayout.setImmediate(false);
+        mainLayout.setWidth("100%");
+        mainLayout.setHeight("100%");
+        mainLayout.setMargin(false);
 
-	@AutoGenerated
-	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;
-	}
+        // top-level component properties
+        setWidth("100.0%");
+        setHeight("100.0%");
 
-	@AutoGenerated
-	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);
-
-		// label_1
-		label_1 = new Label();
-		label_1.setImmediate(false);
-		label_1.setWidth("213px");
-		label_1.setHeight("-1px");
-		label_1.setValue("Please choose a Classification and a distribution area to proceed.");
-		verticalLayout_2.addComponent(label_1);
-
-		// accordion
-		accordion = buildAccordion();
-		verticalLayout_2.addComponent(accordion);
-		verticalLayout_2.setComponentAlignment(accordion, new Alignment(48));
-
-		// button_1
-		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;
-	}
+        // panel_1
+        panel_1 = buildPanel_1();
+        mainLayout.addComponent(panel_1);
+        mainLayout.setComponentAlignment(panel_1, new Alignment(48));
 
-	@AutoGenerated
-	private Accordion buildAccordion() {
-		// common part: create layout
-		accordion = new Accordion();
-		accordion.setImmediate(true);
-		accordion.setWidth("-1px");
-		accordion.setHeight("-1px");
-
-		// classificationSelection
-		classificationSelection = new OptionGroup();
-		classificationSelection.setImmediate(false);
-		classificationSelection.setWidth("-1px");
-		classificationSelection.setHeight("-1px");
-		accordion.addTab(classificationSelection, "Classifcation", null);
-
-		// distributionSelection
-		distributionSelection = new OptionGroup();
-		distributionSelection.setImmediate(false);
-		distributionSelection.setWidth("-1px");
-		distributionSelection.setHeight("-1px");
-		accordion.addTab(distributionSelection, "Distribution Area", null);
-
-		return accordion;
-	}
+        return mainLayout;
+    }
+
+
+    @AutoGenerated
+    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;
+    }
+
+
+    @AutoGenerated
+    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);
+
+        // label_1
+        label_1 = new Label();
+        label_1.setImmediate(false);
+        label_1.setWidth("213px");
+        label_1.setHeight("-1px");
+        label_1.setValue("Please choose a Classification and a distribution area to proceed.");
+        verticalLayout_2.addComponent(label_1);
+
+        // 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("Distributrion Area");
+        distributionAreaBox.setImmediate(false);
+        distributionAreaBox.setWidth("200px");
+        distributionAreaBox.setHeight("-1px");
+        verticalLayout_2.addComponent(distributionAreaBox);
+
+        // 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;
+    }
 
 }
