incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1098948 [10/16] - in /incubator/isis/trunk/viewer: restful/applib/src/main/java/org/apache/isis/viewer/restful/applib/ restful/applib/src/main/java/org/apache/isis/viewer/restful/applib/providers/ restful/applib/src/main/java/org/apache/is...
Date Tue, 03 May 2011 07:44:50 GMT
Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/empty/EmptyCollectionPanel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/empty/EmptyCollectionPanel.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/empty/EmptyCollectionPanel.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/empty/EmptyCollectionPanel.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.empty;
 
 import org.apache.isis.viewer.wicket.model.models.ActionModel;
@@ -27,24 +26,24 @@ import org.apache.wicket.model.Model;
 
 public class EmptyCollectionPanel extends PanelAbstract<ActionModel> {
 
-	private static final long serialVersionUID = 1L;
-	
-	public EmptyCollectionPanel(String id, final ActionModel model) {
-		super(id, model);
-		buildGui(id);
-	}
-	
-	private void buildGui(String id) {
-		final ActionModel model = getModel();
-		addOrReplace(new Button("ok", Model.of("OK")) { // TODO: i18n
-
-			private static final long serialVersionUID = 1L;
-			
-			@Override
-			public void onSubmit() {
-				model.getNoResultsHandler().onNoResults(this);
-			}
-		});
-	}
+    private static final long serialVersionUID = 1L;
+
+    public EmptyCollectionPanel(final String id, final ActionModel model) {
+        super(id, model);
+        buildGui(id);
+    }
+
+    private void buildGui(final String id) {
+        final ActionModel model = getModel();
+        addOrReplace(new Button("ok", Model.of("OK")) { // TODO: i18n
+
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public void onSubmit() {
+                model.getNoResultsHandler().onNoResults(this);
+            }
+        });
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/empty/EmptyCollectionPanelFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/empty/EmptyCollectionPanelFactory.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/empty/EmptyCollectionPanelFactory.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/empty/EmptyCollectionPanelFactory.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.empty;
 
 import org.apache.isis.viewer.wicket.model.common.NoResultsHandler;
@@ -28,31 +27,30 @@ import org.apache.isis.viewer.wicket.ui.
 import org.apache.wicket.Component;
 import org.apache.wicket.model.IModel;
 
-public class EmptyCollectionPanelFactory extends ComponentFactoryAbstract implements
-		ComponentFactory {
+public class EmptyCollectionPanelFactory extends ComponentFactoryAbstract implements ComponentFactory {
+
+    private static final long serialVersionUID = 1L;
 
-	private static final long serialVersionUID = 1L;
-	
-	public EmptyCollectionPanelFactory() {
-		super(ComponentType.EMPTY_COLLECTION);
-	}
-
-	@Override
-	protected ApplicationAdvice appliesTo(IModel<?> model) {
-		if (!(model instanceof ActionModel)) {
-			return ApplicationAdvice.DOES_NOT_APPLY;
-		}
-		ActionModel actionModel = (ActionModel) model;
-		
-		final NoResultsHandler hasNoResultsHandler = actionModel.getNoResultsHandler();
-		// fail fast if a NoResultsHandler has not been specified
-		return appliesIf(hasNoResultsHandler != null);
-	}
-	
-	@Override
-	public Component createComponent(String id, IModel<?> model) {
-		ActionModel actionModel = (ActionModel) model;
-		return new EmptyCollectionPanel(id, actionModel);
-	}
+    public EmptyCollectionPanelFactory() {
+        super(ComponentType.EMPTY_COLLECTION);
+    }
+
+    @Override
+    protected ApplicationAdvice appliesTo(final IModel<?> model) {
+        if (!(model instanceof ActionModel)) {
+            return ApplicationAdvice.DOES_NOT_APPLY;
+        }
+        final ActionModel actionModel = (ActionModel) model;
+
+        final NoResultsHandler hasNoResultsHandler = actionModel.getNoResultsHandler();
+        // fail fast if a NoResultsHandler has not been specified
+        return appliesIf(hasNoResultsHandler != null);
+    }
+
+    @Override
+    public Component createComponent(final String id, final IModel<?> model) {
+        final ActionModel actionModel = (ActionModel) model;
+        return new EmptyCollectionPanel(id, actionModel);
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/EntityComponentFactoryAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/EntityComponentFactoryAbstract.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/EntityComponentFactoryAbstract.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/EntityComponentFactoryAbstract.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -30,35 +29,35 @@ import org.apache.wicket.Component;
 import org.apache.wicket.model.IModel;
 
 /**
- * Convenience adapter for a number of {@link ComponentFactoryAbstract component factory}s that
- * where the created {@link Component} are backed by an {@link EntityModel}.
+ * Convenience adapter for a number of {@link ComponentFactoryAbstract component factory}s that where the created
+ * {@link Component} are backed by an {@link EntityModel}.
  */
 public abstract class EntityComponentFactoryAbstract extends ComponentFactoryAbstract {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	public EntityComponentFactoryAbstract(ComponentType componentType) {
-		super(componentType);
-	}
-
-	public EntityComponentFactoryAbstract(ComponentType componentType, String name) {
-		super(componentType, name);
-	}
-
-	@Override
-	protected ApplicationAdvice appliesTo(IModel<?> model) {
-		if (!(model instanceof EntityModel)) {
-			return ApplicationAdvice.DOES_NOT_APPLY;
-		}
-		EntityModel entityModel = (EntityModel) model;
-		ObjectAdapter adapter = entityModel.getObject();
-		if (adapter == null) {
-			// is ok;
-		}
-		ObjectSpecification specification = entityModel.getTypeOfSpecification();
-		final boolean isObject = specification.isNotCollection();
-		final boolean isValue = specification.containsFacet(ValueFacet.class);
-		return appliesIf(isObject && !isValue);
-	}
+    public EntityComponentFactoryAbstract(final ComponentType componentType) {
+        super(componentType);
+    }
+
+    public EntityComponentFactoryAbstract(final ComponentType componentType, final String name) {
+        super(componentType, name);
+    }
+
+    @Override
+    protected ApplicationAdvice appliesTo(final IModel<?> model) {
+        if (!(model instanceof EntityModel)) {
+            return ApplicationAdvice.DOES_NOT_APPLY;
+        }
+        final EntityModel entityModel = (EntityModel) model;
+        final ObjectAdapter adapter = entityModel.getObject();
+        if (adapter == null) {
+            // is ok;
+        }
+        final ObjectSpecification specification = entityModel.getTypeOfSpecification();
+        final boolean isObject = specification.isNotCollection();
+        final boolean isValue = specification.containsFacet(ValueFacet.class);
+        return appliesIf(isObject && !isValue);
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/action/EntityActionLinkFactory.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/action/EntityActionLinkFactory.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/action/EntityActionLinkFactory.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/action/EntityActionLinkFactory.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity.blocks.action;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -28,8 +27,8 @@ import org.apache.isis.runtimes.dflt.run
 import org.apache.isis.viewer.wicket.model.mementos.ActionMemento;
 import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
 import org.apache.isis.viewer.wicket.model.models.ActionModel;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
 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.util.Actions;
 import org.apache.isis.viewer.wicket.ui.app.registry.ComponentFactoryRegistry;
 import org.apache.isis.viewer.wicket.ui.app.registry.ComponentFactoryRegistryAccessor;
@@ -46,114 +45,103 @@ import org.apache.wicket.markup.html.lin
 
 public final class EntityActionLinkFactory implements CssMenuLinkFactory {
 
-	private static final long serialVersionUID = 1L;
-	
-	private final EntitySummaryPanel summaryPanel;
-
-	public EntityActionLinkFactory(EntityModel entityModel, EntitySummaryPanel summaryPanel) {
-		this.summaryPanel = summaryPanel;
-	}
-
-	public LinkAndLabel newLink(final ObjectAdapterMemento adapterMemento,
-			ObjectAction action, final String linkId) {
-		final ObjectAdapter adapter = adapterMemento.getObjectAdapter();
+    private static final long serialVersionUID = 1L;
+
+    private final EntitySummaryPanel summaryPanel;
+
+    public EntityActionLinkFactory(final EntityModel entityModel, final EntitySummaryPanel summaryPanel) {
+        this.summaryPanel = summaryPanel;
+    }
+
+    @Override
+    public LinkAndLabel newLink(final ObjectAdapterMemento adapterMemento, final ObjectAction action,
+        final String linkId) {
+        final ObjectAdapter adapter = adapterMemento.getObjectAdapter();
 
-		final Link<?> link = createLink(adapterMemento, action, linkId, adapter);
+        final Link<?> link = createLink(adapterMemento, action, linkId, adapter);
         final ObjectAdapter contextAdapter = summaryPanel.getEntityModel().getObject();
-		final String label = Actions.labelFor(action, contextAdapter);
+        final String label = Actions.labelFor(action, contextAdapter);
 
-		return new LinkAndLabel(link, label);
-	}
+        return new LinkAndLabel(link, label);
+    }
+
+    private Link<?> createLink(final ObjectAdapterMemento adapterMemento, final ObjectAction action,
+        final String linkId, final ObjectAdapter adapter) {
+        final Boolean persistent = adapter.isPersistent();
+        if (persistent) {
+            return createLinkForPersistent(linkId, adapterMemento, action);
+        } else {
+            return createLinkForTransient(linkId, adapterMemento, action);
+        }
+    }
 
-    private Link<?> createLink(final ObjectAdapterMemento adapterMemento,
-            final ObjectAction action, final String linkId,
-            final ObjectAdapter adapter) {
-        Boolean persistent = adapter.isPersistent();
-		if (persistent) {
-            return createLinkForPersistent(linkId, adapterMemento,
-					action);
-		} else {
-            return createLinkForTransient(linkId, adapterMemento,
-					action);
-		}
-    }
-
-	private Link<?> createLinkForPersistent(final String linkId,
-			final ObjectAdapterMemento adapterMemento,
-			final ObjectAction action) {
-		final ObjectAdapter adapter = adapterMemento.getObjectAdapter();
-		final ObjectAdapter contextAdapter = summaryPanel.getEntityModel().getObject();
-		
-		PageParameters pageParameters = ActionModel
-				.createPageParameters(adapter, action,
-						getOidStringifier(), contextAdapter,
-						ActionModel.SingleResultsMode.REDIRECT);
-		Class<? extends Page> pageClass = getPageClassRegistry().getPageClass(PageType.ACTION);
-		return newBookmarkablePageLink(linkId, pageClass,
-				pageParameters);
-	}
-
-	/*
-	 * Separate method in order to capture the generic
-	 */
-	private <T extends Page> Link<T> newBookmarkablePageLink(
-			final String linkId, Class<T> pageClass,
-			PageParameters pageParameters) {
-		return new BookmarkablePageLink<T>(linkId, pageClass,
-				pageParameters);
-	}
-
-	private Link<?> createLinkForTransient(final String linkId,
-			final ObjectAdapterMemento adapterMemento,
-			ObjectAction action) {
-		final ActionMemento actionMemento = new ActionMemento(action);
-		final ActionModel.Mode actionMode = ActionModel
-		.determineMode(action);
-		return new Link<String>(linkId) {
-			private static final long serialVersionUID = 1L;
-			
-			public void onClick() {
-				// TODO: seems like can't use REDIRECT, since won't
-				// let multiple setResponsePage() calls once
-				// committed to redirecting (I'm guessing)
-				ActionModel actionModel = ActionModel.create(
-						adapterMemento, actionMemento, actionMode,
-						SingleResultsMode.INLINE);
-				summaryPanel.onClick(actionModel);
-			}
-		};
-	}
-	
-
-	// ///////////////////////////////////////////////////////////////////
-	// Dependencies (from IsisContext)
-	// ///////////////////////////////////////////////////////////////////
-
-	public IsisContext getIsisContext() {
-		return IsisContext.getInstance();
-	}
-	
-	public PersistenceSession getPersistenceSession() {
-		return IsisContext.getPersistenceSession();
-	}
-
-	protected OidStringifier getOidStringifier() {
-		return getPersistenceSession().getOidGenerator().getOidStringifier();
-	}
-
-
-	// ///////////////////////////////////////////////////////////////////
-	// Convenience
-	// ///////////////////////////////////////////////////////////////////
+    private Link<?> createLinkForPersistent(final String linkId, final ObjectAdapterMemento adapterMemento,
+        final ObjectAction action) {
+        final ObjectAdapter adapter = adapterMemento.getObjectAdapter();
+        final ObjectAdapter contextAdapter = summaryPanel.getEntityModel().getObject();
 
-	protected ComponentFactoryRegistry getComponentFactoryRegistry() {
-		final ComponentFactoryRegistryAccessor cfra = (ComponentFactoryRegistryAccessor)Application.get();
+        final PageParameters pageParameters =
+            ActionModel.createPageParameters(adapter, action, getOidStringifier(), contextAdapter,
+                ActionModel.SingleResultsMode.REDIRECT);
+        final Class<? extends Page> pageClass = getPageClassRegistry().getPageClass(PageType.ACTION);
+        return newBookmarkablePageLink(linkId, pageClass, pageParameters);
+    }
+
+    /*
+     * Separate method in order to capture the generic
+     */
+    private <T extends Page> Link<T> newBookmarkablePageLink(final String linkId, final Class<T> pageClass,
+        final PageParameters pageParameters) {
+        return new BookmarkablePageLink<T>(linkId, pageClass, pageParameters);
+    }
+
+    private Link<?> createLinkForTransient(final String linkId, final ObjectAdapterMemento adapterMemento,
+        final ObjectAction action) {
+        final ActionMemento actionMemento = new ActionMemento(action);
+        final ActionModel.Mode actionMode = ActionModel.determineMode(action);
+        return new Link<String>(linkId) {
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public void onClick() {
+                // TODO: seems like can't use REDIRECT, since won't
+                // let multiple setResponsePage() calls once
+                // committed to redirecting (I'm guessing)
+                final ActionModel actionModel =
+                    ActionModel.create(adapterMemento, actionMemento, actionMode, SingleResultsMode.INLINE);
+                summaryPanel.onClick(actionModel);
+            }
+        };
+    }
+
+    // ///////////////////////////////////////////////////////////////////
+    // Dependencies (from IsisContext)
+    // ///////////////////////////////////////////////////////////////////
+
+    public IsisContext getIsisContext() {
+        return IsisContext.getInstance();
+    }
+
+    public PersistenceSession getPersistenceSession() {
+        return IsisContext.getPersistenceSession();
+    }
+
+    protected OidStringifier getOidStringifier() {
+        return getPersistenceSession().getOidGenerator().getOidStringifier();
+    }
+
+    // ///////////////////////////////////////////////////////////////////
+    // Convenience
+    // ///////////////////////////////////////////////////////////////////
+
+    protected ComponentFactoryRegistry getComponentFactoryRegistry() {
+        final ComponentFactoryRegistryAccessor cfra = (ComponentFactoryRegistryAccessor) Application.get();
         return cfra.getComponentFactoryRegistry();
-	}
+    }
 
-	protected PageClassRegistry getPageClassRegistry() {
-		final PageClassRegistryAccessor pcra = (PageClassRegistryAccessor)Application.get();
+    protected PageClassRegistry getPageClassRegistry() {
+        final PageClassRegistryAccessor pcra = (PageClassRegistryAccessor) Application.get();
         return pcra.getPageClassRegistry();
-	}
+    }
 
 }
\ No newline at end of file

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityCollectionsPanelFactory.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/EntityCollectionsPanelFactory.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityCollectionsPanelFactory.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityCollectionsPanelFactory.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity.blocks.propcoll;
 
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
@@ -33,14 +32,15 @@ import org.apache.wicket.model.IModel;
  */
 public class EntityCollectionsPanelFactory extends EntityComponentFactoryAbstract {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	public EntityCollectionsPanelFactory() {
-		super(ComponentType.ENTITY_COLLECTIONS);
-	}
-
-	public Component createComponent(String id, IModel<?> model) {
-		EntityModel entityModel = (EntityModel) model;
-		return new EntityPropertiesAndOrCollectionsPanel(id, entityModel, Render.COLLECTIONS_ONLY);
-	}
+    public EntityCollectionsPanelFactory() {
+        super(ComponentType.ENTITY_COLLECTIONS);
+    }
+
+    @Override
+    public Component createComponent(final String id, final IModel<?> model) {
+        final EntityModel entityModel = (EntityModel) model;
+        return new EntityPropertiesAndOrCollectionsPanel(id, entityModel, Render.COLLECTIONS_ONLY);
+    }
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityPropertiesAndCollectionsPanelFactory.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/EntityPropertiesAndCollectionsPanelFactory.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityPropertiesAndCollectionsPanelFactory.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityPropertiesAndCollectionsPanelFactory.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity.blocks.propcoll;
 
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
@@ -33,14 +32,15 @@ import org.apache.wicket.model.IModel;
  */
 public class EntityPropertiesAndCollectionsPanelFactory extends EntityComponentFactoryAbstract {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	public EntityPropertiesAndCollectionsPanelFactory() {
-		super(ComponentType.ENTITY_PROPERTIES_AND_COLLECTIONS);
-	}
-
-	public Component createComponent(String id, IModel<?> model) {
-		EntityModel entityModel = (EntityModel) model;
-		return new EntityPropertiesAndOrCollectionsPanel(id, entityModel, Render.PROPERTIES_AND_COLLECTIONS);
-	}
+    public EntityPropertiesAndCollectionsPanelFactory() {
+        super(ComponentType.ENTITY_PROPERTIES_AND_COLLECTIONS);
+    }
+
+    @Override
+    public Component createComponent(final String id, final IModel<?> model) {
+        final EntityModel entityModel = (EntityModel) model;
+        return new EntityPropertiesAndOrCollectionsPanel(id, entityModel, Render.PROPERTIES_AND_COLLECTIONS);
+    }
 }

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=1098948&r1=1098947&r2=1098948&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 Tue May  3 07:44:41 2011
@@ -17,29 +17,10 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity.blocks.propcoll;
 
 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.applib.filter.Filter;
 import org.apache.isis.applib.filter.Filters;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -60,336 +41,342 @@ 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;
 
 /**
- * {@link PanelAbstract Panel} representing the properties of an entity,
- * as per the provided {@link EntityModel}.
+ * {@link PanelAbstract Panel} representing the properties of an entity, as per the provided {@link EntityModel}.
  */
 public class EntityPropertiesAndOrCollectionsPanel extends PanelAbstract<EntityModel> {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	private static final String ID_ENTITY_PROPERTIES_AND_OR_COLLECTIONS = "entityPropertiesAndOrCollections";
+    private static final String ID_ENTITY_PROPERTIES_AND_OR_COLLECTIONS = "entityPropertiesAndOrCollections";
 
-	public enum Render {
-	    PROPERTIES_ONLY {
+    public enum Render {
+        PROPERTIES_ONLY {
             @Override
             public Filter<ObjectAssociation> getFilters() {
                 return ObjectAssociationFilters.PROPERTIES;
             }
         },
-	    COLLECTIONS_ONLY {
+        COLLECTIONS_ONLY {
             @Override
             public Filter<ObjectAssociation> getFilters() {
                 return ObjectAssociationFilters.COLLECTIONS;
             }
         },
-	    PROPERTIES_AND_COLLECTIONS {
+        PROPERTIES_AND_COLLECTIONS {
             @Override
             public Filter<ObjectAssociation> getFilters() {
-                return Filters.or(PROPERTIES_ONLY.getFilters(),COLLECTIONS_ONLY.getFilters());
+                return Filters.or(PROPERTIES_ONLY.getFilters(), COLLECTIONS_ONLY.getFilters());
             }
         };
 
         public abstract Filter<ObjectAssociation> getFilters();
-	}
-	
-    private final Render render;
-	private PropCollForm form;
+    }
 
-	public EntityPropertiesAndOrCollectionsPanel(String id, final EntityModel entityModel, final Render render) {
-		super(id, entityModel);
-		this.render = render;
-		buildGui();
-		form.toViewMode(null);
-	}
-
-	private void buildGui() {
-		buildEntityPropertiesAndOrCollectionsGui();
-		setOutputMarkupId(true); // so can repaint via ajax
-	}
-
-	private void buildEntityPropertiesAndOrCollectionsGui() {
-	    EntityModel model = getModel();
-	    ObjectAdapter adapter = model.getObject();
-		if (adapter != null) {
-			form = new PropCollForm(ID_ENTITY_PROPERTIES_AND_OR_COLLECTIONS,
-					model,
-					render, 
-					this);
-			addOrReplace(form);
-		} else {
-			permanentlyHide(ID_ENTITY_PROPERTIES_AND_OR_COLLECTIONS);
-		}
-	}
+    private final Render render;
+    private PropCollForm form;
 
-	
-	static class PropCollForm extends FormAbstract<ObjectAdapter> {
+    public EntityPropertiesAndOrCollectionsPanel(final String id, final EntityModel entityModel, final Render render) {
+        super(id, entityModel);
+        this.render = render;
+        buildGui();
+        form.toViewMode(null);
+    }
+
+    private void buildGui() {
+        buildEntityPropertiesAndOrCollectionsGui();
+        setOutputMarkupId(true); // so can repaint via ajax
+    }
+
+    private void buildEntityPropertiesAndOrCollectionsGui() {
+        final EntityModel model = getModel();
+        final ObjectAdapter adapter = model.getObject();
+        if (adapter != null) {
+            form = new PropCollForm(ID_ENTITY_PROPERTIES_AND_OR_COLLECTIONS, model, render, this);
+            addOrReplace(form);
+        } else {
+            permanentlyHide(ID_ENTITY_PROPERTIES_AND_OR_COLLECTIONS);
+        }
+    }
 
+    static class PropCollForm extends FormAbstract<ObjectAdapter> {
 
         private static final long serialVersionUID = 1L;
 
-	    private static final String ID_PROPERTIES_AND_OR_COLLECTIONS = "propertiesAndOrCollections";
-	    private static final String ID_PROPERTY_OR_COLLECTION = "propertyOrCollection";
-	    private static final String ID_EDIT_BUTTON = "edit";
-	    private static final String ID_OK_BUTTON = "ok";
-	    private static final String ID_CANCEL_BUTTON = "cancel";
-	    private static final String ID_FEEDBACK = "feedback";
-
-	    private final Render render;
-	    
-	    private final Component owningPanel;
-	    private Button editButton;
-	    private Button okButton;
-	    private Button cancelButton;
-	    private FeedbackPanel feedback;
-
-	    public PropCollForm(String id, EntityModel entityModel, Render render, Component owningPanel) {
-	        super(id, entityModel);
-	        this.owningPanel = owningPanel; // for repainting
-	        this.render = render;
-
-	        buildGui();
-	    }
-
-	    private void buildGui() {
-	        addPropertiesAndOrCollections();
-	        addButtons();
-	        addFeedbackGui();
-	        
-	        addValidator();
-	    }
-	    
-	    private void addPropertiesAndOrCollections() {
-	        EntityModel entityModel = (EntityModel) getModel();
-	        ObjectAdapter adapter = entityModel.getObject();
-	        ObjectSpecification noSpec = adapter.getSpecification();
-
-	        List<ObjectAssociation> associations = visibleAssociations(adapter,
-	                noSpec);
-
-	        RepeatingView rv = new RepeatingView(ID_PROPERTIES_AND_OR_COLLECTIONS);
-	        EvenOrOddCssClassAppenderFactory eo = new EvenOrOddCssClassAppenderFactory();
-	        add(rv);
-	        
-	        @SuppressWarnings("unused")
+        private static final String ID_PROPERTIES_AND_OR_COLLECTIONS = "propertiesAndOrCollections";
+        private static final String ID_PROPERTY_OR_COLLECTION = "propertyOrCollection";
+        private static final String ID_EDIT_BUTTON = "edit";
+        private static final String ID_OK_BUTTON = "ok";
+        private static final String ID_CANCEL_BUTTON = "cancel";
+        private static final String ID_FEEDBACK = "feedback";
+
+        private final Render render;
+
+        private final Component owningPanel;
+        private Button editButton;
+        private Button okButton;
+        private Button cancelButton;
+        private FeedbackPanel feedback;
+
+        public PropCollForm(final String id, final EntityModel entityModel, final Render render,
+            final Component owningPanel) {
+            super(id, entityModel);
+            this.owningPanel = owningPanel; // for repainting
+            this.render = render;
+
+            buildGui();
+        }
+
+        private void buildGui() {
+            addPropertiesAndOrCollections();
+            addButtons();
+            addFeedbackGui();
+
+            addValidator();
+        }
+
+        private void addPropertiesAndOrCollections() {
+            final EntityModel entityModel = (EntityModel) getModel();
+            final ObjectAdapter adapter = entityModel.getObject();
+            final ObjectSpecification noSpec = adapter.getSpecification();
+
+            final List<ObjectAssociation> associations = visibleAssociations(adapter, noSpec);
+
+            final RepeatingView rv = new RepeatingView(ID_PROPERTIES_AND_OR_COLLECTIONS);
+            final EvenOrOddCssClassAppenderFactory eo = new EvenOrOddCssClassAppenderFactory();
+            add(rv);
+
+            @SuppressWarnings("unused")
             Component component;
-	        for(ObjectAssociation association: associations) {
-	            WebMarkupContainer container = new WebMarkupContainer(rv
-	                    .newChildId());
-	            rv.add(container);
-	            container.add(eo.nextClass());
-	            if (association instanceof OneToOneAssociation) {
-	                OneToOneAssociation otoa = (OneToOneAssociation) association;
-                    PropertyMemento pm = new PropertyMemento(otoa); 
-	                
-	                ScalarModel scalarModel = entityModel.getPropertyModel(pm);
-	                component = getComponentFactoryRegistry().addOrReplaceComponent(container,
-	                        ID_PROPERTY_OR_COLLECTION, ComponentType.SCALAR_NAME_AND_VALUE, scalarModel);
-	            } else {
-	                OneToManyAssociation otma = (OneToManyAssociation) association;
-                    
-                    final EntityCollectionModel entityCollectionModel = EntityCollectionModel.createParented(entityModel, otma);
-                    final CollectionPanel collectionPanel = new CollectionPanel(ID_PROPERTY_OR_COLLECTION, entityCollectionModel);
+            for (final ObjectAssociation association : associations) {
+                final WebMarkupContainer container = new WebMarkupContainer(rv.newChildId());
+                rv.add(container);
+                container.add(eo.nextClass());
+                if (association instanceof OneToOneAssociation) {
+                    final OneToOneAssociation otoa = (OneToOneAssociation) association;
+                    final PropertyMemento pm = new PropertyMemento(otoa);
+
+                    final ScalarModel scalarModel = entityModel.getPropertyModel(pm);
+                    component =
+                        getComponentFactoryRegistry().addOrReplaceComponent(container, ID_PROPERTY_OR_COLLECTION,
+                            ComponentType.SCALAR_NAME_AND_VALUE, scalarModel);
+                } else {
+                    final OneToManyAssociation otma = (OneToManyAssociation) association;
+
+                    final EntityCollectionModel entityCollectionModel =
+                        EntityCollectionModel.createParented(entityModel, otma);
+                    final CollectionPanel collectionPanel =
+                        new CollectionPanel(ID_PROPERTY_OR_COLLECTION, entityCollectionModel);
                     container.addOrReplace(collectionPanel);
-                    
-                    component = getComponentFactoryRegistry().addOrReplaceComponent(container,
-                            ID_PROPERTY_OR_COLLECTION, ComponentType.COLLECTION_NAME_AND_CONTENTS, entityCollectionModel);
-	            }
-	        }
-	        
-	        // massive hack: an empty property line to get CSS correct...!
-            WebMarkupContainer container = new WebMarkupContainer(rv
-                    .newChildId());
+
+                    component =
+                        getComponentFactoryRegistry().addOrReplaceComponent(container, ID_PROPERTY_OR_COLLECTION,
+                            ComponentType.COLLECTION_NAME_AND_CONTENTS, entityCollectionModel);
+                }
+            }
+
+            // massive hack: an empty property line to get CSS correct...!
+            final WebMarkupContainer container = new WebMarkupContainer(rv.newChildId());
             rv.add(container);
             container.add(new Label(ID_PROPERTY_OR_COLLECTION, Model.of(" ")));
             container.add(eo.nextClass());
-	    }
+        }
+
+        @SuppressWarnings("unchecked")
+        private List<ObjectAssociation> visibleAssociations(final ObjectAdapter adapter,
+            final ObjectSpecification noSpec) {
+            return noSpec.getAssociations(visibleAssociationFilter(adapter));
+        }
+
+        private Filter<ObjectAssociation> visibleAssociationFilter(final ObjectAdapter adapter) {
+            return Filters.and(render.getFilters(),
+                ObjectAssociationFilters.dynamicallyVisible(getAuthenticationSession(), adapter));
+        }
+
+        private void addButtons() {
+            editButton = new AjaxButton(ID_EDIT_BUTTON, Model.of("Edit")) {
+                private static final long serialVersionUID = 1L;
+
+                @Override
+                public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+                    toEditMode(target);
+                }
+
+                @Override
+                protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+                    toEditMode(target);
+                }
+            };
+            add(editButton);
+
+            okButton = new Button(ID_OK_BUTTON, Model.of("OK")) {
+                private static final long serialVersionUID = 1L;
+
+                @Override
+                public void onSubmit() {
+                    if (!getForm().hasError()) {
+                        final ObjectAdapter object = getEntityModel().getObject();
+                        final Memento snapshotToRollbackToIfInvalid = new Memento(object);
+                        // to perform object-level validation, we must apply the changes first
+                        // contrast this with ActionPanel (for validating action arguments) where
+                        // we do the validation prior to the execution of the action
+                        getEntityModel().apply();
+                        final String invalidReasonIfAny = getEntityModel().getReasonInvalidIfAny();
+                        if (invalidReasonIfAny != null) {
+                            getForm().error(invalidReasonIfAny);
+                            snapshotToRollbackToIfInvalid.recreateObject();
+                            return;
+                        } else {
+                            toViewMode(null);
+                        }
+                    } else {
+                        // stay in edit mode
+                    }
+                }
+            };
+            add(okButton);
+
+            cancelButton = new AjaxButton(ID_CANCEL_BUTTON, Model.of("Cancel")) {
+                private static final long serialVersionUID = 1L;
+                {
+                    setDefaultFormProcessing(false);
+                }
+
+                @Override
+                protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+                    Session.get().getFeedbackMessages().clear();
+                    getForm().clearInput();
+                    getForm().visitFormComponentsPostOrder(new IVisitor() {
+
+                        @Override
+                        public Object formComponent(final IFormVisitorParticipant formComponent) {
+                            if (formComponent instanceof CancelHintRequired) {
+                                final CancelHintRequired cancelHintRequired = (CancelHintRequired) formComponent;
+                                cancelHintRequired.onCancel();
+                            }
+                            return null;
+                        }
+                    });
+                    getEntityModel().resetPropertyModels();
+                    toViewMode(target);
+                }
+
+                @Override
+                protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+                    toViewMode(target);
+                }
+            };
+            add(cancelButton);
+
+            editButton.setOutputMarkupPlaceholderTag(true);
+            cancelButton.setOutputMarkupPlaceholderTag(true);
+        }
+
+        private void requestRepaintPanel(final AjaxRequestTarget target) {
+            if (target != null) {
+                target.addComponent(owningPanel);
+                // TODO: is it necessary to add these too?
+                target.addComponent(editButton);
+                target.addComponent(okButton);
+                target.addComponent(cancelButton);
+                target.addComponent(feedback);
+            }
+        }
 
-	    @SuppressWarnings("unchecked")
-	    private List<ObjectAssociation> visibleAssociations(
-	    		ObjectAdapter adapter, ObjectSpecification noSpec) {
-	        return noSpec
-	                .getAssociations(visibleAssociationFilter(adapter));
-	    }
-
-	    private Filter<ObjectAssociation> visibleAssociationFilter(
-	    		ObjectAdapter adapter) {
-	        return Filters.and(render.getFilters(),
-	                ObjectAssociationFilters.dynamicallyVisible(
-	                        getAuthenticationSession(), adapter));
-	    }
-
-	    private void addButtons() {
-	        editButton = new AjaxButton(ID_EDIT_BUTTON, Model.of("Edit")) {
-	        private static final long serialVersionUID = 1L;
-
-	        @Override
-	        public void onSubmit(AjaxRequestTarget target, Form<?> form) {
-	            toEditMode(target);
-	        }
-	        @Override
-	        protected void onError(AjaxRequestTarget target,
-	                Form<?> form) {
-	            toEditMode(target);
-	        }
-	    };
-	    add(editButton);
-
-	    okButton = new Button(ID_OK_BUTTON, Model.of("OK")) {
-	            private static final long serialVersionUID = 1L;
-
-	            @Override
-	            public void onSubmit() {
-	                if (!getForm().hasError()) {
-	                	ObjectAdapter object = getEntityModel().getObject();
-	                    Memento snapshotToRollbackToIfInvalid = new Memento(object);
-	                    // to perform object-level validation, we must apply the changes first
-	                    // contrast this with ActionPanel (for validating action arguments) where
-	                    // we do the validation prior to the execution of the action
-	                    getEntityModel().apply();
-	                    String invalidReasonIfAny = getEntityModel().getReasonInvalidIfAny();
-	                    if (invalidReasonIfAny != null) {
-	                        getForm().error(invalidReasonIfAny);
-	                        snapshotToRollbackToIfInvalid.recreateObject();
-	                        return;
-	                    } else {
-	                        toViewMode(null);
-	                    }
-	                } else {
-	                    // stay in edit mode
-	                }
-	            }
-	        };
-	        add(okButton);
-
-	        cancelButton = new AjaxButton(ID_CANCEL_BUTTON, Model.of("Cancel")) {
-	            private static final long serialVersionUID = 1L;
-	            {
-	                setDefaultFormProcessing(false);
-	            }
-	            @Override
-	            protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
-	                Session.get().getFeedbackMessages().clear();
-	                getForm().clearInput();
-	                getForm().visitFormComponentsPostOrder(new IVisitor(){
-
-	                    @Override
-	                    public Object formComponent(
-	                            IFormVisitorParticipant formComponent) {
-	                        if (formComponent instanceof CancelHintRequired) {
-	                            CancelHintRequired cancelHintRequired = (CancelHintRequired) formComponent;
-	                            cancelHintRequired.onCancel();
-	                        }
-	                        return null;
-	                    }
-	                });
-	                getEntityModel().resetPropertyModels();
-	                toViewMode(target);
-	            }
-	            @Override
-	            protected void onError(AjaxRequestTarget target, Form<?> form) {
-	                toViewMode(target);
-	            }
-	        };
-	        add(cancelButton);
-	        
-	        editButton.setOutputMarkupPlaceholderTag(true);
-	        cancelButton.setOutputMarkupPlaceholderTag(true);
-	    }
-
-	    private void requestRepaintPanel(AjaxRequestTarget target) {
-	        if (target != null) {
-	            target.addComponent(owningPanel);
-	            // TODO: is it necessary to add these too?
-	            target.addComponent(editButton);
-	            target.addComponent(okButton);
-	            target.addComponent(cancelButton);
-	            target.addComponent(feedback);
-	        }
-	    }
-	    
-
-	    private void addValidator() {
-	        add(new AbstractFormValidator(){
-
-	            private static final long serialVersionUID = 1L;
-
-	            @Override
-	            public FormComponent<?>[] getDependentFormComponents() {
-	                return new FormComponent<?>[0];
-	            }
-
-	            @Override
-	            public void validate(Form<?> form) {
-	                EntityModel entityModel = (EntityModel) getModel();
-	                ObjectAdapter adapter = entityModel.getObject();
-	                ValidateObjectFacet facet = adapter.getSpecification().getFacet(ValidateObjectFacet.class);
-	                if (facet == null) {
-	                    return;
-	                }
-	                String invalidReasonIfAny = facet.invalidReason(adapter);
-	                if (invalidReasonIfAny != null) {
-	                    Session.get().getFeedbackMessages().add(
-	                        new FeedbackMessage(form, invalidReasonIfAny, FeedbackMessage.ERROR));
-	                }
-	            }
-	        });
-	    }
-
-	    private EntityModel getEntityModel() {
-	        return (EntityModel) getModel();
-	    }
-
-	    void toViewMode(AjaxRequestTarget target) {
-	        getEntityModel().toViewMode();
-	        editButton.setVisible(true);
-	        okButton.setVisible(false);
-	        cancelButton.setVisible(false);
-	        requestRepaintPanel(target);
-	    }
-	    
-	    private void toEditMode(AjaxRequestTarget target) {
-	        getEntityModel().toEditMode();
-	        editButton.setVisible(false);
-	        okButton.setVisible(true);
-	        cancelButton.setVisible(true);
-	        requestRepaintPanel(target);
-	    }
-
-	    @Override
-	    protected void onValidate() {
-	        Session.get().getFeedbackMessages().clear(new IFeedbackMessageFilter() {
-	            
-	            private static final long serialVersionUID = 1L;
-
-	            @Override
-	            public boolean accept(FeedbackMessage message) {
-	                return message.getReporter() == owningPanel;
-	            }
-	        });
-	        super.onValidate();
-	    }
-
-
-	    private void addFeedbackGui() {
-	        final FeedbackPanel feedback = addOrReplaceFeedback();
-
-	        ObjectAdapter adapter = getEntityModel().getObject();
-	        if (adapter == null) {
-	            feedback.error("cannot locate object:"
-	                    + getEntityModel().getObjectAdapterMemento().toString());
-	        }
-	    }
-
-	    private FeedbackPanel addOrReplaceFeedback() {
-	        feedback = new ComponentFeedbackPanel(ID_FEEDBACK, this);
-	        feedback.setOutputMarkupPlaceholderTag(true);
-	        addOrReplace(feedback);
-	        return feedback;
-	    }
-	}
+        private void addValidator() {
+            add(new AbstractFormValidator() {
 
-}
+                private static final long serialVersionUID = 1L;
+
+                @Override
+                public FormComponent<?>[] getDependentFormComponents() {
+                    return new FormComponent<?>[0];
+                }
+
+                @Override
+                public void validate(final Form<?> form) {
+                    final EntityModel entityModel = (EntityModel) getModel();
+                    final ObjectAdapter adapter = entityModel.getObject();
+                    final ValidateObjectFacet facet = adapter.getSpecification().getFacet(ValidateObjectFacet.class);
+                    if (facet == null) {
+                        return;
+                    }
+                    final String invalidReasonIfAny = facet.invalidReason(adapter);
+                    if (invalidReasonIfAny != null) {
+                        Session.get().getFeedbackMessages()
+                            .add(new FeedbackMessage(form, invalidReasonIfAny, FeedbackMessage.ERROR));
+                    }
+                }
+            });
+        }
+
+        private EntityModel getEntityModel() {
+            return (EntityModel) getModel();
+        }
+
+        void toViewMode(final AjaxRequestTarget target) {
+            getEntityModel().toViewMode();
+            editButton.setVisible(true);
+            okButton.setVisible(false);
+            cancelButton.setVisible(false);
+            requestRepaintPanel(target);
+        }
+
+        private void toEditMode(final AjaxRequestTarget target) {
+            getEntityModel().toEditMode();
+            editButton.setVisible(false);
+            okButton.setVisible(true);
+            cancelButton.setVisible(true);
+            requestRepaintPanel(target);
+        }
+
+        @Override
+        protected void onValidate() {
+            Session.get().getFeedbackMessages().clear(new IFeedbackMessageFilter() {
+
+                private static final long serialVersionUID = 1L;
+
+                @Override
+                public boolean accept(final FeedbackMessage message) {
+                    return message.getReporter() == owningPanel;
+                }
+            });
+            super.onValidate();
+        }
+
+        private void addFeedbackGui() {
+            final FeedbackPanel feedback = addOrReplaceFeedback();
+
+            final ObjectAdapter adapter = getEntityModel().getObject();
+            if (adapter == null) {
+                feedback.error("cannot locate object:" + getEntityModel().getObjectAdapterMemento().toString());
+            }
+        }
+
+        private FeedbackPanel addOrReplaceFeedback() {
+            feedback = new ComponentFeedbackPanel(ID_FEEDBACK, this);
+            feedback.setOutputMarkupPlaceholderTag(true);
+            addOrReplace(feedback);
+            return feedback;
+        }
+    }
 
+}

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityPropertiesPanelFactory.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/EntityPropertiesPanelFactory.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityPropertiesPanelFactory.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityPropertiesPanelFactory.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity.blocks.propcoll;
 
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
@@ -33,14 +32,15 @@ import org.apache.wicket.model.IModel;
  */
 public class EntityPropertiesPanelFactory extends EntityComponentFactoryAbstract {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	public EntityPropertiesPanelFactory() {
-		super(ComponentType.ENTITY_PROPERTIES);
-	}
-
-	public Component createComponent(String id, IModel<?> model) {
-		EntityModel entityModel = (EntityModel) model;
-		return new EntityPropertiesAndOrCollectionsPanel(id, entityModel, Render.PROPERTIES_ONLY);
-	}
+    public EntityPropertiesPanelFactory() {
+        super(ComponentType.ENTITY_PROPERTIES);
+    }
+
+    @Override
+    public Component createComponent(final String id, final IModel<?> model) {
+        final EntityModel entityModel = (EntityModel) model;
+        return new EntityPropertiesAndOrCollectionsPanel(id, entityModel, Render.PROPERTIES_ONLY);
+    }
 }

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=1098948&r1=1098947&r2=1098948&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 Tue May  3 07:44:41 2011
@@ -17,17 +17,10 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity.blocks.summary;
 
 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.facets.object.icon.IconFacet;
 import org.apache.isis.core.metamodel.spec.ActionType;
@@ -43,13 +36,17 @@ 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
- * actions) of an entity, as per the provided {@link EntityModel}.
+ * {@link PanelAbstract Panel} representing the summary details (title, icon and actions) of an entity, as per the
+ * provided {@link EntityModel}.
  */
-public class EntitySummaryPanel extends PanelAbstract<EntityModel> implements
-        ActionInvokeHandler {
+public class EntitySummaryPanel extends PanelAbstract<EntityModel> implements ActionInvokeHandler {
 
     private static final long serialVersionUID = 1L;
 
@@ -61,7 +58,7 @@ public class EntitySummaryPanel extends 
 
     private ImageCache imageCache;
 
-    public EntitySummaryPanel(String id, final EntityModel entityModel) {
+    public EntitySummaryPanel(final String id, final EntityModel entityModel) {
         super(id, entityModel);
         linkFactory = new EntityActionLinkFactory(getEntityModel(), this);
     }
@@ -85,27 +82,26 @@ public class EntitySummaryPanel extends 
     }
 
     private void addOrReplaceTitleAndImage() {
-        String titleString = determineTitle();
+        final String titleString = determineTitle();
         addOrReplace(new Label(ID_ENTITY_TITLE, titleString));
         addOrReplaceImage();
     }
 
     private String determineTitle() {
-    	ObjectAdapter adapter = getModel().getObject();
-        String titleString = adapter != null ? adapter.titleString()
-                : "(no object)"; // TODO: i18n
+        final ObjectAdapter adapter = getModel().getObject();
+        final String titleString = adapter != null ? adapter.titleString() : "(no object)"; // TODO: i18n
         return titleString;
     }
 
     private void addOrReplaceImage() {
-    	ObjectAdapter adapter = getModel().getObject();
+        final ObjectAdapter adapter = getModel().getObject();
         ObjectSpecification typeOfSpec;
         PackageResource imageResource = null;
         if (adapter != null) {
             typeOfSpec = adapter.getSpecification();
-            IconFacet iconFacet = typeOfSpec.getFacet(IconFacet.class);
+            final IconFacet iconFacet = typeOfSpec.getFacet(IconFacet.class);
             if (iconFacet != null) {
-                String iconName = iconFacet.iconName(adapter);
+                final String iconName = iconFacet.iconName(adapter);
                 imageResource = getImageCache().findImage(iconName);
             }
         }
@@ -122,17 +118,16 @@ public class EntitySummaryPanel extends 
     }
 
     private void buildEntityActionsGui() {
-        EntityModel model = getModel();
-        ObjectAdapter adapter = model.getObject();
+        final EntityModel model = getModel();
+        final ObjectAdapter adapter = model.getObject();
         final ObjectAdapterMemento adapterMemento = model.getObjectAdapterMemento();
         if (adapter != null) {
-            List<ObjectAction> userActions = adapter.getSpecification().getObjectActions(ActionType.USER);
+            final List<ObjectAction> userActions = adapter.getSpecification().getObjectActions(ActionType.USER);
 
-            CssMenuBuilder cssMenuBuilder = new CssMenuBuilder(adapterMemento,
-                    getServiceAdapters(), userActions, linkFactory);
+            final CssMenuBuilder cssMenuBuilder =
+                new CssMenuBuilder(adapterMemento, getServiceAdapters(), userActions, linkFactory);
             // TODO: i18n
-            CssMenuPanel cssMenuPanel = cssMenuBuilder.buildPanel(
-                    ID_ENTITY_ACTIONS, "Actions");
+            final CssMenuPanel cssMenuPanel = cssMenuBuilder.buildPanel(ID_ENTITY_ACTIONS, "Actions");
 
             this.addOrReplace(cssMenuPanel);
         } else {
@@ -141,21 +136,20 @@ public class EntitySummaryPanel extends 
     }
 
     @Override
-    public void onClick(ActionModel actionModel) {
+    public void onClick(final ActionModel actionModel) {
         setResponsePage(new ActionPage(actionModel));
     }
 
-    
-    /////////////////////////////////////////////////
+    // ///////////////////////////////////////////////
     // Dependency Injection
-    /////////////////////////////////////////////////
-    
+    // ///////////////////////////////////////////////
+
     protected ImageCache getImageCache() {
         return imageCache;
     }
 
     @Inject
-    public void setImageCache(ImageCache imageCache) {
+    public void setImageCache(final ImageCache imageCache) {
         this.imageCache = imageCache;
     }
 

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/summary/EntitySummaryPanelFactory.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/EntitySummaryPanelFactory.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/summary/EntitySummaryPanelFactory.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/summary/EntitySummaryPanelFactory.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity.blocks.summary;
 
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
@@ -32,14 +31,15 @@ import org.apache.wicket.model.IModel;
  */
 public class EntitySummaryPanelFactory extends EntityComponentFactoryAbstract {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	public EntitySummaryPanelFactory() {
-		super(ComponentType.ENTITY_SUMMARY);
-	}
-
-	public Component createComponent(String id, IModel<?> model) {
-		EntityModel entityModel = (EntityModel) model;
-		return new EntitySummaryPanel(id, entityModel);
-	}
+    public EntitySummaryPanelFactory() {
+        super(ComponentType.ENTITY_SUMMARY);
+    }
+
+    @Override
+    public Component createComponent(final String id, final IModel<?> model) {
+        final EntityModel entityModel = (EntityModel) model;
+        return new EntitySummaryPanel(id, entityModel);
+    }
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/combined/EntityCombinedPanel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/combined/EntityCombinedPanel.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/combined/EntityCombinedPanel.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/combined/EntityCombinedPanel.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity.combined;
 
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
@@ -25,22 +24,21 @@ import org.apache.isis.viewer.wicket.ui.
 import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
 
 /**
- * {@link PanelAbstract Panel} to represent an entity on a single page
- * made up of several &lt;div&gt; regions.
+ * {@link PanelAbstract Panel} to represent an entity on a single page made up of several &lt;div&gt; regions.
  */
 public class EntityCombinedPanel extends PanelAbstract<EntityModel> {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	public EntityCombinedPanel(String id, final EntityModel entityModel) {
-		super(id, entityModel);
-		buildGui();
-	}
-
-	private void buildGui() {
-		EntityModel model = getModel();
-		
-		addOrReplace(ComponentType.ENTITY_SUMMARY, model);
-		addOrReplace(ComponentType.ENTITY_PROPERTIES_AND_COLLECTIONS, model);
-	}
+    public EntityCombinedPanel(final String id, final EntityModel entityModel) {
+        super(id, entityModel);
+        buildGui();
+    }
+
+    private void buildGui() {
+        final EntityModel model = getModel();
+
+        addOrReplace(ComponentType.ENTITY_SUMMARY, model);
+        addOrReplace(ComponentType.ENTITY_PROPERTIES_AND_COLLECTIONS, model);
+    }
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/combined/EntityCombinedPanelFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/combined/EntityCombinedPanelFactory.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/combined/EntityCombinedPanelFactory.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/combined/EntityCombinedPanelFactory.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity.combined;
 
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
@@ -32,16 +31,17 @@ import org.apache.wicket.model.IModel;
  */
 public class EntityCombinedPanelFactory extends EntityComponentFactoryAbstract {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	private static final String NAME = "combined";
+    private static final String NAME = "combined";
 
-	public EntityCombinedPanelFactory() {
-		super(ComponentType.ENTITY, NAME);
-	}
-
-	public Component createComponent(String id, IModel<?> model) {
-		EntityModel entityModel = (EntityModel) model;
-		return new EntityCombinedPanel(id, entityModel);
-	}
+    public EntityCombinedPanelFactory() {
+        super(ComponentType.ENTITY, NAME);
+    }
+
+    @Override
+    public Component createComponent(final String id, final IModel<?> model) {
+        final EntityModel entityModel = (EntityModel) model;
+        return new EntityCombinedPanel(id, entityModel);
+    }
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/EntitySelector.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/EntitySelector.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/EntitySelector.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/EntitySelector.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity.selector;
 
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
@@ -26,23 +25,21 @@ import org.apache.isis.viewer.wicket.ui.
 import org.apache.isis.viewer.wicket.ui.selector.SelectorPanelAbstract;
 
 /**
- * Provides a drop-down for selecting other views that support 
- * {@link ComponentType#ENTITY} with a backing {@link EntityModel}. 
+ * Provides a drop-down for selecting other views that support {@link ComponentType#ENTITY} with a backing
+ * {@link EntityModel}.
  * 
  * <p>
  * Most of the heavy lifting is factored out into the superclass, {@link SelectorPanelAbstract}.
  * 
  * <p>
- * Note that this class should be registered (in <tt>ComponentFactoryListDefault</tt>) prior to
- * any other views.
+ * Note that this class should be registered (in <tt>ComponentFactoryListDefault</tt>) prior to any other views.
  */
 public class EntitySelector extends SelectorPanelAbstract<EntityModel> {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	public EntitySelector(String id, EntityModel model,
-			ComponentFactory factory) {
-		super(id, "entity", model, factory);
-	}
+    public EntitySelector(final String id, final EntityModel model, final ComponentFactory factory) {
+        super(id, "entity", model, factory);
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/EntitySelectorFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/EntitySelectorFactory.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/EntitySelectorFactory.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/EntitySelectorFactory.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity.selector;
 
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
@@ -32,15 +31,15 @@ import org.apache.wicket.model.IModel;
  */
 public class EntitySelectorFactory extends EntityComponentFactoryAbstract {
 
-	private static final long serialVersionUID = 1L;
-
-	public EntitySelectorFactory() {
-		super(ComponentType.ENTITY);
-	}
-
+    private static final long serialVersionUID = 1L;
 
-	public Component createComponent(String id, IModel<?> model) {
-		EntityModel entityModel = (EntityModel) model;
-		return new EntitySelector(id, entityModel, this);
-	}
+    public EntitySelectorFactory() {
+        super(ComponentType.ENTITY);
+    }
+
+    @Override
+    public Component createComponent(final String id, final IModel<?> model) {
+        final EntityModel entityModel = (EntityModel) model;
+        return new EntitySelector(id, entityModel, this);
+    }
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityCollectionTab.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/EntityCollectionTab.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityCollectionTab.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityCollectionTab.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity.tabbed;
 
 import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel;
@@ -28,17 +27,16 @@ import org.apache.isis.viewer.wicket.ui.
  * Tab holding the entity properties.
  */
 class EntityCollectionTab extends TabAbstract<EntityCollectionModel> {
-	
-	private static final long serialVersionUID = 1L;
-	
-	private static final String ID_ENTITY_COLLECTION = "entityCollection";
 
-	public EntityCollectionTab(String id, EntityCollectionModel entityCollectionModel) {
+    private static final long serialVersionUID = 1L;
+
+    private static final String ID_ENTITY_COLLECTION = "entityCollection";
+
+    public EntityCollectionTab(final String id, final EntityCollectionModel entityCollectionModel) {
         super(id, entityCollectionModel);
 
-        getComponentFactoryRegistry().addOrReplaceComponent(this,
-            ID_ENTITY_COLLECTION, ComponentType.COLLECTION_CONTENTS, entityCollectionModel);
+        getComponentFactoryRegistry().addOrReplaceComponent(this, ID_ENTITY_COLLECTION,
+            ComponentType.COLLECTION_CONTENTS, entityCollectionModel);
     }
 
-
 }
\ No newline at end of file

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityPropertiesTab.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/EntityPropertiesTab.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityPropertiesTab.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityPropertiesTab.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity.tabbed;
 
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
@@ -28,11 +27,10 @@ import org.apache.isis.viewer.wicket.ui.
  * Tab holding the entity properties.
  */
 class EntityPropertiesTab extends TabAbstract<EntityModel> {
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	public EntityPropertiesTab(String id, EntityModel entityModel)
-    {
+    public EntityPropertiesTab(final String id, final EntityModel entityModel) {
         super(id, entityModel);
-		addOrReplace(ComponentType.ENTITY_PROPERTIES, entityModel);
+        addOrReplace(ComponentType.ENTITY_PROPERTIES, entityModel);
     }
 }
\ No newline at end of file

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntitySummaryTab.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/EntitySummaryTab.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntitySummaryTab.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntitySummaryTab.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity.tabbed;
 
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
@@ -29,11 +28,10 @@ import org.apache.isis.viewer.wicket.ui.
  */
 class EntitySummaryTab extends TabAbstract<EntityModel> {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	public EntitySummaryTab(String id, EntityModel entityModel)
-    {
+    public EntitySummaryTab(final String id, final EntityModel entityModel) {
         super(id, entityModel);
-		addOrReplace(ComponentType.ENTITY_SUMMARY, entityModel);
+        addOrReplace(ComponentType.ENTITY_SUMMARY, entityModel);
     }
 }
\ No newline at end of file

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=1098948&r1=1098947&r2=1098948&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 Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity.tabbed;
 
 import java.util.ArrayList;
@@ -35,8 +34,8 @@ import org.apache.wicket.markup.html.pan
 import org.apache.wicket.model.Model;
 
 /**
- * {@link PanelAbstract Panel} for entity, with separate tabs for the summary
- * info (icon, title, actions), the properties, and for each of the collections.
+ * {@link PanelAbstract Panel} for entity, with separate tabs for the summary info (icon, title, actions), the
+ * properties, and for each of the collections.
  */
 public class EntityTabbedPanel extends TabbedPanelAbstract<EntityModel> {
 
@@ -44,7 +43,7 @@ public class EntityTabbedPanel extends T
 
     private static final String ID_TABS = "tabs";
 
-    public EntityTabbedPanel(String id, final EntityModel entityModel) {
+    public EntityTabbedPanel(final String id, final EntityModel entityModel) {
         super(id, entityModel);
         buildGui();
     }
@@ -52,12 +51,12 @@ public class EntityTabbedPanel extends T
     private void buildGui() {
 
         // create a list of ITab objects used to feed the tabbed panel
-        List<ITab> tabs = new ArrayList<ITab>();
+        final List<ITab> tabs = new ArrayList<ITab>();
         tabs.add(new AbstractTab(new Model<String>("Summary")) {
             private static final long serialVersionUID = 1L;
 
             @Override
-            public Panel getPanel(String panelId) {
+            public Panel getPanel(final String panelId) {
                 return new EntitySummaryTab(panelId, getModel());
             }
         });
@@ -66,21 +65,19 @@ public class EntityTabbedPanel extends T
             private static final long serialVersionUID = 1L;
 
             @Override
-            public Panel getPanel(String panelId) {
+            public Panel getPanel(final String panelId) {
                 return new EntityPropertiesTab(panelId, getModel());
             }
         });
 
-        List<OneToManyAssociation> collectionList = getModel()
-                .getTypeOfSpecification().getCollections();
-        for (OneToManyAssociation collection : collectionList) {
-            final EntityCollectionModel collectionModel = EntityCollectionModel
-                    .createParented(getModel(), collection);
+        final List<OneToManyAssociation> collectionList = getModel().getTypeOfSpecification().getCollections();
+        for (final OneToManyAssociation collection : collectionList) {
+            final EntityCollectionModel collectionModel = EntityCollectionModel.createParented(getModel(), collection);
             tabs.add(new AbstractTab(new Model<String>(collection.getName())) {
                 private static final long serialVersionUID = 1L;
 
                 @Override
-                public Panel getPanel(String panelId) {
+                public Panel getPanel(final String panelId) {
                     return new EntityCollectionTab(panelId, collectionModel);
                 }
             });

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanelFactory.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/EntityTabbedPanelFactory.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanelFactory.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanelFactory.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.entity.tabbed;
 
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
@@ -32,16 +31,17 @@ import org.apache.wicket.model.IModel;
  */
 public class EntityTabbedPanelFactory extends EntityComponentFactoryAbstract {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	private static final String NAME = "tabbed";
+    private static final String NAME = "tabbed";
 
-	public EntityTabbedPanelFactory() {
-		super(ComponentType.ENTITY, NAME);
-	}
-
-	public Component createComponent(String id, IModel<?> model) {
-		EntityModel entityModel = (EntityModel) model;
-		return new EntityTabbedPanel(id, entityModel);
-	}
+    public EntityTabbedPanelFactory() {
+        super(ComponentType.ENTITY, NAME);
+    }
+
+    @Override
+    public Component createComponent(final String id, final IModel<?> model) {
+        final EntityModel entityModel = (EntityModel) model;
+        return new EntityTabbedPanel(id, entityModel);
+    }
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ComponentFactoryScalarAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ComponentFactoryScalarAbstract.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ComponentFactoryScalarAbstract.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ComponentFactoryScalarAbstract.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.components.scalars;
 
 import org.apache.isis.viewer.wicket.model.models.ScalarModel;
@@ -28,29 +27,30 @@ import org.apache.wicket.model.IModel;
 
 public abstract class ComponentFactoryScalarAbstract extends ComponentFactoryAbstract {
 
-	private static final long serialVersionUID = 1L;
-	
-	private final Class<?>[] scalarTypes;
-
-	public ComponentFactoryScalarAbstract(final Class<?>... scalarTypes) {
-		super(ComponentType.SCALAR_NAME_AND_VALUE);
-		this.scalarTypes = scalarTypes;
-	}
-
-	@Override
-	public ApplicationAdvice appliesTo(IModel<?> model) {
-		if (!(model instanceof ScalarModel)) {
-			return ApplicationAdvice.DOES_NOT_APPLY;
-		}
-		ScalarModel scalarModel = (ScalarModel) model;
-		return appliesIf(scalarModel.isScalarTypeAnyOf(scalarTypes));
-	}
-
-	public final Component createComponent(String id, IModel<?> model) {
-		ScalarModel scalarModel = (ScalarModel) model;
-		return createComponent(id, scalarModel);
-	}
+    private static final long serialVersionUID = 1L;
+
+    private final Class<?>[] scalarTypes;
+
+    public ComponentFactoryScalarAbstract(final Class<?>... scalarTypes) {
+        super(ComponentType.SCALAR_NAME_AND_VALUE);
+        this.scalarTypes = scalarTypes;
+    }
+
+    @Override
+    public ApplicationAdvice appliesTo(final IModel<?> model) {
+        if (!(model instanceof ScalarModel)) {
+            return ApplicationAdvice.DOES_NOT_APPLY;
+        }
+        final ScalarModel scalarModel = (ScalarModel) model;
+        return appliesIf(scalarModel.isScalarTypeAnyOf(scalarTypes));
+    }
+
+    @Override
+    public final Component createComponent(final String id, final IModel<?> model) {
+        final ScalarModel scalarModel = (ScalarModel) model;
+        return createComponent(id, scalarModel);
+    }
 
-	protected abstract Component createComponent(String id, ScalarModel scalarModel);
+    protected abstract Component createComponent(String id, ScalarModel scalarModel);
 
 }



Mime
View raw message