From 690b808879d18e04195927e7542af93d77bac649 Mon Sep 17 00:00:00 2001 From: gpawel <gpawel> Date: Fri, 9 Sep 2011 15:10:04 +0000 Subject: [PATCH] LMS-2416 Rename "Delete" labels for single entities to avoid deletion by mistake SVN: 22862 --- .../client/web/client/application/Dict.java | 10 ++++++++++ .../web/client/application/ProjectViewer.java | 6 ++++++ .../client/application/ui/AbstractViewer.java | 4 +++- .../client/web/public/generic-dictionary.js | 2 +- .../client/application/DemoSampleViewer.java | 10 +++++++++- .../dataset/GenericDataSetViewer.java | 5 +++++ .../experiment/GenericExperimentViewer.java | 6 ++++++ .../material/GenericMaterialViewer.java | 6 +++++- .../sample/GenericSampleViewer.java | 20 +++++++++++-------- .../cisd/openbis/public/common-dictionary.js | 5 +++++ .../client/web/client/application/Dict.java | 4 ++-- .../web/client/application/ProteinViewer.java | 6 ++++++ .../web/public/phosphonetx-dictionary.js | 1 + 13 files changed, 71 insertions(+), 14 deletions(-) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Dict.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Dict.java index bdae38d7574..2c2f892b02c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Dict.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Dict.java @@ -1041,6 +1041,16 @@ public abstract class Dict public static final String BUTTON_DELETE = "button_delete"; + public static final String BUTTON_DELETE_SAMPLE = "button_delete_sample"; + + public static final String BUTTON_DELETE_EXPERIMENT = "button_delete_experiment"; + + public static final String BUTTON_DELETE_MATERIAL = "button_delete_material"; + + public static final String BUTTON_DELETE_DATA_SET = "button_delete_data_set"; + + public static final String BUTTON_DELETE_PROJECT = "button_delete_project"; + public static final String BUTTON_CONFIGURE = "button_configure"; public static final String BUTTON_FILTERS = "button_filters"; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ProjectViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ProjectViewer.java index 7399b07b012..4d2f0546d90 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ProjectViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ProjectViewer.java @@ -206,4 +206,10 @@ public final class ProjectViewer extends AbstractViewer<IEntityInformationHolder { return DatabaseModificationKind.any(ObjectKind.PROJECT); } + + @Override + protected String getDeleteButtonLabel() + { + return viewContext.getMessage(Dict.BUTTON_DELETE_PROJECT); + } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractViewer.java index b1827af4d3c..8ebe84b0800 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractViewer.java @@ -126,6 +126,8 @@ public abstract class AbstractViewer<D extends IEntityInformationHolder> extends viewContext.getClientPluginFactoryProvider().registerModuleInitializationObserver(this); } + protected abstract String getDeleteButtonLabel(); + private Button createEditButton() { Button result = new Button(viewContext.getMessage(Dict.BUTTON_EDIT)); @@ -148,7 +150,7 @@ public abstract class AbstractViewer<D extends IEntityInformationHolder> extends protected Button createDeleteButton(final IDelegatedAction deleteAction) { - Button result = new Button(viewContext.getMessage(Dict.BUTTON_DELETE)); + Button result = new Button(getDeleteButtonLabel()); result.setId(getId() + ID_DELETE_SUFFIX); result.addListener(Events.Select, new Listener<BaseEvent>() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/public/generic-dictionary.js b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/public/generic-dictionary.js index 0b487ce375a..0ba4633c3eb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/public/generic-dictionary.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/public/generic-dictionary.js @@ -13,7 +13,7 @@ var generic = { // Sample Viewer // - sample_properties_panel_sample_identifier: "Sample", + sample_properties_panel_sample_identifier: "Sample", sample_properties_heading: "Sample Properties", part_of_heading: "Components", derived_samples_heading: "Derived Samples", diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/DemoSampleViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/DemoSampleViewer.java index 5c8f9546bfa..0f993687166 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/DemoSampleViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/DemoSampleViewer.java @@ -19,6 +19,7 @@ package ch.systemsx.cisd.openbis.plugin.demo.client.web.client.application; import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; 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.ui.AbstractViewer; @@ -72,7 +73,8 @@ public final class DemoSampleViewer extends AbstractViewer<Sample> protected void reloadAllData() { SampleInfoCallback callback = new SampleInfoCallback(getViewContext(), this); - getViewContext().getService().getSampleGenerationInfo(sampleId, getBaseIndexURL(), callback); + getViewContext().getService() + .getSampleGenerationInfo(sampleId, getBaseIndexURL(), callback); } // @@ -110,4 +112,10 @@ public final class DemoSampleViewer extends AbstractViewer<Sample> } } + @Override + protected String getDeleteButtonLabel() + { + return viewContext.getMessage(Dict.BUTTON_DELETE_SAMPLE); + } + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java index 12882f23d20..78d1130b129 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java @@ -496,4 +496,9 @@ abstract public class GenericDataSetViewer extends AbstractViewerWithVerticalSpl } } + @Override + protected String getDeleteButtonLabel() + { + return viewContext.getMessage(Dict.BUTTON_DELETE_DATA_SET); + } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewer.java index 79d3fd3aa88..be007c4e187 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewer.java @@ -337,4 +337,10 @@ public class GenericExperimentViewer extends AbstractViewerWithVerticalSplit<Exp { createModificationObserver().update(observedModifications); } + + @Override + protected String getDeleteButtonLabel() + { + return viewContext.getMessage(Dict.BUTTON_DELETE_EXPERIMENT); + } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/GenericMaterialViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/GenericMaterialViewer.java index 9311ef27986..d0e422243fe 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/GenericMaterialViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/GenericMaterialViewer.java @@ -298,7 +298,11 @@ abstract public class GenericMaterialViewer extends AbstractViewerWithVerticalSp viewer.setupRemovedEntityView(); } } - } + @Override + protected String getDeleteButtonLabel() + { + return viewContext.getMessage(Dict.BUTTON_DELETE_MATERIAL); + } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java index 8e3bfbb987e..631f9908b22 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java @@ -161,14 +161,16 @@ abstract public class GenericSampleViewer extends AbstractViewerWithVerticalSpli } addToolBarButton(createDeleteButton(new IDelegatedAction() { - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings( + { "unchecked", "rawtypes" }) public void execute() { final AsyncCallback<Void> callback = isTrashEnabled() ? createDeletionCallback() : createPermanentDeletionCallback(); - new SampleListDeletionConfirmationDialog(getViewContext().getCommonViewContext(), - getOriginalDataAsSingleton(), callback, getOriginalData()).show(); + new SampleListDeletionConfirmationDialog(getViewContext() + .getCommonViewContext(), getOriginalDataAsSingleton(), callback, + getOriginalData()).show(); } })); addToolBarButton(createRevertDeletionButton(new IDelegatedAction() @@ -202,8 +204,7 @@ abstract public class GenericSampleViewer extends AbstractViewerWithVerticalSpli final Sample generator = sampleGeneration.getParent(); final IViewContext<?> context = getViewContext(); - final SectionsPanel container = - new SectionsPanel(context.getCommonViewContext(), getId()); + final SectionsPanel container = new SectionsPanel(context.getCommonViewContext(), getId()); container.setDisplayID(DisplayTypeIDGenerator.GENERIC_SAMPLE_VIEWER, displayIdSuffix); List<TabContent> additionalPanels = createAdditionalSectionPanels(); for (TabContent panel : additionalPanels) @@ -220,8 +221,7 @@ abstract public class GenericSampleViewer extends AbstractViewerWithVerticalSpli parentSamplesSection = new ParentSamplesSection(context, generator); container.addSection(parentSamplesSection); // Data Sets - dataSetSection = - new SampleDataSetsSection(context, sampleId, generator.getSampleType()); + dataSetSection = new SampleDataSetsSection(context, sampleId, generator.getSampleType()); container.addSection(dataSetSection); // Attachments @@ -522,7 +522,11 @@ abstract public class GenericSampleViewer extends AbstractViewerWithVerticalSpli genericSampleViewer.setupRemovedEntityView(); } } - } + @Override + protected String getDeleteButtonLabel() + { + return viewContext.getMessage(Dict.BUTTON_DELETE_SAMPLE); + } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/common-dictionary.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/common-dictionary.js index 204366730d2..65351df382f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/common-dictionary.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/common-dictionary.js @@ -146,6 +146,11 @@ var common = { button_browse: "Browse", button_view: "View", button_delete: "Delete", + button_delete_sample: "Delete Sample", + button_delete_experiment: "Delete Experiment", + button_delete_material: "Delete Material", + button_delete_data_set: "Delete Data Set", + button_delete_project: "Delete Project", button_configure: "Settings", button_filters: "Filters", button_upload_data_via_cifex: "Upload Data", diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/Dict.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/Dict.java index d32f0f32dec..1cb7e86bd0a 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/Dict.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/Dict.java @@ -90,6 +90,8 @@ public class Dict // Protein Detail View public static final String PROBABILITY = "protein_probability"; + public static final String BUTTON_DELETE_PROTEIN = "button_delete_protein"; + // SampleAbundance Browser public static final String ABUNDANCE = "abundance"; @@ -104,6 +106,4 @@ public class Dict public static final String COPY_DATA_SETS_MESSAGE = "copy_data_sets_message"; public static final String COPY_DATA_SETS_DATA_SET_TYPE_FIELD = "copy_data_sets_data_set_type_field"; - - } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinViewer.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinViewer.java index 7daf1f91776..d3c6c4033b5 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinViewer.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinViewer.java @@ -436,4 +436,10 @@ public class ProteinViewer extends AbstractViewerWithVerticalSplit<IEntityInform } + @Override + protected String getDeleteButtonLabel() + { + return viewContext.getMessage(Dict.BUTTON_DELETE_PROTEIN); + } + } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/public/phosphonetx-dictionary.js b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/public/phosphonetx-dictionary.js index 763d662e412..fbc798cf09c 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/public/phosphonetx-dictionary.js +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/public/phosphonetx-dictionary.js @@ -40,6 +40,7 @@ var phosphonetx = { sequence_name: "Sequence Reference", false_discovery_rate_column: "FDR (Protein Prophet)", protein_probability: "Probability (Protein Prophet)", + button_delete_protein: "Delete Protein", // ProteinRelatedSampleGrid openbis_protein_related_sample_grid_main_SAMPLE_IDENTIFIER: "Identifier", -- GitLab