This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 09b67145305e359a62c80bef9519530f9d486edf
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sun Apr 15 21:02:16 2018 +0200

    ISIS-1841 further removing guava idioms
---
 .../object/choices/ChoicesFacetFromBoundedAbstract.java       |  5 ++---
 .../components/ComponentFactoryRegistrarDefault.java          |  4 ++++
 .../viewer/wicket/model/mementos/ObjectAdapterMemento.java    | 11 ++++-------
 .../viewer/wicket/model/models/EntityCollectionModel.java     | 11 +++++------
 4 files changed, 15 insertions(+), 16 deletions(-)

diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/choices/ChoicesFacetFromBoundedAbstract.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/choices/ChoicesFacetFromBoundedAbstract.java
index 424e80f..dc4e492 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/choices/ChoicesFacetFromBoundedAbstract.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/choices/ChoicesFacetFromBoundedAbstract.java
@@ -130,11 +130,10 @@ public abstract class ChoicesFacetFromBoundedAbstract
         final List<ObjectAdapter> allInstancesAdapter = 
getPersistenceSessionService().allMatchingQuery(query);
 
         final List<ObjectAdapter> adapters =
-                ObjectAdapter.Util.visibleAdapters(
-                    allInstancesAdapter, interactionInitiatedBy);
+                ObjectAdapter.Util.visibleAdapters(allInstancesAdapter, 
interactionInitiatedBy);
         
         return _NullSafe.stream(adapters)
-               .map(ObjectAdapter.Functions.getObject())
+               .map(ObjectAdapter.Functions.getObject()) // pojos
                .collect(_Arrays.toArray(Object.class, 
_NullSafe.size(adapters)));
     }
 
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 87668d6..15154bc 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
@@ -80,6 +80,7 @@ import 
org.apache.isis.viewer.wicket.ui.components.scalars.uuid.UuidPanelFactory
 import 
org.apache.isis.viewer.wicket.ui.components.scalars.value.ValuePanelFactory;
 import 
org.apache.isis.viewer.wicket.ui.components.scalars.valuechoices.ValueChoicesSelect2PanelFactory;
 import 
org.apache.isis.viewer.wicket.ui.components.standalonecollection.StandaloneCollectionPanelFactory;
+import org.apache.isis.viewer.wicket.ui.components.tree.TreePanelFactory;
 import 
org.apache.isis.viewer.wicket.ui.components.unknown.UnknownModelPanelFactory;
 import 
org.apache.isis.viewer.wicket.ui.components.value.StandaloneValuePanelFactory;
 import 
org.apache.isis.viewer.wicket.ui.components.voidreturn.VoidReturnPanelFactory;
@@ -195,6 +196,7 @@ public class ComponentFactoryRegistrarDefault implements 
ComponentFactoryRegistr
     protected void addComponentFactoriesForValue(final ComponentFactoryList 
componentFactories) {
        componentFactories.add(new MarkupPanelFactory(ComponentType.VALUE));
         componentFactories.add(new StandaloneValuePanelFactory());
+        componentFactories.add(new TreePanelFactory(ComponentType.VALUE));
     }
 
     protected void addComponentFactoriesForScalar(final ComponentFactoryList 
componentFactories) {
@@ -245,6 +247,8 @@ public class ComponentFactoryRegistrarDefault implements 
ComponentFactoryRegistr
 
         // or for choices
         componentFactories.add(new ValueChoicesSelect2PanelFactory());
+        
+        componentFactories.add(new 
TreePanelFactory(ComponentType.SCALAR_NAME_AND_VALUE));
     }
 
     protected void addComponentFactoriesForEntityLink(final 
ComponentFactoryList componentFactories) {
diff --git 
a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/ObjectAdapterMemento.java
 
b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/ObjectAdapterMemento.java
index f2c7ea5..d6dc59d 100644
--- 
a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/ObjectAdapterMemento.java
+++ 
b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/ObjectAdapterMemento.java
@@ -27,6 +27,7 @@ import java.util.function.Function;
 
 import javax.annotation.Nullable;
 
+import org.apache.isis.applib.internal.collections._Lists;
 import org.apache.isis.applib.services.bookmark.Bookmark;
 import org.apache.isis.applib.services.hint.HintStore;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -45,7 +46,6 @@ import org.apache.isis.core.runtime.memento.Memento;
 import org.apache.isis.core.runtime.persistence.ObjectNotFoundException;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
 
-import com.google.common.collect.FluentIterable;
 import com.google.common.collect.Lists;
 
 public class ObjectAdapterMemento implements Serializable {
@@ -134,11 +134,8 @@ public class ObjectAdapterMemento implements Serializable {
                     final ConcurrencyChecking concurrencyChecking, final 
PersistenceSession persistenceSession,
                     final SpecificationLoader specificationLoader) {
                 final List<Object> listOfPojos =
-                        Lists.newArrayList(
-                            FluentIterable.from(oam.list)
-                                           
.transform(Functions.to_Pojo(persistenceSession, specificationLoader))
-                                           .toList()
-                        );
+                        _Lists.transform(oam.list, 
Functions.toPojo(persistenceSession, specificationLoader));
+                        
                 return 
ObjectAdapter.Functions.adapterForUsing(persistenceSession).apply(listOfPojos);
             }
 
@@ -678,7 +675,7 @@ public class ObjectAdapterMemento implements Serializable {
             };
         }
         
-        public static Function<? super ObjectAdapterMemento, Object> toPojo(
+        public static Function<ObjectAdapterMemento, Object> toPojo(
                 final PersistenceSession persistenceSession,
                 final SpecificationLoader specificationLoader) {
                return input->{
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 63b77b3..b09ceaf 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
@@ -97,9 +97,8 @@ public class EntityCollectionModel extends 
ModelAbstract<List<ObjectAdapter>> im
 
                 final PersistenceSession persistenceSession = 
model.getPersistenceSession();
                 
-                final List<RootOid> rootOids = 
_NullSafe.stream(model.mementoList)
-                               .map(ObjectAdapterMemento.Functions.toOid())
-                               .collect(Collectors.toList());
+                final List<RootOid> rootOids =
+                               _Lists.transform(model.mementoList, 
ObjectAdapterMemento.Functions.toOid());
 
                 final Map<RootOid, ObjectAdapter> adaptersByOid = 
persistenceSession.adaptersFor(rootOids);
                 final Collection<ObjectAdapter> adapterList = 
adaptersByOid.values();
@@ -175,9 +174,9 @@ public class EntityCollectionModel extends 
ModelAbstract<List<ObjectAdapter>> im
                     Collections.sort(objectList, comparator);
                 }
 
-                final List<ObjectAdapter> adapterList = 
_NullSafe.stream(objectList)
-                       .map(ObjectAdapter.Functions.adapterForUsing( 
entityCollectionModel.getPersistenceSession() )) 
-                       .collect(Collectors.toList());
+                final List<ObjectAdapter> adapterList = 
+                               _Lists.transform(objectList, 
+                                               
ObjectAdapter.Functions.adapterForUsing( 
entityCollectionModel.getPersistenceSession() )); 
 
                 return adapterList;
             }

-- 
To stop receiving notification emails like this one, please contact
ahu...@apache.org.

Reply via email to