You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2020/02/11 07:58:16 UTC

[syncope] 02/02: Allow for ActionLinksTogglePanel extension in subclasses

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

ilgrosso pushed a commit to branch 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit f3579cfc3cc84a94bc66988e3856de317488319f
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Tue Feb 11 08:53:55 2020 +0100

    Allow for ActionLinksTogglePanel extension in subclasses
---
 .../apache/syncope/client/console/panels/DirectoryPanel.java | 12 ++++++------
 .../org/apache/syncope/client/console/widgets/JobWidget.java |  2 --
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/DirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/DirectoryPanel.java
index 32c7156..a7c197b 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/DirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/DirectoryPanel.java
@@ -108,7 +108,7 @@ public abstract class DirectoryPanel<
 
     protected final BaseModal<W> displayAttributeModal = new BaseModal<>(Constants.OUTER);
 
-    protected ActionLinksTogglePanel<T> actionTogglePanel;
+    protected final ActionLinksTogglePanel<T> actionTogglePanel;
 
     /**
      * Create simple unfiltered search result panel.
@@ -149,7 +149,7 @@ public abstract class DirectoryPanel<
         super(id, wizardInModal);
         setOutputMarkupId(true);
 
-        actionTogglePanel = new ActionLinksTogglePanel<>(Constants.OUTER, builder.getPageRef());
+        actionTogglePanel = actionTogglePanel();
         addOuterObject(actionTogglePanel);
 
         addOuterObject(altDefaultModal);
@@ -358,12 +358,12 @@ public abstract class DirectoryPanel<
         return model == null ? new ActionsPanel<>("actions", new Model<>()) : new ActionsPanel<>("actions", model);
     }
 
-    protected ActionLinksTogglePanel<T> getTogglePanel() {
-        return actionTogglePanel;
+    protected ActionLinksTogglePanel<T> actionTogglePanel() {
+        return new ActionLinksTogglePanel<>(Constants.OUTER, pageRef);
     }
 
-    protected void setTogglePanel(final ActionLinksTogglePanel<T> actionTogglePanel) {
-        this.actionTogglePanel = actionTogglePanel;
+    protected ActionLinksTogglePanel<T> getTogglePanel() {
+        return actionTogglePanel;
     }
 
     public static class EventDataWrapper {
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java b/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java
index 1381ac6..8a94b43 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java
@@ -310,8 +310,6 @@ public class JobWidget extends BaseWidget {
                 }
             }.disableCheckBoxes().hidePaginator());
 
-            super.setTogglePanel(actionTogglePanel);
-
             this.reportModal = JobWidget.this.reportModal;
             setWindowClosedReloadCallback(reportModal);