From 6e7f54516faa2279c1b7f19e36f8b49a74df0ea6 Mon Sep 17 00:00:00 2001
From: ribeaudc <ribeaudc>
Date: Mon, 8 Dec 2008 07:39:01 +0000
Subject: [PATCH] remove: - Hack used to close the combo box when mouse is
 clicked on it. Actually it should close automatically (otherwise it is not a
 combo box!). This is done by just trying to understand how selection works
 and how selection is propagated in GXT. - Generally the flag 'allowEmpty' as
 it is not really used. Instead use properly 'setEmptyText' combined with
 'applyEmptyText'. add: - Some assertions when
 '*SelectionWidget.tryGetSelected*' is used.

SVN: 9222
---
 .../web/client/application/EntityChooser.java |  23 ++--
 .../web/client/application/SearchWidget.java  |   2 +-
 .../web/client/application/TopMenu.java       |   2 +-
 .../model/ExperimentTypeModel.java            |  13 ++
 .../application/model/SampleTypeModel.java    |  13 ++
 .../application/ui/GroupSelectionWidget.java  |  91 ++++++--------
 .../ui/SampleBatchRegistrationPanel.java      |   4 +-
 .../ui/SampleRegistrationPanel.java           |   4 +-
 .../ExperimentBrowserToolbar.java             | 103 +++++++++------
 .../ExperimentTypeSelectionWidget.java        | 118 +++++++-----------
 .../ProjectSelectionWidget.java               |  80 ++++++------
 .../sample_browser/SampleBrowserToolbar.java  |  39 +++---
 .../SampleTypeSelectionWidget.java            | 115 +++++++----------
 .../ui/sample_browser/ToolbarController.java  |   9 +-
 .../client/web/client/dto/SampleProperty.java |   6 +-
 .../sample/GenericSampleRegistrationForm.java |   6 +-
 .../application/ClientPluginFactory.java      |  10 +-
 .../server/dataaccess/db/ProjectDAOTest.java  |   2 +-
 18 files changed, 320 insertions(+), 320 deletions(-)

diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/EntityChooser.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/EntityChooser.java
index 9834c848e74..57763ea5d8d 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/EntityChooser.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/EntityChooser.java
@@ -20,7 +20,6 @@ import java.util.List;
 
 import com.extjs.gxt.ui.client.store.ListStore;
 import com.extjs.gxt.ui.client.widget.form.ComboBox;
-import com.extjs.gxt.ui.client.widget.form.SimpleComboBox;
 import com.google.gwt.user.client.Element;
 
 import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync;
@@ -29,7 +28,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.Sear
 import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SearchableEntity;
 
 /**
- * A {@link SimpleComboBox} extension for searching entities.
+ * A {@link ComboBox} extension for searching entities.
  * 
  * @author Christian Ribeaud
  */
@@ -46,16 +45,16 @@ final class EntityChooser extends ComboBox<SearchableEntityModel>
         setStore(new ListStore<SearchableEntityModel>());
     }
 
-    public final SearchableEntity tryGetSelectedSearchableEntity()
+    /**
+     * Returns the {@link SearchableEntity} currently selected.
+     * 
+     * @return never <code>null</code> but be sure not to call this method if nothing is selected.
+     */
+    public final SearchableEntity getSelectedSearchableEntity()
     {
         final List<SearchableEntityModel> selection = getSelection();
-        if (selection.size() > 0)
-        {
-            return selection.get(0).get(ModelDataPropertyNames.OBJECT);
-        } else
-        {
-            return null;
-        }
+        assert selection.size() == 1 : "Selection is empty.";
+        return selection.get(0).get(ModelDataPropertyNames.OBJECT);
     }
 
     //
@@ -66,8 +65,8 @@ final class EntityChooser extends ComboBox<SearchableEntityModel>
     protected final void onRender(final Element parent, final int index)
     {
         super.onRender(parent, index);
-        commonContext.getService().listSearchableEntities(
-                new ListSearchableEntities(commonContext));
+        commonContext.getService()
+                .listSearchableEntities(new ListSearchableEntities(commonContext));
     }
 
     //
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SearchWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SearchWidget.java
index 8bf56cce96f..e1771740cb0 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SearchWidget.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SearchWidget.java
@@ -139,7 +139,7 @@ final class SearchWidget extends LayoutContainer
             return;
         }
         final SearchableEntity selectedSearchableEntityOrNull =
-                entityChooser.tryGetSelectedSearchableEntity();
+                entityChooser.getSelectedSearchableEntity();
         final String queryText = textField.getValue();
         if (StringUtils.isBlank(queryText) == false)
         {
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/TopMenu.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/TopMenu.java
index 4d2aca6ca4f..a353bee365c 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/TopMenu.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/TopMenu.java
@@ -108,7 +108,7 @@ public class TopMenu extends LayoutContainer
     // Helper classes
     //
 
-    private final class LogoutButton extends TextToolItem
+    private final static class LogoutButton extends TextToolItem
     {
 
         LogoutButton(final CommonViewContext viewContext)
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/ExperimentTypeModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/ExperimentTypeModel.java
index e747b3714bc..75171230dce 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/ExperimentTypeModel.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/ExperimentTypeModel.java
@@ -16,6 +16,9 @@
 
 package ch.systemsx.cisd.openbis.generic.client.web.client.application.model;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import com.extjs.gxt.ui.client.data.BaseModelData;
 import com.extjs.gxt.ui.client.data.ModelData;
 
@@ -37,4 +40,14 @@ public class ExperimentTypeModel extends BaseModelData
         set(ModelDataPropertyNames.OBJECT, experimentType);
     }
 
+    public final static List<ExperimentTypeModel> convert(final List<ExperimentType> experimentTypes)
+    {
+        final List<ExperimentTypeModel> result = new ArrayList<ExperimentTypeModel>();
+        for (final ExperimentType st : experimentTypes)
+        {
+            result.add(new ExperimentTypeModel(st));
+        }
+        return result;
+    }
+
 }
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/SampleTypeModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/SampleTypeModel.java
index f06a2bbebdf..11751320489 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/SampleTypeModel.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/SampleTypeModel.java
@@ -16,6 +16,9 @@
 
 package ch.systemsx.cisd.openbis.generic.client.web.client.application.model;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import com.extjs.gxt.ui.client.data.BaseModelData;
 import com.extjs.gxt.ui.client.data.ModelData;
 
