Skip to content
Snippets Groups Projects
Commit 713a95a3 authored by pkupczyk's avatar pkupczyk
Browse files

SP-385 / BIS-247 : Metaprojects Browsing and Maintenance UI:

- fix entities section layout to be resizable
- make messages more consistent

SVN: 27609
parent 95f4a293
No related branches found
No related tags found
No related merge requests found
...@@ -21,9 +21,8 @@ import java.util.Map; ...@@ -21,9 +21,8 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import com.extjs.gxt.ui.client.widget.Component; import com.extjs.gxt.ui.client.widget.Component;
import com.google.gwt.user.client.ui.Composite; import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.google.gwt.user.client.ui.Panel; import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.user.client.ui.SimplePanel;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableTabContent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableTabContent;
...@@ -40,15 +39,13 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MetaprojectAssignmentsC ...@@ -40,15 +39,13 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MetaprojectAssignmentsC
/** /**
* @author pkupczyk * @author pkupczyk
*/ */
public class MetaprojectEntities extends Composite implements IDisposableComponent public class MetaprojectEntities extends LayoutContainer implements IDisposableComponent
{ {
public static final String ID_SUFFIX = "_metaproject-entities"; public static final String ID_SUFFIX = "_metaproject-entities";
private IViewContext<?> viewContext; private IViewContext<?> viewContext;
private Panel panel;
private SectionsPanel sectionsPanel; private SectionsPanel sectionsPanel;
private Map<EntityKind, DisposableTabContent> sectionsMap; private Map<EntityKind, DisposableTabContent> sectionsMap;
...@@ -60,11 +57,8 @@ public class MetaprojectEntities extends Composite implements IDisposableCompone ...@@ -60,11 +57,8 @@ public class MetaprojectEntities extends Composite implements IDisposableCompone
public MetaprojectEntities(IViewContext<?> viewContext, String idPrefix) public MetaprojectEntities(IViewContext<?> viewContext, String idPrefix)
{ {
this.viewContext = viewContext; this.viewContext = viewContext;
setLayout(new FitLayout());
panel = new SimplePanel(); setId(idPrefix + ID_SUFFIX);
panel.getElement().setId(idPrefix + ID_SUFFIX);
initWidget(panel);
} }
private void initSections(final Long metaprojectId, final IDelegatedAction callback) private void initSections(final Long metaprojectId, final IDelegatedAction callback)
...@@ -77,7 +71,10 @@ public class MetaprojectEntities extends Composite implements IDisposableCompone ...@@ -77,7 +71,10 @@ public class MetaprojectEntities extends Composite implements IDisposableCompone
@Override @Override
protected void process(MetaprojectAssignmentsCount count) protected void process(MetaprojectAssignmentsCount count)
{ {
panel.clear(); if (sectionsPanel != null)
{
remove(sectionsPanel);
}
sectionsPanel = sectionsPanel =
new SectionsPanel(viewContext.getCommonViewContext(), new SectionsPanel(viewContext.getCommonViewContext(),
...@@ -108,7 +105,10 @@ public class MetaprojectEntities extends Composite implements IDisposableCompone ...@@ -108,7 +105,10 @@ public class MetaprojectEntities extends Composite implements IDisposableCompone
viewContext, new TechId(metaprojectId))); viewContext, new TechId(metaprojectId)));
} }
panel.add(sectionsPanel); add(sectionsPanel);
layout();
callback.execute();
} }
}); });
} }
......
...@@ -18,8 +18,10 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.metapr ...@@ -18,8 +18,10 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.metapr
import com.google.gwt.user.client.ui.InlineLabel; import com.google.gwt.user.client.ui.InlineLabel;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.metaproject.tree.model.MetaprojectTreeEntityKindItemData; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.metaproject.tree.model.MetaprojectTreeEntityKindItemData;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind;
/** /**
* @author pkupczyk * @author pkupczyk
...@@ -32,8 +34,28 @@ public class MetaprojectTreeEntityKindItemWidget extends MetaprojectTreeItemWidg ...@@ -32,8 +34,28 @@ public class MetaprojectTreeEntityKindItemWidget extends MetaprojectTreeItemWidg
{ {
super(viewContext); super(viewContext);
initWidget(new InlineLabel(model.getEntityKind().getDescription() + "s (" EntityKind entityKind = model.getEntityKind();
+ model.getEntityCount() + ")")); String messageKey;
}
if (EntityKind.EXPERIMENT.equals(entityKind))
{
messageKey = Dict.METAPROJECT_ENTITIES_EXPERIMENTS;
} else if (EntityKind.SAMPLE.equals(entityKind))
{
messageKey = Dict.METAPROJECT_ENTITIES_SAMPLES;
} else if (EntityKind.DATA_SET.equals(entityKind))
{
messageKey = Dict.METAPROJECT_ENTITIES_DATA_SETS;
} else if (EntityKind.MATERIAL.equals(entityKind))
{
messageKey = Dict.METAPROJECT_ENTITIES_MATERIALS;
} else
{
throw new IllegalArgumentException("Unsupported entity kind: " + entityKind);
}
String message = viewContext.getMessage(messageKey) + " (" + model.getEntityCount() + ")";
initWidget(new InlineLabel(message));
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment