Skip to content
Snippets Groups Projects
Commit 5635fd77 authored by felmer's avatar felmer
Browse files

LMS-795 Edit button added but nothing implemented.

SVN: 10837
parent ad176cfb
No related branches found
No related tags found
No related merge requests found
...@@ -16,9 +16,19 @@ ...@@ -16,9 +16,19 @@
package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui; package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui;
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.widget.ContentPanel; import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.toolbar.AdapterToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.FillToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import ch.systemsx.cisd.openbis.generic.client.web.client.IClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.IClientServiceAsync;
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;
/** /**
...@@ -26,10 +36,27 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewConte ...@@ -26,10 +36,27 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewConte
*/ */
public abstract class AbstractViewer<T extends IClientServiceAsync> extends ContentPanel public abstract class AbstractViewer<T extends IClientServiceAsync> extends ContentPanel
{ {
private final ToolBar toolBar;
protected final IViewContext<T> viewContext; protected final IViewContext<T> viewContext;
public AbstractViewer(final IViewContext<T> viewContext) public AbstractViewer(final IViewContext<T> viewContext, String title)
{ {
this.viewContext = viewContext; this.viewContext = viewContext;
setHeaderVisible(false);
toolBar = new ToolBar();
setTopComponent(toolBar);
toolBar.add(new LabelToolItem(title));
toolBar.add(new FillToolItem());
Button button = new Button(viewContext.getMessage(Dict.BUTTON_EDIT));
button.addListener(Events.Select, new Listener<BaseEvent>()
{
public void handleEvent(BaseEvent be)
{
MessageBox.alert("Info", "Not yet implemented", null);
}
});
toolBar.add(new AdapterToolItem(button));
} }
} }
...@@ -60,11 +60,10 @@ public final class GenericExperimentViewer extends AbstractViewer<IGenericClient ...@@ -60,11 +60,10 @@ public final class GenericExperimentViewer extends AbstractViewer<IGenericClient
private GenericExperimentViewer(final IViewContext<IGenericClientServiceAsync> viewContext, private GenericExperimentViewer(final IViewContext<IGenericClientServiceAsync> viewContext,
final String experimentIdentifier) final String experimentIdentifier)
{ {
super(viewContext); super(viewContext, "Experiment " + experimentIdentifier);
setId(createId(experimentIdentifier)); setId(createId(experimentIdentifier));
this.experimentIdentifier = experimentIdentifier; this.experimentIdentifier = experimentIdentifier;
this.modificationObserver = new CompositeDatabaseModificationObserver(); this.modificationObserver = new CompositeDatabaseModificationObserver();
setHeading("Experiment " + experimentIdentifier);
reloadAllData(); reloadAllData();
} }
......
...@@ -60,10 +60,9 @@ public final class GenericMaterialViewer extends AbstractViewer<IGenericClientSe ...@@ -60,10 +60,9 @@ public final class GenericMaterialViewer extends AbstractViewer<IGenericClientSe
private GenericMaterialViewer(final IViewContext<IGenericClientServiceAsync> viewContext, private GenericMaterialViewer(final IViewContext<IGenericClientServiceAsync> viewContext,
final String materialIdentifier) final String materialIdentifier)
{ {
super(viewContext); super(viewContext, "Material " + materialIdentifier);
setId(createId(materialIdentifier)); setId(createId(materialIdentifier));
this.materialIdentifier = materialIdentifier; this.materialIdentifier = materialIdentifier;
setHeading("Material " + materialIdentifier);
reloadData(); reloadData();
} }
......
...@@ -120,10 +120,9 @@ public final class GenericSampleViewer extends AbstractViewer<IGenericClientServ ...@@ -120,10 +120,9 @@ public final class GenericSampleViewer extends AbstractViewer<IGenericClientServ
private GenericSampleViewer(final IViewContext<IGenericClientServiceAsync> viewContext, private GenericSampleViewer(final IViewContext<IGenericClientServiceAsync> viewContext,
final String sampleIdentifier) final String sampleIdentifier)
{ {
super(viewContext); super(viewContext, "Sample " + sampleIdentifier);
setId(createId(sampleIdentifier)); setId(createId(sampleIdentifier));
this.sampleIdentifier = sampleIdentifier; this.sampleIdentifier = sampleIdentifier;
setHeading("Sample " + sampleIdentifier);
reloadAllData(); reloadAllData();
} }
......
...@@ -42,10 +42,9 @@ public final class ScreeningSampleViewer extends AbstractViewer<IScreeningClient ...@@ -42,10 +42,9 @@ public final class ScreeningSampleViewer extends AbstractViewer<IScreeningClient
public ScreeningSampleViewer(final IViewContext<IScreeningClientServiceAsync> viewContext, public ScreeningSampleViewer(final IViewContext<IScreeningClientServiceAsync> viewContext,
final String sampleIdentifier) final String sampleIdentifier)
{ {
super(viewContext); super(viewContext, "Sample " + sampleIdentifier);
setId(createId(sampleIdentifier)); setId(createId(sampleIdentifier));
this.sampleIdentifier = sampleIdentifier; this.sampleIdentifier = sampleIdentifier;
setHeading("Sample " + sampleIdentifier);
reloadData(); reloadData();
} }
......
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