@@ -37,4 +40,14 @@ public class SampleTypeModel extends BaseModelData
         set(ModelDataPropertyNames.OBJECT, sampleType);
     }
 
+    public final static List<SampleTypeModel> convert(final List<SampleType> sampleTypes)
+    {
+        final List<SampleTypeModel> result = new ArrayList<SampleTypeModel>();
+        for (final SampleType st : sampleTypes)
+        {
+            result.add(new SampleTypeModel(st));
+        }
+        return result;
+    }
+
 }
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GroupSelectionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GroupSelectionWidget.java
index 55ccb0bd5ca..792c5d113b0 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GroupSelectionWidget.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GroupSelectionWidget.java
@@ -18,9 +18,6 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui;
 
 import java.util.List;
 
-import com.extjs.gxt.ui.client.Events;
-import com.extjs.gxt.ui.client.event.FieldEvent;
-import com.extjs.gxt.ui.client.event.Listener;
 import com.extjs.gxt.ui.client.store.ListStore;
 import com.extjs.gxt.ui.client.widget.form.ComboBox;
 import com.google.gwt.user.client.Element;
@@ -39,41 +36,14 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Group;
  * 
  * @author Izabela Adamczyk
  */
-public class GroupSelectionWidget extends ComboBox<GroupModel>
+public final class GroupSelectionWidget extends ComboBox<GroupModel>
 {
-    public final class ListGroupsCallback extends AbstractAsyncCallback<List<Group>>
-    {
-        ListGroupsCallback(final IViewContext<?> viewContext)
-        {
-            super(viewContext);
-        }
-
-        //
-        // AbstractAsyncCallback
-        //
-
-        @Override
-        protected final void process(final List<Group> result)
-        {
-            groupStore.removeAll();
-            groupStore.add(GroupModel.convert(result));
-            if (groupStore.getCount() > 0)
-            {
-                setEnabled(true);
-                setValue(groupStore.getAt(0));
-            }
-            fireEvent(AppEvents.CALLBACK_FINISHED);
-        }
-    }
-
     private static final String PREFIX = "group-select";
 
     public static final String ID = GenericConstants.ID_PREFIX + PREFIX;
 
     private final IViewContext<ICommonClientServiceAsync> viewContext;
 
-    private final ListStore<GroupModel> groupStore;
-
     public GroupSelectionWidget(final IViewContext<ICommonClientServiceAsync> viewContext)
     {
         this.viewContext = viewContext;
@@ -84,32 +54,24 @@ public class GroupSelectionWidget extends ComboBox<GroupModel>
         setEnabled(false);
         setWidth(150);
         setFieldLabel("Group");
-        groupStore = new ListStore<GroupModel>();
-        setStore(groupStore);
-        addListener(Events.OnClick, new Listener<FieldEvent>()
-            {
-
-                //
-                // Listener
-                //
-
-                public final void handleEvent(final FieldEvent be)
-                {
-                    expand();
-                }
-            });
+        setStore(new ListStore<GroupModel>());
     }
 
-    public final Group tryGetSelected()
+    /**
+     * Returns the {@link Group} currently selected.
+     * 
+     * @return <code>null</code> if nothing is selected yet.
+     */
+    public final Group tryGetSelectedGroup()
     {
         final List<GroupModel> selection = getSelection();
-        if (selection.size() > 0)
+        final int size = selection.size();
+        if (size > 0)
         {
+            assert size == 1 : "Only one item must be selected.";
             return selection.get(0).get(ModelDataPropertyNames.OBJECT);
-        } else
-        {
-            return null;
         }
+        return null;
     }
 
     void refresh()
@@ -128,4 +90,33 @@ public class GroupSelectionWidget extends ComboBox<GroupModel>
         refresh();
     }
 
+    //
+    // Helper classes
+    //
+
+    public final class ListGroupsCallback extends AbstractAsyncCallback<List<Group>>
+    {
+        ListGroupsCallback(final IViewContext<ICommonClientServiceAsync> viewContext)
+        {
+            super(viewContext);
+        }
+
+        //
+        // AbstractAsyncCallback
+        //
+
+        @Override
+        protected final void process(final List<Group> result)
+        {
+            final ListStore<GroupModel> groupStore = getStore();
+            groupStore.removeAll();
+            groupStore.add(GroupModel.convert(result));
+            if (groupStore.getCount() > 0)
+            {
+                setEnabled(true);
+                setValue(groupStore.getAt(0));
+            }
+            fireEvent(AppEvents.CALLBACK_FINISHED);
+        }
+    }
 }
