incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1050892 [5/5] - in /incubator/isis/trunk: alternatives/objectstore/nosql/src/main/java/org/apache/isis/alternatives/objectstore/nosql/ alternatives/objectstore/sql/persistor/src/main/java/org/apache/isis/alternatives/objectstore/sql/ alter...
Date Sun, 19 Dec 2010 16:28:42 GMT
Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java (original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java Sun Dec 19 16:28:38 2010
@@ -20,6 +20,8 @@
 
 package org.apache.isis.viewer.scimpi.dispatcher.view.display;
 
+import java.util.List;
+
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
@@ -40,7 +42,7 @@ public class TableView extends AbstractT
         private final boolean includeHeading;
         private final boolean includeFooting;
         private final String[] headers;
-        private final ObjectAssociation[] fields;
+        private final List<ObjectAssociation> fields;
         private final boolean showSelectOption;
         private final boolean showDeleteOption;
         private final boolean showEditOption;
@@ -53,7 +55,7 @@ public class TableView extends AbstractT
                 boolean includeHeading,
                 boolean includeFooting,
                 String[] headers,
-                ObjectAssociation[] fields,
+                List<ObjectAssociation> fields,
                 boolean showSelectOption,
                 boolean showDeleteOption,
                 boolean showEditOption,
@@ -73,12 +75,14 @@ public class TableView extends AbstractT
             this.linkRow = linkRow;
         }
 
+        @Override
         public void writeFooters(PageWriter writer) {
             if (includeFooting) {
                 headerRow(writer, headers);
             }
         }
 
