syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmarte...@apache.org
Subject [06/30] syncope git commit: Merge from master
Date Mon, 21 Sep 2015 13:50:52 GMT
Merge from master


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/2e6b4fdb
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/2e6b4fdb
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/2e6b4fdb

Branch: refs/heads/master
Commit: 2e6b4fdbd454c0202c2f39ac1d96607462055aac
Parents: 474b925
Author: Marco Di Sabatino Di Diodoro <mdisabatino@apache.org>
Authored: Thu Aug 13 11:21:57 2015 +0200
Committer: Marco Di Sabatino Di Diodoro <mdisabatino@apache.org>
Committed: Thu Aug 13 11:21:57 2015 +0200

----------------------------------------------------------------------
 .../client/console/pages/StatusModalPage.java   |  33 ++---
 .../console/panels/AnySearchResultPanel.java    | 140 +++++++++----------
 .../console/panels/GroupSearchResultPanel.java  |  30 ++--
 .../console/panels/UserSearchResultPanel.java   |  53 +++----
 4 files changed, 121 insertions(+), 135 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/2e6b4fdb/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java
b/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java
index 6ebb7be..c97e44c 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.client.console.pages;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -255,12 +256,12 @@ public class StatusModalPage<T extends AnyTO> extends AbstractStatusModalPage
{
         pwdMgtForm.add(goon);
 
         if (statusOnly) {
-            table.addAction(new ActionLink() {
+            table.addAction(new ActionLink<Serializable>() {
 
                 private static final long serialVersionUID = -3722207913631435501L;
 
                 @Override
-                public void onClick(final AjaxRequestTarget target) {
+                public void onClick(final AjaxRequestTarget target, final Serializable ignore)
{
                     try {
                         userRestClient.reactivate(
                                 anyTO.getETagValue(),
@@ -278,12 +279,12 @@ public class StatusModalPage<T extends AnyTO> extends AbstractStatusModalPage
{
                 }
             }, ActionLink.ActionType.REACTIVATE, pageId);
 
-            table.addAction(new ActionLink() {
+            table.addAction(new ActionLink<Serializable>() {
 
                 private static final long serialVersionUID = -3722207913631435501L;
 
                 @Override
-                public void onClick(final AjaxRequestTarget target) {
+                public void onClick(final AjaxRequestTarget target, final Serializable ignore)
{
                     try {
                         userRestClient.suspend(
                                 anyTO.getETagValue(),
@@ -303,12 +304,12 @@ public class StatusModalPage<T extends AnyTO> extends AbstractStatusModalPage
{
                 }
             }, ActionLink.ActionType.SUSPEND, pageId);
         } else {
-            table.addAction(new ActionLink() {
+            table.addAction(new ActionLink<Serializable>() {
 
                 private static final long serialVersionUID = -3722207913631435501L;
 
                 @Override
-                public void onClick(final AjaxRequestTarget target) {
+                public void onClick(final AjaxRequestTarget target, final Serializable ignore)
{
                     try {
                         if (anyTO instanceof UserTO) {
                             userRestClient.unlink(
@@ -332,12 +333,12 @@ public class StatusModalPage<T extends AnyTO> extends AbstractStatusModalPage
{
                 }
             }, ActionLink.ActionType.UNLINK, pageId);
 
-            table.addAction(new ActionLink() {
+            table.addAction(new ActionLink<Serializable>() {
 
                 private static final long serialVersionUID = -3722207913631435501L;
 
                 @Override
-                public void onClick(final AjaxRequestTarget target) {
+                public void onClick(final AjaxRequestTarget target, final Serializable ignore)
{
                     try {
                         if (anyTO instanceof UserTO) {
                             userRestClient.link(
@@ -361,12 +362,12 @@ public class StatusModalPage<T extends AnyTO> extends AbstractStatusModalPage
{
                 }
             }, ActionLink.ActionType.LINK, pageId);
 
-            table.addAction(new ActionLink() {
+            table.addAction(new ActionLink<Serializable>() {
 
                 private static final long serialVersionUID = -3722207913631435501L;
 
                 @Override
-                public void onClick(final AjaxRequestTarget target) {
+                public void onClick(final AjaxRequestTarget target, final Serializable ignore)
{
                     try {
                         BulkActionResult bulkActionResult;
                         if (anyTO instanceof UserTO) {
@@ -391,12 +392,12 @@ public class StatusModalPage<T extends AnyTO> extends AbstractStatusModalPage
{
                 }
             }, ActionLink.ActionType.DEPROVISION, pageId);
 
-            table.addAction(new ActionLink() {
+            table.addAction(new ActionLink<Serializable>() {
 
                 private static final long serialVersionUID = -3722207913631435501L;
 
                 @Override
-                public void onClick(final AjaxRequestTarget target) {
+                public void onClick(final AjaxRequestTarget target, final Serializable ignore)
{
 
                     if (anyTO instanceof UserTO) {
                         StatusModalPage.this.passwordManagement(
@@ -419,12 +420,12 @@ public class StatusModalPage<T extends AnyTO> extends AbstractStatusModalPage
{
                 }
             }.feedbackPanelAutomaticReload(!(anyTO instanceof UserTO)), ActionLink.ActionType.PROVISION,
pageId);
 
-            table.addAction(new ActionLink() {
+            table.addAction(new ActionLink<Serializable>() {
 
                 private static final long serialVersionUID = -3722207913631435501L;
 
                 @Override
-                public void onClick(final AjaxRequestTarget target) {
+                public void onClick(final AjaxRequestTarget target, final Serializable ignore)
{
                     try {
                         final BulkActionResult bulkActionResult;
                         if (anyTO instanceof UserTO) {
@@ -449,12 +450,12 @@ public class StatusModalPage<T extends AnyTO> extends AbstractStatusModalPage
{
                 }
             }, ActionLink.ActionType.UNASSIGN, pageId);
 
-            table.addAction(new ActionLink() {
+            table.addAction(new ActionLink<Serializable>() {
 
                 private static final long serialVersionUID = -3722207913631435501L;
 
                 @Override
-                public void onClick(final AjaxRequestTarget target) {
+                public void onClick(final AjaxRequestTarget target, final Serializable ignore)
{
                     if (anyTO instanceof UserTO) {
                         StatusModalPage.this.passwordManagement(
                                 target, ResourceAssociationActionType.ASSIGN, table.getModelObject());

http://git-wip-us.apache.org/repos/asf/syncope/blob/2e6b4fdb/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java
index 21f7609..1081272 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.client.console.panels;
 
+import java.io.Serializable;
 import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -45,7 +46,6 @@ import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
 import org.apache.wicket.model.ResourceModel;
 import org.apache.wicket.spring.injection.annot.SpringBean;
 import org.slf4j.Logger;
@@ -53,31 +53,31 @@ import org.slf4j.LoggerFactory;
 import org.springframework.util.ReflectionUtils;
 
 public class AnySearchResultPanel extends AbstractSearchResultPanel {
-
+    
     private static final long serialVersionUID = -1100228004207271270L;
-
+    
     protected static final Logger LOG = LoggerFactory.getLogger(AnySearchResultPanel.class);
-
+    
     private String customMarkupId;
-
+    
     @SpringBean
     protected SchemaRestClient schemaRestClient;
-
+    
     protected final List<String> schemaNames;
-
+    
     protected final List<String> dSchemaNames;
-
+    
     protected final String pageID = "Any";
-
+    
     private final String entitlement = "USER_LIST";
-
+    
     public AnySearchResultPanel(final String type, final String parentId, final String markupId,
final boolean filtered,
             final String fiql, final PageReference callerRef, final AbstractAnyRestClient
restClient,
             final List<AnyTypeClassTO> anyTypeClassTOs, final String realm) {
         super(parentId, filtered, fiql, callerRef, restClient, realm, type);
         setCustomMarkupId(markupId);
         add(new Label("name", type));
-
+        
         this.schemaNames = new ArrayList<String>();
         for (AnyTypeClassTO anyTypeClassTO : anyTypeClassTOs) {
             this.schemaNames.addAll(anyTypeClassTO.getPlainSchemas());
@@ -86,27 +86,27 @@ public class AnySearchResultPanel extends AbstractSearchResultPanel {
         for (AnyTypeClassTO anyTypeClassTO : anyTypeClassTOs) {
             this.dSchemaNames.addAll(anyTypeClassTO.getDerSchemas());
         }
-
+        
         initResultTable();
     }
-
+    
     public String getCustomMarkupId() {
         return customMarkupId;
     }
-
+    
     public void setCustomMarkupId(final String markupId) {
         this.customMarkupId = markupId;
     }
-
+    
     @Override
     protected List<IColumn<AnyTO, String>> getColumns() {
-
+        
         final List<IColumn<AnyTO, String>> columns =
                 new ArrayList<IColumn<AnyTO, String>>();
-
+        
         for (String name : prefMan.getList(getRequest(), Constants.PREF_ANY_DETAILS_VIEW))
{
             final Field field = ReflectionUtils.findField(AnyObjectTO.class, name);
-
+            
             if ("token".equalsIgnoreCase(name)) {
                 columns.add(new PropertyColumn<AnyTO, String>(new ResourceModel(name,
name), name, name));
             } else if (field != null && field.getType().equals(Date.class)) {
@@ -116,13 +116,13 @@ public class AnySearchResultPanel extends AbstractSearchResultPanel
{
                         new PropertyColumn<AnyTO, String>(new ResourceModel(name, name),
name, name));
             }
         }
-
+        
         for (String name : prefMan.getList(getRequest(), Constants.PREF_ANY_ATTRIBUTES_VIEW))
{
             if (schemaNames.contains(name)) {
                 columns.add(new AttrColumn(name, SchemaType.PLAIN));
             }
         }
-
+        
         for (String name : prefMan.getList(getRequest(), Constants.PREF_ANY_DERIVED_ATTRIBUTES_VIEW))
{
             if (dSchemaNames.contains(name)) {
                 columns.add(new AttrColumn(name, SchemaType.DERIVED));
@@ -135,28 +135,28 @@ public class AnySearchResultPanel extends AbstractSearchResultPanel
{
                 columns.add(
                         new PropertyColumn<AnyTO, String>(new ResourceModel(name, name),
name, name));
             }
-
+            
         }
-
+        
         columns.add(new ActionColumn<AnyTO, String>(new ResourceModel("actions", ""))
{
-
+            
             private static final long serialVersionUID = -3503023501954863131L;
-
+            
             @Override
             public ActionLinksPanel getActions(final String componentId, final IModel<AnyTO>
model) {
-
-                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, page.getPageReference());
-
-                panel.add(new ActionLink() {
-
+                
+                final ActionLinksPanel.Builder<AnyTO> panel = ActionLinksPanel.builder(page.getPageReference());
+                
+                panel.add(new ActionLink<AnyTO>() {
+                    
                     private static final long serialVersionUID = -7978723352517770644L;
-
+                    
                     @Override
-                    public void onClick(final AjaxRequestTarget target) {
+                    public void onClick(final AjaxRequestTarget target, final AnyTO anyTO)
{
                         editmodal.setPageCreator(new ModalWindow.PageCreator() {
-
+                            
                             private static final long serialVersionUID = -7834632442532690940L;
-
+                            
                             @Override
                             public Page createPage() {
                                 // SYNCOPE-294: re-read anyTO before edit
@@ -164,33 +164,31 @@ public class AnySearchResultPanel extends AbstractSearchResultPanel
{
                                 return null;
                             }
                         });
-
+                        
                         editmodal.show(target);
                     }
-                }, ActionLink.ActionType.EDIT, entitlement);
-
-                panel.add(new ActionLink() {
-
+                }, ActionLink.ActionType.EDIT, entitlement).add(new ActionLink<AnyTO>()
{
+                    
                     private static final long serialVersionUID = -7978723352517770644L;
-
+                    
                     @Override
-                    public void onClick(final AjaxRequestTarget target) {
+                    public void onClick(final AjaxRequestTarget target, final AnyTO anyTO)
{
                         try {
-                            final AnyObjectTO anyTO = (AnyObjectTO) restClient.
-                                    delete(model.getObject().getETagValue(), model.getObject().getKey());
-
+                            AnyTO deleteAnyTO =
+                                    restClient.delete(model.getObject().getETagValue(), model.getObject().getKey());
+                            
                             page.setModalResult(true);
-
+                            
                             editmodal.setPageCreator(new ModalWindow.PageCreator() {
-
+                                
                                 private static final long serialVersionUID = -7834632442532690940L;
-
+                                
                                 @Override
                                 public Page createPage() {
                                     return null;
                                 }
                             });
-
+                            
                             editmodal.show(target);
                         } catch (SyncopeClientException scce) {
                             error(getString(Constants.OPERATION_ERROR) + ": " + scce.getMessage());
@@ -198,65 +196,63 @@ public class AnySearchResultPanel extends AbstractSearchResultPanel
{
                         }
                     }
                 }, ActionLink.ActionType.DELETE, entitlement);
-
-                return panel;
+                
+                return panel.build(componentId);
             }
-
+            
             @Override
             public ActionLinksPanel getHeader(final String componentId) {
-                final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(),
page.getPageReference());
-
-                panel.add(new ActionLink() {
-
+                final ActionLinksPanel.Builder<Serializable> panel = ActionLinksPanel.builder(page.getPageReference());
+                
+                panel.add(new ActionLink<Serializable>() {
+                    
                     private static final long serialVersionUID = -7978723352517770644L;
-
+                    
                     @Override
-                    public void onClick(final AjaxRequestTarget target) {
+                    public void onClick(final AjaxRequestTarget target, final Serializable
ignore) {
                         displaymodal.setPageCreator(new ModalWindow.PageCreator() {
-
+                            
                             private static final long serialVersionUID = -7834632442532690940L;
-
+                            
                             @Override
                             public Page createPage() {
                                 return new AnyDisplayAttributesModalPage(
                                         page.getPageReference(), displaymodal, schemaNames,
dSchemaNames);
                             }
                         });
-
+                        
                         displaymodal.show(target);
                     }
-                }, ActionLink.ActionType.CHANGE_VIEW, entitlement);
-
-                panel.add(new ActionLink() {
-
+                }, ActionLink.ActionType.CHANGE_VIEW, entitlement).add(new ActionLink<Serializable>()
{
+                    
                     private static final long serialVersionUID = -7978723352517770644L;
-
+                    
                     @Override
-                    public void onClick(final AjaxRequestTarget target) {
+                    public void onClick(final AjaxRequestTarget target, final Serializable
ignore) {
                         if (target != null) {
                             target.add(container);
                         }
                     }
                 }, ActionLink.ActionType.RELOAD, entitlement);
-
-                return panel;
+                
+                return panel.build(componentId);
             }
         });
-
+        
         return columns;
     }
-
+    
     @Override
     protected <T extends AnyTO> Collection<ActionLink.ActionType> getBulkActions()
{
         final List<ActionLink.ActionType> bulkActions = new ArrayList<ActionLink.ActionType>();
-
+        
         bulkActions.add(ActionLink.ActionType.DELETE);
         bulkActions.add(ActionLink.ActionType.SUSPEND);
         bulkActions.add(ActionLink.ActionType.REACTIVATE);
-
+        
         return bulkActions;
     }
-
+    
     @Override
     protected String getPageId() {
         return pageID;

http://git-wip-us.apache.org/repos/asf/syncope/blob/2e6b4fdb/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupSearchResultPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupSearchResultPanel.java
index 83e442b..45b5239 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupSearchResultPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupSearchResultPanel.java
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.client.console.panels;
 
+import java.io.Serializable;
 import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -45,7 +46,6 @@ import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
 import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
 import org.apache.wicket.model.ResourceModel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -115,14 +115,14 @@ public class GroupSearchResultPanel extends AnySearchResultPanel {
             @Override
             public ActionLinksPanel getActions(final String componentId, final IModel<AnyTO>
model) {
 
-                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, page.getPageReference());
-
-                panel.add(new ActionLink() {
+                final ActionLinksPanel.Builder<AnyTO> panel = ActionLinksPanel.builder(page.getPageReference());
+                
+                panel.add(new ActionLink<AnyTO>() {
 
                     private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
-                    public void onClick(final AjaxRequestTarget target) {
+                    public void onClick(final AjaxRequestTarget target, final AnyTO anyTO)
{
                         editmodal.setPageCreator(new ModalWindow.PageCreator() {
 
                             private static final long serialVersionUID = -7834632442532690940L;
@@ -137,14 +137,12 @@ public class GroupSearchResultPanel extends AnySearchResultPanel {
 
                         editmodal.show(target);
                     }
-                }, ActionLink.ActionType.EDIT, entitlement);
-
-                panel.add(new ActionLink() {
+                }, ActionLink.ActionType.EDIT, entitlement).add(new ActionLink<AnyTO>()
{
 
                     private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
-                    public void onClick(final AjaxRequestTarget target) {
+                    public void onClick(final AjaxRequestTarget target, final AnyTO anyTO)
{
                         try {
                             final GroupTO groupTO = (GroupTO) restClient.
                                     delete(model.getObject().getETagValue(), model.getObject().getKey());
@@ -169,19 +167,19 @@ public class GroupSearchResultPanel extends AnySearchResultPanel {
                     }
                 }, ActionLink.ActionType.DELETE, entitlement);
 
-                return panel;
+                return panel.build(componentId);
             }
 
             @Override
             public ActionLinksPanel getHeader(final String componentId) {
-                final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(),
page.getPageReference());
+                final ActionLinksPanel.Builder<Serializable> panel = ActionLinksPanel.builder(page.getPageReference());
 
-                panel.add(new ActionLink() {
+                panel.add(new ActionLink<Serializable>() {
 
                     private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
-                    public void onClick(final AjaxRequestTarget target) {
+                    public void onClick(final AjaxRequestTarget target, final Serializable
ignore) {
                         displaymodal.setPageCreator(new ModalWindow.PageCreator() {
 
                             private static final long serialVersionUID = -7834632442532690940L;
@@ -197,19 +195,19 @@ public class GroupSearchResultPanel extends AnySearchResultPanel {
                     }
                 }, ActionLink.ActionType.CHANGE_VIEW, entitlement);
 
-                panel.add(new ActionLink() {
+                panel.add(new ActionLink<Serializable>() {
 
                     private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
-                    public void onClick(final AjaxRequestTarget target) {
+                    public void onClick(final AjaxRequestTarget target, final Serializable
ignore) {
                         if (target != null) {
                             target.add(container);
                         }
                     }
                 }, ActionLink.ActionType.RELOAD, entitlement);
 
-                return panel;
+                return panel.build(componentId);
             }
         });
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/2e6b4fdb/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java
index 8c78785..3dd2b4e 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.client.console.panels;
 
+import java.io.Serializable;
 import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -46,7 +47,6 @@ import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
 import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
 import org.apache.wicket.model.ResourceModel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -88,7 +88,7 @@ public class UserSearchResultPanel extends AnySearchResultPanel {
 
         for (String name : prefMan.getList(getRequest(), Constants.PREF_USERS_ATTRIBUTES_VIEW))
{
             if (schemaNames.contains(name)) {
-                columns.add(new AttrColumn(name, SchemaType.PLAIN));                
+                columns.add(new AttrColumn(name, SchemaType.PLAIN));
             }
         }
 
@@ -116,56 +116,52 @@ public class UserSearchResultPanel extends AnySearchResultPanel {
             @Override
             public ActionLinksPanel getActions(final String componentId, final IModel<AnyTO>
model) {
 
-                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, page.getPageReference());
+                final ActionLinksPanel.Builder<AnyTO> panel = ActionLinksPanel.builder(page.getPageReference());
 
-                panel.add(new ActionLink() {
+                panel.add(new ActionLink<AnyTO>() {
 
                     private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
-                    public void onClick(final AjaxRequestTarget target) {
+                    public void onClick(final AjaxRequestTarget target, final AnyTO anyTO)
{
                         statusmodal.setPageCreator(new ModalWindow.PageCreator() {
 
                             private static final long serialVersionUID = -7834632442532690940L;
 
                             @Override
                             public Page createPage() {
-                                return new StatusModalPage<UserTO>(
+                                return new StatusModalPage<>(
                                         page.getPageReference(), statusmodal, (UserTO) model.getObject());
                             }
                         });
 
                         statusmodal.show(target);
                     }
-                }, ActionLink.ActionType.MANAGE_RESOURCES, entitlement);
-
-                panel.add(new ActionLink() {
+                }, ActionLink.ActionType.MANAGE_RESOURCES, entitlement).add(new ActionLink<AnyTO>()
{
 
                     private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
-                    public void onClick(final AjaxRequestTarget target) {
+                    public void onClick(final AjaxRequestTarget target, final AnyTO anyTO)
{
                         statusmodal.setPageCreator(new ModalWindow.PageCreator() {
 
                             private static final long serialVersionUID = -7834632442532690940L;
 
                             @Override
                             public Page createPage() {
-                                return new StatusModalPage<UserTO>(
+                                return new StatusModalPage<>(
                                         page.getPageReference(), statusmodal, (UserTO) model.getObject(),
true);
                             }
                         });
 
                         statusmodal.show(target);
                     }
-                }, ActionLink.ActionType.ENABLE, entitlement);
-
-                panel.add(new ActionLink() {
+                }, ActionLink.ActionType.ENABLE, entitlement).add(new ActionLink<AnyTO>()
{
 
                     private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
-                    public void onClick(final AjaxRequestTarget target) {
+                    public void onClick(final AjaxRequestTarget target, final AnyTO anyTO)
{
                         editmodal.setPageCreator(new ModalWindow.PageCreator() {
 
                             private static final long serialVersionUID = -7834632442532690940L;
@@ -180,17 +176,14 @@ public class UserSearchResultPanel extends AnySearchResultPanel {
 
                         editmodal.show(target);
                     }
-                }, ActionLink.ActionType.EDIT, entitlement);
-
-                panel.add(new ActionLink() {
+                }, ActionLink.ActionType.EDIT, entitlement).add(new ActionLink<AnyTO>()
{
 
                     private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
-                    public void onClick(final AjaxRequestTarget target) {
+                    public void onClick(final AjaxRequestTarget target, final AnyTO anyTO)
{
                         try {
-                            final UserTO userTO = (UserTO) restClient.
-                                    delete(model.getObject().getETagValue(), model.getObject().getKey());
+                            restClient.delete(model.getObject().getETagValue(), model.getObject().getKey());
 
                             page.setModalResult(true);
 
@@ -212,19 +205,19 @@ public class UserSearchResultPanel extends AnySearchResultPanel {
                     }
                 }, ActionLink.ActionType.DELETE, entitlement);
 
-                return panel;
+                return panel.build(componentId, model.getObject());
             }
 
             @Override
             public ActionLinksPanel getHeader(final String componentId) {
-                final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(),
page.getPageReference());
+                final ActionLinksPanel.Builder<Serializable> panel = ActionLinksPanel.builder(page.getPageReference());
 
-                panel.add(new ActionLink() {
+                panel.add(new ActionLink<Serializable>() {
 
                     private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
-                    public void onClick(final AjaxRequestTarget target) {
+                    public void onClick(final AjaxRequestTarget target, final Serializable
ignore) {
                         displaymodal.setPageCreator(new ModalWindow.PageCreator() {
 
                             private static final long serialVersionUID = -7834632442532690940L;
@@ -238,21 +231,19 @@ public class UserSearchResultPanel extends AnySearchResultPanel {
 
                         displaymodal.show(target);
                     }
-                }, ActionLink.ActionType.CHANGE_VIEW, entitlement);
-
-                panel.add(new ActionLink() {
+                }, ActionLink.ActionType.CHANGE_VIEW, entitlement).add(new ActionLink<Serializable>()
{
 
                     private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
-                    public void onClick(final AjaxRequestTarget target) {
+                    public void onClick(final AjaxRequestTarget target, final Serializable
ignore) {
                         if (target != null) {
                             target.add(container);
                         }
                     }
                 }, ActionLink.ActionType.RELOAD, entitlement);
 
-                return panel;
+                return panel.build(componentId);
             }
         });
 
@@ -261,7 +252,7 @@ public class UserSearchResultPanel extends AnySearchResultPanel {
 
     @Override
     protected <T extends AnyTO> Collection<ActionLink.ActionType> getBulkActions()
{
-        final List<ActionType> bulkActions = new ArrayList<ActionType>();
+        final List<ActionType> bulkActions = new ArrayList<>();
 
         bulkActions.add(ActionType.DELETE);
         bulkActions.add(ActionType.SUSPEND);


Mime
View raw message