You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2016/01/31 11:57:28 UTC
[12/18] isis git commit: ISIS-993: still sketching out the layout
classes for BS3 and FC (fixed col)
ISIS-993: still sketching out the layout classes for BS3 and FC (fixed col)
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/10d80f3a
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/10d80f3a
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/10d80f3a
Branch: refs/heads/ISIS-993
Commit: 10d80f3a850ad602d775b09098405b3b56c2541a
Parents: 517b6cc
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Jan 29 02:25:52 2016 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Jan 29 02:25:52 2016 +0000
----------------------------------------------------------------------
.../isis/applib/annotation/ActionLayout.java | 4 +-
.../isis/applib/annotation/BookmarkPolicy.java | 2 +-
.../isis/applib/annotation/Contributed.java | 2 +-
.../isis/applib/annotation/LabelPosition.java | 2 +-
.../isis/applib/annotation/RenderType.java | 2 +-
.../apache/isis/applib/annotation/Where.java | 2 +-
.../isis/applib/layout/bootstrap3/BS3Col.java | 84 +++++
.../applib/layout/bootstrap3/BS3Collection.java | 44 ---
.../isis/applib/layout/bootstrap3/BS3Page.java | 63 ++++
.../applib/layout/bootstrap3/BS3PropGroup.java | 44 ---
.../isis/applib/layout/bootstrap3/BS3Row.java | 52 +++
.../isis/applib/layout/bootstrap3/BS3Tab.java | 8 +-
.../applib/layout/bootstrap3/BS3TabGroup.java | 8 +-
.../applib/layout/bootstrap3/DivColumn.java | 82 -----
.../applib/layout/bootstrap3/DivContainer.java | 81 -----
.../isis/applib/layout/bootstrap3/DivRow.java | 52 ---
.../applib/layout/bootstrap3/package-info.java | 34 ++
.../applib/layout/fixedcols/ColumnMetadata.java | 153 ---------
.../isis/applib/layout/fixedcols/FCColumn.java | 163 ++++++++++
.../applib/layout/fixedcols/FCColumnOwner.java | 25 ++
.../isis/applib/layout/fixedcols/FCPage.java | 313 +++++++++++++++++++
.../isis/applib/layout/fixedcols/FCTab.java | 172 ++++++++++
.../applib/layout/fixedcols/FCTabGroup.java | 113 +++++++
.../layout/fixedcols/FCTabGroupOwner.java | 25 ++
.../layout/fixedcols/ObjectLayoutMetadata.java | 310 ------------------
.../layout/fixedcols/TabGroupMetadata.java | 114 -------
.../applib/layout/fixedcols/TabGroupOwner.java | 25 --
.../applib/layout/fixedcols/TabMetadata.java | 173 ----------
.../applib/layout/fixedcols/package-info.java | 35 +++
.../applib/layout/members/MemberRegion.java | 33 ++
.../layout/members/MemberRegionOwner.java | 23 ++
.../isis/applib/layout/members/Owned.java | 23 ++
.../isis/applib/layout/members/Owner.java | 24 ++
.../layout/members/v1/ActionLayoutData.java | 227 ++++++++++++++
.../applib/layout/members/v1/ActionOwner.java | 27 ++
.../layout/members/v1/CollectionLayoutData.java | 261 ++++++++++++++++
.../isis/applib/layout/members/v1/FieldSet.java | 152 +++++++++
.../layout/members/v1/PropertyLayoutData.java | 246 +++++++++++++++
.../applib/layout/members/v1/package-info.java | 36 +++
.../layout/v1_0/ActionLayoutMetadata.java | 226 -------------
.../isis/applib/layout/v1_0/ActionOwner.java | 25 --
.../layout/v1_0/CollectionLayoutMetadata.java | 259 ---------------
.../isis/applib/layout/v1_0/ColumnOwner.java | 23 --
.../layout/v1_0/MemberLayoutMetadata.java | 24 --
.../layout/v1_0/MemberLayoutMetadataOwner.java | 23 --
.../apache/isis/applib/layout/v1_0/Owned.java | 23 --
.../apache/isis/applib/layout/v1_0/Owner.java | 24 --
.../layout/v1_0/PropertyGroupMetadata.java | 145 ---------
.../layout/v1_0/PropertyLayoutMetadata.java | 245 ---------------
.../isis/applib/layout/v1_0/package-info.java | 25 --
.../layout/ObjectLayoutMetadataService.java | 11 +-
.../layout/Object_downloadLayoutXml.java | 6 +-
.../services/layout/Object_viewLayout.java | 6 +-
.../layout/ActionPositionFacetForActionXml.java | 4 +-
.../layout/BookmarkPolicyFacetForActionXml.java | 4 +-
.../layout/CssClassFaFacetForActionXml.java | 4 +-
.../layout/CssClassFacetForActionXml.java | 4 +-
.../layout/DescribedAsFacetForActionXml.java | 4 +-
.../layout/HiddenFacetForActionLayoutXml.java | 4 +-
.../actions/layout/NamedFacetForActionXml.java | 4 +-
.../layout/CssClassFacetForCollectionXml.java | 4 +-
.../DefaultViewFacetForCollectionXml.java | 4 +-
.../DescribedAsFacetForCollectionXml.java | 4 +-
.../layout/HiddenFacetForCollectionXml.java | 4 +-
.../layout/NamedFacetForCollectionXml.java | 4 +-
.../layout/PagedFacetForCollectionXml.java | 4 +-
.../layout/SortedByFacetForCollectionXml.java | 4 +-
.../ObjectLayoutMetadataFacet.java | 4 +-
.../ObjectLayoutMetadataFacetDefault.java | 214 ++++++-------
.../CssClassFacetForPropertyXml.java | 4 +-
.../DescribedAsFacetForPropertyXml.java | 4 +-
.../HiddenFacetForPropertyXml.java | 4 +-
.../LabelAtFacetForPropertyXml.java | 4 +-
.../MultiLineFacetForPropertyXml.java | 4 +-
.../NamedFacetForPropertyXml.java | 4 +-
.../RenderedAdjustedFacetForPropertyXml.java | 4 +-
.../TypicalLengthFacetForPropertyXml.java | 4 +-
.../json/LayoutMetadataReaderFromJson.java | 2 +-
.../ObjectLayoutMetadataServiceDefault.java | 18 +-
.../services/metamodel/MetadataMenu.java | 4 +-
.../metamodel/spec/ObjectSpecifications.java | 8 +-
.../layoutxml/FCPageFacetDefaultTest.java | 60 ++++
.../ObjectLayoutMetadataFacetDefaultTest.java | 60 ----
.../metamodel/layoutxml/v1_0/FCPageTest.java | 124 ++++++++
.../v1_0/ObjectLayoutMetadataTest.java | 124 --------
.../model/models/EntityCollectionModel.java | 14 +-
.../viewer/wicket/model/models/EntityModel.java | 72 ++---
.../components/entity/EntityPanelFactory.java | 4 +-
.../wicket/ui/components/entity/PropUtil.java | 10 +-
.../collections/EntityCollectionsPanel.java | 18 +-
.../components/entity/column/EntityColumn.java | 41 ++-
.../entity/propgroup/PropertyGroup.java | 14 +-
.../propsandcolls/EntityPropsAndCollsForm.java | 30 +-
.../entity/tabbed/EntityTabbedPanel.java | 24 +-
.../entity/tabgroup/TabGroupPanel.java | 20 +-
.../entity/tabgrouplist/TabGroupListPanel.java | 10 +-
.../ui/components/entity/tabpanel/TabPanel.java | 6 +-
.../wicket/ui/pages/entity/EntityPage.java | 4 +-
98 files changed, 2642 insertions(+), 2635 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionLayout.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionLayout.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionLayout.java
index d8255c5..d5428d2 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionLayout.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionLayout.java
@@ -75,7 +75,7 @@ public @interface ActionLayout {
CssClassFaPosition cssClassFaPosition() default CssClassFaPosition.LEFT;
@XmlType(
- namespace = "http://isis.apache.org/schema/applib/layout"
+ namespace = "http://isis.apache.org/schema/applib/layout/members/v1"
)
enum CssClassFaPosition {
LEFT, RIGHT
@@ -115,7 +115,7 @@ public @interface ActionLayout {
Position position() default Position.BELOW;
@XmlType(
- namespace = "http://isis.apache.org/schema/applib/layout"
+ namespace = "http://isis.apache.org/schema/applib/layout/members/v1"
)
enum Position {
BELOW,
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/annotation/BookmarkPolicy.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/BookmarkPolicy.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/BookmarkPolicy.java
index b6b1fb3..2ab7a7c 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/BookmarkPolicy.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/BookmarkPolicy.java
@@ -22,7 +22,7 @@ package org.apache.isis.applib.annotation;
import javax.xml.bind.annotation.XmlType;
@XmlType(
- namespace = "http://isis.apache.org/schema/applib/layout"
+ namespace = "http://isis.apache.org/schema/applib/layout/members/v1"
)
public enum BookmarkPolicy {
/**
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/annotation/Contributed.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Contributed.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Contributed.java
index 81821bb..e3fbc14 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Contributed.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Contributed.java
@@ -25,7 +25,7 @@ import javax.xml.bind.annotation.XmlType;
* The means by which a domain service action will be contributed to a domain object.
*/
@XmlType(
- namespace = "http://isis.apache.org/schema/applib/layout"
+ namespace = "http://isis.apache.org/schema/applib/layout/members/v1"
)
public enum Contributed {
/**
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/annotation/LabelPosition.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/LabelPosition.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/LabelPosition.java
index a91d280..5b5873b 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/LabelPosition.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/LabelPosition.java
@@ -27,7 +27,7 @@ import javax.xml.bind.annotation.XmlType;
* @see org.apache.isis.applib.annotation.ParameterLayout
*/
@XmlType(
- namespace = "http://isis.apache.org/schema/applib/layout"
+ namespace = "http://isis.apache.org/schema/applib/layout/members/v1"
)
public enum LabelPosition {
DEFAULT,
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/annotation/RenderType.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/RenderType.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/RenderType.java
index 5363b38..8af27cb 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/RenderType.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/RenderType.java
@@ -21,7 +21,7 @@ package org.apache.isis.applib.annotation;
import javax.xml.bind.annotation.XmlType;
@XmlType(
- namespace = "http://isis.apache.org/schema/applib/layout"
+ namespace = "http://isis.apache.org/schema/applib/layout/members/v1"
)
public enum RenderType {
EAGERLY,
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/annotation/Where.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Where.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Where.java
index e89403d..fe35958 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Where.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Where.java
@@ -41,7 +41,7 @@ import org.apache.isis.applib.util.Enums;
* the framework developer should only use those values that represent concrete locations.
*/
@XmlType(
- namespace = "http://isis.apache.org/schema/applib/layout"
+ namespace = "http://isis.apache.org/schema/applib/layout/members/v1"
)
public enum Where {
/**
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Col.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Col.java b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Col.java
new file mode 100644
index 0000000..4e948be
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Col.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.isis.applib.layout.bootstrap3;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.isis.applib.layout.members.v1.FieldSet;
+
+@XmlType(
+ name = "col"
+ , propOrder = {
+ "rows",
+ "tabGroup",
+ "propGroups",
+ "collections",
+ }
+)
+public class BS3Col {
+
+
+ private List<BS3Row> rows = new ArrayList<BS3Row>();
+
+ // no wrapper
+ @XmlElement(name = "row", required = false)
+ public List<BS3Row> getRows() {
+ return rows;
+ }
+
+ public void setRows(final List<BS3Row> rows) {
+ this.rows = rows;
+ }
+
+
+
+ private BS3TabGroup tabGroup;
+
+ @XmlElement(name="tabGroup", required = false)
+ public BS3TabGroup getTabGroup() {
+ return tabGroup;
+ }
+
+ public void setTabGroup(final BS3TabGroup tabGroup) {
+ this.tabGroup = tabGroup;
+ }
+
+
+
+
+ private List<FieldSet> propGroups = new ArrayList<FieldSet>();
+
+ // no wrapper
+ @XmlElement(name = "propGroup", required = false)
+ public List<FieldSet> getPropGroups() {
+ return propGroups;
+ }
+
+ public void setPropGroups(final List<FieldSet> propGroups) {
+ this.propGroups = propGroups;
+ }
+
+
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Collection.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Collection.java b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Collection.java
deleted file mode 100644
index d1cb0b9..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Collection.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.isis.applib.layout.bootstrap3;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-
-@XmlType(
- name = "collection"
- , propOrder = {
- "name"
- }
-)
-public class BS3Collection {
-
-
- private String name;
-
- @XmlAttribute(required = true)
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Page.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Page.java b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Page.java
new file mode 100644
index 0000000..0b81c30
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Page.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.isis.applib.layout.bootstrap3;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * This is the top-level region for the domain object's properties, collections and actions. It simply consists
+ * of a number of rows.
+ *
+ * <p>
+ * Note that the title's
+ * </p>
+ */
+@XmlRootElement(
+ name = "page"
+)
+@XmlType(
+ name = "page"
+ , propOrder = {
+ "rows"
+ }
+)
+public class BS3Page {
+
+ private List<BS3Row> rows = new ArrayList<BS3Row>(){{
+ add(new BS3Row());
+ }};
+
+ // no wrapper
+ @XmlElement(name = "row", required = true)
+ public List<BS3Row> getRows() {
+ return rows;
+ }
+
+ public void setRows(final List<BS3Row> rows) {
+ this.rows = rows;
+ }
+
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3PropGroup.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3PropGroup.java b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3PropGroup.java
deleted file mode 100644
index b8aa5c9..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3PropGroup.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.isis.applib.layout.bootstrap3;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-
-@XmlType(
- name = "propGroup"
- , propOrder = {
- "name"
- }
-)
-public class BS3PropGroup {
-
-
- private String name;
-
- @XmlAttribute(required = true)
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Row.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Row.java b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Row.java
new file mode 100644
index 0000000..ea78d7c
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Row.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.isis.applib.layout.bootstrap3;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType(
+ name = "row"
+ , propOrder = {
+ "columns"
+ }
+)
+public class BS3Row {
+
+
+
+ private List<BS3Col> columns = new ArrayList<BS3Col>(){{
+ add(new BS3Col());
+ }};
+
+ // no wrapper
+ @XmlElement(name = "column", required = true)
+ public List<BS3Col> getColumns() {
+ return columns;
+ }
+
+ public void setColumns(final List<BS3Col> columns) {
+ this.columns = columns;
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Tab.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Tab.java b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Tab.java
index 5520a6f..aea912d 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Tab.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3Tab.java
@@ -35,8 +35,8 @@ import javax.xml.bind.annotation.XmlType;
public class BS3Tab {
// at least one row
- private List<DivRow> rows = new ArrayList<DivRow>(){{
- add(new DivRow());
+ private List<BS3Row> rows = new ArrayList<BS3Row>(){{
+ add(new BS3Row());
}};
@@ -53,11 +53,11 @@ public class BS3Tab {
// no wrapper
@XmlElement(name = "row", required = true)
- public List<DivRow> getRows() {
+ public List<BS3Row> getRows() {
return rows;
}
- public void setRows(final List<DivRow> rows) {
+ public void setRows(final List<BS3Row> rows) {
this.rows = rows;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3TabGroup.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3TabGroup.java b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3TabGroup.java
index a561811..8221069 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3TabGroup.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/BS3TabGroup.java
@@ -32,17 +32,17 @@ import javax.xml.bind.annotation.XmlType;
)
public class BS3TabGroup {
- private List<DivColumn> columns = new ArrayList<DivColumn>(){{
- add(new DivColumn());
+ private List<BS3Col> columns = new ArrayList<BS3Col>(){{
+ add(new BS3Col());
}};
// no wrapper
@XmlElement(name = "column", required = true)
- public List<DivColumn> getColumns() {
+ public List<BS3Col> getColumns() {
return columns;
}
- public void setColumns(final List<DivColumn> columns) {
+ public void setColumns(final List<BS3Col> columns) {
this.columns = columns;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/DivColumn.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/DivColumn.java b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/DivColumn.java
deleted file mode 100644
index 2338b84..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/DivColumn.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.isis.applib.layout.bootstrap3;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-@XmlType(
- name = "div-column"
- , propOrder = {
- "rows",
- "tabGroup",
- "propGroups",
- "collections",
- }
-)
-public class DivColumn {
-
-
- private List<DivRow> rows = new ArrayList<DivRow>();
-
- // no wrapper
- @XmlElement(name = "row", required = false)
- public List<DivRow> getRows() {
- return rows;
- }
-
- public void setRows(final List<DivRow> rows) {
- this.rows = rows;
- }
-
-
-
- private BS3TabGroup tabGroup;
-
- @XmlElement(name="tabGroup", required = false)
- public BS3TabGroup getTabGroup() {
- return tabGroup;
- }
-
- public void setTabGroup(final BS3TabGroup tabGroup) {
- this.tabGroup = tabGroup;
- }
-
-
-
-
- private List<BS3PropGroup> propGroups = new ArrayList<BS3PropGroup>();
-
- // no wrapper
- @XmlElement(name = "propGroup", required = false)
- public List<BS3PropGroup> getPropGroups() {
- return propGroups;
- }
-
- public void setPropGroups(final List<BS3PropGroup> propGroups) {
- this.propGroups = propGroups;
- }
-
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/DivContainer.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/DivContainer.java b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/DivContainer.java
deleted file mode 100644
index fc026f2..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/DivContainer.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.isis.applib.layout.bootstrap3;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-@XmlRootElement(
- name = "div-container"
-)
-@XmlType(
- name = "div-container"
- , propOrder = {
- "rows"
- }
-)
-public class DivContainer {
-
- public enum Width {
- /**
- * <code>div class="container"</code>
- */
- FIXED,
- /**
- * <code>div class="container-fluid"</code>
- */
- FULL
- }
-
- private Width width;
-
- @XmlAttribute(required = true)
- public Width getWidth() {
- return width;
- }
-
- public void setWidth(final Width width) {
- this.width = width;
- }
-
-
-
-
- private List<DivRow> rows = new ArrayList<DivRow>(){{
- add(new DivRow());
- }};
-
- // no wrapper
- @XmlElement(name = "row", required = true)
- public List<DivRow> getRows() {
- return rows;
- }
-
- public void setRows(final List<DivRow> rows) {
- this.rows = rows;
- }
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/DivRow.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/DivRow.java b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/DivRow.java
deleted file mode 100644
index d39731d..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/DivRow.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.isis.applib.layout.bootstrap3;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-@XmlType(
- name = "div-row"
- , propOrder = {
- "columns"
- }
-)
-public class DivRow {
-
-
-
- private List<DivColumn> columns = new ArrayList<DivColumn>(){{
- add(new DivColumn());
- }};
-
- // no wrapper
- @XmlElement(name = "column", required = true)
- public List<DivColumn> getColumns() {
- return columns;
- }
-
- public void setColumns(final List<DivColumn> columns) {
- this.columns = columns;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/package-info.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/package-info.java b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/package-info.java
new file mode 100644
index 0000000..751f620
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/bootstrap3/package-info.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * The classes in this package define how to layout the properties, collections and actions of a domain object - the
+ * building blocks - as defined in the <code>members.v1</code> package.
+ *
+ * <p>
+ * The layout is modelled closely after <a href="http://getbootstrap.com/">Bootstrap</a>, and is intended to
+ * support the grid layouts implemented by that CSS framework. This flexibility comes at the cost of some
+ * verbosity.
+ * </p>
+ */
+@javax.xml.bind.annotation.XmlSchema(
+ namespace = "http://isis.apache.org/schema/applib/layout/bootstrap3",
+ elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED
+)
+package org.apache.isis.applib.layout.bootstrap3;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/ColumnMetadata.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/ColumnMetadata.java b/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/ColumnMetadata.java
deleted file mode 100644
index 2897ad8..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/ColumnMetadata.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.isis.applib.layout.fixedcols;
-
-import java.io.Serializable;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-
-import com.google.common.collect.Lists;
-
-import org.apache.isis.applib.annotation.MemberGroupLayout;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.layout.v1_0.CollectionLayoutMetadata;
-import org.apache.isis.applib.layout.v1_0.ColumnOwner;
-import org.apache.isis.applib.layout.v1_0.MemberLayoutMetadataOwner;
-import org.apache.isis.applib.layout.v1_0.Owned;
-import org.apache.isis.applib.layout.v1_0.PropertyGroupMetadata;
-
-@XmlType(
- propOrder = {
- "propertyGroups"
- , "collections"
- }
-)
-public class ColumnMetadata implements Serializable, MemberLayoutMetadataOwner, Owned<ColumnOwner> {
-
- private static final long serialVersionUID = 1L;
-
- public ColumnMetadata() {
- }
-
- public ColumnMetadata(final int span) {
- setSpan(span);
- }
-
- private int span = 4;
-
- @XmlAttribute(required = true)
- public int getSpan() {
- return span;
- }
-
- public void setSpan(final int span) {
- this.span = span;
- }
-
-
-
- private List<PropertyGroupMetadata> propertyGroups = Lists.newArrayList();
-
- // no wrapper
- @XmlElement(name = "propertyGroup", required = false)
- public List<PropertyGroupMetadata> getPropertyGroups() {
- return propertyGroups;
- }
-
- public void setPropertyGroups(final List<PropertyGroupMetadata> propertyGroups) {
- this.propertyGroups = propertyGroups;
- }
-
-
- private List<CollectionLayoutMetadata> collections = Lists.newArrayList();
-
- // no wrapper
- @XmlElement(name = "collection", required = false)
- public List<CollectionLayoutMetadata> getCollections() {
- return collections;
- }
-
- public void setCollections(final List<CollectionLayoutMetadata> collections) {
- this.collections = collections;
- }
-
-
- private ColumnOwner owner;
- /**
- * Owner.
- *
- * <p>
- * Set programmatically by framework after reading in from XML.
- * </p>
- */
- @XmlTransient
- public ColumnOwner getOwner() {
- return owner;
- }
-
- public void setOwner(final ColumnOwner owner) {
- this.owner = owner;
- }
-
-
-
- private String path;
-
- @Programmatic
- @XmlTransient
- public String getPath() {
- return path;
- }
-
- @Programmatic
- public void setPath(final String path) {
- this.path = path;
- }
-
-
-
-
- public enum Hint {
- LEFT,
- MIDDLE,
- RIGHT;
-
- public int from(MemberGroupLayout.ColumnSpans columnSpans) {
- if(this == LEFT) return columnSpans.getLeft();
- if(this == MIDDLE) return columnSpans.getMiddle();
- if(this == RIGHT) return columnSpans.getRight();
- throw new IllegalStateException();
- }
-
- public ColumnMetadata from(final TabMetadata tabMetadata) {
- if(tabMetadata == null) {
- return null;
- }
- if(this == LEFT) return tabMetadata.getLeft();
- if(this == MIDDLE) return tabMetadata.getMiddle();
- if(this == RIGHT) return tabMetadata.getRight();
- throw new IllegalStateException();
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCColumn.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCColumn.java b/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCColumn.java
new file mode 100644
index 0000000..830b21d
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCColumn.java
@@ -0,0 +1,163 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.isis.applib.layout.fixedcols;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import com.google.common.collect.Lists;
+
+import org.apache.isis.applib.annotation.MemberGroupLayout;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.layout.members.v1.CollectionLayoutData;
+import org.apache.isis.applib.layout.members.MemberRegionOwner;
+import org.apache.isis.applib.layout.members.Owned;
+import org.apache.isis.applib.layout.members.v1.FieldSet;
+import org.apache.isis.applib.layout.members.v1.PropertyLayoutData;
+
+/**
+ * The column contains a mixture of {@link FieldSet}s (of {@link PropertyLayoutData properties}) and also
+ * {@link CollectionLayoutData collection}s.
+ *
+ * <p>
+ * A column generally is used within a {@link FCTab}; there can be up to three such (left, middle and right). It is
+ * also possible for their to be a column far-left on the top-level {@link FCPage page}, and another far-right.
+ * </p>
+ *
+ */
+@XmlType(
+ propOrder = {
+ "propertyGroups"
+ , "collections"
+ }
+)
+public class FCColumn implements Serializable, MemberRegionOwner, Owned<FCColumnOwner> {
+
+ private static final long serialVersionUID = 1L;
+
+ public FCColumn() {
+ }
+
+ public FCColumn(final int span) {
+ setSpan(span);
+ }
+
+ private int span = 4;
+
+ @XmlAttribute(required = true)
+ public int getSpan() {
+ return span;
+ }
+
+ public void setSpan(final int span) {
+ this.span = span;
+ }
+
+
+
+ private List<FieldSet> fieldSets = Lists.newArrayList();
+
+ // no wrapper
+ @XmlElement(name = "propertyGroup", required = false)
+ public List<FieldSet> getFieldSets() {
+ return fieldSets;
+ }
+
+ public void setFieldSets(final List<FieldSet> fieldSets) {
+ this.fieldSets = fieldSets;
+ }
+
+
+ private List<CollectionLayoutData> collections = Lists.newArrayList();
+
+ // no wrapper
+ @XmlElement(name = "collection", required = false)
+ public List<CollectionLayoutData> getCollections() {
+ return collections;
+ }
+
+ public void setCollections(final List<CollectionLayoutData> collections) {
+ this.collections = collections;
+ }
+
+
+ private FCColumnOwner owner;
+ /**
+ * Owner.
+ *
+ * <p>
+ * Set programmatically by framework after reading in from XML.
+ * </p>
+ */
+ @XmlTransient
+ public FCColumnOwner getOwner() {
+ return owner;
+ }
+
+ public void setOwner(final FCColumnOwner owner) {
+ this.owner = owner;
+ }
+
+
+
+ private String path;
+
+ @Programmatic
+ @XmlTransient
+ public String getPath() {
+ return path;
+ }
+
+ @Programmatic
+ public void setPath(final String path) {
+ this.path = path;
+ }
+
+
+
+
+ public enum Hint {
+ LEFT,
+ MIDDLE,
+ RIGHT;
+
+ public int from(MemberGroupLayout.ColumnSpans columnSpans) {
+ if(this == LEFT) return columnSpans.getLeft();
+ if(this == MIDDLE) return columnSpans.getMiddle();
+ if(this == RIGHT) return columnSpans.getRight();
+ throw new IllegalStateException();
+ }
+
+ public FCColumn from(final FCTab FCTab) {
+ if(FCTab == null) {
+ return null;
+ }
+ if(this == LEFT) return FCTab.getLeft();
+ if(this == MIDDLE) return FCTab.getMiddle();
+ if(this == RIGHT) return FCTab.getRight();
+ throw new IllegalStateException();
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCColumnOwner.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCColumnOwner.java b/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCColumnOwner.java
new file mode 100644
index 0000000..dfdf8a5
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCColumnOwner.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.isis.applib.layout.fixedcols;
+
+import org.apache.isis.applib.layout.members.Owner;
+
+public interface FCColumnOwner extends Owner {
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCPage.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCPage.java b/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCPage.java
new file mode 100644
index 0000000..c5ff91c
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCPage.java
@@ -0,0 +1,313 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.isis.applib.layout.fixedcols;
+
+import java.io.Serializable;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import com.google.common.collect.Maps;
+
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.layout.members.v1.ActionLayoutData;
+import org.apache.isis.applib.layout.members.v1.ActionOwner;
+import org.apache.isis.applib.layout.members.v1.CollectionLayoutData;
+import org.apache.isis.applib.layout.members.v1.FieldSet;
+import org.apache.isis.applib.layout.members.v1.PropertyLayoutData;
+import org.apache.isis.applib.services.dto.Dto;
+
+/**
+ * Top-level page, consisting of an optional {@link FCColumn column} on the far left and another (also optional) on the
+ * far right, with the middle consisting of a number of {@link FCTabGroup tabgroup}s, stacked vertically.
+ */
+@XmlRootElement(
+ name = "objectLayout"
+)
+@XmlType(
+ name = "objectLayout"
+ , propOrder = {
+ "actions"
+ , "left"
+ , "tabGroups"
+ , "right"
+ }
+)
+public class FCPage implements Dto, ActionOwner, Serializable, FCColumnOwner, FCTabGroupOwner {
+
+ private static final long serialVersionUID = 1L;
+
+ private List<ActionLayoutData> actions;
+
+ @XmlElementWrapper(name = "actions", required = false)
+ @XmlElement(name = "action", required = false)
+ public List<ActionLayoutData> getActions() {
+ return actions;
+ }
+
+ public void setActions(List<ActionLayoutData> actionLayoutDatas) {
+ this.actions = actionLayoutDatas;
+ }
+
+
+
+ private FCColumn left;
+
+ @XmlElement(required = false)
+ public FCColumn getLeft() {
+ return left;
+ }
+
+ public void setLeft(final FCColumn left) {
+ this.left = left;
+ }
+
+
+
+ private List<FCTabGroup> tabGroups;
+
+ // no wrapper
+ @XmlElement(name = "tabGroup", required = true)
+ public List<FCTabGroup> getTabGroups() {
+ return tabGroups;
+ }
+
+ public void setTabGroups(List<FCTabGroup> tabGroups) {
+ this.tabGroups = tabGroups;
+ }
+
+
+
+ private FCColumn right;
+
+ @XmlElement(required = false)
+ public FCColumn getRight() {
+ return right;
+ }
+
+ public void setRight(final FCColumn right) {
+ this.right = right;
+ }
+
+
+ public interface Visitor {
+ void visit(final FCPage FCPage);
+ void visit(final FCTabGroup tabGroup);
+ void visit(final FCTab FCTab);
+ void visit(final FCColumn FCColumn);
+ void visit(final FieldSet fieldSet);
+ void visit(final PropertyLayoutData propertyLayoutData);
+ void visit(final CollectionLayoutData collectionLayoutData);
+ void visit(final ActionLayoutData actionLayoutData);
+ }
+
+ public static class VisitorAdapter implements Visitor {
+ @Override
+ public void visit(final FCPage FCPage) { }
+ @Override
+ public void visit(final FCTabGroup tabGroup) { }
+ @Override
+ public void visit(final FCTab FCTab) { }
+ @Override
+ public void visit(final FCColumn FCColumn) { }
+ @Override
+ public void visit(final FieldSet fieldSet) {}
+ @Override
+ public void visit(final PropertyLayoutData propertyLayoutData) {}
+ @Override
+ public void visit(final CollectionLayoutData collectionLayoutData) {}
+ @Override
+ public void visit(final ActionLayoutData actionLayoutData) { }
+ }
+
+
+ /**
+ * Visits all elements of the graph. The {@link Visitor} implementation
+ * can assume that all "owner" references are populated.
+ */
+ public void visit(final Visitor visitor) {
+ visitor.visit(this);
+ traverseActions(this, visitor);
+ traverseColumn(getLeft(), this, visitor);
+ final List<FCTabGroup> tabGroups = getTabGroups();
+ for (final FCTabGroup tabGroup : tabGroups) {
+ tabGroup.setOwner(this);
+ visitor.visit(tabGroup);
+ final List<FCTab> tabs = tabGroup.getTabs();
+ for (final FCTab FCTab : tabs) {
+ FCTab.setOwner(tabGroup);
+ visitor.visit(FCTab);
+ traverseColumn(FCTab.getLeft(), FCTab, visitor);
+ traverseColumn(FCTab.getMiddle(), FCTab, visitor);
+ traverseColumn(FCTab.getRight(), FCTab, visitor);
+ }
+ }
+ traverseColumn(getRight(), this, visitor);
+ }
+
+ private void traverseColumn(final FCColumn FCColumn, final FCColumnOwner FCColumnOwner, final Visitor visitor) {
+ if(FCColumn == null) {
+ return;
+ }
+ FCColumn.setOwner(FCColumnOwner);
+ visitor.visit(FCColumn);
+ traversePropertyGroups(FCColumn, visitor);
+ traverseCollections(FCColumn, visitor);
+ }
+
+ private void traversePropertyGroups(final FCColumn FCColumn, final Visitor visitor) {
+ for (final FieldSet fieldSet : FCColumn.getFieldSets()) {
+ fieldSet.setOwner(FCColumn);
+ visitor.visit(fieldSet);
+ traverseActions(fieldSet, visitor);
+ final List<PropertyLayoutData> properties = fieldSet.getProperties();
+ for (final PropertyLayoutData propertyLayoutData : properties) {
+ propertyLayoutData.setOwner(fieldSet);
+ visitor.visit(propertyLayoutData);
+ traverseActions(propertyLayoutData, visitor);
+ }
+ }
+ }
+
+ private void traverseCollections(final FCColumn FCColumn, final Visitor visitor) {
+ for (final CollectionLayoutData collectionLayoutData : FCColumn.getCollections()) {
+ collectionLayoutData.setOwner(FCColumn);
+ visitor.visit(collectionLayoutData);
+ traverseActions(collectionLayoutData, visitor);
+ }
+ }
+
+ private void traverseActions(final ActionOwner actionOwner, final Visitor visitor) {
+ final List<ActionLayoutData> actionLayoutDatas = actionOwner.getActions();
+ if(actionLayoutDatas == null) {
+ return;
+ }
+ for (final ActionLayoutData actionLayoutData : actionLayoutDatas) {
+ actionLayoutData.setOwner(actionOwner);
+ visitor.visit(actionLayoutData);
+ }
+ }
+
+
+ @Programmatic
+ @XmlTransient
+ public LinkedHashMap<String, PropertyLayoutData> getAllPropertiesById() {
+ final LinkedHashMap<String, PropertyLayoutData> propertiesById = Maps.newLinkedHashMap();
+ visit(new FCPage.VisitorAdapter() {
+ public void visit(final PropertyLayoutData propertyLayoutData) {
+ propertiesById.put(propertyLayoutData.getId(), propertyLayoutData);
+ }
+ });
+ return propertiesById;
+ }
+
+
+ @Programmatic
+ @XmlTransient
+ public LinkedHashMap<String, CollectionLayoutData> getAllCollectionsById() {
+ final LinkedHashMap<String, CollectionLayoutData> collectionsById = Maps.newLinkedHashMap();
+
+ visit(new FCPage.VisitorAdapter() {
+ @Override
+ public void visit(final CollectionLayoutData collectionLayoutData) {
+ collectionsById.put(collectionLayoutData.getId(), collectionLayoutData);
+ }
+ });
+ return collectionsById;
+ }
+
+
+ @Programmatic
+ @XmlTransient
+ public LinkedHashMap<String, ActionLayoutData> getAllActionsById() {
+ final LinkedHashMap<String, ActionLayoutData> actionsById = Maps.newLinkedHashMap();
+
+ visit(new FCPage.VisitorAdapter() {
+ @Override
+ public void visit(final ActionLayoutData actionLayoutData) {
+ actionsById.put(actionLayoutData.getId(), actionLayoutData);
+ }
+ });
+ return actionsById;
+ }
+
+
+ @Programmatic
+ @XmlTransient
+ public LinkedHashMap<String, FCTab> getAllTabsByName() {
+ final LinkedHashMap<String, FCTab> tabsByName = Maps.newLinkedHashMap();
+
+ visit(new FCPage.VisitorAdapter() {
+ @Override
+ public void visit(final FCTab FCTab) {
+ tabsByName.put(FCTab.getName(), FCTab);
+ }
+ });
+ return tabsByName;
+ }
+
+
+ @Programmatic
+ @XmlTransient
+ public LinkedHashMap<String, FieldSet> getAllPropertyGroupsByName() {
+ final LinkedHashMap<String, FieldSet> propertyGroupsByName = Maps.newLinkedHashMap();
+
+ visit(new FCPage.VisitorAdapter() {
+ @Override
+ public void visit(final FieldSet fieldSet) {
+ propertyGroupsByName.put(fieldSet.getName(), fieldSet);
+ }
+ });
+ return propertyGroupsByName;
+ }
+
+
+ private String path;
+
+ @Programmatic
+ @XmlTransient
+ public String getPath() {
+ return path;
+ }
+
+ @Programmatic
+ public void setPath(final String path) {
+ this.path = path;
+ }
+
+
+ private boolean normalized;
+
+ @Programmatic
+ @XmlTransient
+ public boolean isNormalized() {
+ return normalized;
+ }
+
+ @Programmatic
+ public void setNormalized(final boolean normalized) {
+ this.normalized = normalized;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCTab.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCTab.java b/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCTab.java
new file mode 100644
index 0000000..eb6b35d
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCTab.java
@@ -0,0 +1,172 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.isis.applib.layout.fixedcols;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Lists;
+
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.layout.members.v1.CollectionLayoutData;
+import org.apache.isis.applib.layout.members.MemberRegion;
+import org.apache.isis.applib.layout.members.Owned;
+import org.apache.isis.applib.layout.members.v1.FieldSet;
+
+@XmlType(
+ name="tab"
+ , propOrder = {
+ "name"
+ , "left"
+ , "middle"
+ , "right"
+ }
+)
+public class FCTab implements FCColumnOwner, Serializable, Owned<FCTabGroup> {
+
+ private static final long serialVersionUID = 1L;
+
+ private String name;
+
+ @XmlAttribute(required = true)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+
+
+ private FCColumn left = new FCColumn();
+
+ @XmlElement(required = true)
+ public FCColumn getLeft() {
+ return left;
+ }
+
+ public void setLeft(final FCColumn left) {
+ this.left = left;
+ }
+
+
+ private FCColumn middle;
+
+ @XmlElement(required = false)
+ public FCColumn getMiddle() {
+ return middle;
+ }
+
+ public void setMiddle(final FCColumn middle) {
+ this.middle = middle;
+ }
+
+
+ private FCColumn right;
+
+ @XmlElement(required = false)
+ public FCColumn getRight() {
+ return right;
+ }
+
+ public void setRight(final FCColumn right) {
+ this.right = right;
+ }
+
+
+
+ private FCTabGroup owner;
+ /**
+ * Owner.
+ *
+ * <p>
+ * Set programmatically by framework after reading in from XML.
+ * </p>
+ */
+ @XmlTransient
+ public FCTabGroup getOwner() {
+ return owner;
+ }
+
+ public void setOwner(final FCTabGroup owner) {
+ this.owner = owner;
+ }
+
+ /**
+ * Aggregates the contents of all collections on this tab.
+ */
+ @Programmatic
+ public List<MemberRegion> getContents() {
+ final List<MemberRegion> contents = Lists.newArrayList();
+ appendContent(contents, getLeft());
+ appendContent(contents, getMiddle());
+ appendContent(contents, getRight());
+ return contents;
+ }
+
+
+
+
+ private String path;
+
+ @Programmatic
+ @XmlTransient
+ public String getPath() {
+ return path;
+ }
+
+ @Programmatic
+ public void setPath(final String path) {
+ this.path = path;
+ }
+
+
+
+ private static void appendContent(final List<MemberRegion> contents, final FCColumn FCColumn) {
+ if(FCColumn == null) {
+ return;
+ }
+ final List<FieldSet> fieldSets = FCColumn.getFieldSets();
+ if(fieldSets != null) {
+ contents.addAll(fieldSets);
+ }
+ final List<CollectionLayoutData> collectionLayoutDatas = FCColumn.getCollections();
+ if(collectionLayoutDatas != null) {
+ contents.addAll(collectionLayoutDatas);
+ }
+ }
+
+ public static class Predicates {
+ public static Predicate<FCTab> notEmpty() {
+ return new Predicate<FCTab>() {
+ @Override
+ public boolean apply(final FCTab FCTab) {
+ return !FCTab.getContents().isEmpty();
+ }
+ };
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCTabGroup.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCTabGroup.java b/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCTabGroup.java
new file mode 100644
index 0000000..2d6328a
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCTabGroup.java
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.isis.applib.layout.fixedcols;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.FluentIterable;
+
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.layout.members.Owned;
+
+@XmlType(
+ propOrder = {
+ "tabs"
+ }
+
+)
+public class FCTabGroup implements FCColumnOwner, Serializable, Owned<FCTabGroupOwner> {
+
+ private static final long serialVersionUID = 1L;
+
+ // must be at least one tab.
+ private List<FCTab> tabs = new ArrayList<FCTab>(){{
+ add(new FCTab());
+ }};
+
+
+
+ // no wrapper
+ @XmlElement(name = "tab", required = true)
+ public List<FCTab> getTabs() {
+ return tabs;
+ }
+
+ public void setTabs(List<FCTab> tabs) {
+ this.tabs = tabs;
+ }
+
+
+
+ private FCTabGroupOwner owner;
+
+ /**
+ * Owner.
+ *
+ * <p>
+ * Set programmatically by framework after reading in from XML.
+ * </p>
+ */
+ @XmlTransient
+ public FCTabGroupOwner getOwner() {
+ return owner;
+ }
+
+ public void setOwner(final FCTabGroupOwner owner) {
+ this.owner = owner;
+ }
+
+
+
+
+ private String path;
+
+ @Programmatic
+ @XmlTransient
+ public String getPath() {
+ return path;
+ }
+
+ @Programmatic
+ public void setPath(final String path) {
+ this.path = path;
+ }
+
+
+
+ public static class Predicates {
+ public static Predicate<FCTabGroup> notEmpty() {
+ return new Predicate<FCTabGroup>() {
+ @Override
+ public boolean apply(final FCTabGroup tabGroup) {
+ return FluentIterable
+ .from(tabGroup.getTabs())
+ .anyMatch(FCTab.Predicates.notEmpty());
+ }
+ };
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCTabGroupOwner.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCTabGroupOwner.java b/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCTabGroupOwner.java
new file mode 100644
index 0000000..2fb6431
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/FCTabGroupOwner.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.isis.applib.layout.fixedcols;
+
+import org.apache.isis.applib.layout.members.Owner;
+
+public interface FCTabGroupOwner extends Owner {
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/ObjectLayoutMetadata.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/ObjectLayoutMetadata.java b/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/ObjectLayoutMetadata.java
deleted file mode 100644
index 87566af..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/ObjectLayoutMetadata.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.isis.applib.layout.fixedcols;
-
-import java.io.Serializable;
-import java.util.LinkedHashMap;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-
-import com.google.common.collect.Maps;
-
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.layout.v1_0.ActionLayoutMetadata;
-import org.apache.isis.applib.layout.v1_0.ActionOwner;
-import org.apache.isis.applib.layout.v1_0.CollectionLayoutMetadata;
-import org.apache.isis.applib.layout.v1_0.ColumnOwner;
-import org.apache.isis.applib.layout.v1_0.PropertyGroupMetadata;
-import org.apache.isis.applib.layout.v1_0.PropertyLayoutMetadata;
-import org.apache.isis.applib.services.dto.Dto;
-
-@XmlRootElement(
- name = "objectLayout"
-)
-@XmlType(
- name = "objectLayout"
- , propOrder = {
- "actions"
- , "left"
- , "tabGroups"
- , "right"
- }
-)
-public class ObjectLayoutMetadata implements Dto, ActionOwner, Serializable, ColumnOwner, TabGroupOwner {
-
- private static final long serialVersionUID = 1L;
-
- private List<ActionLayoutMetadata> actions;
-
- @XmlElementWrapper(name = "actions", required = false)
- @XmlElement(name = "action", required = false)
- public List<ActionLayoutMetadata> getActions() {
- return actions;
- }
-
- public void setActions(List<ActionLayoutMetadata> actionLayoutMetadatas) {
- this.actions = actionLayoutMetadatas;
- }
-
-
-
- private ColumnMetadata left;
-
- @XmlElement(required = false)
- public ColumnMetadata getLeft() {
- return left;
- }
-
- public void setLeft(final ColumnMetadata left) {
- this.left = left;
- }
-
-
-
- private List<TabGroupMetadata> tabGroups;
-
- // no wrapper
- @XmlElement(name = "tabGroup", required = true)
- public List<TabGroupMetadata> getTabGroups() {
- return tabGroups;
- }
-
- public void setTabGroups(List<TabGroupMetadata> tabGroups) {
- this.tabGroups = tabGroups;
- }
-
-
-
- private ColumnMetadata right;
-
- @XmlElement(required = false)
- public ColumnMetadata getRight() {
- return right;
- }
-
- public void setRight(final ColumnMetadata right) {
- this.right = right;
- }
-
-
- public interface Visitor {
- void visit(final ObjectLayoutMetadata objectLayoutMetadata);
- void visit(final TabGroupMetadata tabGroup);
- void visit(final TabMetadata tabMetadata);
- void visit(final ColumnMetadata columnMetadata);
- void visit(final PropertyGroupMetadata propertyGroupMetadata);
- void visit(final PropertyLayoutMetadata propertyLayoutMetadata);
- void visit(final CollectionLayoutMetadata collectionLayoutMetadata);
- void visit(final ActionLayoutMetadata actionLayoutMetadata);
- }
-
- public static class VisitorAdapter implements Visitor {
- @Override
- public void visit(final ObjectLayoutMetadata objectLayoutMetadata) { }
- @Override
- public void visit(final TabGroupMetadata tabGroup) { }
- @Override
- public void visit(final TabMetadata tabMetadata) { }
- @Override
- public void visit(final ColumnMetadata columnMetadata) { }
- @Override
- public void visit(final PropertyGroupMetadata propertyGroupMetadata) {}
- @Override
- public void visit(final PropertyLayoutMetadata propertyLayoutMetadata) {}
- @Override
- public void visit(final CollectionLayoutMetadata collectionLayoutMetadata) {}
- @Override
- public void visit(final ActionLayoutMetadata actionLayoutMetadata) { }
- }
-
-
- /**
- * Visits all elements of the graph. The {@link Visitor} implementation
- * can assume that all "owner" references are populated.
- */
- public void visit(final Visitor visitor) {
- visitor.visit(this);
- traverseActions(this, visitor);
- traverseColumn(getLeft(), this, visitor);
- final List<TabGroupMetadata> tabGroups = getTabGroups();
- for (final TabGroupMetadata tabGroup : tabGroups) {
- tabGroup.setOwner(this);
- visitor.visit(tabGroup);
- final List<TabMetadata> tabs = tabGroup.getTabs();
- for (final TabMetadata tabMetadata : tabs) {
- tabMetadata.setOwner(tabGroup);
- visitor.visit(tabMetadata);
- traverseColumn(tabMetadata.getLeft(), tabMetadata, visitor);
- traverseColumn(tabMetadata.getMiddle(), tabMetadata, visitor);
- traverseColumn(tabMetadata.getRight(), tabMetadata, visitor);
- }
- }
- traverseColumn(getRight(), this, visitor);
- }
-
- private void traverseColumn(final ColumnMetadata columnMetadata, final ColumnOwner columnOwner, final Visitor visitor) {
- if(columnMetadata == null) {
- return;
- }
- columnMetadata.setOwner(columnOwner);
- visitor.visit(columnMetadata);
- traversePropertyGroups(columnMetadata, visitor);
- traverseCollections(columnMetadata, visitor);
- }
-
- private void traversePropertyGroups(final ColumnMetadata columnMetadata, final Visitor visitor) {
- for (final PropertyGroupMetadata propertyGroupMetadata : columnMetadata.getPropertyGroups()) {
- propertyGroupMetadata.setOwner(columnMetadata);
- visitor.visit(propertyGroupMetadata);
- traverseActions(propertyGroupMetadata, visitor);
- final List<PropertyLayoutMetadata> properties = propertyGroupMetadata.getProperties();
- for (final PropertyLayoutMetadata propertyLayoutMetadata : properties) {
- propertyLayoutMetadata.setOwner(propertyGroupMetadata);
- visitor.visit(propertyLayoutMetadata);
- traverseActions(propertyLayoutMetadata, visitor);
- }
- }
- }
-
- private void traverseCollections(final ColumnMetadata columnMetadata, final Visitor visitor) {
- for (final CollectionLayoutMetadata collectionLayoutMetadata : columnMetadata.getCollections()) {
- collectionLayoutMetadata.setOwner(columnMetadata);
- visitor.visit(collectionLayoutMetadata);
- traverseActions(collectionLayoutMetadata, visitor);
- }
- }
-
- private void traverseActions(final ActionOwner actionOwner, final Visitor visitor) {
- final List<ActionLayoutMetadata> actionLayoutMetadatas = actionOwner.getActions();
- if(actionLayoutMetadatas == null) {
- return;
- }
- for (final ActionLayoutMetadata actionLayoutMetadata : actionLayoutMetadatas) {
- actionLayoutMetadata.setOwner(actionOwner);
- visitor.visit(actionLayoutMetadata);
- }
- }
-
-
- @Programmatic
- @XmlTransient
- public LinkedHashMap<String, PropertyLayoutMetadata> getAllPropertiesById() {
- final LinkedHashMap<String, PropertyLayoutMetadata> propertiesById = Maps.newLinkedHashMap();
- visit(new ObjectLayoutMetadata.VisitorAdapter() {
- public void visit(final PropertyLayoutMetadata propertyLayoutMetadata) {
- propertiesById.put(propertyLayoutMetadata.getId(), propertyLayoutMetadata);
- }
- });
- return propertiesById;
- }
-
-
- @Programmatic
- @XmlTransient
- public LinkedHashMap<String, CollectionLayoutMetadata> getAllCollectionsById() {
- final LinkedHashMap<String, CollectionLayoutMetadata> collectionsById = Maps.newLinkedHashMap();
-
- visit(new ObjectLayoutMetadata.VisitorAdapter() {
- @Override
- public void visit(final CollectionLayoutMetadata collectionLayoutMetadata) {
- collectionsById.put(collectionLayoutMetadata.getId(), collectionLayoutMetadata);
- }
- });
- return collectionsById;
- }
-
-
- @Programmatic
- @XmlTransient
- public LinkedHashMap<String, ActionLayoutMetadata> getAllActionsById() {
- final LinkedHashMap<String, ActionLayoutMetadata> actionsById = Maps.newLinkedHashMap();
-
- visit(new ObjectLayoutMetadata.VisitorAdapter() {
- @Override
- public void visit(final ActionLayoutMetadata actionLayoutMetadata) {
- actionsById.put(actionLayoutMetadata.getId(), actionLayoutMetadata);
- }
- });
- return actionsById;
- }
-
-
- @Programmatic
- @XmlTransient
- public LinkedHashMap<String, TabMetadata> getAllTabsByName() {
- final LinkedHashMap<String, TabMetadata> tabsByName = Maps.newLinkedHashMap();
-
- visit(new ObjectLayoutMetadata.VisitorAdapter() {
- @Override
- public void visit(final TabMetadata tabMetadata) {
- tabsByName.put(tabMetadata.getName(), tabMetadata);
- }
- });
- return tabsByName;
- }
-
-
- @Programmatic
- @XmlTransient
- public LinkedHashMap<String, PropertyGroupMetadata> getAllPropertyGroupsByName() {
- final LinkedHashMap<String, PropertyGroupMetadata> propertyGroupsByName = Maps.newLinkedHashMap();
-
- visit(new ObjectLayoutMetadata.VisitorAdapter() {
- @Override
- public void visit(final PropertyGroupMetadata propertyGroupMetadata) {
- propertyGroupsByName.put(propertyGroupMetadata.getName(), propertyGroupMetadata);
- }
- });
- return propertyGroupsByName;
- }
-
-
- private String path;
-
- @Programmatic
- @XmlTransient
- public String getPath() {
- return path;
- }
-
- @Programmatic
- public void setPath(final String path) {
- this.path = path;
- }
-
-
- private boolean normalized;
-
- @Programmatic
- @XmlTransient
- public boolean isNormalized() {
- return normalized;
- }
-
- @Programmatic
- public void setNormalized(final boolean normalized) {
- this.normalized = normalized;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/TabGroupMetadata.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/TabGroupMetadata.java b/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/TabGroupMetadata.java
deleted file mode 100644
index 2e95386..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/TabGroupMetadata.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.isis.applib.layout.fixedcols;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.FluentIterable;
-
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.layout.v1_0.ColumnOwner;
-import org.apache.isis.applib.layout.v1_0.Owned;
-
-@XmlType(
- propOrder = {
- "tabs"
- }
-
-)
-public class TabGroupMetadata implements ColumnOwner, Serializable, Owned<TabGroupOwner> {
-
- private static final long serialVersionUID = 1L;
-
- // must be at least one tab.
- private List<TabMetadata> tabs = new ArrayList<TabMetadata>(){{
- add(new TabMetadata());
- }};
-
-
-
- // no wrapper
- @XmlElement(name = "tab", required = true)
- public List<TabMetadata> getTabs() {
- return tabs;
- }
-
- public void setTabs(List<TabMetadata> tabs) {
- this.tabs = tabs;
- }
-
-
-
- private TabGroupOwner owner;
-
- /**
- * Owner.
- *
- * <p>
- * Set programmatically by framework after reading in from XML.
- * </p>
- */
- @XmlTransient
- public TabGroupOwner getOwner() {
- return owner;
- }
-
- public void setOwner(final TabGroupOwner owner) {
- this.owner = owner;
- }
-
-
-
-
- private String path;
-
- @Programmatic
- @XmlTransient
- public String getPath() {
- return path;
- }
-
- @Programmatic
- public void setPath(final String path) {
- this.path = path;
- }
-
-
-
- public static class Predicates {
- public static Predicate<TabGroupMetadata> notEmpty() {
- return new Predicate<TabGroupMetadata>() {
- @Override
- public boolean apply(final TabGroupMetadata tabGroup) {
- return FluentIterable
- .from(tabGroup.getTabs())
- .anyMatch(TabMetadata.Predicates.notEmpty());
- }
- };
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/10d80f3a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/TabGroupOwner.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/TabGroupOwner.java b/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/TabGroupOwner.java
deleted file mode 100644
index ab118c8..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/fixedcols/TabGroupOwner.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.isis.applib.layout.fixedcols;
-
-import org.apache.isis.applib.layout.v1_0.Owner;
-
-public interface TabGroupOwner extends Owner {
-
-}