+        @Override
         public void writeHeaders(PageWriter writer) {
             if (includeHeading) {
                 headerRow(writer, headers);
@@ -97,6 +101,7 @@ public class TableView extends AbstractT
             request.appendHtml("</tr>");
         }
 
+        @Override
         public void writeElement(Request request, RequestContext context, ObjectAdapter element) {
             String rowId = context.mapObject(element, Scope.INTERACTION);
             String scope = linkRow == null ? "" : "&" + SCOPE + "=" + linkRow.getScope();
@@ -105,7 +110,7 @@ public class TableView extends AbstractT
                                 // Scope.REQUEST);
             result = context.encodedInteractionParameters();
 
-            if (fields.length == 0) {
+            if (fields.size() == 0) {
                 if (linkRow != null) {
                     request.appendHtml("<td><a href=\"" + linkRow.getForwardView() + "?" + linkRow.getVariable() + "="
                             + rowId + result + scope + "\">" + element.titleString() + "</a></td>");
@@ -114,23 +119,23 @@ public class TableView extends AbstractT
                 }
 
             } else {
-                for (int i = 0; i < fields.length; i++) {
-                    if (fields[i].isOneToManyAssociation()) {
+                for (int i = 0; i < fields.size(); i++) {
+                    if (fields.get(i).isOneToManyAssociation()) {
                         continue;
                     }
                     request.appendHtml("<td>");
-                    ObjectAdapter field = fields[i].get(element);
+                    ObjectAdapter field = fields.get(i).get(element);
                     if (field != null) {
-                        if (!fields[i].getSpecification().containsFacet(ParseableFacet.class)) {
+                        if (!fields.get(i).getSpecification().containsFacet(ParseableFacet.class)) {
                             request.appendHtml("<img class=\"" + "small-icon" + "\" src=\""
                                     + request.getContext().imagePath(field) + "\" alt=\""
-                                    + fields[i].getSpecification().getShortName() + "\"/>");
+                                    + fields.get(i).getSpecification().getShortName() + "\"/>");
                         }
                         if (linkRow != null) {
                             request.appendHtml("<a href=\"" + linkRow.getForwardView() + "?" + linkRow.getVariable() + "="
                                     + rowId + result + scope + "\">");
                         } else if (linkedFields[i] != null) {
-                            ObjectAdapter fieldObject = (ObjectAdapter) fields[i].get(element);
+                            ObjectAdapter fieldObject = fields.get(i).get(element);
                             String id = context.mapObject(fieldObject, Scope.INTERACTION);
                             request.appendHtml("<a href=\"" + linkedFields[i].getForwardView() + "?"
                                     + linkedFields[i].getVariable() + "=" + id + "\">");
@@ -167,11 +172,12 @@ public class TableView extends AbstractT
         }
     }
 
+    @Override
     protected TableContentWriter createRowBuilder(
             final Request request,
             RequestContext context,
             final String parent,
-            ObjectAssociation[] allFields) {
+            final List<ObjectAssociation> allFields) {
         final String fieldName = request.getOptionalProperty(FIELD);
         return rowBuilder(request, context, parent, fieldName, allFields);
     }
@@ -180,7 +186,8 @@ public class TableView extends AbstractT
             final Request request,
             RequestContext context,
             final String object,
-            String fieldName, ObjectAssociation[] allFields) {
+            String fieldName, 
+            List<ObjectAssociation> allFields) {
         String linkRowView = request.getOptionalProperty(LINK);
         String linkObjectName = request.getOptionalProperty(ELEMENT_NAME, RequestContext.RESULT);
         String linkObjectScope = request.getOptionalProperty(SCOPE, Scope.INTERACTION.toString());
@@ -197,10 +204,10 @@ public class TableView extends AbstractT
         LinkedFieldsBlock block = new LinkedFieldsBlock();
         request.setBlockContent(block);
         request.processUtilCloseTag();
-        final ObjectAssociation[] fields = block.includedFields(allFields);
+        final List<ObjectAssociation> fields = block.includedFields(allFields);
         final LinkedObject[] linkedFields = block.linkedFields(fields);
         for (int i = 0; i < linkedFields.length; i++) {
-            if (linkedFields[i] == null && linkFields && !fields[i].getSpecification().containsFacet(ParseableFacet.class)) {
+            if (linkedFields[i] == null && linkFields && !fields.get(i).getSpecification().containsFacet(ParseableFacet.class)) {
                 linkedFields[i] = new LinkedObject("_generic.shtml");
             }
             if (linkedFields[i] != null) {
@@ -208,13 +215,13 @@ public class TableView extends AbstractT
             }
         }
 
-        final String headers[] = new String[fields.length];
+        final String headers[] = new String[fields.size()];
         int h = 0;
-        for (int i = 0; i < fields.length; i++) {
-            if (fields[i].isOneToManyAssociation()) {
+        for (int i = 0; i < fields.size(); i++) {
+            if (fields.get(i).isOneToManyAssociation()) {
                 continue;
             }
-            headers[h++] = fields[i].getName();
+            headers[h++] = fields.get(i).getName();
         }
 
         request.popBlockContent();
@@ -228,12 +235,12 @@ public class TableView extends AbstractT
             ObjectAdapter object,
             ObjectAssociation field,
             ObjectAdapter collection,
-            ObjectAssociation[] fields,
+            List<ObjectAssociation> fields,
             boolean linkAllFields) {
-        boolean[] linkFields = new boolean[fields.length];
+        boolean[] linkFields = new boolean[fields.size()];
         if (linkAllFields) {
             for (int i = 0; i < linkFields.length; i++) {
-                linkFields[i] = fields[i].isOneToOneAssociation();
+                linkFields[i] = fields.get(i).isOneToOneAssociation();
             }
         }
         RequestContext context = request.getContext();
@@ -241,6 +248,7 @@ public class TableView extends AbstractT
         write(request, collection, rowBuilder, null);
     }
 
+    @Override
     public String getName() {
         return "table";
     }

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/EditObject.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/EditObject.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/EditObject.java (original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/EditObject.java Sun Dec 19 16:28:38 2010
@@ -20,6 +20,8 @@
 
 package org.apache.isis.viewer.scimpi.dispatcher.view.edit;
 
+import java.util.List;
+
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.authentication.AuthenticationSession;
 import org.apache.isis.core.metamodel.consent.Consent;
@@ -42,6 +44,7 @@ import org.apache.isis.viewer.scimpi.dis
 
 public class EditObject extends AbstractElementProcessor {
 
+    @Override
     public void process(Request request) {
         RequestContext context = request.getContext();
 
@@ -57,11 +60,12 @@ public class EditObject extends Abstract
         String className = request.getOptionalProperty(CLASS, "edit");
         String id = request.getOptionalProperty(ID);
 
-        final ObjectAdapter object = (ObjectAdapter) context.getMappedObjectOrResult(objectId);
+        final ObjectAdapter object = context.getMappedObjectOrResult(objectId);
         String actualObjectId = context.mapObject(object, Scope.INTERACTION);
         String version = context.mapVersion(object);
 
         EditFieldBlock containedBlock = new EditFieldBlock() {
+            @Override
             public boolean isVisible(String name) {
                 ObjectAssociation fld = object.getSpecification().getAssociation(name);
                 boolean isVisible = fld.isVisible(IsisContext.getAuthenticationSession(), object).isAllowed();
@@ -72,7 +76,7 @@ public class EditObject extends Abstract
         request.setBlockContent(containedBlock);
         request.processUtilCloseTag();
         AuthenticationSession session = IsisContext.getAuthenticationSession();
-        ObjectAssociation[] fields = object.getSpecification().getAssociations(
+        List<ObjectAssociation> fields = object.getSpecification().getAssociations(
                 ObjectAssociationFilters.dynamicallyVisible(session, object));
         fields = containedBlock.includedFields(fields);
 
@@ -99,12 +103,12 @@ public class EditObject extends Abstract
         request.popBlockContent();
     }
 
-    private InputField[] createFields(ObjectAssociation[] fields) {
-        InputField[] formFields = new InputField[fields.length];
+    private InputField[] createFields(List<ObjectAssociation> fields) {
+        InputField[] formFields = new InputField[fields.size()];
         int length = 0;
-        for (int i = 0; i < fields.length; i++) {
-            if (!fields[i].isOneToManyAssociation()) {
-                formFields[i] = new InputField(fields[i].getId());
+        for (int i = 0; i < fields.size(); i++) {
+            if (!fields.get(i).isOneToManyAssociation()) {
+                formFields[i] = new InputField(fields.get(i).getId());
                 length++;
             }
         }
@@ -251,7 +255,7 @@ public class EditObject extends Abstract
         for (int i = 0; i < formFields.length; i++) {
             String fieldId = formFields[i].getName();
             ObjectAssociation field = object.getSpecification().getAssociation(fieldId);
-            ObjectAdapter defaultValue = (ObjectAdapter) field.getDefault(object);
+            ObjectAdapter defaultValue = field.getDefault(object);
             if (defaultValue == null) {
                 continue;
             }
@@ -312,6 +316,7 @@ public class EditObject extends Abstract
         }
     }
 
+    @Override
     public String getName() {
         return "edit";
     }

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/field/InclusionList.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/field/InclusionList.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/field/InclusionList.java (original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/field/InclusionList.java Sun Dec 19 16:28:38 2010
@@ -21,8 +21,11 @@
 package org.apache.isis.viewer.scimpi.dispatcher.view.field;
 
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
+import com.google.common.collect.Lists;
+
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
 import org.apache.isis.viewer.scimpi.dispatcher.BlockContent;
@@ -49,19 +52,16 @@ public class InclusionList implements Bl
         excludedList.add(field);
     }
 
-    public ObjectAssociation[] includedFields(ObjectAssociation[] originalFields) {
-        ObjectAssociation[] includedFields = new ObjectAssociation[originalFields.length];
-        int j = 0;
-        for (int i = 0; i < originalFields.length; i++) {
-            String id2 = originalFields[i].getId();
+    public List<ObjectAssociation> includedFields(List<ObjectAssociation> originalFields) {
+        List<ObjectAssociation> includedFields = Lists.newArrayList();
+        for (int i = 0; i < originalFields.size(); i++) {
+            String id2 = originalFields.get(i).getId();
             if (includes(id2)) {
-                includedFields[j++] = originalFields[i];
+                includedFields.add(originalFields.get(i));
             }
         }
 
-        ObjectAssociation[] fields = new ObjectAssociation[j];
-        System.arraycopy(includedFields, 0, fields, 0, j);
-        return fields;
+        return includedFields;
     }
 
     public void hideExcludedParameters(InputField[] inputFields) {
@@ -77,19 +77,16 @@ public class InclusionList implements Bl
         return inIncludedList(id) && !inExcludedList(id);
     }
 
-    public ObjectAction[] includedActions(ObjectAction[] originalActions) {
-        ObjectAction[] includedActions = new ObjectAction[originalActions.length];
-        int j = 0;
-        for (int i = 0; i < originalActions.length; i++) {
-            String id2 = originalActions[i].getId();
+    public List<ObjectAction> includedActions(List<ObjectAction> originalActions) {
+        List<ObjectAction> includedActions = Lists.newArrayList();
+        for (int i = 0; i < originalActions.size(); i++) {
+            String id2 = originalActions.get(i).getId();
             if (includes(id2)) {
-                includedActions[j++] = originalActions[i];
+                includedActions.add(originalActions.get(i));
             }
         }
 
-        ObjectAction[] fields = new ObjectAction[j];
-        System.arraycopy(includedActions, 0, fields, 0, j);
-        return fields;
+        return includedActions;
     }
 }
 

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/field/LinkedFieldsBlock.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/field/LinkedFieldsBlock.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/field/LinkedFieldsBlock.java (original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/field/LinkedFieldsBlock.java Sun Dec 19 16:28:38 2010
@@ -21,6 +21,7 @@
 package org.apache.isis.viewer.scimpi.dispatcher.view.field;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
@@ -33,11 +34,11 @@ public class LinkedFieldsBlock extends I
         linkedFields.put(field, new LinkedObject(variable, scope, forwardView));
     }
 
-    public LinkedObject[] linkedFields(ObjectAssociation[] fields) {
-        LinkedObject[] includedFields = new LinkedObject[fields.length];
-        for (int i = 0; i < fields.length; i++) {
-            String id2 = fields[i].getId();
-            if (fields[i].isOneToOneAssociation() && linkedFields.containsKey(id2)) {
+    public LinkedObject[] linkedFields(List<ObjectAssociation> fields) {
+        LinkedObject[] includedFields = new LinkedObject[fields.size()];
+        for (int i = 0; i < fields.size(); i++) {
+            String id2 = fields.get(i).getId();
+            if (fields.get(i).isOneToOneAssociation() && linkedFields.containsKey(id2)) {
                 includedFields[i] = linkedFields.get(id2);
             }
         }

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/AbstractConditionalBlock.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/AbstractConditionalBlock.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/AbstractConditionalBlock.java (original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/AbstractConditionalBlock.java Sun Dec 19 16:28:38 2010
@@ -38,6 +38,7 @@ import org.apache.isis.viewer.scimpi.dis
 
 public abstract class AbstractConditionalBlock extends AbstractElementProcessor {
 
+    @Override
     public void process(Request request) {
         String id = request.getOptionalProperty(OBJECT);
         
@@ -64,7 +65,7 @@ public abstract class AbstractConditiona
         method = request.getOptionalProperty(METHOD + "-exists");
         if (method != null) {
             ObjectAdapter object = MethodsUtils.findObject(request.getContext(), id);
-            List<? extends ObjectAction> objectActions = object.getSpecification().getObjectActionList(ObjectActionType.USER);
+            List<? extends ObjectAction> objectActions = object.getSpecification().getObjectActions(ObjectActionType.USER);
             boolean methodExists = false;
             for (ObjectAction objectAssociation : objectActions) {
                 if (objectAssociation.getId().equals(method)) {
@@ -88,7 +89,7 @@ public abstract class AbstractConditiona
         field = request.getOptionalProperty(FIELD + "-exists");
         if (field != null) {
             ObjectAdapter object = MethodsUtils.findObject(request.getContext(), id);
-            List<? extends ObjectAssociation> objectFields = object.getSpecification().getAssociationList();
+            List<? extends ObjectAssociation> objectFields = object.getSpecification().getAssociations();
             boolean fieldExists = false;
             for (ObjectAssociation objectAssociation : objectFields) {
                 if (objectAssociation.getId().equals(field)) {
@@ -118,7 +119,7 @@ public abstract class AbstractConditiona
             if (fld == null) {
                 processTags(true, request);
             } else {
-                    CollectionFacet facet = (CollectionFacet) fld.getSpecification().getFacet(CollectionFacet.class);
+                    CollectionFacet facet = fld.getSpecification().getFacet(CollectionFacet.class);
                     boolean isEmpty = facet != null &&   facet.size(fld) == 0;
                     // boolean isEmpty = fld == null || (fld instanceof CollectionAdapter && ((CollectionAdapter) fld).size() == 0);
                     processTags(isEmpty, request);
@@ -144,7 +145,7 @@ public abstract class AbstractConditiona
 
         String persistent = request.getOptionalProperty("persistent");
         if (persistent != null) {
-            ObjectAdapter object = (ObjectAdapter) request.getContext().getMappedObjectOrResult(persistent);
+            ObjectAdapter object = request.getContext().getMappedObjectOrResult(persistent);
             processTags(object.isPersistent(), request);
             return;
         }
@@ -163,7 +164,7 @@ public abstract class AbstractConditiona
                 String collection = request.getOptionalProperty("empty");
                 if (collection != null) {
                     ObjectAdapter object = request.getContext().getMappedObjectOrResult(collection);
-                    CollectionFacet facet = (CollectionFacet) object.getSpecification().getFacet(CollectionFacet.class);
+                    CollectionFacet facet = object.getSpecification().getFacet(CollectionFacet.class);
                     processTags(facet.size(object) == 0, request);
                 }
             } else {

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/EditLink.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/EditLink.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/EditLink.java (original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/EditLink.java Sun Dec 19 16:28:38 2010
@@ -20,6 +20,8 @@
 
 package org.apache.isis.viewer.scimpi.dispatcher.view.simple;
 
+import java.util.List;
+
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.authentication.AuthenticationSession;
 import org.apache.isis.core.metamodel.facets.object.immutable.ImmutableFacet;
@@ -33,26 +35,30 @@ import org.apache.isis.viewer.scimpi.dis
 
 public class EditLink extends AbstractLink {
 
+    @Override
     protected boolean valid(Request request, ObjectAdapter adapter) {
         ObjectSpecification specification = adapter.getSpecification();
         AuthenticationSession session = IsisContext.getAuthenticationSession();
-        ObjectAssociation[] visibleFields = specification.getAssociations(ObjectAssociationFilters.dynamicallyVisible(
+        List<ObjectAssociation> visibleFields = specification.getAssociations(ObjectAssociationFilters.dynamicallyVisible(
                 session, adapter));
-        ImmutableFacet facet = (ImmutableFacet) specification.getFacet(ImmutableFacet.class);
+        ImmutableFacet facet = specification.getFacet(ImmutableFacet.class);
         boolean isImmutable = facet != null && facet.value() == org.apache.isis.core.metamodel.facets.When.ALWAYS;
         boolean isImmutableOncePersisted = facet != null
                 && facet.value() == org.apache.isis.core.metamodel.facets.When.ONCE_PERSISTED && adapter.isPersistent();
-        return visibleFields.length > 0 && !isImmutable && !isImmutableOncePersisted;
+        return visibleFields.size() > 0 && !isImmutable && !isImmutableOncePersisted;
     }
 
+    @Override
     protected String linkLabel(String name, ObjectAdapter object) {
         return "edit";
     }
 
+    @Override
     protected String defaultView() {
         return  Dispatcher.GENERIC + Dispatcher.EDIT  + "." + Dispatcher.EXTENSION;
     }
 
+    @Override
     public String getName() {
         return "edit-link";
     }

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/ObjectLink.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/ObjectLink.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/ObjectLink.java (original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/ObjectLink.java Sun Dec 19 16:28:38 2010
@@ -20,6 +20,8 @@
 
 package org.apache.isis.viewer.scimpi.dispatcher.view.simple;
 
+import java.util.List;
+
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.authentication.AuthenticationSession;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
@@ -31,12 +33,14 @@ import org.apache.isis.viewer.scimpi.dis
 
 public class ObjectLink extends AbstractLink {
 
+    @Override
     protected boolean valid(Request request, ObjectAdapter object) {
         AuthenticationSession session = IsisContext.getAuthenticationSession();
-        ObjectAssociation[] visibleFields = object.getSpecification().getAssociations(ObjectAssociationFilters.dynamicallyVisible(session, object));
-        return visibleFields.length > 0;
+        List<ObjectAssociation> visibleFields = object.getSpecification().getAssociations(ObjectAssociationFilters.dynamicallyVisible(session, object));
+        return visibleFields.size() > 0;
     }
 
+    @Override
     protected String linkLabel(String name, ObjectAdapter object) {
         if (name == null) {
             return object.titleString();
@@ -45,10 +49,12 @@ public class ObjectLink extends Abstract
         }
     }
     
+    @Override
     protected String defaultView() {
         return Dispatcher.GENERIC + "." + Dispatcher.EXTENSION;
     }
 
+    @Override
     public String getName() {
         return "object-link";
     }

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/RemoveElement.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/RemoveElement.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/RemoveElement.java (original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/RemoveElement.java Sun Dec 19 16:28:38 2010
@@ -20,6 +20,8 @@
 
 package org.apache.isis.viewer.scimpi.dispatcher.view.simple;
 
+import java.util.List;
+
 import org.apache.isis.core.commons.filters.Filter;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.authentication.AuthenticationSession;
@@ -39,6 +41,7 @@ import org.apache.isis.viewer.scimpi.dis
 
 public class RemoveElement extends AbstractElementProcessor {
 
+    @Override
     public void process(Request request) {
         String title = request.getOptionalProperty(TITLE, "Delete");
         String cls = request.getOptionalProperty(CLASS, "element-delete");
@@ -64,6 +67,7 @@ public class RemoveElement extends Abstr
     }
 
 
+    @Override
     public String getName() {
         return "remove-element";
     }
@@ -103,8 +107,8 @@ public class RemoveElement extends Abstr
         // TODO check is valid to remove element
         AuthenticationSession session = IsisContext.getAuthenticationSession();
         Filter<ObjectAssociation> filter = ObjectAssociationFilters.dynamicallyVisible(session, adapter);
-        ObjectAssociation[] visibleFields = adapter.getSpecification().getAssociations(filter);
-        return visibleFields.length > 0;
+        List<ObjectAssociation> visibleFields = adapter.getSpecification().getAssociations(filter);
+        return visibleFields.size() > 0;
     }
 }
 

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/value/ParameterName.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/value/ParameterName.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/value/ParameterName.java (original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/value/ParameterName.java Sun Dec 19 16:28:38 2010
@@ -20,6 +20,8 @@
 
 package org.apache.isis.viewer.scimpi.dispatcher.view.value;
 
+import java.util.List;
+
 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.ObjectActionParameter;
@@ -31,6 +33,7 @@ import org.apache.isis.viewer.scimpi.dis
 
 public class ParameterName extends AbstractElementProcessor {
 
+    @Override
     public void process(Request request) {
         String objectId = request.getOptionalProperty(OBJECT);
         String methodName = request.getRequiredProperty(METHOD);
@@ -38,7 +41,7 @@ public class ParameterName extends Abstr
         
         ObjectAdapter object = MethodsUtils.findObject(request.getContext(), objectId);
         ObjectAction action = MethodsUtils.findAction(object, methodName);
-        ObjectActionParameter[] parameters = action.getParameters();
+        final List<ObjectActionParameter> parameters = action.getParameters();
 
         int index;
         if (field == null) {
@@ -46,13 +49,14 @@ public class ParameterName extends Abstr
         } else {
             index = Integer.valueOf(field).intValue() - 1;
         }
-        if (index < 0 || index >= parameters.length) {
-            throw new ScimpiException("Parameter numbers should be between 1 and " + parameters.length + ": " + index);
+        if (index < 0 || index >= parameters.size()) {
+            throw new ScimpiException("Parameter numbers should be between 1 and " + parameters.size() + ": " + index);
         }
         
-        request.appendHtml(parameters[index].getName());
+        request.appendHtml(parameters.get(index).getName());
     }
 
+    @Override
     public String getName() {
         return "parameter-name";
     }

Modified: incubator/isis/trunk/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/ActionParameterMemento.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/ActionParameterMemento.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/ActionParameterMemento.java (original)
+++ incubator/isis/trunk/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/ActionParameterMemento.java Sun Dec 19 16:28:38 2010
@@ -60,7 +60,7 @@ public class ActionParameterMemento impl
 	public ObjectActionParameter getActionParameter() {
 		if (actionParameter == null) {
 			ObjectAction action = actionMemento.getAction();
-			this.actionParameter = action.getParameters()[number];
+			this.actionParameter = action.getParameters().get(number);
 		}
 		return actionParameter;
 	}

Modified: incubator/isis/trunk/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/ActionModel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/ActionModel.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/ActionModel.java (original)
+++ incubator/isis/trunk/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/ActionModel.java Sun Dec 19 16:28:38 2010
@@ -25,6 +25,12 @@ import java.util.Map.Entry;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.apache.wicket.Component;
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+
+import com.google.common.collect.Maps;
+
 import org.apache.isis.applib.Identifier;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
@@ -41,13 +47,7 @@ import org.apache.isis.viewer.wicket.mod
 import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
 import org.apache.isis.viewer.wicket.model.mementos.PageParameterNames;
 import org.apache.isis.viewer.wicket.model.mementos.SpecMemento;
-import org.apache.isis.viewer.wicket.model.models.ActionModel.Mode;
 import org.apache.isis.viewer.wicket.model.util.ActionParams;
-import org.apache.wicket.Component;
-import org.apache.wicket.PageParameters;
-import org.apache.wicket.markup.html.link.BookmarkablePageLink;
-
-import com.google.common.collect.Maps;
 
 /**
  * Models an action invocation, either the gathering of arguments for the
@@ -149,7 +149,7 @@ public class ActionModel extends ModelAb
         }
         // no need to prompt for contributed actions (ie if have a context
         // adapter)
-        ObjectActionParameter actionParam = noAction.getParameters()[0];
+        ObjectActionParameter actionParam = noAction.getParameters().get(0);
         return ActionParams.compatibleWith(contextAdapter, actionParam) ? Mode.RESULTS
                 : Mode.PARAMETERS;
     }
@@ -312,7 +312,7 @@ public class ActionModel extends ModelAb
             return false;
         }
 
-        ObjectActionParameter actionParam = action.getParameters()[paramNum];
+        ObjectActionParameter actionParam = action.getParameters().get(paramNum);
         ActionParameterMemento apm = new ActionParameterMemento(actionParam);
         ScalarModel argumentModel = getArgumentModel(apm);
         argumentModel.setObject(argumentAdapter);

Modified: incubator/isis/trunk/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/util/Actions.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/util/Actions.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/util/Actions.java (original)
+++ incubator/isis/trunk/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/util/Actions.java Sun Dec 19 16:28:38 2010
@@ -21,14 +21,14 @@
 package org.apache.isis.viewer.wicket.model.util;
 
 
+import com.google.common.base.Predicate;
+
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.facets.naming.named.NamedFacet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
 import org.apache.isis.core.metamodel.spec.feature.ObjectActionParameter;
 import org.apache.isis.core.metamodel.spec.feature.ObjectActionType;
 
-import com.google.common.base.Predicate;
-
 public final class Actions {
 
 	private Actions(){}
@@ -36,7 +36,8 @@ public final class Actions {
 	public static Predicate<ObjectAction> ofType(
 			final ObjectActionType type) {
 		return new Predicate<ObjectAction>(){
-			public boolean apply(ObjectAction input) {
+			@Override
+            public boolean apply(ObjectAction input) {
 				return input.getType() == type;
 			}};
 	}
@@ -53,7 +54,7 @@ public final class Actions {
     public static String labelFor(ObjectAction action,
             final ObjectAdapter contextAdapter) {
         if(action.getParameterCount() == 1) {
-            final ObjectActionParameter actionParam = action.getParameters()[0];
+            final ObjectActionParameter actionParam = action.getParameters().get(0);
             if (ActionParams.compatibleWith(contextAdapter, actionParam)) {
                 return nameFor(action);
             }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/actions/params/ActionParametersFormPanel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/actions/params/ActionParametersFormPanel.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/actions/params/ActionParametersFormPanel.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/actions/params/ActionParametersFormPanel.java Sun Dec 19 16:28:38 2010
@@ -24,9 +24,15 @@ import static org.hamcrest.CoreMatchers.
 import static org.hamcrest.CoreMatchers.not;
 import static org.hamcrest.CoreMatchers.nullValue;
 
-import java.util.Arrays;
 import java.util.List;
 
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.Button;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.repeater.RepeatingView;
+
+import com.google.common.collect.Lists;
+
 import org.apache.isis.core.commons.ensure.Ensure;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
@@ -39,12 +45,6 @@ import org.apache.isis.viewer.wicket.mod
 import org.apache.isis.viewer.wicket.ui.ComponentType;
 import org.apache.isis.viewer.wicket.ui.components.widgets.formcomponent.FormFeedbackPanel;
 import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.form.Button;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.repeater.RepeatingView;
-
-import com.google.common.collect.Lists;
 
 /**
  * {@link PanelAbstract Panel} to capture the arguments for an action invocation.
@@ -95,7 +95,7 @@ public class ActionParametersFormPanel e
 			final ObjectAction ObjectAction = actionModel
 					.getActionMemento().getAction();
 
-			ObjectActionParameter[] parameters = ObjectAction
+			List<ObjectActionParameter> parameters = ObjectAction
 					.getParameters();
 
 			RepeatingView rv = new RepeatingView(ID_ACTION_PARAMETERS);
@@ -116,16 +116,16 @@ public class ActionParametersFormPanel e
 			add(new Button(ID_OK_BUTTON) {
 				private static final long serialVersionUID = 1L;
 
-				public void onSubmit() {
+				@Override
+                public void onSubmit() {
 					actionExecutor.executeActionAndProcessResults();
 				};
 			});
 		}
 
 		private List<ActionParameterMemento> buildParameterMementos(
-				ObjectActionParameter[] parameters) {
-			List<ActionParameterMemento> parameterMementoList = Lists.transform(Arrays
-					.asList(parameters), Mementos.fromActionParameter());
+				List<ObjectActionParameter> parameters) {
+			List<ActionParameterMemento> parameterMementoList = Lists.transform(parameters, Mementos.fromActionParameter());
 			// we copy into a new array list otherwise we get lazy evaluation =
 			// reference to a non-serializable object
 			return Lists.newArrayList(parameterMementoList);

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTable.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTable.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTable.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTable.java Sun Dec 19 16:28:38 2010
@@ -22,6 +22,13 @@ package org.apache.isis.viewer.wicket.ui
 
 import java.util.List;
 
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.model.Model;
+
+import com.google.common.collect.Lists;
+
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
@@ -33,12 +40,6 @@ import org.apache.isis.viewer.wicket.ui.
 import org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.columns.ObjectAdapterSelectColumn;
 import org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.columns.ObjectAdapterTitleColumn;
 import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
-import org.apache.wicket.model.Model;
-
-import com.google.common.collect.Lists;
 
 /**
  * {@link PanelAbstract Panel} that represents a {@link EntityCollectionModel collection of entity}s
@@ -81,7 +82,7 @@ public class CollectionContentsAsAjaxTab
 			return;
 		}
 		List<? extends ObjectAssociation> propertyList = typeOfSpec
-				.getAssociationList(ObjectAssociationFilters.PROPERTIES);
+				.getAssociations(ObjectAssociationFilters.PROPERTIES);
 		for (ObjectAssociation property : propertyList) {
 			ColumnAbstract<ObjectAdapter> nopc = createObjectAdapterPropertyColumn(property);
 			columns.add(nopc);

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/simple/CollectionContentsAsSimpleTable.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/simple/CollectionContentsAsSimpleTable.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/simple/CollectionContentsAsSimpleTable.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/simple/CollectionContentsAsSimpleTable.java Sun Dec 19 16:28:38 2010
@@ -22,6 +22,9 @@ package org.apache.isis.viewer.wicket.ui
 
 import java.util.List;
 
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.repeater.RepeatingView;
+
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
@@ -29,8 +32,6 @@ import org.apache.isis.core.metamodel.sp
 import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel;
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
 import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.repeater.RepeatingView;
 
 /**
  * {@link PanelAbstract Panel} that represents a {@link EntityCollectionModel collection of entity}s
@@ -59,7 +60,7 @@ public class CollectionContentsAsSimpleT
 		add(propertyNames);
 
 		List<? extends ObjectAssociation> propertyList = typeOfSpec
-				.getAssociationList(ObjectAssociationFilters.PROPERTIES);
+				.getAssociations(ObjectAssociationFilters.PROPERTIES);
 		for (ObjectAssociation property : propertyList) {
 			propertyNames.add(new Label(property.getId(), property.getName()));
 		}

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/simple/CollectionContentsInstanceAsTableRow.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/simple/CollectionContentsInstanceAsTableRow.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/simple/CollectionContentsInstanceAsTableRow.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/simple/CollectionContentsInstanceAsTableRow.java Sun Dec 19 16:28:38 2010
@@ -22,6 +22,10 @@ package org.apache.isis.viewer.wicket.ui
 
 import java.util.List;
 
+import org.apache.wicket.Component;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.repeater.RepeatingView;
+
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.facets.object.value.ValueFacet;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
@@ -29,9 +33,6 @@ import org.apache.isis.core.metamodel.sp
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociationFilters;
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
 import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-import org.apache.wicket.Component;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.repeater.RepeatingView;
 
 /**
  * Renders a single entity instance within the HTML table.
@@ -54,7 +55,7 @@ class CollectionContentsInstanceAsTableR
 		ObjectAdapter adapter = model.getObject();
 		ObjectSpecification typeOfSpec = model.getTypeOfSpecification();
 		List<? extends ObjectAssociation> propertyList = typeOfSpec
-				.getAssociationList(ObjectAssociationFilters.PROPERTIES);
+				.getAssociations(ObjectAssociationFilters.PROPERTIES);
 
 		add(new Label("title", adapter.titleString()));
 

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityPropertiesAndOrCollectionsPanel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityPropertiesAndOrCollectionsPanel.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityPropertiesAndOrCollectionsPanel.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityPropertiesAndOrCollectionsPanel.java Sun Dec 19 16:28:38 2010
@@ -22,6 +22,24 @@ package org.apache.isis.viewer.wicket.ui
 
 import java.util.List;
 
+import org.apache.wicket.Component;
+import org.apache.wicket.Session;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.feedback.FeedbackMessage;
+import org.apache.wicket.feedback.IFeedbackMessageFilter;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Button;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.FormComponent;
+import org.apache.wicket.markup.html.form.IFormVisitorParticipant;
+import org.apache.wicket.markup.html.form.validation.AbstractFormValidator;
+import org.apache.wicket.markup.html.panel.ComponentFeedbackPanel;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.markup.repeater.RepeatingView;
+import org.apache.wicket.model.Model;
+
 import org.apache.isis.core.commons.filters.Filter;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
@@ -41,23 +59,6 @@ import org.apache.isis.viewer.wicket.ui.
 import org.apache.isis.viewer.wicket.ui.panels.FormAbstract;
 import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
 import org.apache.isis.viewer.wicket.ui.util.EvenOrOddCssClassAppenderFactory;
-import org.apache.wicket.Component;
-import org.apache.wicket.Session;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.form.AjaxButton;
-import org.apache.wicket.feedback.FeedbackMessage;
-import org.apache.wicket.feedback.IFeedbackMessageFilter;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.form.Button;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.FormComponent;
-import org.apache.wicket.markup.html.form.IFormVisitorParticipant;
-import org.apache.wicket.markup.html.form.validation.AbstractFormValidator;
-import org.apache.wicket.markup.html.panel.ComponentFeedbackPanel;
-import org.apache.wicket.markup.html.panel.FeedbackPanel;
-import org.apache.wicket.markup.repeater.RepeatingView;
-import org.apache.wicket.model.Model;
 
 
 /**
@@ -115,7 +116,7 @@ public class EntityPropertiesAndOrCollec
 			form = new PropCollForm(ID_ENTITY_PROPERTIES_AND_OR_COLLECTIONS,
 					model,
 					render, 
-					(Component)this);
+					this);
 			addOrReplace(form);
 		} else {
 			permanentlyHide(ID_ENTITY_PROPERTIES_AND_OR_COLLECTIONS);
@@ -208,8 +209,8 @@ public class EntityPropertiesAndOrCollec
 	    @SuppressWarnings("unchecked")
 	    private List<ObjectAssociation> visibleAssociations(
 	    		ObjectAdapter adapter, ObjectSpecification noSpec) {
-	        return (List<ObjectAssociation>) noSpec
-	                .getAssociationList(visibleAssociationFilter(adapter));
+	        return noSpec
+	                .getAssociations(visibleAssociationFilter(adapter));
 	    }
 
 	    private Filter<ObjectAssociation> visibleAssociationFilter(

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/summary/EntitySummaryPanel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/summary/EntitySummaryPanel.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/summary/EntitySummaryPanel.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/summary/EntitySummaryPanel.java Sun Dec 19 16:28:38 2010
@@ -20,9 +20,14 @@
 
 package org.apache.isis.viewer.wicket.ui.components.entity.blocks.summary;
 
-import java.util.Arrays;
 import java.util.List;
 
+import org.apache.wicket.markup.html.PackageResource;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.image.Image;
+
+import com.google.inject.Inject;
+
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
@@ -38,11 +43,6 @@ import org.apache.isis.viewer.wicket.ui.
 import org.apache.isis.viewer.wicket.ui.components.widgets.cssmenu.CssMenuPanel;
 import org.apache.isis.viewer.wicket.ui.pages.action.ActionPage;
 import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-import org.apache.wicket.markup.html.PackageResource;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.image.Image;
-
-import com.google.inject.Inject;
 
 /**
  * {@link PanelAbstract Panel} representing the summary details (title, icon and
@@ -126,8 +126,7 @@ public class EntitySummaryPanel extends 
         ObjectAdapter adapter = model.getObject();
         final ObjectAdapterMemento adapterMemento = model.getObjectAdapterMemento();
         if (adapter != null) {
-            List<ObjectAction> userActions = Arrays.asList(adapter
-                    .getSpecification().getObjectActions(ObjectActionType.USER));
+            List<ObjectAction> userActions = adapter.getSpecification().getObjectActions(ObjectActionType.USER);
 
             CssMenuBuilder cssMenuBuilder = new CssMenuBuilder(adapterMemento,
                     getServiceAdapters(), userActions, linkFactory);
@@ -141,6 +140,7 @@ public class EntitySummaryPanel extends 
         }
     }
 
+    @Override
     public void onClick(ActionModel actionModel) {
         setResponsePage(new ActionPage(actionModel));
     }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.java Sun Dec 19 16:28:38 2010
@@ -72,7 +72,7 @@ public class EntityTabbedPanel extends T
         });
 
         List<OneToManyAssociation> collectionList = getModel()
-                .getTypeOfSpecification().getCollectionList();
+                .getTypeOfSpecification().getCollections();
         for (OneToManyAssociation collection : collectionList) {
             final EntityCollectionModel collectionModel = EntityCollectionModel
                     .createParented(getModel(), collection);

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssMenuBuilder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssMenuBuilder.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssMenuBuilder.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssMenuBuilder.java Sun Dec 19 16:28:38 2010
@@ -25,6 +25,10 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
+import org.apache.wicket.Application;
+
+import com.google.common.collect.Collections2;
+
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
@@ -34,9 +38,6 @@ import org.apache.isis.viewer.wicket.mod
 import org.apache.isis.viewer.wicket.model.util.Actions;
 import org.apache.isis.viewer.wicket.ui.components.widgets.cssmenu.CssMenuItem.Builder;
 import org.apache.isis.viewer.wicket.ui.components.widgets.cssmenu.CssMenuPanel.Style;
-import org.apache.wicket.Application;
-
-import com.google.common.collect.Collections2;
 
 /**
  * Used to build a {@link CssMenuItem} hierarchy from a {@link ObjectAdapterMemento object adapter}'s
@@ -120,7 +121,7 @@ public class CssMenuBuilder  {
 	private void addMenuItemForActionSet(CssMenuItem parent,
 			ObjectAction action) {
 		Builder builder = parent.newSubMenuItem(action.getName());
-		ObjectAction[] actions = action.getActions();
+		List<ObjectAction> actions = action.getActions();
 		addMenuItems(builder.itemBeingBuilt(), actions);
 		if (builder.itemBeingBuilt().hasSubMenuItems()) {
 			builder.build();

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/entitylink/EntityLink.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/entitylink/EntityLink.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/entitylink/EntityLink.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/entitylink/EntityLink.java Sun Dec 19 16:28:38 2010
@@ -20,9 +20,24 @@
 
 package org.apache.isis.viewer.wicket.ui.components.widgets.entitylink;
 
-import java.util.Arrays;
 import java.util.List;
 
+import org.apache.wicket.Page;
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.extensions.yui.calendar.DateField;
+import org.apache.wicket.markup.html.PackageResource;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.FormComponentPanel;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.image.Image;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+import com.google.common.collect.Lists;
+
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
@@ -48,21 +63,6 @@ import org.apache.isis.viewer.wicket.ui.
 import org.apache.isis.viewer.wicket.ui.pages.PageType;
 import org.apache.isis.viewer.wicket.ui.pages.entity.EntityPage;
 import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-import org.apache.wicket.Page;
-import org.apache.wicket.PageParameters;
-import org.apache.wicket.extensions.yui.calendar.DateField;
-import org.apache.wicket.markup.html.PackageResource;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.form.FormComponentPanel;
-import org.apache.wicket.markup.html.form.TextField;
-import org.apache.wicket.markup.html.image.Image;
-import org.apache.wicket.markup.html.link.BookmarkablePageLink;
-import org.apache.wicket.markup.html.link.Link;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
-
-import com.google.common.collect.Lists;
 
 /**
  * {@link FormComponentPanel} representing a reference to an entity: a link and
@@ -404,11 +404,12 @@ public class EntityLink extends FormComp
 
     private static void addServiceActionsFor(ObjectSpecification noSpec,
             ObjectActionType actionType, List<ObjectAction> actionList) {
-        ObjectAction[] serviceActionsFor = noSpec
+        final List<ObjectAction> serviceActionsFor = noSpec
                 .getServiceActionsFor(actionType);
-        actionList.addAll(Arrays.asList(serviceActionsFor));
+        actionList.addAll(serviceActionsFor);
     }
 
+    @Override
     public void onClick(ActionModel actionModel) {
         ActionPanel actionPanel = new ActionPanel(actionFindUsingComponent
                 .getComponentType().toString(), actionModel);

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/ProcessObjectPanelAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/ProcessObjectPanelAbstract.java?rev=1050892&r1=1050891&r2=1050892&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/ProcessObjectPanelAbstract.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/ProcessObjectPanelAbstract.java Sun Dec 19 16:28:38 2010
@@ -20,8 +20,16 @@
 
 package org.apache.isis.viewer.wicket.ui.panels;
 
+import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.wicket.MarkupContainer;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.repeater.RepeatingView;
+
+import com.google.common.collect.Lists;
+
 import org.apache.isis.core.commons.filters.Filter;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
@@ -35,18 +43,12 @@ import org.apache.isis.viewer.wicket.mod
 import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
 import org.apache.isis.viewer.wicket.model.mementos.PropertyMemento;
 import org.apache.isis.viewer.wicket.model.models.ActionModel;
+import org.apache.isis.viewer.wicket.model.models.ActionModel.SingleResultsMode;
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
 import org.apache.isis.viewer.wicket.model.models.ScalarModel;
-import org.apache.isis.viewer.wicket.model.models.ActionModel.SingleResultsMode;
 import org.apache.isis.viewer.wicket.model.util.Mementos;
 import org.apache.isis.viewer.wicket.ui.ComponentType;
 import org.apache.isis.viewer.wicket.ui.pages.action.ActionPage;
-import org.apache.wicket.MarkupContainer;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.repeater.RepeatingView;
-
-import com.google.common.collect.Lists;
 
 /**
  * Convenience adapter for building bespoke panels for process objects.
@@ -65,7 +67,7 @@ public abstract class ProcessObjectPanel
 	}
 
     protected void addProperties(MarkupContainer mc, String idProperties, String idProperty) {
-        EntityModel entityModel = (EntityModel) getModel();
+        EntityModel entityModel = getModel();
         ObjectAdapter adapter = entityModel.getObject();
         ObjectSpecification noSpec = adapter.getSpecification();
 
@@ -89,8 +91,9 @@ public abstract class ProcessObjectPanel
     @SuppressWarnings("unchecked")
     private List<OneToOneAssociation> visibleProperties(
             ObjectAdapter adapter, ObjectSpecification noSpec) {
-        return (List<OneToOneAssociation>) noSpec
-                .getAssociationList(visiblePropertyFilter(adapter));
+        @SuppressWarnings("rawtypes")
+        List list = noSpec.getAssociations(visiblePropertyFilter(adapter));
+        return new ArrayList<OneToOneAssociation>(list);
     }
 
     private Filter<ObjectAssociation> visiblePropertyFilter(



Mime
View raw message