incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1387974 - in /incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/entitylink: EntityLink.java FindUsingLinkFactory.java
Date Thu, 20 Sep 2012 11:12:48 GMT
Author: danhaywood
Date: Thu Sep 20 11:12:47 2012
New Revision: 1387974

URL: http://svn.apache.org/viewvc?rev=1387974&view=rev
Log:
ISIS-232: minor refactoring...

* to better support forthcoming EntityLinkSelect2 component

Modified:
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/entitylink/EntityLink.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/entitylink/FindUsingLinkFactory.java

Modified: incubator/isis/trunk/framework/viewer/wicket/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/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/entitylink/EntityLink.java?rev=1387974&r1=1387973&r2=1387974&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/entitylink/EntityLink.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/entitylink/EntityLink.java
Thu Sep 20 11:12:47 2012
@@ -62,7 +62,7 @@ import org.apache.isis.viewer.wicket.ui.
  * {@link FormComponentPanel} representing a reference to an entity: a link and
  * a findUsing button.
  */
-public class EntityLink extends FormComponentPanelAbstract<ObjectAdapter> implements
CancelHintRequired, ActionInvokeHandler {
+public class EntityLink extends FormComponentPanelAbstract<ObjectAdapter> implements
CancelHintRequired, ActionInvokeHandler, FindUsingLinkFactory.Callback {
 
     private static final long serialVersionUID = 1L;
 

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/entitylink/FindUsingLinkFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/entitylink/FindUsingLinkFactory.java?rev=1387974&r1=1387973&r2=1387974&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/entitylink/FindUsingLinkFactory.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/entitylink/FindUsingLinkFactory.java
Thu Sep 20 11:12:47 2012
@@ -33,14 +33,20 @@ 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.CssMenuLinkFactory;
 
-final class FindUsingLinkFactory implements CssMenuLinkFactory {
+public final class FindUsingLinkFactory implements CssMenuLinkFactory {
+    
+    public interface Callback {
+        public void onSelected(ObjectAdapter adapter);
+        public void onNoResults();
+        public void onClick(ActionModel actionModel);
+    }
 
     private static final long serialVersionUID = 1L;
 
-    private final EntityLink entityLink;
+    private final Callback callback;
 
-    FindUsingLinkFactory(final EntityLink entityLink) {
-        this.entityLink = entityLink;
+    public FindUsingLinkFactory(final Callback entityLink) {
+        this.callback = entityLink;
     }
 
     @Override
@@ -54,7 +60,7 @@ final class FindUsingLinkFactory impleme
 
             @Override
             public void onSelected(final Component context, final ObjectAdapter selectedAdapter)
{
-                entityLink.onSelected(selectedAdapter);
+                callback.onSelected(selectedAdapter);
             }
         });
         actionModel.setNoResultsHandler(new NoResultsHandler() {
@@ -62,7 +68,7 @@ final class FindUsingLinkFactory impleme
 
             @Override
             public void onNoResults(final Component context) {
-                entityLink.onNoResults();
+                callback.onNoResults();
             }
         });
 
@@ -71,7 +77,7 @@ final class FindUsingLinkFactory impleme
 
             @Override
             public void onClick() {
-                entityLink.onClick(actionModel);
+                callback.onClick(actionModel);
             }
         }, Actions.labelFor(action));
     }



Mime
View raw message