From ab20871c98eaf6c8bf100140efec83d9c728f4a6 Mon Sep 17 00:00:00 2001
From: cramakri <cramakri>
Date: Thu, 13 Jan 2011 14:41:23 +0000
Subject: [PATCH] LMS-1949 Updating the managed widget api.

SVN: 19416
---
 ...ManagedComboBoxInputWidgetDescription.java | 40 +++++++++++++
 .../basic/dto/ManagedInputFieldType.java      | 25 ++++++++
 .../dto/ManagedInputWidgetDescription.java    | 60 +++++++++++++++++++
 .../ManagedTextInputWidgetDescription.java    | 27 +++++++++
 .../basic/dto/ManagedUiDescription.java       | 26 +++++---
 5 files changed, 171 insertions(+), 7 deletions(-)
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedComboBoxInputWidgetDescription.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedInputFieldType.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedInputWidgetDescription.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedTextInputWidgetDescription.java

diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedComboBoxInputWidgetDescription.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedComboBoxInputWidgetDescription.java
new file mode 100644
index 00000000000..763f3a1770d
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedComboBoxInputWidgetDescription.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2011 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.generic.shared.basic.dto;
+
+import java.util.ArrayList;
+
+/**
+ * @author Chandrasekhar Ramakrishnan
+ */
+public class ManagedComboBoxInputWidgetDescription extends ManagedInputWidgetDescription
+{
+    private static final long serialVersionUID = 1L;
+
+    private ArrayList<String> options = new ArrayList<String>();
+
+    public ArrayList<String> getOptions()
+    {
+        return options;
+    }
+
+    public void setOptions(ArrayList<String> options)
+    {
+        this.options = options;
+    }
+
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedInputFieldType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedInputFieldType.java
new file mode 100644
index 00000000000..d84098bb51b
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedInputFieldType.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2011 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.generic.shared.basic.dto;
+
+/**
+ * @author Chandrasekhar Ramakrishnan
+ */
+public enum ManagedInputFieldType
+{
+    TEXT, COMBO_BOX
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedInputWidgetDescription.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedInputWidgetDescription.java
new file mode 100644
index 00000000000..ca150330a9e
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedInputWidgetDescription.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2011 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.generic.shared.basic.dto;
+
+/**
+ * @author Chandrasekhar Ramakrishnan
+ */
+public abstract class ManagedInputWidgetDescription implements IManagedWidgetDescription
+{
+    private static final long serialVersionUID = 1L;
+
+    private String label;
+
+    private String value;
+
+    public ManagedWidgetType getManagedWidgetType()
+    {
+        return ManagedWidgetType.INPUT;
+    }
+
+    public ManagedInputFieldType getManagedInputFieldType()
+    {
+        return ManagedInputFieldType.TEXT;
+    }
+
+    public String getLabel()
+    {
+        return label;
+    }
+
+    public void setLabel(String label)
+    {
+        this.label = label;
+    }
+
+    public String getValue()
+    {
+        return value;
+    }
+
+    public void setValue(String value)
+    {
+        this.value = value;
+    }
+
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedTextInputWidgetDescription.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedTextInputWidgetDescription.java
new file mode 100644
index 00000000000..47d781d3d81
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedTextInputWidgetDescription.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2011 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.generic.shared.basic.dto;
+
+/**
+ * @author Chandrasekhar Ramakrishnan
+ */
+public class ManagedTextInputWidgetDescription extends ManagedInputWidgetDescription
+{
+
+    private static final long serialVersionUID = 1L;
+
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedUiDescription.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedUiDescription.java
index 817248e08b5..a6ed4d72e3d 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedUiDescription.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedUiDescription.java
@@ -29,24 +29,36 @@ public class ManagedUiDescription implements ISerializable
 {
     private static final long serialVersionUID = ServiceVersionHolder.VERSION;
 
-    private List<IManagedWidgetDescription> widgetDescriptions;
+    private IManagedWidgetDescription outputWidgetDescription;
+
+    private List<ManagedInputWidgetDescription> inputWidgetDescriptions;
 
     public ManagedUiDescription()
     {
     }
 
-    public List<IManagedWidgetDescription> getWidgetDescriptions()
+    public IManagedWidgetDescription getOutputWidgetDescription()
+    {
+        return outputWidgetDescription;
+    }
+
+    public void setOutputWidgetDescription(IManagedWidgetDescription outputWidgetDescription)
+    {
+        this.outputWidgetDescription = outputWidgetDescription;
+    }
+
+    public List<ManagedInputWidgetDescription> getInputWidgetDescriptions()
     {
-        return widgetDescriptions;
+        return inputWidgetDescriptions;
     }
 
-    public void setWidgetDescriptions(List<IManagedWidgetDescription> widgetDescriptions)
+    public void setInputWidgetDescriptions(List<ManagedInputWidgetDescription> widgetDescriptions)
     {
-        this.widgetDescriptions = widgetDescriptions;
+        this.inputWidgetDescriptions = widgetDescriptions;
     }
 
-    public void addWidgetDescription(IManagedWidgetDescription widgetDescription)
+    public void addInputWidgetDescription(ManagedInputWidgetDescription widgetDescription)
     {
-        widgetDescriptions.add(widgetDescription);
+        inputWidgetDescriptions.add(widgetDescription);
     }
 }
-- 
GitLab