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/02/02 01:36:01 UTC
[04/15] isis git commit: ISIS-993: use a single layoutMetadata hint
in EntityModel, rather than many different hints. Also,
moved FC classes under a new "fixedcols" layout.
ISIS-993: use a single layoutMetadata hint in EntityModel, rather than many different hints. Also, moved FC classes under a new "fixedcols" layout.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/84c9cf75
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/84c9cf75
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/84c9cf75
Branch: refs/heads/ISIS-993
Commit: 84c9cf7585ddb4d8870c423643025bc29ca1df63
Parents: d7a1ee2
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sun Jan 31 20:44:45 2016 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sun Jan 31 20:45:20 2016 +0100
----------------------------------------------------------------------
.../applib/layout/bootstrap3/bootstrap3.xsd | 6 +-
.../isis/applib/layout/bootstrap3/BS3Col.java | 13 +-
.../isis/applib/layout/fixedcols/FCColumn.java | 10 +-
.../ComponentFactoryRegistrarDefault.java | 2 +-
.../model/models/EntityCollectionModel.java | 2 +-
.../viewer/wicket/model/models/EntityModel.java | 91 +----------
.../components/entity/EntityPanelFactory.java | 2 +-
.../collections/EntityCollectionsPanel.html | 32 ----
.../collections/EntityCollectionsPanel.java | 151 -------------------
.../EntityCollectionsPanelFactory.java | 49 ------
.../components/entity/column/EntityColumn.java | 27 +++-
.../entity/propgroup/PropertyGroup.html | 41 -----
.../entity/propgroup/PropertyGroup.java | 122 ---------------
.../propsandcolls/EntityPropsAndCollsForm.java | 10 +-
.../propsandcolls/EntityPropsAndCollsPanel.java | 2 +-
.../EntityPropsAndCollsPanelFactory.java | 2 +-
.../entity/tabbed/EntityTabbedPanel.html | 34 -----
.../entity/tabbed/EntityTabbedPanel.java | 114 --------------
.../entity/tabgroup/TabGroupPanel.java | 104 -------------
.../entity/tabgrouplist/TabGroupListPanel.html | 28 ----
.../entity/tabgrouplist/TabGroupListPanel.java | 67 --------
.../ui/components/entity/tabpanel/TabPanel.html | 31 ----
.../ui/components/entity/tabpanel/TabPanel.java | 24 ---
.../fixedcols/EntityCollectionsPanel.html | 32 ++++
.../fixedcols/EntityCollectionsPanel.java | 151 +++++++++++++++++++
.../EntityCollectionsPanelFactory.java | 49 ++++++
.../layout/fixedcols/EntityTabbedPanel.html | 34 +++++
.../layout/fixedcols/EntityTabbedPanel.java | 113 ++++++++++++++
.../layout/fixedcols/PropertyGroup.html | 41 +++++
.../layout/fixedcols/PropertyGroup.java | 122 +++++++++++++++
.../layout/fixedcols/TabGroupListPanel.html | 28 ++++
.../layout/fixedcols/TabGroupListPanel.java | 66 ++++++++
.../layout/fixedcols/TabGroupPanel.java | 103 +++++++++++++
.../components/layout/fixedcols/TabPanel.html | 31 ++++
.../components/layout/fixedcols/TabPanel.java | 24 +++
.../dom/simple/SimpleObject.layout-BS3.xml | 28 ++--
.../dom/simple/SimpleObject.layout.xml | 2 +
37 files changed, 857 insertions(+), 931 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/adocs/documentation/src/main/asciidoc/schema/applib/layout/bootstrap3/bootstrap3.xsd
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/schema/applib/layout/bootstrap3/bootstrap3.xsd b/adocs/documentation/src/main/asciidoc/schema/applib/layout/bootstrap3/bootstrap3.xsd
index 0505e4d..db16d1a 100644
--- a/adocs/documentation/src/main/asciidoc/schema/applib/layout/bootstrap3/bootstrap3.xsd
+++ b/adocs/documentation/src/main/asciidoc/schema/applib/layout/bootstrap3/bootstrap3.xsd
@@ -53,9 +53,9 @@
<xs:element ref="ns1:collection" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="span" type="xs:int" use="required"/>
- <xs:attribute name="unreferencedActions" type="xs:boolean" use="required"/>
- <xs:attribute name="unreferencedCollections" type="xs:boolean" use="required"/>
- <xs:attribute name="unreferencedProperties" type="xs:boolean" use="required"/>
+ <xs:attribute name="unreferencedActions" type="xs:boolean" use="optional"/>
+ <xs:attribute name="unreferencedCollections" type="xs:boolean" use="optional"/>
+ <xs:attribute name="unreferencedProperties" type="xs:boolean" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/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
index 5f687c8..8118add 100644
--- 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
@@ -43,13 +43,6 @@ import org.apache.isis.applib.layout.common.FieldSet;
* </p>
*
* <p>
- * It is also possible for them to contain specifically identified {@link ActionLayoutData action}s and even the domain object's
- * {@link DomainObjectLayoutData title and icon}. Most pages however tend to show these elements in a top-level
- * header, and so if that's the case then use the page's {@link BS3Page#setHeader(boolean) header} attribute that
- * is provided as a convenience.
- * </p>
- *
- * <p>
* It is rendered as a (eg) <div class="col-md-4 ...">
* </p>
*/
@@ -94,7 +87,7 @@ public class BS3Col extends BS3RowContent {
* </p>
*/
@XmlAttribute(required = false)
- public boolean isUnreferencedActions() {
+ public boolean getUnreferencedActions() {
return unreferencedActions;
}
@@ -112,7 +105,7 @@ public class BS3Col extends BS3RowContent {
* </p>
*/
@XmlAttribute(required = false)
- public boolean isUnreferencedProperties() {
+ public boolean getUnreferencedProperties() {
return unreferencedProperties;
}
@@ -130,7 +123,7 @@ public class BS3Col extends BS3RowContent {
* </p>
*/
@XmlAttribute(required = false)
- public boolean isUnreferencedCollections() {
+ public boolean getUnreferencedCollections() {
return unreferencedCollections;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/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
index a11b459..80e5207 100644
--- 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
@@ -162,13 +162,13 @@ public class FCColumn implements Serializable, MemberRegionOwner, Owned<FCColumn
throw new IllegalStateException();
}
- public FCColumn from(final FCTab FCTab) {
- if(FCTab == null) {
+ 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();
+ 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/84c9cf75/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java b/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
index c150cf0..b328c85 100644
--- a/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
+++ b/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
@@ -39,7 +39,7 @@ import org.apache.isis.viewer.wicket.ui.components.collectioncontents.multiple.C
import org.apache.isis.viewer.wicket.ui.components.collectioncontents.summary.CollectionContentsAsSummaryFactory;
import org.apache.isis.viewer.wicket.ui.components.collectioncontents.unresolved.CollectionContentsAsUnresolvedPanelFactory;
import org.apache.isis.viewer.wicket.ui.components.empty.EmptyCollectionPanelFactory;
-import org.apache.isis.viewer.wicket.ui.components.entity.collections.EntityCollectionsPanelFactory;
+import org.apache.isis.viewer.wicket.ui.components.layout.fixedcols.EntityCollectionsPanelFactory;
import org.apache.isis.viewer.wicket.ui.components.entity.header.EntityHeaderPanelFactory;
import org.apache.isis.viewer.wicket.ui.components.entity.icontitle.EntityIconAndTitlePanelFactory;
import org.apache.isis.viewer.wicket.ui.components.entity.icontitle.EntityIconTitleAndCopyLinkPanelFactory;
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java
index d27f624..76ed8bc 100644
--- a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java
+++ b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java
@@ -325,7 +325,7 @@ public class EntityCollectionModel extends ModelAbstract<List<ObjectAdapter>> im
}
private EntityCollectionModel(final EntityModel entityModel) {
- this(entityModel.getObjectAdapterMemento(), entityModel.getCollectionLayoutData());
+ this(entityModel.getObjectAdapterMemento(), (CollectionLayoutData) entityModel.getLayoutMetadata());
}
private EntityCollectionModel(final ObjectAdapterMemento parentObjectAdapterMemento, final CollectionLayoutData collectionLayoutData) {
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
index 54ece97..d99b2a4 100644
--- a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
+++ b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
@@ -29,10 +29,7 @@ import org.apache.wicket.model.Model;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.layout.common.CollectionLayoutData;
-import org.apache.isis.applib.layout.common.FieldSet;
import org.apache.isis.applib.layout.fixedcols.FCColumn.Hint;
-import org.apache.isis.applib.layout.fixedcols.FCTab;
import org.apache.isis.applib.services.memento.MementoService.Memento;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager.ConcurrencyChecking;
@@ -645,100 +642,22 @@ public class EntityModel extends BookmarkableModel<ObjectAdapter> {
// tab and column metadata (if any)
// //////////////////////////////////////////////////////////
- private Object tabGroupListMetadata;
+ private Object layoutMetadata;
- public Object getTabGroupListMetadata() {
- return tabGroupListMetadata;
+ public Object getLayoutMetadata() {
+ return layoutMetadata;
}
/**
* Returns a new copy that SHARES the property scalar models (for edit form).
*/
- public EntityModel cloneWithTabGroupListMetadata(final Object tabGroupListMetadata) {
+ public EntityModel cloneWithLayoutMetadata(final Object layoutMetadata) {
final EntityModel entityModel = new EntityModel(this.adapterMemento, this.propertyScalarModels);
- entityModel.tabGroupListMetadata = tabGroupListMetadata;
+ entityModel.layoutMetadata = layoutMetadata;
return entityModel;
}
- private Object fcTabGroup;
-
- public Object getFCTabGroup() {
- return fcTabGroup;
- }
-
- /**
- * Returns a new copy that SHARES the property scalar models (for edit form).
- */
- public EntityModel cloneWithTabGroupMetadata(final Object fcTabgroup) {
- final EntityModel entityModel = new EntityModel(this.adapterMemento, this.propertyScalarModels);
- entityModel.fcTabGroup = fcTabgroup;
- return entityModel;
- }
-
-
- private Object fcTab;
-
- public Object getFCTab() {
- return fcTab;
- }
-
- /**
- * Returns a new copy that SHARES the property scalar models (for edit form).
- */
- public EntityModel cloneWithTabMetadata(final FCTab fcTab) {
- final EntityModel entityModel = new EntityModel(this.adapterMemento, this.propertyScalarModels);
- entityModel.fcTab = fcTab;
- return entityModel;
- }
-
-
- private Object fcColumn;
-
- public Object getFCColumn() {
- return fcColumn;
- }
-
- /**
- * Returns a new copy that SHARES the property scalar models (for edit form).
- */
- public EntityModel cloneWithColumnMetadata(final Object fcColumn) {
- final EntityModel entityModel = new EntityModel(this.adapterMemento, this.propertyScalarModels);
- entityModel.fcColumn = fcColumn;
- return entityModel;
- }
-
-
- private FieldSet fieldSet;
- public FieldSet getFieldSet() {
- return fieldSet;
- }
-
- /**
- * Returns a new copy that SHARES the property scalar models (for edit form).
- */
- public EntityModel cloneWithPropertyGroupMetadata(
- final FieldSet fieldSet) {
- final EntityModel entityModel = new EntityModel(this.adapterMemento, this.propertyScalarModels);
- entityModel.fieldSet = fieldSet;
- return entityModel;
- }
-
-
- private CollectionLayoutData collectionLayoutData;
- public CollectionLayoutData getCollectionLayoutData() {
- return collectionLayoutData;
- }
-
- /**
- * Returns a new copy that SHARES the property scalar models.
- */
- public EntityModel cloneWithCollectionLayoutMetadata(
- final CollectionLayoutData collectionLayoutData) {
- final EntityModel entityModel = new EntityModel(this.adapterMemento, this.propertyScalarModels);
- entityModel.collectionLayoutData = collectionLayoutData;
- return entityModel;
- }
@Override
protected void doSetHint(final String scopeKey, final String attributeName, final String value) {
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/EntityPanelFactory.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/EntityPanelFactory.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/EntityPanelFactory.java
index c187f2a..1463e80 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/EntityPanelFactory.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/EntityPanelFactory.java
@@ -30,7 +30,7 @@ import org.apache.isis.viewer.wicket.model.models.EntityModel;
import org.apache.isis.viewer.wicket.ui.ComponentFactory;
import org.apache.isis.viewer.wicket.ui.ComponentType;
import org.apache.isis.viewer.wicket.ui.components.entity.editable.EntityEditablePanel;
-import org.apache.isis.viewer.wicket.ui.components.entity.tabbed.EntityTabbedPanel;
+import org.apache.isis.viewer.wicket.ui.components.layout.fixedcols.EntityTabbedPanel;
/**
* {@link ComponentFactory} for {@link EntityTabbedPanel}.
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.html
deleted file mode 100644
index 0e03ea9..0000000
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <body>
- <wicket:panel>
- <div class="entityCollectionsPanel entityCollectionsComponentType">
- <div wicket:id="collections">
- <div wicket:id="collection">
- [collection]
- </div>
- </div>
- </div>
- </wicket:panel>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.java
deleted file mode 100644
index 61fb3f3..0000000
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.java
+++ /dev/null
@@ -1,151 +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.viewer.wicket.ui.components.entity.collections;
-
-import java.util.Comparator;
-import java.util.List;
-
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.ImmutableList;
-
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.repeater.RepeatingView;
-
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.applib.filter.Filter;
-import org.apache.isis.applib.filter.Filters;
-import org.apache.isis.applib.layout.common.CollectionLayoutData;
-import org.apache.isis.applib.layout.fixedcols.FCColumn;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
-import org.apache.isis.core.metamodel.facets.members.order.MemberOrderFacet;
-import org.apache.isis.core.metamodel.spec.feature.Contributed;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.core.runtime.services.DeweyOrderComparator;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.ui.components.entity.collection.EntityCollectionPanel;
-import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-
-/**
- * {@link PanelAbstract Panel} representing the properties of an entity, as per
- * the provided {@link EntityModel}.
- */
-public class EntityCollectionsPanel extends PanelAbstract<EntityModel> {
-
- private static final long serialVersionUID = 1L;
-
- private static final String ID_ENTITY_COLLECTIONS = "entityCollections";
- private static final String ID_COLLECTIONS = "collections";
- private static final String ID_COLLECTION = "collection";
-
- // view metadata (if any available)
- private final FCColumn FCColumnIfAny;
-
- public EntityCollectionsPanel(final String id, final EntityModel entityModel) {
- super(id, entityModel);
-
- FCColumnIfAny = (FCColumn) entityModel.getFCColumn();
-
- buildGui();
- }
-
- private void buildGui() {
- buildEntityPropertiesAndOrCollectionsGui();
- setOutputMarkupId(true); // so can repaint via ajax
- }
-
- private void buildEntityPropertiesAndOrCollectionsGui() {
- final EntityModel model = getModel();
- final ObjectAdapter adapter = model.getObject();
- if (adapter != null) {
- addCollections();
- } else {
- permanentlyHide(ID_ENTITY_COLLECTIONS);
- }
- }
-
- private void addCollections() {
- final EntityModel entityModel = getModel();
- final ObjectAdapter adapter = entityModel.getObject();
-
- final Filter<ObjectAssociation> filter;
- if (FCColumnIfAny != null) {
- final ImmutableList<String> collectionIds = FluentIterable
- .from(FCColumnIfAny.getCollections())
- .transform(CollectionLayoutData.Functions.id())
- .toList();
- filter = new Filter<ObjectAssociation>() {
- @Override
- public boolean accept(final ObjectAssociation objectAssociation) {
- return collectionIds.contains(objectAssociation.getId());
- }
- };
- } else {
- filter = Filters.any();
- }
-
- final List<ObjectAssociation> associations = visibleCollections(adapter, filter);
- associations.sort(new Comparator<ObjectAssociation>() {
- private final DeweyOrderComparator deweyOrderComparator = new DeweyOrderComparator();
- @Override
- public int compare(final ObjectAssociation o1, final ObjectAssociation o2) {
- final MemberOrderFacet o1Facet = o1.getFacet(MemberOrderFacet.class);
- final MemberOrderFacet o2Facet = o2.getFacet(MemberOrderFacet.class);
- return o1Facet == null? +1:
- o2Facet == null? -1:
- deweyOrderComparator.compare(o1Facet.sequence(), o2Facet.sequence());
- }
- });
-
- final RepeatingView collectionRv = new RepeatingView(ID_COLLECTIONS);
- add(collectionRv);
-
- for (final ObjectAssociation association : associations) {
-
- final WebMarkupContainer collectionRvContainer = new WebMarkupContainer(collectionRv.newChildId());
- collectionRv.add(collectionRvContainer);
-
- final CollectionLayoutData collectionLayoutData = new CollectionLayoutData(association.getId());
- final EntityModel entityModelWithCollectionLayoutMetadata =
- entityModel.cloneWithCollectionLayoutMetadata(collectionLayoutData);
-
- collectionRvContainer.add(new EntityCollectionPanel(ID_COLLECTION, entityModelWithCollectionLayoutMetadata));
- }
- }
-
- private static List<ObjectAssociation> visibleCollections(
- final ObjectAdapter adapter,
- final Filter<ObjectAssociation> filter) {
- return adapter.getSpecification().getAssociations(
- Contributed.INCLUDED, visibleCollectionsFilter(adapter, filter));
- }
-
- @SuppressWarnings("unchecked")
- private static Filter<ObjectAssociation> visibleCollectionsFilter(
- final ObjectAdapter adapter,
- final Filter<ObjectAssociation> filter) {
- return Filters.and(
- ObjectAssociation.Filters.COLLECTIONS,
- ObjectAssociation.Filters.dynamicallyVisible(
- adapter, InteractionInitiatedBy.USER, Where.PARENTED_TABLES),
- filter);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanelFactory.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanelFactory.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanelFactory.java
deleted file mode 100644
index e2947a0..0000000
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanelFactory.java
+++ /dev/null
@@ -1,49 +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.viewer.wicket.ui.components.entity.collections;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.model.IModel;
-
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.ui.ComponentFactory;
-import org.apache.isis.viewer.wicket.ui.ComponentType;
-import org.apache.isis.viewer.wicket.ui.components.entity.EntityComponentFactoryAbstract;
-
-/**
- * {@link ComponentFactory} for {@link EntityCollectionsPanel}.
- */
-public class EntityCollectionsPanelFactory extends EntityComponentFactoryAbstract {
-
- private static final long serialVersionUID = 1L;
-
- public EntityCollectionsPanelFactory() {
- super(ComponentType.ENTITY_COLLECTIONS, EntityCollectionsPanel.class);
- }
-
- @Override
- public Component createComponent(final String id, final IModel<?> model) {
- final EntityModel entityModel = (EntityModel) model;
- return new EntityCollectionsPanel(id, entityModel);
- }
-}
-
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/column/EntityColumn.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/column/EntityColumn.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/column/EntityColumn.java
index 07fd0e9..e1cfe87 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/column/EntityColumn.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/column/EntityColumn.java
@@ -31,9 +31,9 @@ import org.apache.wicket.MarkupContainer;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.repeater.RepeatingView;
-import org.apache.isis.applib.layout.fixedcols.FCColumn;
import org.apache.isis.applib.layout.common.FieldSet;
import org.apache.isis.applib.layout.common.PropertyLayoutData;
+import org.apache.isis.applib.layout.fixedcols.FCColumn;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.facets.object.membergroups.MemberGroupLayoutFacet;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
@@ -44,6 +44,7 @@ import org.apache.isis.core.runtime.system.context.IsisContext;
import org.apache.isis.viewer.wicket.model.models.EntityModel;
import org.apache.isis.viewer.wicket.ui.ComponentType;
import org.apache.isis.viewer.wicket.ui.components.entity.PropUtil;
+import org.apache.isis.viewer.wicket.ui.components.layout.fixedcols.PropertyGroup;
import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
import org.apache.isis.viewer.wicket.ui.util.Components;
@@ -66,18 +67,32 @@ public class EntityColumn extends PanelAbstract<EntityModel> {
// view metadata (populated for EntityTabbedPanel, absent for EntityEditablePanel)
private final FCColumn columnMetaDataIfAny;
+
// which column to render (populated for EntityEditablePanel, not required and so absent for EntityTabbedPanel)
final FCColumn.Hint hint;
+ private static FCColumn.Hint hintFrom(final EntityModel entityModel) {
+ final FCColumn fcColumn = (FCColumn) entityModel.getLayoutMetadata();
+ return fcColumn.getHint();
+ }
+
+
public EntityColumn(
final String id,
final EntityModel entityModel) {
+ this(id, entityModel, hintFrom(entityModel));
+ }
+
+ public EntityColumn(
+ final String id,
+ final EntityModel entityModel,
+ final FCColumn.Hint hint) {
+
super(id, entityModel);
- columnMetaDataIfAny = (FCColumn) entityModel.getFCColumn();
- final FCColumn fcColumn = (FCColumn) entityModel.getFCColumn();
- hint = fcColumn.getHint();
+ columnMetaDataIfAny = (FCColumn) entityModel.getLayoutMetadata();
+ this.hint = hint;
buildGui();
}
@@ -143,8 +158,8 @@ public class EntityColumn extends PanelAbstract<EntityModel> {
final String id = memberGroupRv.newChildId();
- final EntityModel entityModelWithHints = entityModel.cloneWithPropertyGroupMetadata(fieldSet);
- final WebMarkupContainer memberGroupRvContainer = new org.apache.isis.viewer.wicket.ui.components.entity.propgroup.PropertyGroup(id, entityModelWithHints);
+ final EntityModel entityModelWithHints = entityModel.cloneWithLayoutMetadata(fieldSet);
+ final WebMarkupContainer memberGroupRvContainer = new PropertyGroup(id, entityModelWithHints);
memberGroupRv.add(memberGroupRvContainer);
}
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propgroup/PropertyGroup.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propgroup/PropertyGroup.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propgroup/PropertyGroup.html
deleted file mode 100644
index 38245a0..0000000
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propgroup/PropertyGroup.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <body>
- <wicket:panel>
- <fieldset class="memberGroup">
- <div class="panel panel-default">
- <div class="panel-heading">
- <span wicket:id="memberGroupName" class="panel-title">[group name]</span>
- <div class="pull-right additionalLinks">
- <div wicket:id="associatedActionLinksPanel"></div>
- <div wicket:id="associatedActionLinksPanelDropDown"></div>
- </div>
- </div>
- <div class="properties panel-body">
- <div wicket:id="properties">
- <div wicket:id="property" class="property">[property]</div>
- </div>
- </div>
- </div>
- </fieldset>
- </wicket:panel>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propgroup/PropertyGroup.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propgroup/PropertyGroup.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propgroup/PropertyGroup.java
deleted file mode 100644
index 6a13547..0000000
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propgroup/PropertyGroup.java
+++ /dev/null
@@ -1,122 +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.viewer.wicket.ui.components.entity.propgroup;
-
-import java.util.List;
-
-import com.google.common.collect.Lists;
-
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.repeater.RepeatingView;
-
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.layout.common.FieldSet;
-import org.apache.isis.applib.layout.common.PropertyLayoutData;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
-import org.apache.isis.viewer.wicket.model.links.LinkAndLabel;
-import org.apache.isis.viewer.wicket.model.mementos.PropertyMemento;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.model.models.ScalarModel;
-import org.apache.isis.viewer.wicket.ui.ComponentType;
-import org.apache.isis.viewer.wicket.ui.components.actionmenu.entityactions.AdditionalLinksPanel;
-import org.apache.isis.viewer.wicket.ui.components.actionmenu.entityactions.EntityActionUtil;
-import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-
-public class PropertyGroup extends PanelAbstract<EntityModel> {
-
- private static final String ID_MEMBER_GROUP_NAME = "memberGroupName";
-
- private static final String ID_ASSOCIATED_ACTION_LINKS_PANEL = "associatedActionLinksPanel";
- private static final String ID_ASSOCIATED_ACTION_LINKS_PANEL_DROPDOWN = "associatedActionLinksPanelDropDown";
-
- private static final String ID_PROPERTIES = "properties";
- private static final String ID_PROPERTY = "property";
-
- private final FieldSet fieldSet;
-
- public PropertyGroup(final String id, final EntityModel model) {
- super(id, model);
- fieldSet = model.getFieldSet();
-
- buildGui();
- }
-
- public EntityModel getModel() {
- return (EntityModel) getDefaultModel();
- }
-
- private void buildGui() {
- String groupName = fieldSet.getName();
- final ObjectAdapter adapter = getModel().getObject();
-
- add(new Label(ID_MEMBER_GROUP_NAME, groupName));
-
- final List<LinkAndLabel> memberGroupActions = Lists.newArrayList();
-
- final RepeatingView propertyRv = new RepeatingView(ID_PROPERTIES);
- add(propertyRv);
-
- final List<PropertyLayoutData> properties = fieldSet.getProperties();
- for (PropertyLayoutData property : properties) {
- final ObjectAssociation association = adapter.getSpecification().getAssociation(property.getId());
-
- final WebMarkupContainer propertyRvContainer = new WebMarkupContainer(propertyRv.newChildId());
- propertyRv.add(propertyRvContainer);
-
- addPropertyToForm(getModel(), (OneToOneAssociation) association, propertyRvContainer,
- memberGroupActions);
- }
-
- final List<LinkAndLabel> actionsPanel = LinkAndLabel
- .positioned(memberGroupActions, ActionLayout.Position.PANEL);
- final List<LinkAndLabel> actionsPanelDropDown = LinkAndLabel
- .positioned(memberGroupActions, ActionLayout.Position.PANEL_DROPDOWN);
-
- AdditionalLinksPanel.addAdditionalLinks(
- this, ID_ASSOCIATED_ACTION_LINKS_PANEL,
- actionsPanel,
- AdditionalLinksPanel.Style.INLINE_LIST);
- AdditionalLinksPanel.addAdditionalLinks(
- this, ID_ASSOCIATED_ACTION_LINKS_PANEL_DROPDOWN,
- actionsPanelDropDown,
- AdditionalLinksPanel.Style.DROPDOWN);
- }
-
- private void addPropertyToForm(
- final EntityModel entityModel,
- final OneToOneAssociation otoa,
- final WebMarkupContainer container,
- final List<LinkAndLabel> entityActions) {
- final PropertyMemento pm = new PropertyMemento(otoa);
-
- final ScalarModel scalarModel = entityModel.getPropertyModel(pm);
- getComponentFactoryRegistry()
- .addOrReplaceComponent(container, ID_PROPERTY, ComponentType.SCALAR_NAME_AND_VALUE, scalarModel);
-
- final List<ObjectAction> associatedActions =
- EntityActionUtil.getObjectActionsForAssociation(entityModel, otoa, getDeploymentCategory());
-
- entityActions.addAll(
- EntityActionUtil.asLinkAndLabelsForAdditionalLinksPanel(entityModel, associatedActions));
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propsandcolls/EntityPropsAndCollsForm.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propsandcolls/EntityPropsAndCollsForm.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propsandcolls/EntityPropsAndCollsForm.java
index c850a2d..6952325 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propsandcolls/EntityPropsAndCollsForm.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propsandcolls/EntityPropsAndCollsForm.java
@@ -127,7 +127,7 @@ public class EntityPropsAndCollsForm extends FormAbstract<ObjectAdapter> impleme
private void buildGui() {
final EntityModel entityModel = (EntityModel) getModel();
- final FCTab FCTabMetaDataIfAny = (FCTab) entityModel.getFCTab();
+ final FCTab FCTabMetaDataIfAny = (FCTab) entityModel.getLayoutMetadata();
final ColumnSpans columnSpans;
if(FCTabMetaDataIfAny != null) {
@@ -233,14 +233,14 @@ public class EntityPropsAndCollsForm extends FormAbstract<ObjectAdapter> impleme
private void addPropertiesAndCollections(
final MarkupContainer markupContainer,
final EntityModel entityModel,
- final FCTab FCTabMetaDataIfAny,
+ final FCTab fcTabMetaDataIfAny,
final Hint hint) {
- final FCColumn columnMetaDataIfAny = hint.from(FCTabMetaDataIfAny);
+ final FCColumn columnMetaDataIfAny = hint.from(fcTabMetaDataIfAny);
- final EntityModel entityModelWithHints = entityModel.cloneWithColumnMetadata(columnMetaDataIfAny);
+ final EntityModel entityModelWithHints = entityModel.cloneWithLayoutMetadata(columnMetaDataIfAny);
final EntityColumn columnMembers =
- new EntityColumn(ID_ENTITY_COLUMN, entityModelWithHints);
+ new EntityColumn(ID_ENTITY_COLUMN, entityModelWithHints, hint);
markupContainer.add(columnMembers);
}
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propsandcolls/EntityPropsAndCollsPanel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propsandcolls/EntityPropsAndCollsPanel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propsandcolls/EntityPropsAndCollsPanel.java
index a11a234..62d188e 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propsandcolls/EntityPropsAndCollsPanel.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propsandcolls/EntityPropsAndCollsPanel.java
@@ -22,7 +22,7 @@ package org.apache.isis.viewer.wicket.ui.components.entity.propsandcolls;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.viewer.wicket.model.models.EntityModel;
import org.apache.isis.viewer.wicket.ui.components.entity.editable.EntityEditablePanel;
-import org.apache.isis.viewer.wicket.ui.components.entity.tabbed.EntityTabbedPanel;
+import org.apache.isis.viewer.wicket.ui.components.layout.fixedcols.EntityTabbedPanel;
import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
/**
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propsandcolls/EntityPropsAndCollsPanelFactory.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propsandcolls/EntityPropsAndCollsPanelFactory.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propsandcolls/EntityPropsAndCollsPanelFactory.java
index bdaeeda..3352bb7 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propsandcolls/EntityPropsAndCollsPanelFactory.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/propsandcolls/EntityPropsAndCollsPanelFactory.java
@@ -27,7 +27,7 @@ import org.apache.isis.viewer.wicket.ui.ComponentFactory;
import org.apache.isis.viewer.wicket.ui.ComponentType;
import org.apache.isis.viewer.wicket.ui.components.entity.EntityComponentFactoryAbstract;
import org.apache.isis.viewer.wicket.ui.components.entity.editable.EntityEditablePanel;
-import org.apache.isis.viewer.wicket.ui.components.entity.tabbed.EntityTabbedPanel;
+import org.apache.isis.viewer.wicket.ui.components.layout.fixedcols.EntityTabbedPanel;
/**
* {@link ComponentFactory} for {@link EntityPropsAndCollsPanel}.
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.html
deleted file mode 100644
index 7b172aa..0000000
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<html xmlns:wicket="http://wicket.apache.org">
-<body>
-<wicket:panel>
- <div class="entityTabbed">
- <div wicket:id="entitySummary"></div>
-
- <div class="row">
- <div wicket:id="leftColumn" class = "leftColumn"/>
- <div wicket:id="middleColumn" class="middleColumn"/>
- <div wicket:id="rightColumn" class = "rightColumn"/>
- </div>
- </div>
-</wicket:panel>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.java
deleted file mode 100644
index 38aa516..0000000
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.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.viewer.wicket.ui.components.entity.tabbed;
-
-import java.util.List;
-
-import com.google.common.collect.FluentIterable;
-
-import org.apache.isis.applib.layout.fixedcols.FCColumn;
-import org.apache.isis.applib.layout.fixedcols.FCPage;
-import org.apache.isis.applib.layout.fixedcols.FCTabGroup;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacet;
-import org.apache.isis.core.metamodel.facets.object.layoutmetadata.PageFacet;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.ui.ComponentType;
-import org.apache.isis.viewer.wicket.ui.components.entity.column.EntityColumn;
-import org.apache.isis.viewer.wicket.ui.components.entity.tabgrouplist.TabGroupListPanel;
-import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-import org.apache.isis.viewer.wicket.ui.util.CssClassAppender;
-
-/**
- * {@link PanelAbstract Panel} to represent an entity on a single page made up
- * of several <div> regions.
- */
-public class EntityTabbedPanel extends PanelAbstract<EntityModel> {
-
- private static final long serialVersionUID = 1L;
-
- private static final String ID_LEFT_COLUMN = "leftColumn";
- private static final String ID_MIDDLE_COLUMN = "middleColumn";
- private static final String ID_RIGHT_COLUMN = "rightColumn";
-
- public EntityTabbedPanel(final String id, final EntityModel entityModel) {
- super(id, entityModel);
- buildGui();
- }
-
- private void buildGui() {
- final EntityModel model = getModel();
- final ObjectAdapter objectAdapter = model.getObject();
- final CssClassFacet facet = objectAdapter.getSpecification().getFacet(CssClassFacet.class);
- if(facet != null) {
- final String cssClass = facet.cssClass(objectAdapter);
- CssClassAppender.appendCssClassTo(this, cssClass);
- }
-
- // forces metadata to be derived && synced
- final PageFacet PageFacet = model.getTypeOfSpecification().getFacet(PageFacet.class);
- final FCPage page = (FCPage) PageFacet.getPage();
-
-
- addOrReplace(ComponentType.ENTITY_SUMMARY, model);
-
- final int leftSpan = addColumnIfRequired(ID_LEFT_COLUMN, page.getLeft());
-
- final TabGroupListPanel middleTabs = addTabGroups(ID_MIDDLE_COLUMN, page.getTabGroups());
-
- final int rightSpan = addColumnIfRequired(ID_RIGHT_COLUMN, page.getRight());
-
- final int columnSpans = leftSpan + rightSpan;
- int tabGroupSpan = columnSpans < 12 ? 12 - (columnSpans) : 12;
- CssClassAppender.appendCssClassTo(middleTabs, "col-xs-" + tabGroupSpan);
-
- }
-
- private TabGroupListPanel addTabGroups(
- final String id, final List<FCTabGroup> tabGroupList) {
- final EntityModel model = getModel();
- final List<FCTabGroup> tabGroups = FluentIterable
- .from(tabGroupList)
- .filter(FCTabGroup.Predicates.notEmpty())
- .toList();
- final EntityModel entityModelWitHints = model.cloneWithTabGroupListMetadata(tabGroups);
- final TabGroupListPanel middleComponent = new TabGroupListPanel(id, entityModelWitHints);
- addOrReplace(middleComponent);
- return middleComponent;
- }
-
- private int addColumnIfRequired(final String id, final FCColumn col) {
- if(col != null) {
- final EntityModel entityModel =
- getModel().cloneWithColumnMetadata(col);
- final FCColumn fcColumn = (FCColumn) entityModel.getFCColumn();
- final int span = fcColumn.getSpan();
- if(span > 0) {
- final EntityColumn entityColumn = new EntityColumn(id, entityModel);
- addOrReplace(entityColumn);
- CssClassAppender.appendCssClassTo(entityColumn, "col-xs-" + span);
- return span;
- }
- }
- permanentlyHide(id);
- return 0;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroup/TabGroupPanel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroup/TabGroupPanel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroup/TabGroupPanel.java
deleted file mode 100644
index fd6ca06..0000000
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroup/TabGroupPanel.java
+++ /dev/null
@@ -1,104 +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.viewer.wicket.ui.components.entity.tabgroup;
-
-import java.util.List;
-
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.Lists;
-
-import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
-import org.apache.wicket.extensions.markup.html.tabs.ITab;
-import org.apache.wicket.extensions.markup.html.tabs.TabbedPanel;
-import org.apache.wicket.markup.html.panel.Panel;
-import org.apache.wicket.model.Model;
-
-import org.apache.isis.applib.layout.fixedcols.FCTabGroup;
-import org.apache.isis.applib.layout.fixedcols.FCTab;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.model.util.ScopedSessionAttribute;
-import org.apache.isis.viewer.wicket.ui.components.entity.tabpanel.TabPanel;
-
-import de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel;
-
-public class TabGroupPanel extends AjaxBootstrapTabbedPanel {
-
- public static final String SESSION_ATTR_SELECTED_TAB = "selectedTab";
- private final EntityModel entityModel;
- // the view metadata
- private final FCTabGroup tabGroup;
- private final ScopedSessionAttribute<Integer> selectedTabInSession;
-
- private static final String ID_TAB_GROUP = "tabGroup";
-
- private static List<ITab> tabsFor(final EntityModel entityModel) {
- final List<ITab> tabs = Lists.newArrayList();
-
- final FCTabGroup tabGroup = (FCTabGroup) entityModel.getFCTabGroup();
- final List<FCTab> FCTabList = FluentIterable
- .from(tabGroup.getTabs())
- .filter(FCTab.Predicates.notEmpty())
- .toList();
-
- for (final FCTab FCTab : FCTabList) {
- tabs.add(new AbstractTab(Model.of(FCTab.getName())) {
- private static final long serialVersionUID1 = 1L;
-
- @Override
- public Panel getPanel(String panelId) {
- return new TabPanel(panelId, entityModel, FCTab);
- }
- });
- }
- return tabs;
- }
-
- public TabGroupPanel(final EntityModel entityModel) {
- super(ID_TAB_GROUP, tabsFor(entityModel));
-
- this.entityModel = entityModel;
- this.tabGroup = (FCTabGroup) entityModel.getFCTabGroup();
- this.selectedTabInSession = ScopedSessionAttribute.create(entityModel, this, SESSION_ATTR_SELECTED_TAB);
-
- }
-
- @Override
- protected void onInitialize() {
- setSelectedTabFromSessionIfAny(this);
- super.onInitialize();
- }
-
- @Override
- public TabbedPanel setSelectedTab(final int index) {
- selectedTabInSession.set(index);
- return super.setSelectedTab(index);
- }
-
- private void setSelectedTabFromSessionIfAny(
- final AjaxBootstrapTabbedPanel ajaxBootstrapTabbedPanel) {
- final Integer tabIndex = selectedTabInSession.get();
- if (tabIndex != null) {
- final int numTabs = ajaxBootstrapTabbedPanel.getTabs().size();
- if (tabIndex < numTabs) {
- // to support dynamic reloading; the data in the session might not be compatible with current layout.
- ajaxBootstrapTabbedPanel.setSelectedTab(tabIndex);
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgrouplist/TabGroupListPanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgrouplist/TabGroupListPanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgrouplist/TabGroupListPanel.html
deleted file mode 100644
index 6699518..0000000
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgrouplist/TabGroupListPanel.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<html xmlns:wicket="http://wicket.apache.org">
-<body>
-<wicket:panel>
- <div wicket:id="tabGroups">
- <div wicket:id="tabGroup">[tabbed panel will be here]</div>
- </div>
-</wicket:panel>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgrouplist/TabGroupListPanel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgrouplist/TabGroupListPanel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgrouplist/TabGroupListPanel.java
deleted file mode 100644
index 952c3ad..0000000
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgrouplist/TabGroupListPanel.java
+++ /dev/null
@@ -1,67 +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.viewer.wicket.ui.components.entity.tabgrouplist;
-
-import java.util.List;
-
-import org.apache.wicket.markup.html.list.ListItem;
-import org.apache.wicket.markup.html.list.ListView;
-
-import org.apache.isis.applib.layout.fixedcols.FCTabGroup;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.ui.components.entity.tabgroup.TabGroupPanel;
-import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-
-public class TabGroupListPanel extends PanelAbstract<EntityModel> {
-
- private static final long serialVersionUID = 1L;
-
- private static final String ID_TAB_GROUPS = "tabGroups";
-
- // the view metadata
- private final List<FCTabGroup> tabGroups;
-
- public TabGroupListPanel(final String id, final EntityModel entityModel) {
- super(id, entityModel);
-
- this.tabGroups = (List<FCTabGroup>) entityModel.getTabGroupListMetadata();
-
- buildGui();
- }
-
- private void buildGui() {
- final EntityModel model = getModel();
-
- final ListView<FCTabGroup> tabGroupsList = new ListView<FCTabGroup>(ID_TAB_GROUPS, this.tabGroups) {
-
- @Override
- protected void populateItem(final ListItem<FCTabGroup> item) {
-
- final FCTabGroup tabGroup = item.getModelObject();
- final EntityModel entityModelWithHints = model.cloneWithTabGroupMetadata(tabGroup);
- final TabGroupPanel tabGroupPanel = new TabGroupPanel(entityModelWithHints);
- item.add(tabGroupPanel);
- }
- };
-
- add(tabGroupsList);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabpanel/TabPanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabpanel/TabPanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabpanel/TabPanel.html
deleted file mode 100644
index 111fc68..0000000
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabpanel/TabPanel.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<html xmlns:wicket="http://wicket.apache.org">
-<body>
-<wicket:panel>
- <div class="tabPanel">
- <form class="inputForm" role="form">
- <div wicket:id="column">
- </div>
- </form>
- </div>
-</wicket:panel>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabpanel/TabPanel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabpanel/TabPanel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabpanel/TabPanel.java
deleted file mode 100644
index 6b6d9d7..0000000
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabpanel/TabPanel.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.apache.isis.viewer.wicket.ui.components.entity.tabpanel;
-
-import org.apache.isis.applib.layout.fixedcols.FCTab;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.ui.ComponentType;
-import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-
-public class TabPanel extends PanelAbstract {
-
- private static final long serialVersionUID = 1L;
-
- private static final String ID_COLUMN = "column";
-
- public TabPanel(String id, final EntityModel model, final FCTab FCTab) {
- super(id);
-
- final EntityModel modelWithTabHints = model.cloneWithTabMetadata(FCTab);
-
- getComponentFactoryRegistry()
- .addOrReplaceComponent(this,
- ID_COLUMN, ComponentType.ENTITY_PROPERTIES, modelWithTabHints);
-
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityCollectionsPanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityCollectionsPanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityCollectionsPanel.html
new file mode 100644
index 0000000..0e03ea9
--- /dev/null
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityCollectionsPanel.html
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <body>
+ <wicket:panel>
+ <div class="entityCollectionsPanel entityCollectionsComponentType">
+ <div wicket:id="collections">
+ <div wicket:id="collection">
+ [collection]
+ </div>
+ </div>
+ </div>
+ </wicket:panel>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityCollectionsPanel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityCollectionsPanel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityCollectionsPanel.java
new file mode 100644
index 0000000..fd706cd
--- /dev/null
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityCollectionsPanel.java
@@ -0,0 +1,151 @@
+/*
+ * 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.viewer.wicket.ui.components.layout.fixedcols;
+
+import java.util.Comparator;
+import java.util.List;
+
+import com.google.common.collect.FluentIterable;
+import com.google.common.collect.ImmutableList;
+
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.repeater.RepeatingView;
+
+import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.applib.filter.Filter;
+import org.apache.isis.applib.filter.Filters;
+import org.apache.isis.applib.layout.common.CollectionLayoutData;
+import org.apache.isis.applib.layout.fixedcols.FCColumn;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
+import org.apache.isis.core.metamodel.facets.members.order.MemberOrderFacet;
+import org.apache.isis.core.metamodel.spec.feature.Contributed;
+import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
+import org.apache.isis.core.runtime.services.DeweyOrderComparator;
+import org.apache.isis.viewer.wicket.model.models.EntityModel;
+import org.apache.isis.viewer.wicket.ui.components.entity.collection.EntityCollectionPanel;
+import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
+
+/**
+ * {@link PanelAbstract Panel} representing the properties of an entity, as per
+ * the provided {@link EntityModel}.
+ */
+public class EntityCollectionsPanel extends PanelAbstract<EntityModel> {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final String ID_ENTITY_COLLECTIONS = "entityCollections";
+ private static final String ID_COLLECTIONS = "collections";
+ private static final String ID_COLLECTION = "collection";
+
+ // view metadata (if any available)
+ private final FCColumn fcColumnIfAny;
+
+ public EntityCollectionsPanel(final String id, final EntityModel entityModel) {
+ super(id, entityModel);
+
+ fcColumnIfAny = (FCColumn) entityModel.getLayoutMetadata();
+
+ buildGui();
+ }
+
+ private void buildGui() {
+ buildEntityPropertiesAndOrCollectionsGui();
+ setOutputMarkupId(true); // so can repaint via ajax
+ }
+
+ private void buildEntityPropertiesAndOrCollectionsGui() {
+ final EntityModel model = getModel();
+ final ObjectAdapter adapter = model.getObject();
+ if (adapter != null) {
+ addCollections();
+ } else {
+ permanentlyHide(ID_ENTITY_COLLECTIONS);
+ }
+ }
+
+ private void addCollections() {
+ final EntityModel entityModel = getModel();
+ final ObjectAdapter adapter = entityModel.getObject();
+
+ final Filter<ObjectAssociation> filter;
+ if (fcColumnIfAny != null) {
+ final ImmutableList<String> collectionIds = FluentIterable
+ .from(fcColumnIfAny.getCollections())
+ .transform(CollectionLayoutData.Functions.id())
+ .toList();
+ filter = new Filter<ObjectAssociation>() {
+ @Override
+ public boolean accept(final ObjectAssociation objectAssociation) {
+ return collectionIds.contains(objectAssociation.getId());
+ }
+ };
+ } else {
+ filter = Filters.any();
+ }
+
+ final List<ObjectAssociation> associations = visibleCollections(adapter, filter);
+ associations.sort(new Comparator<ObjectAssociation>() {
+ private final DeweyOrderComparator deweyOrderComparator = new DeweyOrderComparator();
+ @Override
+ public int compare(final ObjectAssociation o1, final ObjectAssociation o2) {
+ final MemberOrderFacet o1Facet = o1.getFacet(MemberOrderFacet.class);
+ final MemberOrderFacet o2Facet = o2.getFacet(MemberOrderFacet.class);
+ return o1Facet == null? +1:
+ o2Facet == null? -1:
+ deweyOrderComparator.compare(o1Facet.sequence(), o2Facet.sequence());
+ }
+ });
+
+ final RepeatingView collectionRv = new RepeatingView(ID_COLLECTIONS);
+ add(collectionRv);
+
+ for (final ObjectAssociation association : associations) {
+
+ final WebMarkupContainer collectionRvContainer = new WebMarkupContainer(collectionRv.newChildId());
+ collectionRv.add(collectionRvContainer);
+
+ final CollectionLayoutData collectionLayoutData = new CollectionLayoutData(association.getId());
+ final EntityModel entityModelWithCollectionLayoutMetadata =
+ entityModel.cloneWithLayoutMetadata(collectionLayoutData);
+
+ collectionRvContainer.add(new EntityCollectionPanel(ID_COLLECTION, entityModelWithCollectionLayoutMetadata));
+ }
+ }
+
+ private static List<ObjectAssociation> visibleCollections(
+ final ObjectAdapter adapter,
+ final Filter<ObjectAssociation> filter) {
+ return adapter.getSpecification().getAssociations(
+ Contributed.INCLUDED, visibleCollectionsFilter(adapter, filter));
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Filter<ObjectAssociation> visibleCollectionsFilter(
+ final ObjectAdapter adapter,
+ final Filter<ObjectAssociation> filter) {
+ return Filters.and(
+ ObjectAssociation.Filters.COLLECTIONS,
+ ObjectAssociation.Filters.dynamicallyVisible(
+ adapter, InteractionInitiatedBy.USER, Where.PARENTED_TABLES),
+ filter);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityCollectionsPanelFactory.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityCollectionsPanelFactory.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityCollectionsPanelFactory.java
new file mode 100644
index 0000000..980fe6c
--- /dev/null
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityCollectionsPanelFactory.java
@@ -0,0 +1,49 @@
+/*
+ * 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.viewer.wicket.ui.components.layout.fixedcols;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.model.IModel;
+
+import org.apache.isis.viewer.wicket.model.models.EntityModel;
+import org.apache.isis.viewer.wicket.ui.ComponentFactory;
+import org.apache.isis.viewer.wicket.ui.ComponentType;
+import org.apache.isis.viewer.wicket.ui.components.entity.EntityComponentFactoryAbstract;
+
+/**
+ * {@link ComponentFactory} for {@link EntityCollectionsPanel}.
+ */
+public class EntityCollectionsPanelFactory extends EntityComponentFactoryAbstract {
+
+ private static final long serialVersionUID = 1L;
+
+ public EntityCollectionsPanelFactory() {
+ super(ComponentType.ENTITY_COLLECTIONS, EntityCollectionsPanel.class);
+ }
+
+ @Override
+ public Component createComponent(final String id, final IModel<?> model) {
+ final EntityModel entityModel = (EntityModel) model;
+ return new EntityCollectionsPanel(id, entityModel);
+ }
+}
+
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityTabbedPanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityTabbedPanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityTabbedPanel.html
new file mode 100644
index 0000000..7b172aa
--- /dev/null
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityTabbedPanel.html
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<body>
+<wicket:panel>
+ <div class="entityTabbed">
+ <div wicket:id="entitySummary"></div>
+
+ <div class="row">
+ <div wicket:id="leftColumn" class = "leftColumn"/>
+ <div wicket:id="middleColumn" class="middleColumn"/>
+ <div wicket:id="rightColumn" class = "rightColumn"/>
+ </div>
+ </div>
+</wicket:panel>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityTabbedPanel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityTabbedPanel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityTabbedPanel.java
new file mode 100644
index 0000000..c7a3905
--- /dev/null
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/EntityTabbedPanel.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.viewer.wicket.ui.components.layout.fixedcols;
+
+import java.util.List;
+
+import com.google.common.collect.FluentIterable;
+
+import org.apache.isis.applib.layout.fixedcols.FCColumn;
+import org.apache.isis.applib.layout.fixedcols.FCPage;
+import org.apache.isis.applib.layout.fixedcols.FCTabGroup;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacet;
+import org.apache.isis.core.metamodel.facets.object.layoutmetadata.PageFacet;
+import org.apache.isis.viewer.wicket.model.models.EntityModel;
+import org.apache.isis.viewer.wicket.ui.ComponentType;
+import org.apache.isis.viewer.wicket.ui.components.entity.column.EntityColumn;
+import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
+import org.apache.isis.viewer.wicket.ui.util.CssClassAppender;
+
+/**
+ * {@link PanelAbstract Panel} to represent an entity on a single page made up
+ * of several <div> regions.
+ */
+public class EntityTabbedPanel extends PanelAbstract<EntityModel> {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final String ID_LEFT_COLUMN = "leftColumn";
+ private static final String ID_MIDDLE_COLUMN = "middleColumn";
+ private static final String ID_RIGHT_COLUMN = "rightColumn";
+
+ public EntityTabbedPanel(final String id, final EntityModel entityModel) {
+ super(id, entityModel);
+ buildGui();
+ }
+
+ private void buildGui() {
+ final EntityModel model = getModel();
+ final ObjectAdapter objectAdapter = model.getObject();
+ final CssClassFacet facet = objectAdapter.getSpecification().getFacet(CssClassFacet.class);
+ if(facet != null) {
+ final String cssClass = facet.cssClass(objectAdapter);
+ CssClassAppender.appendCssClassTo(this, cssClass);
+ }
+
+ // forces metadata to be derived && synced
+ final PageFacet PageFacet = model.getTypeOfSpecification().getFacet(PageFacet.class);
+ final FCPage page = (FCPage) PageFacet.getPage();
+
+
+ addOrReplace(ComponentType.ENTITY_SUMMARY, model);
+
+ final int leftSpan = addColumnIfRequired(ID_LEFT_COLUMN, page.getLeft());
+
+ final TabGroupListPanel middleTabs = addTabGroups(ID_MIDDLE_COLUMN, page.getTabGroups());
+
+ final int rightSpan = addColumnIfRequired(ID_RIGHT_COLUMN, page.getRight());
+
+ final int columnSpans = leftSpan + rightSpan;
+ int tabGroupSpan = columnSpans < 12 ? 12 - (columnSpans) : 12;
+ CssClassAppender.appendCssClassTo(middleTabs, "col-xs-" + tabGroupSpan);
+
+ }
+
+ private TabGroupListPanel addTabGroups(
+ final String id, final List<FCTabGroup> tabGroupList) {
+ final EntityModel model = getModel();
+ final List<FCTabGroup> tabGroups = FluentIterable
+ .from(tabGroupList)
+ .filter(FCTabGroup.Predicates.notEmpty())
+ .toList();
+ final EntityModel entityModelWitHints = model.cloneWithLayoutMetadata(tabGroups);
+ final TabGroupListPanel middleComponent = new TabGroupListPanel(id, entityModelWitHints);
+ addOrReplace(middleComponent);
+ return middleComponent;
+ }
+
+ private int addColumnIfRequired(final String id, final FCColumn col) {
+ if(col != null) {
+ final EntityModel entityModel =
+ getModel().cloneWithLayoutMetadata(col);
+ final FCColumn fcColumn = (FCColumn) entityModel.getLayoutMetadata();
+ final int span = fcColumn.getSpan();
+ if(span > 0) {
+ final EntityColumn entityColumn = new EntityColumn(id, entityModel);
+ addOrReplace(entityColumn);
+ CssClassAppender.appendCssClassTo(entityColumn, "col-xs-" + span);
+ return span;
+ }
+ }
+ permanentlyHide(id);
+ return 0;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/84c9cf75/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/PropertyGroup.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/PropertyGroup.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/PropertyGroup.html
new file mode 100644
index 0000000..38245a0
--- /dev/null
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/fixedcols/PropertyGroup.html
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <body>
+ <wicket:panel>
+ <fieldset class="memberGroup">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <span wicket:id="memberGroupName" class="panel-title">[group name]</span>
+ <div class="pull-right additionalLinks">
+ <div wicket:id="associatedActionLinksPanel"></div>
+ <div wicket:id="associatedActionLinksPanelDropDown"></div>
+ </div>
+ </div>
+ <div class="properties panel-body">
+ <div wicket:id="properties">
+ <div wicket:id="property" class="property">[property]</div>
+ </div>
+ </div>
+ </div>
+ </fieldset>
+ </wicket:panel>
+ </body>
+</html>