From fd76e052c34a5c50872beabfa75ba6ff70b3fd8c Mon Sep 17 00:00:00 2001
From: buczekp <buczekp>
Date: Wed, 12 Jan 2011 09:51:08 +0000
Subject: [PATCH] [LMS-1949] first version of ManagedUiDescription

SVN: 19381
---
 .../basic/dto/IManagedWidgetDescription.java  | 29 ++++++++++
 .../dto/ManagedTableWidgetDescription.java    | 53 +++++++++++++++++++
 .../basic/dto/ManagedUiDescription.java       | 52 ++++++++++++++++++
 .../shared/basic/dto/ManagedWidgetType.java   | 27 ++++++++++
 4 files changed, 161 insertions(+)
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IManagedWidgetDescription.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedTableWidgetDescription.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedUiDescription.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedWidgetType.java

diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IManagedWidgetDescription.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IManagedWidgetDescription.java
new file mode 100644
index 00000000000..f983a1380c1
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IManagedWidgetDescription.java
@@ -0,0 +1,29 @@
+/*
+ * 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 ch.systemsx.cisd.openbis.generic.shared.basic.ISerializable;
+
+/**
+ * Interface implemented by objects describing a UI element (label, field, table)
+ * 
+ * @author Piotr Buczek
+ */
+public interface IManagedWidgetDescription extends ISerializable
+{
+    ManagedWidgetType getManagedWidgetType();
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedTableWidgetDescription.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedTableWidgetDescription.java
new file mode 100644
index 00000000000..8f30de23df0
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedTableWidgetDescription.java
@@ -0,0 +1,53 @@
+/*
+ * 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;
+
+/**
+ * {@link IManagedWidgetDescription} implementation for tables
+ * 
+ * @author Piotr Buczek
+ */
+public class ManagedTableWidgetDescription implements IManagedWidgetDescription
+{
+    private static final long serialVersionUID = ServiceVersionHolder.VERSION;
+
+    private TypedTableModel<?> tableModel;
+
+    public ManagedTableWidgetDescription()
+    {
+    }
+
+    public void setTableModel(TypedTableModel<?> tableModel)
+    {
+        this.tableModel = tableModel;
+    }
+
+    public TypedTableModel<?> getTableModel()
+    {
+        return tableModel;
+    }
+
+    //
+    // IManagedWidgetDescription
+    //
+
+    public ManagedWidgetType getManagedWidgetType()
+    {
+        return ManagedWidgetType.TABLE;
+    }
+
+}
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
new file mode 100644
index 00000000000..817248e08b5
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedUiDescription.java
@@ -0,0 +1,52 @@
+/*
+ * 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.List;
+
+import ch.systemsx.cisd.openbis.generic.shared.basic.ISerializable;
+
+/**
+ * Object that declaratively describes a UI (labels, fields, their ordering, table content).
+ * 
+ * @author Piotr Buczek
+ */
+public class ManagedUiDescription implements ISerializable
+{
+    private static final long serialVersionUID = ServiceVersionHolder.VERSION;
+
+    private List<IManagedWidgetDescription> widgetDescriptions;
+
+    public ManagedUiDescription()
+    {
+    }
+
+    public List<IManagedWidgetDescription> getWidgetDescriptions()
+    {
+        return widgetDescriptions;
+    }
+
+    public void setWidgetDescriptions(List<IManagedWidgetDescription> widgetDescriptions)
+    {
+        this.widgetDescriptions = widgetDescriptions;
+    }
+
+    public void addWidgetDescription(IManagedWidgetDescription widgetDescription)
+    {
+        widgetDescriptions.add(widgetDescription);
+    }
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedWidgetType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedWidgetType.java
new file mode 100644
index 00000000000..b5c46623d47
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedWidgetType.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;
+
+import ch.systemsx.cisd.openbis.generic.shared.basic.ISerializable;
+
+/**
+ * @author Piotr Buczek
+ */
+public enum ManagedWidgetType implements ISerializable
+{
+    TABLE, LABEL, INPUT;
+}
-- 
GitLab