\ No newline at end of file
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SampleBatchRegistrationPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SampleBatchRegistrationPanel.java
index a14a11ddb8b..e30efbc05c0 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SampleBatchRegistrationPanel.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SampleBatchRegistrationPanel.java
@@ -45,7 +45,7 @@ public final class SampleBatchRegistrationPanel extends LayoutContainer
     {
         setId(GenericConstants.ID_PREFIX + ID);
         setScrollMode(Scroll.AUTO);
-        sampleTypeSelection = new SampleTypeSelectionWidget(viewContext, true, ID);
+        sampleTypeSelection = new SampleTypeSelectionWidget(viewContext, ID);
         final ToolBar toolBar = createToolBar();
         add(toolBar);
         sampleTypeSelection.addSelectionChangedListener(new SelectionChangedListener<ModelData>()
@@ -58,7 +58,7 @@ public final class SampleBatchRegistrationPanel extends LayoutContainer
                 @Override
                 public final void selectionChanged(final SelectionChangedEvent<ModelData> se)
                 {
-                    final SampleType sampleType = sampleTypeSelection.tryGetSelected();
+                    final SampleType sampleType = sampleTypeSelection.tryGetSelectedSampleType();
                     if (sampleType != null)
                     {
                         removeAll();
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SampleRegistrationPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SampleRegistrationPanel.java
index 0c1770e4323..f002f123b62 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SampleRegistrationPanel.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SampleRegistrationPanel.java
@@ -45,7 +45,7 @@ public final class SampleRegistrationPanel extends LayoutContainer
     {
         setId(GenericConstants.ID_PREFIX + ID);
         setScrollMode(Scroll.AUTO);
-        sampleTypeSelection = new SampleTypeSelectionWidget(viewContext, true, ID);
+        sampleTypeSelection = new SampleTypeSelectionWidget(viewContext, ID);
         final ToolBar toolBar = new ToolBar();
         toolBar.add(new LabelToolItem("Sample type:"));
         toolBar.add(new AdapterToolItem(sampleTypeSelection));
@@ -60,7 +60,7 @@ public final class SampleRegistrationPanel extends LayoutContainer
                 @Override
                 public void selectionChanged(final SelectionChangedEvent<ModelData> se)
                 {
-                    final SampleType selectedType = sampleTypeSelection.tryGetSelected();
+                    final SampleType selectedType = sampleTypeSelection.tryGetSelectedSampleType();
                     if (selectedType != null)
                     {
                         removeAll();
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment_browser/ExperimentBrowserToolbar.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment_browser/ExperimentBrowserToolbar.java
index f07549fed63..c022f19559e 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment_browser/ExperimentBrowserToolbar.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment_browser/ExperimentBrowserToolbar.java
@@ -16,7 +16,7 @@
 
 package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment_browser;
 
-import com.extjs.gxt.ui.client.data.ModelData;
+import com.extjs.gxt.ui.client.event.ButtonEvent;
 import com.extjs.gxt.ui.client.event.ComponentEvent;
 import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
 import com.extjs.gxt.ui.client.event.SelectionChangedListener;
@@ -33,6 +33,9 @@ import com.google.gwt.user.client.Element;
 import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync;
 import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants;
 import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.ExperimentTypeModel;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.ModelDataPropertyNames;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.ProjectModel;
 import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentType;
 import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Project;
 
@@ -60,10 +63,13 @@ class ExperimentBrowserToolbar extends ToolBar
 
     private final Button exportButton;
 
+    private final IViewContext<ICommonClientServiceAsync> viewContext;
+
     public ExperimentBrowserToolbar(final IViewContext<ICommonClientServiceAsync> viewContext,
             final ExperimentBrowserGrid experimentBrowserGrid)
     {
         this.experimentBrowserGrid = experimentBrowserGrid;
+        this.viewContext = viewContext;
         selectExperimentTypeCombo = new ExperimentTypeSelectionWidget(viewContext, ID);
         selectProjectCombo = new ProjectSelectionWidget(viewContext);
         submitButton = createSubmitButton();
@@ -74,14 +80,15 @@ class ExperimentBrowserToolbar extends ToolBar
         addSelectGroupListeners();
     }
 
-    private void refreshButtons()
+    private final void refreshButtons(final Project projectOrNull,
+            final ExperimentType experimentTypeOrNull)
     {
-        final boolean experiementTypeSelected = selectExperimentTypeCombo.tryGetSelected() != null;
-        final boolean projectChosen = selectProjectCombo.tryGetSelected() != null;
-        final boolean enable = experiementTypeSelected && projectChosen;
-        submitButton.setEnabled(enable);
-        exportButton.setEnabled(enable);
-        if (enable)
+        final boolean experimentTypeSelected = experimentTypeOrNull != null;
+        final boolean projectChosen = projectOrNull != null;
+        final boolean enabled = experimentTypeSelected && projectChosen;
+        submitButton.setEnabled(enabled);
+        exportButton.setEnabled(enabled);
+        if (enabled)
         {
             submitButton.setTitle("Load or update experiment table");
             exportButton.setTitle("Export experiment table to excel file");
@@ -91,17 +98,23 @@ class ExperimentBrowserToolbar extends ToolBar
             submitButton.setTitle(msg);
             exportButton.setTitle(msg);
         }
-
     }
 
     private void addSelectGroupListeners()
     {
-        selectProjectCombo.addSelectionChangedListener(new SelectionChangedListener<ModelData>()
+        selectProjectCombo.addSelectionChangedListener(new SelectionChangedListener<ProjectModel>()
             {
+                //
+                // SelectionChangedListener
+                //
+
                 @Override
-                public final void selectionChanged(final SelectionChangedEvent<ModelData> se)
+                public final void selectionChanged(final SelectionChangedEvent<ProjectModel> se)
                 {
-                    refreshButtons();
+                    final ProjectModel selectedItem = se.getSelectedItem();
+                    refreshButtons(selectedItem != null ? (Project) selectedItem
+                            .get(ModelDataPropertyNames.OBJECT) : null, selectExperimentTypeCombo
+                            .tryGetSelectedExperimentType());
                 }
             });
 
@@ -110,12 +123,21 @@ class ExperimentBrowserToolbar extends ToolBar
     private void addSelectSampleTypeListeners()
     {
         selectExperimentTypeCombo
-                .addSelectionChangedListener(new SelectionChangedListener<ModelData>()
+                .addSelectionChangedListener(new SelectionChangedListener<ExperimentTypeModel>()
                     {
+
+                        //
+                        // SelectionChangedListener
+                        //
+
                         @Override
-                        public final void selectionChanged(final SelectionChangedEvent<ModelData> se)
+                        public final void selectionChanged(
+                                final SelectionChangedEvent<ExperimentTypeModel> se)
                         {
-                            refreshButtons();
+                            final ExperimentTypeModel selectedItem = se.getSelectedItem();
+                            refreshButtons(selectProjectCombo.tryGetSelectedProject(),
+                                    selectedItem != null ? (ExperimentType) selectedItem
+                                            .get(ModelDataPropertyNames.OBJECT) : null);
                         }
                     });
     }
@@ -126,51 +148,56 @@ class ExperimentBrowserToolbar extends ToolBar
         removeAll();
         add(new LabelToolItem("Experiment type:"));
         add(new AdapterToolItem(selectExperimentTypeCombo));
-
         add(new SeparatorToolItem());
-
         add(new LabelToolItem("Project:"));
         add(new AdapterToolItem(selectProjectCombo));
-
-        add(new SeparatorToolItem());
-
         add(new FillToolItem());
-
         add(new AdapterToolItem(submitButton));
-
         add(new SeparatorToolItem());
-
         add(new AdapterToolItem(exportButton));
         layout();
     }
 
     private Button createSubmitButton()
     {
-        final Button refreshButton = new Button("Refresh", new SelectionListener<ComponentEvent>()
-            {
-                @Override
-                public final void componentSelected(final ComponentEvent ce)
-                {
-                    final ExperimentType selectedType = selectExperimentTypeCombo.tryGetSelected();
-                    final Project selectedProject =
-                            selectProjectCombo.tryGetSelected() == null ? null : selectProjectCombo
-                                    .tryGetSelected();
-
-                    experimentBrowserGrid.refresh(selectedType, selectedProject);
-                }
-            });
+        final Button refreshButton =
+                new Button(viewContext.getMessageProvider().getMessage("button_refresh"),
+                        new SelectionListener<ButtonEvent>()
+                            {
+                                //
+                                // SelectionListener
+                                //
+
+                                @Override
+                                public final void componentSelected(final ButtonEvent ce)
+                                {
+                                    final ExperimentType selectedType =
+                                            selectExperimentTypeCombo
+                                                    .tryGetSelectedExperimentType();
+                                    assert selectedType != null : "No experiment type selected.";
+                                    final Project selectedProject =
+                                            selectProjectCombo.tryGetSelectedProject();
+                                    assert selectedProject != null : "No project selected.";
+                                    experimentBrowserGrid.refresh(selectedType, selectedProject);
+                                }
+                            });
         refreshButton.setId(REFRESH_BUTTON_ID);
         return refreshButton;
     }
 
-    private Button createExportButton()
+    private final Button createExportButton()
     {
         final Button button = new Button("Export data", new SelectionListener<ComponentEvent>()
             {
+                //
+                // SelectionListener
+                //
+
                 @Override
                 public final void componentSelected(final ComponentEvent ce)
                 {
-                    MessageBox.alert("Warning", "Not yet implemented!", null);
+                    MessageBox.alert(viewContext.getMessageProvider().getMessage(
+                            "messagebox_warning"), "Not yet implemented!", null);
                 }
             });
         return button;
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment_browser/ExperimentTypeSelectionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment_browser/ExperimentTypeSelectionWidget.java
index 18506bf8f59..0cdca8c4c66 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment_browser/ExperimentTypeSelectionWidget.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment_browser/ExperimentTypeSelectionWidget.java
@@ -16,12 +16,8 @@
 
 package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment_browser;
 
-import java.util.ArrayList;
 import java.util.List;
 
-import com.extjs.gxt.ui.client.Events;
-import com.extjs.gxt.ui.client.event.BaseEvent;
-import com.extjs.gxt.ui.client.event.Listener;
 import com.extjs.gxt.ui.client.store.ListStore;
 import com.extjs.gxt.ui.client.widget.form.ComboBox;
 import com.google.gwt.user.client.Element;
@@ -39,97 +35,42 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentType;
  * 
  * @author Izabela Adamczyk
  */
-public class ExperimentTypeSelectionWidget extends ComboBox<ExperimentTypeModel>
+public final class ExperimentTypeSelectionWidget extends ComboBox<ExperimentTypeModel>
 {
-
-    public final class ListExperimentTypesCallback extends
-            AbstractAsyncCallback<List<ExperimentType>>
-    {
-        private final boolean allowEmptyCall;
-
-        ListExperimentTypesCallback(final IViewContext<?> viewContext, final boolean allowEmpty)
-        {
-            super(viewContext);
-            allowEmptyCall = allowEmpty;
-        }
-
-        @Override
-        protected void process(final List<ExperimentType> result)
-        {
-            experimentTypeStore.removeAll();
-            experimentTypeStore.add(convert(result));
-            if (experimentTypeStore.getCount() > 0)
-            {
-                setEnabled(true);
-                if (allowEmptyCall == false)
-                {
-                    setValue(experimentTypeStore.getAt(0));
-                }
-            }
-        }
-
-        List<ExperimentTypeModel> convert(final List<ExperimentType> experimentTypes)
-        {
-            final List<ExperimentTypeModel> result = new ArrayList<ExperimentTypeModel>();
-            for (final ExperimentType st : experimentTypes)
-            {
-                result.add(new ExperimentTypeModel(st));
-            }
-            return result;
-        }
-    }
-
     private static final String PREFIX = "experiment-type-select-";
 
     public static final String ID = GenericConstants.ID_PREFIX + PREFIX;
 
     private final IViewContext<ICommonClientServiceAsync> viewContext;
 
-    private final ListStore<ExperimentTypeModel> experimentTypeStore;
-
-    private final boolean allowEmpty;
-
     public ExperimentTypeSelectionWidget(final IViewContext<ICommonClientServiceAsync> viewContext,
             final String idSuffix)
-    {
-        this(viewContext, false, idSuffix);
-    }
-
-    public ExperimentTypeSelectionWidget(final IViewContext<ICommonClientServiceAsync> viewContext,
-            final boolean allowEmpty, final String idSuffix)
     {
         this.viewContext = viewContext;
-        this.allowEmpty = allowEmpty;
         setId(ID + idSuffix);
-        setEmptyText(allowEmpty ? "Choose experiment type..." : "- No experiment types found -");
         setEnabled(false);
         setDisplayField(ModelDataPropertyNames.CODE);
         setEditable(false);
-        setWidth(150);
+        setWidth(180);
         setFieldLabel("Experiment type");
-        experimentTypeStore = new ListStore<ExperimentTypeModel>();
-        setStore(experimentTypeStore);
-        addListener(Events.OnClick, new Listener<BaseEvent>()
-            {
-
-                public void handleEvent(final BaseEvent be)
-                {
-                    expand();
-                }
-            });
+        setStore(new ListStore<ExperimentTypeModel>());
     }
 
-    public ExperimentType tryGetSelected()
+    /**
+     * Returns the {@link ExperimentType} currently selected.
+     * 
+     * @return <code>null</code> if nothing is selected yet.
+     */
+    public final ExperimentType tryGetSelectedExperimentType()
     {
-
         final List<ExperimentTypeModel> selection = getSelection();
-        if (selection.size() > 0)
+        final int size = selection.size();
+        if (size > 0)
         {
+            assert size == 1 : "Selection is empty.";
             return selection.get(0).get(ModelDataPropertyNames.OBJECT);
-        } else
-        {
-            return null;
         }
+        return null;
     }
 
     @Override
@@ -141,7 +82,36 @@ public class ExperimentTypeSelectionWidget extends ComboBox<ExperimentTypeModel>
 
     void refresh()
     {
-        viewContext.getService().listExperimentTypes(
-                new ListExperimentTypesCallback(viewContext, allowEmpty));
+        viewContext.getService().listExperimentTypes(new ListExperimentTypesCallback(viewContext));
+    }
+
+    //
+    // Helper classes
+    //
+
+    public final class ListExperimentTypesCallback extends
+            AbstractAsyncCallback<List<ExperimentType>>
+    {
+        ListExperimentTypesCallback(final IViewContext<ICommonClientServiceAsync> viewContext)
+        {
+            super(viewContext);
+        }
+
+        @Override
+        protected void process(final List<ExperimentType> result)
+        {
+            final ListStore<ExperimentTypeModel> experimentTypeStore = getStore();
+            experimentTypeStore.removeAll();
+            experimentTypeStore.add(ExperimentTypeModel.convert(result));
+            if (experimentTypeStore.getCount() > 0)
+            {
+                setEnabled(true);
+                setEmptyText("Choose experiment type...");
+            } else
+            {
+                setEmptyText("- No sample types found -");
+            }
+            applyEmptyText();
+        }
     }
 }
\ No newline at end of file
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment_browser/ProjectSelectionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment_browser/ProjectSelectionWidget.java
index 34da372f4e7..3bcb9ce9f60 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment_browser/ProjectSelectionWidget.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment_browser/ProjectSelectionWidget.java
@@ -18,9 +18,6 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experi
 
 import java.util.List;
 
-import com.extjs.gxt.ui.client.Events;
-import com.extjs.gxt.ui.client.event.BaseEvent;
-import com.extjs.gxt.ui.client.event.Listener;
 import com.extjs.gxt.ui.client.store.ListStore;
 import com.extjs.gxt.ui.client.widget.form.ComboBox;
 import com.google.gwt.user.client.Element;
@@ -39,37 +36,14 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Project;
  * 
  * @author Izabela Adamczyk
  */
-public class ProjectSelectionWidget extends ComboBox<ProjectModel>
+public final class ProjectSelectionWidget extends ComboBox<ProjectModel>
 {
-    public final class ListProjectsCallback extends AbstractAsyncCallback<List<Project>>
-    {
-        ListProjectsCallback(final IViewContext<?> viewContext)
-        {
-            super(viewContext);
-        }
-
-        @Override
-        protected void process(final List<Project> result)
-        {
-            projectStore.removeAll();
-            projectStore.add(ProjectModel.convert(result));
-            if (projectStore.getCount() > 0)
-            {
-                setEnabled(true);
-                setValue(projectStore.getAt(0));
-            }
-            fireEvent(AppEvents.CALLBACK_FINISHED);
-        }
-    }
-
     private static final String PREFIX = "project-select";
 
     public static final String ID = GenericConstants.ID_PREFIX + PREFIX;
 
     private final IViewContext<ICommonClientServiceAsync> viewContext;
 
-    private final ListStore<ProjectModel> projectStore;
-
     public ProjectSelectionWidget(final IViewContext<ICommonClientServiceAsync> viewContext)
     {
         this.viewContext = viewContext;
@@ -78,29 +52,26 @@ public class ProjectSelectionWidget extends ComboBox<ProjectModel>
         setDisplayField(ModelDataPropertyNames.PROJECT_WITH_GROUP);
         setEditable(false);
         setEnabled(false);
-        setWidth(250);
+        setWidth(200);
         setFieldLabel("Project");
-        projectStore = new ListStore<ProjectModel>();
-        setStore(projectStore);
-        addListener(Events.OnClick, new Listener<BaseEvent>()
-            {
-                public void handleEvent(final BaseEvent be)
-                {
-                    expand();
-                }
-            });
+        setStore(new ListStore<ProjectModel>());
     }
 
-    public Project tryGetSelected()
+    /**
+     * Returns the {@link Project} currently selected.
+     * 
+     * @return <code>null</code> if nothing is selected yet.
+     */
+    public final Project tryGetSelectedProject()
     {
         final List<ProjectModel> selection = getSelection();
-        if (selection.size() > 0)
+        final int size = selection.size();
+        if (size > 0)
         {
+            assert size == 1 : "Selection is empty.";
             return selection.get(0).get(ModelDataPropertyNames.OBJECT);
-        } else
-        {
-            return null;
         }
+        return null;
     }
 
     @Override
@@ -115,4 +86,29 @@ public class ProjectSelectionWidget extends ComboBox<ProjectModel>
         viewContext.getService().listProjects(new ListProjectsCallback(viewContext));
     }
 
+    //
+    // Helper classes
+    //
+
+    public final class ListProjectsCallback extends AbstractAsyncCallback<List<Project>>
+    {
+        ListProjectsCallback(final IViewContext<ICommonClientServiceAsync> viewContext)
+        {
+            super(viewContext);
+        }
+
+        @Override
+        protected void process(final List<Project> result)
+        {
+            final ListStore<ProjectModel> projectStore = getStore();
+            projectStore.removeAll();
+            projectStore.add(ProjectModel.convert(result));
+            if (projectStore.getCount() > 0)
+            {
+                setEnabled(true);
+                setValue(projectStore.getAt(0));
+            }
+            fireEvent(AppEvents.CALLBACK_FINISHED);
+        }
+    }
 }
\ No newline at end of file
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleBrowserToolbar.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleBrowserToolbar.java
index 5248f2e942d..fa4065b8cd0 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleBrowserToolbar.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleBrowserToolbar.java
@@ -16,7 +16,6 @@
 
 package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample_browser;
 
-import com.extjs.gxt.ui.client.data.ModelData;
 import com.extjs.gxt.ui.client.event.ButtonEvent;
 import com.extjs.gxt.ui.client.event.FieldEvent;
 import com.extjs.gxt.ui.client.event.Listener;
@@ -38,10 +37,13 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAs
 import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants;
 import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext;
 import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AppEvents;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.GroupModel;
+import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.ModelDataPropertyNames;
 import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.SampleTypeModel;
 import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.GroupSelectionWidget;
 import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.ParentColumns;
 import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.PropertyColumns;
+import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Group;
 import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleType;
 
 /**
@@ -123,7 +125,8 @@ final class SampleBrowserToolbar extends ToolBar
 
                 public final void handleEvent(final FieldEvent be)
                 {
-                    controller.refreshButtons();
+                    controller.refreshButtons(selectSampleTypeCombo.tryGetSelectedSampleType(),
+                            selectGroupCombo.tryGetSelectedGroup());
                     controller.showOrHideGroupList();
                 }
             });
@@ -139,14 +142,15 @@ final class SampleBrowserToolbar extends ToolBar
 
                 public final void handleEvent(final FieldEvent be)
                 {
-                    controller.refreshButtons();
+                    controller.refreshButtons(selectSampleTypeCombo.tryGetSelectedSampleType(),
+                            selectGroupCombo.tryGetSelectedGroup());
                 }
             });
     }
 
     private void addSelectGroupListeners()
     {
-        selectGroupCombo.addSelectionChangedListener(new SelectionChangedListener<ModelData>()
+        selectGroupCombo.addSelectionChangedListener(new SelectionChangedListener<GroupModel>()
             {
 
                 //
@@ -154,9 +158,12 @@ final class SampleBrowserToolbar extends ToolBar
                 //
 
                 @Override
-                public final void selectionChanged(final SelectionChangedEvent<ModelData> se)
+                public final void selectionChanged(final SelectionChangedEvent<GroupModel> se)
                 {
-                    controller.refreshButtons();
+                    final GroupModel selectedItem = se.getSelectedItem();
+                    controller.refreshButtons(selectSampleTypeCombo.tryGetSelectedSampleType(),
+                            selectedItem != null ? (Group) selectedItem
+                                    .get(ModelDataPropertyNames.OBJECT) : null);
                 }
             });
 
@@ -187,7 +194,11 @@ final class SampleBrowserToolbar extends ToolBar
                         public final void selectionChanged(
                                 final SelectionChangedEvent<SampleTypeModel> se)
                         {
-                            controller.refreshButtons();
+                            final SampleTypeModel selectedItem = se.getSelectedItem();
+                            controller.refreshButtons(
+                                    selectedItem != null ? (SampleType) selectedItem
+                                            .get(ModelDataPropertyNames.OBJECT) : null,
+                                    selectGroupCombo.tryGetSelectedGroup());
                         }
                     });
     }
@@ -226,11 +237,11 @@ final class SampleBrowserToolbar extends ToolBar
                                 public final void componentSelected(final ButtonEvent ce)
                                 {
                                     final SampleType selectedType =
-                                            selectSampleTypeCombo.tryGetSelected();
-                                    final String selectedGroupCode =
-                                            selectGroupCombo.tryGetSelected() == null ? null
-                                                    : selectGroupCombo.tryGetSelected().getCode();
-
+                                            selectSampleTypeCombo.tryGetSelectedSampleType();
+                                    assert selectedType != null : "No sample type is selected.";
+                                    final Group selectedGroup =
+                                            selectGroupCombo.tryGetSelectedGroup();
+                                    assert selectedGroup != null : "No group is selected.";
                                     final Boolean includeGroup = includeGroupCheckbox.getValue();
                                     final Boolean includeInstance =
                                             includeInstanceCheckbox.getValue();
@@ -240,8 +251,8 @@ final class SampleBrowserToolbar extends ToolBar
                                         controller.redefineColumns();
                                         selectedSampleType = selectedType;
                                     }
-                                    sampleBrowserGrid.refresh(selectedType, selectedGroupCode,
-                                            includeGroup, includeInstance);
+                                    sampleBrowserGrid.refresh(selectedType,
+                                            selectedGroup.getCode(), includeGroup, includeInstance);
                                 }
                             });
         refreshButton.setId(REFRESH_BUTTON_ID);
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleTypeSelectionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleTypeSelectionWidget.java
index 420858394a7..9f51a00b719 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleTypeSelectionWidget.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleTypeSelectionWidget.java
@@ -16,12 +16,8 @@
 
 package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample_browser;
 
-import java.util.ArrayList;
 import java.util.List;
 
-import com.extjs.gxt.ui.client.Events;
-import com.extjs.gxt.ui.client.event.BaseEvent;
-import com.extjs.gxt.ui.client.event.Listener;
 import com.extjs.gxt.ui.client.store.ListStore;
 import com.extjs.gxt.ui.client.widget.form.ComboBox;
 import com.google.gwt.user.client.Element;
@@ -39,96 +35,42 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleType;
  * 
  * @author Izabela Adamczyk
  */
-public class SampleTypeSelectionWidget extends ComboBox<SampleTypeModel>
+public final class SampleTypeSelectionWidget extends ComboBox<SampleTypeModel>
 {
-
-    public final class ListSampleTypesCallback extends AbstractAsyncCallback<List<SampleType>>
-    {
-        private final boolean allowEmptyCall;
-
-        ListSampleTypesCallback(final IViewContext<?> viewContext, final boolean allowEmpty)
-        {
-            super(viewContext);
-            allowEmptyCall = allowEmpty;
-        }
-
-        @Override
-        protected void process(final List<SampleType> result)
-        {
-            sampleTypeStore.removeAll();
-            sampleTypeStore.add(convert(result));
-            if (sampleTypeStore.getCount() > 0)
-            {
-                setEnabled(true);
-                if (allowEmptyCall == false)
-                {
-                    setValue(sampleTypeStore.getAt(0));
-                }
-            }
-        }
-
-        List<SampleTypeModel> convert(final List<SampleType> sampleTypes)
-        {
-            final List<SampleTypeModel> result = new ArrayList<SampleTypeModel>();
-            for (final SampleType st : sampleTypes)
-            {
-                result.add(new SampleTypeModel(st));
-            }
-            return result;
-        }
-    }
-
     private static final String PREFIX = "sample-type-select-";
 
     public static final String ID = GenericConstants.ID_PREFIX + PREFIX;
 
     private final IViewContext<ICommonClientServiceAsync> viewContext;
 
-    private final ListStore<SampleTypeModel> sampleTypeStore;
-
-    private final boolean allowEmpty;
-
     public SampleTypeSelectionWidget(final IViewContext<ICommonClientServiceAsync> viewContext,
             String idSuffix)
-    {
-        this(viewContext, false, idSuffix);
-    }
-
-    public SampleTypeSelectionWidget(final IViewContext<ICommonClientServiceAsync> viewContext,
-            final boolean allowEmpty, String idSuffix)
     {
         this.viewContext = viewContext;
-        this.allowEmpty = allowEmpty;
         setId(ID + idSuffix);
-        setEmptyText(allowEmpty ? "Choose sample type..." : "- No sample types found -");
         setEnabled(false);
         setDisplayField(ModelDataPropertyNames.CODE);
         setEditable(false);
         setWidth(150);
         setFieldLabel("Sample type");
-        sampleTypeStore = new ListStore<SampleTypeModel>();
-        setStore(sampleTypeStore);
-        addListener(Events.OnClick, new Listener<BaseEvent>()
-            {
-
-                public void handleEvent(final BaseEvent be)
-                {
-                    expand();
-                }
-            });
+        setStore(new ListStore<SampleTypeModel>());
     }
 
-    public SampleType tryGetSelected()
+    /**
+     * Returns the {@link SampleType} currently selected.
+     * 
+     * @return <code>null</code> if nothing is selected yet.
+     */
+    public final SampleType tryGetSelectedSampleType()
     {
-
         final List<SampleTypeModel> selection = getSelection();
-        if (selection.size() > 0)
+        final int size = selection.size();
+        if (size > 0)
         {
+            assert size == 1 : "Only one item must be selected.";
             return selection.get(0).get(ModelDataPropertyNames.OBJECT);
-        } else
-        {
-            return null;
         }
+        return null;
     }
 
     @Override
@@ -140,7 +82,36 @@ public class SampleTypeSelectionWidget extends ComboBox<SampleTypeModel>
 
     void refresh()
     {
-        viewContext.getService().listSampleTypes(
-                new ListSampleTypesCallback(viewContext, allowEmpty));
+        viewContext.getService().listSampleTypes(new ListSampleTypesCallback(viewContext));
+    }
+
+    //
+    // Helper classes
+    //
+
+    public final class ListSampleTypesCallback extends AbstractAsyncCallback<List<SampleType>>
+    {
+
+        ListSampleTypesCallback(final IViewContext<ICommonClientServiceAsync> viewContext)
+        {
+            super(viewContext);
+        }
+
+        @Override
+        protected void process(final List<SampleType> result)
+        {
+            final ListStore<SampleTypeModel> sampleTypeStore = getStore();
+            sampleTypeStore.removeAll();
+            sampleTypeStore.add(SampleTypeModel.convert(result));
+            if (sampleTypeStore.getCount() > 0)
+            {
+                setEmptyText("Choose sample type...");
+                setEnabled(true);
+            } else
+            {
+                setEmptyText("- No sample types found -");
+            }
+            applyEmptyText();
+        }
     }
 }
\ No newline at end of file
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/ToolbarController.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/ToolbarController.java
index fb6a0120a05..2df9708c4af 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/ToolbarController.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/ToolbarController.java
@@ -22,6 +22,7 @@ import com.extjs.gxt.ui.client.widget.form.CheckBox;
 import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.GroupSelectionWidget;
 import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.ParentColumns;
 import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.PropertyColumns;
+import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Group;
 import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleType;
 
 /**
@@ -65,11 +66,11 @@ final class ToolbarController
     /**
      * Refreshes the <i>refresh</i> resp. <i>export</i> button.
      */
-    final void refreshButtons()
+    final void refreshButtons(final SampleType sampleTypeOrNull, final Group groupOrNull)
     {
-        final boolean sampleTypeSelected = sampleTypeSelectionWidget.tryGetSelected() != null;
+        final boolean sampleTypeSelected = sampleTypeOrNull != null;
         final boolean showGroupSamples = groupCheckbox.getValue();
-        final boolean groupChosen = groupSelectionWidget.tryGetSelected() != null;
+        final boolean groupChosen = groupOrNull != null;
         final boolean showInstanceSamples = instanceCheckbox.getValue();
         final boolean enable =
                 sampleTypeSelected && (showGroupSamples && groupChosen || showInstanceSamples);
@@ -95,7 +96,7 @@ final class ToolbarController
 
     final void redefineColumns()
     {
-        final SampleType type = sampleTypeSelectionWidget.tryGetSelected();
+        final SampleType type = sampleTypeSelectionWidget.tryGetSelectedSampleType();
         assert type != null : "Should not be null.";
         propertyColumns.define(type);
         parentColumns.define(type);
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SampleProperty.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SampleProperty.java
index 17e1119fe14..7bf442c3bd8 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SampleProperty.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SampleProperty.java
@@ -16,7 +16,7 @@
 
 package ch.systemsx.cisd.openbis.generic.client.web.client.dto;
 
-import com.google.gwt.user.client.rpc.IsSerializable;
+import java.io.Serializable;
 
 /**
  * The {@link EntityProperty} extension for <i>Sample</i>.
@@ -24,7 +24,9 @@ import com.google.gwt.user.client.rpc.IsSerializable;
  * @author Izabela Adamczyk
  */
 public final class SampleProperty extends EntityProperty<SampleType, SampleTypePropertyType>
-        implements IsSerializable
+        implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+
     public static final SampleProperty[] EMPTY_ARRAY = new SampleProperty[0];
 }
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationForm.java
index 85285b0315c..9f33955e946 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationForm.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationForm.java
@@ -167,7 +167,7 @@ public final class GenericSampleRegistrationForm extends FormPanel
                 public final String validate(final MultiField<Field<?>> field, final String value)
                 {
                     if (sharedCheckbox.getValue() == false
-                            && groupSelectionWidget.tryGetSelected() == null)
+                            && groupSelectionWidget.tryGetSelectedGroup() == null)
                     {
                         return "Group must be chosen or shared selected";
                     }
@@ -240,7 +240,7 @@ public final class GenericSampleRegistrationForm extends FormPanel
     private final String createSampleIdentifier()
     {
         final boolean shared = sharedCheckbox.getValue();
-        final Group group = groupSelectionWidget.tryGetSelected();
+        final Group group = groupSelectionWidget.tryGetSelectedGroup();
         final String code = codeField.getValue();
         final StringBuilder builder = new StringBuilder("/");
         if (shared == false)
@@ -393,7 +393,7 @@ public final class GenericSampleRegistrationForm extends FormPanel
 
             final String message =
                     createSuccessfullRegistrationInfo(sharedCheckbox.getValue(), codeField
-                            .getValue(), groupSelectionWidget.tryGetSelected());
+                            .getValue(), groupSelectionWidget.tryGetSelectedGroup());
             resetForm(message);
         }
     }
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java
index 7407b07af31..70af6fb667c 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java
@@ -98,7 +98,8 @@ public final class ClientPluginFactory extends
         {
             final ScreeningSampleViewer sampleViewer =
                     new ScreeningSampleViewer(getViewContext(), sampleIdentifier);
-            return new ViewerTabItem(sampleIdentifier, sampleViewer);        }
+            return new ViewerTabItem(sampleIdentifier, sampleViewer);
+        }
 
         public final Widget createRegistrationForSampleType(final SampleType sampleTypeCode)
         {
@@ -111,8 +112,13 @@ public final class ClientPluginFactory extends
         }
     }
 
-    private final class ExperimentViewClientPlugin implements IExperimentViewClientPlugin
+    private final static class ExperimentViewClientPlugin implements IExperimentViewClientPlugin
     {
+
+        //
+        // IExperimentViewClientPlugin
+        //
+
         public final ITabItem createExperimentViewer(final String experimentIdentifier)
         {
             final DummyComponent experimentViewer = new DummyComponent();
diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ProjectDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ProjectDAOTest.java
index 753180380aa..fd8fdefef0d 100644
--- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ProjectDAOTest.java
+++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ProjectDAOTest.java
@@ -43,7 +43,7 @@ public class ProjectDAOTest extends AbstractDAOTest
 
     public static final String DEFAULT = "DEFAULT";
 
-    public static final String[] PRELOADED_PROJECTS =
+    static final String[] PRELOADED_PROJECTS =
         { DEFAULT, NEMO, NOE, TESTPROJ };
 
     @Test
-- 
GitLab