isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1098948 [14/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/panels/PanelAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/PanelAbstract.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/PanelAbstract.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/PanelAbstract.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.panels;
 
 import java.util.List;
@@ -45,144 +44,139 @@ import com.google.inject.Inject;
 /**
  * Convenience adapter for {@link Panel}s built up using {@link ComponentType}s.
  */
-public abstract class PanelAbstract<T extends IModel<?>> extends Panel
-		implements IHeaderContributor, PersistenceSessionAccessor, AuthenticationSessionAccessor {
+public abstract class PanelAbstract<T extends IModel<?>> extends Panel implements IHeaderContributor,
+    PersistenceSessionAccessor, AuthenticationSessionAccessor {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	private ComponentType componentType;
+    private ComponentType componentType;
 
-	/**
+    /**
      * Injected
+     * 
      * @see #setComponentFactoryRegistry(ComponentFactoryRegistry)
      */
     private ComponentFactoryRegistry componentFactoryRegistry;
 
-    
-	public PanelAbstract(ComponentType componentType) {
-		this(componentType, null);
-	}
-
-	public PanelAbstract(String id) {
-		this(id, null);
-	}
-
-	public PanelAbstract(ComponentType componentType, T model) {
-		this(componentType.getWicketId(), model);
-	}
-
-	public PanelAbstract(String id, T model) {
-		super(id, model);
-		this.componentType = ComponentType.lookup(id);
-	}
-
-	/**
-	 * Will be null if created using {@link #PanelAbstract(String, IModel)}.
-	 */
-	public ComponentType getComponentType() {
-		return componentType;
-	}
-
-	@SuppressWarnings("unchecked")
-	protected T getModel() {
-		return (T) getDefaultModel();
-	}
-
-	/**
-	 * For subclasses
-	 * 
-	 * @return
-	 */
-	protected Component addOrReplace(ComponentType componentType,
-			IModel<?> model) {
-		return componentFactoryRegistry.addOrReplaceComponent(this,
-				componentType, model);
-	}
-
-	/**
-	 * For subclasses
-	 */
-	protected void permanentlyHide(ComponentType... componentIds) {
-		Components.permanentlyHide(this, componentIds);
-	}
-
-	/**
-	 * For subclasses
-	 */
-	public void permanentlyHide(String... ids) {
-		Components.permanentlyHide(this, ids);
-	}
-
-	// ///////////////////////////////////////////////////////////////////
-	// Header Contributors
-	// ///////////////////////////////////////////////////////////////////
+    public PanelAbstract(final ComponentType componentType) {
+        this(componentType, null);
+    }
+
+    public PanelAbstract(final String id) {
+        this(id, null);
+    }
+
+    public PanelAbstract(final ComponentType componentType, final T model) {
+        this(componentType.getWicketId(), model);
+    }
+
+    public PanelAbstract(final String id, final T model) {
+        super(id, model);
+        this.componentType = ComponentType.lookup(id);
+    }
 
     /**
-     * Automatically reference any corresponding CSS.
+     * Will be null if created using {@link #PanelAbstract(String, IModel)}.
+     */
+    public ComponentType getComponentType() {
+        return componentType;
+    }
+
+    @SuppressWarnings("unchecked")
+    protected T getModel() {
+        return (T) getDefaultModel();
+    }
+
+    /**
+     * For subclasses
+     * 
+     * @return
+     */
+    protected Component addOrReplace(final ComponentType componentType, final IModel<?> model) {
+        return componentFactoryRegistry.addOrReplaceComponent(this, componentType, model);
+    }
+
+    /**
+     * For subclasses
+     */
+    protected void permanentlyHide(final ComponentType... componentIds) {
+        Components.permanentlyHide(this, componentIds);
+    }
+
+    /**
+     * For subclasses
      */
-	@Override
-	public void renderHead(IHeaderResponse response) {
-		renderHead(response, this.getClass());
-	}
-
-	/**
-	 * Factored out to allow non-concrete subclasses to additionally render
-	 * their own CSS if required.
-	 */
-	protected void renderHead(IHeaderResponse response, final Class<?> cls) {
-		String url = cls.getSimpleName() + ".css";
-		response.renderCSSReference(new ResourceReference(cls, url));
-	}
-
-	// ///////////////////////////////////////////////////////////////////
-	// Convenience
-	// ///////////////////////////////////////////////////////////////////
+    public void permanentlyHide(final String... ids) {
+        Components.permanentlyHide(this, ids);
+    }
+
+    // ///////////////////////////////////////////////////////////////////
+    // Header Contributors
+    // ///////////////////////////////////////////////////////////////////
 
+    /**
+     * Automatically reference any corresponding CSS.
+     */
+    @Override
+    public void renderHead(final IHeaderResponse response) {
+        renderHead(response, this.getClass());
+    }
 
+    /**
+     * Factored out to allow non-concrete subclasses to additionally render their own CSS if required.
+     */
+    protected void renderHead(final IHeaderResponse response, final Class<?> cls) {
+        final String url = cls.getSimpleName() + ".css";
+        response.renderCSSReference(new ResourceReference(cls, url));
+    }
 
+    // ///////////////////////////////////////////////////////////////////
+    // Convenience
+    // ///////////////////////////////////////////////////////////////////
 
-	/**
-	 * The underlying {@link AuthenticationSession Isis session}
-	 * wrapped in the {@link #getWebSession() Wicket session}.
-	 * 
-	 * @return
-	 */
-	public AuthenticationSession getAuthenticationSession() {
-		final AuthenticationSessionAccessor asa = (AuthenticationSessionAccessor) Session.get();
+    /**
+     * The underlying {@link AuthenticationSession Isis session} wrapped in the {@link #getWebSession() Wicket session}.
+     * 
+     * @return
+     */
+    @Override
+    public AuthenticationSession getAuthenticationSession() {
+        final AuthenticationSessionAccessor asa = (AuthenticationSessionAccessor) Session.get();
         return asa.getAuthenticationSession();
-	}
+    }
 
-	// ///////////////////////////////////////////////////////////////////
-	// Dependencies (from IsisContext
-	// ///////////////////////////////////////////////////////////////////
-
-	public IsisContext getIsisContext() {
-		return IsisContext.getInstance();
-	}
-	
-	public PersistenceSession getPersistenceSession() {
-		return IsisContext.getPersistenceSession();
-	}
-
-	protected List<ObjectAdapter> getServiceAdapters() {
-		return getPersistenceSession().getServices();
-	}
-
-	protected OidStringifier getOidStringifier() {
-		return getPersistenceSession().getOidGenerator().getOidStringifier();
-	}
-	
-    ///////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
+    // Dependencies (from IsisContext
+    // ///////////////////////////////////////////////////////////////////
+
+    public IsisContext getIsisContext() {
+        return IsisContext.getInstance();
+    }
+
+    @Override
+    public PersistenceSession getPersistenceSession() {
+        return IsisContext.getPersistenceSession();
+    }
+
+    protected List<ObjectAdapter> getServiceAdapters() {
+        return getPersistenceSession().getServices();
+    }
+
+    protected OidStringifier getOidStringifier() {
+        return getPersistenceSession().getOidGenerator().getOidStringifier();
+    }
+
+    // /////////////////////////////////////////////////
     // Dependency Injection
-    ///////////////////////////////////////////////////
-    
+    // /////////////////////////////////////////////////
+
     protected ComponentFactoryRegistry getComponentFactoryRegistry() {
         return componentFactoryRegistry;
     }
+
     @Inject
-    public void setComponentFactoryRegistry(
-            ComponentFactoryRegistry componentFactoryRegistry) {
+    public void setComponentFactoryRegistry(final ComponentFactoryRegistry componentFactoryRegistry) {
         this.componentFactoryRegistry = componentFactoryRegistry;
     }
-	
+
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/ProcessObjectPanelAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/ProcessObjectPanelAbstract.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/ProcessObjectPanelAbstract.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/ProcessObjectPanelAbstract.java Tue May  3 07:44:41 2011
@@ -17,19 +17,11 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.panels;
 
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.wicket.MarkupContainer;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.repeater.RepeatingView;
-
-import com.google.common.collect.Lists;
-
 import org.apache.isis.applib.filter.Filter;
 import org.apache.isis.applib.filter.Filters;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -50,118 +42,111 @@ import org.apache.isis.viewer.wicket.mod
 import org.apache.isis.viewer.wicket.model.util.Mementos;
 import org.apache.isis.viewer.wicket.ui.ComponentType;
 import org.apache.isis.viewer.wicket.ui.pages.action.ActionPage;
+import org.apache.wicket.MarkupContainer;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.repeater.RepeatingView;
+
+import com.google.common.collect.Lists;
 
 /**
  * Convenience adapter for building bespoke panels for process objects.
  */
-public abstract class ProcessObjectPanelAbstract extends
-		PanelAbstract<EntityModel> {
+public abstract class ProcessObjectPanelAbstract extends PanelAbstract<EntityModel> {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	public ProcessObjectPanelAbstract(String id, EntityModel model) {
-		super(id, model);
-	}
+    public ProcessObjectPanelAbstract(final String id, final EntityModel model) {
+        super(id, model);
+    }
 
-	protected EntityModel getEntityModel() {
-		return getModel();
-	}
+    protected EntityModel getEntityModel() {
+        return getModel();
+    }
 
-    protected void addProperties(MarkupContainer mc, String idProperties, String idProperty) {
-        EntityModel entityModel = getModel();
-        ObjectAdapter adapter = entityModel.getObject();
-        ObjectSpecification noSpec = adapter.getSpecification();
+    protected void addProperties(final MarkupContainer mc, final String idProperties, final String idProperty) {
+        final EntityModel entityModel = getModel();
+        final ObjectAdapter adapter = entityModel.getObject();
+        final ObjectSpecification noSpec = adapter.getSpecification();
 
-        List<OneToOneAssociation> properties = visibleProperties(adapter,
-                noSpec);
+        final List<OneToOneAssociation> properties = visibleProperties(adapter, noSpec);
 
-        RepeatingView rv = new RepeatingView(idProperties);
+        final RepeatingView rv = new RepeatingView(idProperties);
         mc.add(rv);
-        List<PropertyMemento> mementos = buildPropertyMementos(properties);
-        for (PropertyMemento pm : mementos) {
-            WebMarkupContainer container = new WebMarkupContainer(rv
-                    .newChildId());
+        final List<PropertyMemento> mementos = buildPropertyMementos(properties);
+        for (final PropertyMemento pm : mementos) {
+            final WebMarkupContainer container = new WebMarkupContainer(rv.newChildId());
             rv.add(container);
 
-            ScalarModel scalarModel = entityModel.getPropertyModel(pm);
-            getComponentFactoryRegistry().addOrReplaceComponent(container,
-                    idProperty, ComponentType.SCALAR_NAME_AND_VALUE, scalarModel);
+            final ScalarModel scalarModel = entityModel.getPropertyModel(pm);
+            getComponentFactoryRegistry().addOrReplaceComponent(container, idProperty,
+                ComponentType.SCALAR_NAME_AND_VALUE, scalarModel);
         }
     }
 
     @SuppressWarnings("unchecked")
-    private List<OneToOneAssociation> visibleProperties(
-            ObjectAdapter adapter, ObjectSpecification noSpec) {
+    private List<OneToOneAssociation> visibleProperties(final ObjectAdapter adapter, final ObjectSpecification noSpec) {
         @SuppressWarnings("rawtypes")
-        List list = noSpec.getAssociations(visiblePropertyFilter(adapter));
+        final List list = noSpec.getAssociations(visiblePropertyFilter(adapter));
         return new ArrayList<OneToOneAssociation>(list);
     }
 
-    private Filter<ObjectAssociation> visiblePropertyFilter(
-    		ObjectAdapter adapter) {
+    private Filter<ObjectAssociation> visiblePropertyFilter(final ObjectAdapter adapter) {
         return Filters.and(ObjectAssociationFilters.PROPERTIES,
-                ObjectAssociationFilters.dynamicallyVisible(
-                        getAuthenticationSession(), adapter));
+            ObjectAssociationFilters.dynamicallyVisible(getAuthenticationSession(), adapter));
     }
 
-    private List<PropertyMemento> buildPropertyMementos(
-            List<OneToOneAssociation> properties) {
-        List<PropertyMemento> mementos = Lists.transform(properties,
-                Mementos.fromProperty());
+    private List<PropertyMemento> buildPropertyMementos(final List<OneToOneAssociation> properties) {
+        final List<PropertyMemento> mementos = Lists.transform(properties, Mementos.fromProperty());
         // we copy into a new array list otherwise we get lazy evaluation =
         // reference to a non-serializable object
         return Lists.newArrayList(mementos);
     }
 
+    /**
+     * Validates the form properties and domain object (object-level validation).
+     */
+    protected boolean isValid(final Form<?> form) {
+
+        // check properties are all valid
+        if (form.hasError()) {
+            return false;
+        }
+
+        // check object is valid
 
-	/**
-	 * Validates the form properties and domain object (object-level
-	 * validation).
-	 */
-	protected boolean isValid(Form<?> form) {
-
-		// check properties are all valid
-		if (form.hasError()) {
-			return false;
-		}
-
-		// check object is valid
-
-		// 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.
-		ObjectAdapter object = getEntityModel().getObject();
-		Memento snapshotToRollbackToIfInvalid = new Memento(object);
-
-		getEntityModel().apply();
-		String invalidReasonIfAny = getEntityModel().getReasonInvalidIfAny();
-		if (invalidReasonIfAny != null) {
-			form.error(invalidReasonIfAny);
-			snapshotToRollbackToIfInvalid.recreateObject();
-			return false;
-		}
-
-		// ok
-		return true;
-	}
-
-	/**
-	 * Executes action; expected to take no arguments.
-	 */
-	protected void executeNoArgAction(final String actionId) {
-		final ObjectSpecification typeOfSpec = getModel()
-				.getTypeOfSpecification();
-		ObjectAction action = typeOfSpec.getObjectAction(
-			ActionType.USER, actionId);
-		final ObjectAdapterMemento adapterMemento = getModel()
-				.getObjectAdapterMemento();
-		final ActionMemento actionMemento = new ActionMemento(action);
-		final ActionModel.Mode actionMode = ActionModel.determineMode(action);
-
-		ActionModel actionModel = ActionModel.create(adapterMemento,
-				actionMemento, actionMode, SingleResultsMode.INLINE);
-		setResponsePage(new ActionPage(actionModel));
-	}
+        // 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.
+        final ObjectAdapter object = getEntityModel().getObject();
+        final Memento snapshotToRollbackToIfInvalid = new Memento(object);
+
+        getEntityModel().apply();
+        final String invalidReasonIfAny = getEntityModel().getReasonInvalidIfAny();
+        if (invalidReasonIfAny != null) {
+            form.error(invalidReasonIfAny);
+            snapshotToRollbackToIfInvalid.recreateObject();
+            return false;
+        }
+
+        // ok
+        return true;
+    }
+
+    /**
+     * Executes action; expected to take no arguments.
+     */
+    protected void executeNoArgAction(final String actionId) {
+        final ObjectSpecification typeOfSpec = getModel().getTypeOfSpecification();
+        final ObjectAction action = typeOfSpec.getObjectAction(ActionType.USER, actionId);
+        final ObjectAdapterMemento adapterMemento = getModel().getObjectAdapterMemento();
+        final ActionMemento actionMemento = new ActionMemento(action);
+        final ActionModel.Mode actionMode = ActionModel.determineMode(action);
+
+        final ActionModel actionModel =
+            ActionModel.create(adapterMemento, actionMemento, actionMode, SingleResultsMode.INLINE);
+        setResponsePage(new ActionPage(actionModel));
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/DropDownChoiceComponentFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/DropDownChoiceComponentFactory.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/DropDownChoiceComponentFactory.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/DropDownChoiceComponentFactory.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 /**
  * 
  */
@@ -40,60 +39,63 @@ import org.apache.wicket.model.Model;
  * <p>
  * Used by {@link SelectorPanelAbstract}.
  */
-public class DropDownChoiceComponentFactory extends
-		DropDownChoice<ComponentFactory> {
+public class DropDownChoiceComponentFactory extends DropDownChoice<ComponentFactory> {
+
+    private static final long serialVersionUID = 1L;
 
-	private static final long serialVersionUID = 1L;
-	
-	private final IModel<?> underlyingModel;
-	private final String underlyingId;
-	private MarkupContainer container;
-
-	private static final class ComponentFactoryChoiceRenderer implements
-	IChoiceRenderer<ComponentFactory> {
-		private static final long serialVersionUID = 1L;
-	
-		@Override
-		public Object getDisplayValue(ComponentFactory object) {
-			return object.getName();
-		}
-	
-		@Override
-		public String getIdValue(ComponentFactory object, int index) {
-			return Integer.toString(index);
-		}
-	}
-
-	/**
-	 * @param id - id to use for the drop down
-	 * @param selectedComponentFactoryModel - currently selected in the drop-down
-	 * @param componentFactories - list of {@link ComponentFactory}s to show in drop-down
-	 * @param container - the container that should contain the {@link Component} created by the selected {@link ComponentFactory} 
-	 * @param underlyingId - the id of the {@link Component} created
-	 * @param underlyingModel - the model for the {@link Component}, ie as passed to {@link Components#findComponentFactories(org.starobjects.wicket.viewer.components.ComponentType, IModel)}
-	 */
-	public DropDownChoiceComponentFactory(String id,
-			Model<ComponentFactory> selectedComponentFactoryModel,
-			List<? extends ComponentFactory> componentFactories,
-			MarkupContainer container, 
-			String underlyingId, 
-			IModel<?> underlyingModel) {
-		super(id, selectedComponentFactoryModel, componentFactories, new ComponentFactoryChoiceRenderer());
-		this.underlyingId = underlyingId;
-		this.underlyingModel = underlyingModel;
-		this.container = container;
-	}
-
-	@Override
-	protected boolean wantOnSelectionChangedNotifications() {
-		return true;
-	}
-
-	@Override
-	protected void onSelectionChanged(ComponentFactory newSelection) {
-		ComponentFactory componentFactory = getModel().getObject();
-		if (componentFactory != null)
-			container.addOrReplace(componentFactory
-					.createComponent(underlyingId, underlyingModel));
-	}
+    private final IModel<?> underlyingModel;
+    private final String underlyingId;
+    private final MarkupContainer container;
+
+    private static final class ComponentFactoryChoiceRenderer implements IChoiceRenderer<ComponentFactory> {
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        public Object getDisplayValue(final ComponentFactory object) {
+            return object.getName();
+        }
+
+        @Override
+        public String getIdValue(final ComponentFactory object, final int index) {
+            return Integer.toString(index);
+        }
+    }
+
+    /**
+     * @param id
+     *            - id to use for the drop down
+     * @param selectedComponentFactoryModel
+     *            - currently selected in the drop-down
+     * @param componentFactories
+     *            - list of {@link ComponentFactory}s to show in drop-down
+     * @param container
+     *            - the container that should contain the {@link Component} created by the selected
+     *            {@link ComponentFactory}
+     * @param underlyingId
+     *            - the id of the {@link Component} created
+     * @param underlyingModel
+     *            - the model for the {@link Component}, ie as passed to
+     *            {@link Components#findComponentFactories(org.starobjects.wicket.viewer.components.ComponentType, IModel)}
+     */
+    public DropDownChoiceComponentFactory(final String id, final Model<ComponentFactory> selectedComponentFactoryModel,
+        final List<? extends ComponentFactory> componentFactories, final MarkupContainer container,
+        final String underlyingId, final IModel<?> underlyingModel) {
+        super(id, selectedComponentFactoryModel, componentFactories, new ComponentFactoryChoiceRenderer());
+        this.underlyingId = underlyingId;
+        this.underlyingModel = underlyingModel;
+        this.container = container;
+    }
+
+    @Override
+    protected boolean wantOnSelectionChangedNotifications() {
+        return true;
+    }
+
+    @Override
+    protected void onSelectionChanged(final ComponentFactory newSelection) {
+        final ComponentFactory componentFactory = getModel().getObject();
+        if (componentFactory != null) {
+            container.addOrReplace(componentFactory.createComponent(underlyingId, underlyingModel));
+        }
+    }
 }
\ No newline at end of file

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/SelectorPanelAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/SelectorPanelAbstract.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/SelectorPanelAbstract.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/SelectorPanelAbstract.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.selector;
 
 import java.util.List;
@@ -34,65 +33,58 @@ import com.google.common.base.Predicate;
 import com.google.common.collect.Collections2;
 import com.google.common.collect.Lists;
 
-public abstract class SelectorPanelAbstract<T extends IModel<?>> extends
-		PanelAbstract<T> {
+public abstract class SelectorPanelAbstract<T extends IModel<?>> extends PanelAbstract<T> {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	private static final String ID_VIEWS = "views";
-	private static final String ID_VIEWS_DROP_DOWN = "viewsDropDown";
+    private static final String ID_VIEWS = "views";
+    private static final String ID_VIEWS_DROP_DOWN = "viewsDropDown";
 
     private final ComponentType componentType;
 
-    public SelectorPanelAbstract(final String id,
-            final String underlyingId, final T model, final ComponentFactory factory) {
+    public SelectorPanelAbstract(final String id, final String underlyingId, final T model,
+        final ComponentFactory factory) {
         super(id, model);
-        
+
         componentType = factory.getComponentType();
 
         addUnderlyingViews(underlyingId, model, factory);
     }
 
-    private void addUnderlyingViews(final String underlyingId, final T model,
-            final ComponentFactory factory) {
-        List<ComponentFactory> componentFactories = findOtherComponentFactories(
-				model, factory);
-		ComponentFactory firstComponentFactory = componentFactories.get(0);
-		final Model<ComponentFactory> componentFactoryModel = new Model<ComponentFactory>();
-		componentFactoryModel.setObject(firstComponentFactory);
-
-		if (componentFactories.size()>1) {
-			WebMarkupContainer views = new WebMarkupContainer(ID_VIEWS);
-			DropDownChoiceComponentFactory viewsDropDown = new DropDownChoiceComponentFactory(ID_VIEWS_DROP_DOWN,
-					componentFactoryModel,
-					componentFactories,
-					this, underlyingId, model);
-			views.addOrReplace(viewsDropDown);
-			addOrReplace(views);
-		} else {
-			permanentlyHide(ID_VIEWS);
-		}
-		addOrReplace(firstComponentFactory.createComponent(underlyingId, model));
+    private void addUnderlyingViews(final String underlyingId, final T model, final ComponentFactory factory) {
+        final List<ComponentFactory> componentFactories = findOtherComponentFactories(model, factory);
+        final ComponentFactory firstComponentFactory = componentFactories.get(0);
+        final Model<ComponentFactory> componentFactoryModel = new Model<ComponentFactory>();
+        componentFactoryModel.setObject(firstComponentFactory);
+
+        if (componentFactories.size() > 1) {
+            final WebMarkupContainer views = new WebMarkupContainer(ID_VIEWS);
+            final DropDownChoiceComponentFactory viewsDropDown =
+                new DropDownChoiceComponentFactory(ID_VIEWS_DROP_DOWN, componentFactoryModel, componentFactories, this,
+                    underlyingId, model);
+            views.addOrReplace(viewsDropDown);
+            addOrReplace(views);
+        } else {
+            permanentlyHide(ID_VIEWS);
+        }
+        addOrReplace(firstComponentFactory.createComponent(underlyingId, model));
     }
 
-	private List<ComponentFactory> findOtherComponentFactories(
-			T model, final ComponentFactory ignoreFactory) {
-		List<ComponentFactory> componentFactories = getComponentFactoryRegistry()
-				.findComponentFactories(componentType, model);
-		return Lists.newArrayList(Collections2.filter(componentFactories,
-				new Predicate<ComponentFactory>() {
-					@Override
-					public boolean apply(ComponentFactory input) {
-						return input != ignoreFactory;
-					}
-				}));
-	}
+    private List<ComponentFactory> findOtherComponentFactories(final T model, final ComponentFactory ignoreFactory) {
+        final List<ComponentFactory> componentFactories =
+            getComponentFactoryRegistry().findComponentFactories(componentType, model);
+        return Lists.newArrayList(Collections2.filter(componentFactories, new Predicate<ComponentFactory>() {
+            @Override
+            public boolean apply(final ComponentFactory input) {
+                return input != ignoreFactory;
+            }
+        }));
+    }
 
     @Override
-    public void renderHead(IHeaderResponse response) {
+    public void renderHead(final IHeaderResponse response) {
         super.renderHead(response);
         renderHead(response, SelectorPanelAbstract.class);
     }
 
-
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/tabs/TabAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/tabs/TabAbstract.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/tabs/TabAbstract.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/tabs/TabAbstract.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.tabs;
 
 import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
@@ -25,10 +24,10 @@ import org.apache.wicket.model.IModel;
 
 public class TabAbstract<T extends IModel<?>> extends PanelAbstract<T> {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	public TabAbstract(String id, T model) {
-		super(id, model);
-	}
+    public TabAbstract(final String id, final T model) {
+        super(id, model);
+    }
 
 }
\ No newline at end of file

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/tabs/TabbedPanelAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/tabs/TabbedPanelAbstract.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/tabs/TabbedPanelAbstract.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/tabs/TabbedPanelAbstract.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.tabs;
 
 import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
@@ -25,21 +24,20 @@ import org.apache.wicket.markup.html.IHe
 import org.apache.wicket.model.IModel;
 
 /**
- * Adapter class for tabbed panels; does very little in itself, but does ensure that
- * the CSS needed is rendered.
+ * Adapter class for tabbed panels; does very little in itself, but does ensure that the CSS needed is rendered.
  */
 public abstract class TabbedPanelAbstract<T extends IModel<?>> extends PanelAbstract<T> {
 
-	private static final long serialVersionUID = 1L;
-	
-	public TabbedPanelAbstract(String id, final T model) {
-		super(id, model);
-	}
-
-	@Override
-	public void renderHead(IHeaderResponse response) {
-		super.renderHead(response);
-		renderHead(response, TabbedPanelAbstract.class);
-	}
+    private static final long serialVersionUID = 1L;
+
+    public TabbedPanelAbstract(final String id, final T model) {
+        super(id, model);
+    }
+
+    @Override
+    public void renderHead(final IHeaderResponse response) {
+        super.renderHead(response);
+        renderHead(response, TabbedPanelAbstract.class);
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/util/Components.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/util/Components.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/util/Components.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/util/Components.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.util;
 
 import org.apache.isis.viewer.wicket.ui.ComponentType;
@@ -27,61 +26,60 @@ import org.apache.wicket.markup.html.bas
 
 public final class Components {
 
-	private Components() {
-	}
+    private Components() {
+    }
 
-	/**
-	 * Permanently hides by replacing with a {@link Label} that has an empty string for its caption.
-	 */
-	public static void permanentlyHide(MarkupContainer container, String... ids) {
-		for (String id : ids) {
-			permanentlyHideSingle(container, id);
-		}
-	}
-
-	/**
-	 * @see #permanentlyHide(MarkupContainer, String...)
-	 */
-	public static void permanentlyHide(MarkupContainer container,
-			ComponentType... componentIds) {
-		for (ComponentType componentType : componentIds) {
-			String wicketId = componentType.getWicketId();
-			permanentlyHideSingle(container, wicketId);
-		}
-	}
-	
-	/**
-	 * Not overloaded because - although compiles ok on JDK6u20 (Mac), fails to on JDK6u18 (Ubuntu)
-	 */
-	private static void permanentlyHideSingle(MarkupContainer container, String id) {
-		Label label = new Label(id, "");
-		label.setVisible(false);
-		container.addOrReplace(label);
-	}
-
-	/**
-	 * Sets the visibility of the child component(s) within the supplied container.
-	 */
-	public static void setVisible(MarkupContainer container, boolean visibility, String... ids) {
-		for (String id : ids) {
-			setVisible(container, visibility, id);
-		}
-	}
-
-	/**
-	 * @see #setVisible(MarkupContainer, boolean, String...)
-	 */
-	public static void setVisible(MarkupContainer container, boolean visibility, ComponentType... componentTypes) {
-		for (ComponentType componentType: componentTypes) {
-			String wicketId = componentType.getWicketId();
-			setVisible(container, visibility, wicketId);
-		}
-	}
-
-	private static void setVisible(MarkupContainer container,
-			boolean visibility, String wicketId) {
-		Component childComponent = container.get(wicketId);
-		childComponent.setVisible(visibility);
-	}
+    /**
+     * Permanently hides by replacing with a {@link Label} that has an empty string for its caption.
+     */
+    public static void permanentlyHide(final MarkupContainer container, final String... ids) {
+        for (final String id : ids) {
+            permanentlyHideSingle(container, id);
+        }
+    }
+
+    /**
+     * @see #permanentlyHide(MarkupContainer, String...)
+     */
+    public static void permanentlyHide(final MarkupContainer container, final ComponentType... componentIds) {
+        for (final ComponentType componentType : componentIds) {
+            final String wicketId = componentType.getWicketId();
+            permanentlyHideSingle(container, wicketId);
+        }
+    }
+
+    /**
+     * Not overloaded because - although compiles ok on JDK6u20 (Mac), fails to on JDK6u18 (Ubuntu)
+     */
+    private static void permanentlyHideSingle(final MarkupContainer container, final String id) {
+        final Label label = new Label(id, "");
+        label.setVisible(false);
+        container.addOrReplace(label);
+    }
+
+    /**
+     * Sets the visibility of the child component(s) within the supplied container.
+     */
+    public static void setVisible(final MarkupContainer container, final boolean visibility, final String... ids) {
+        for (final String id : ids) {
+            setVisible(container, visibility, id);
+        }
+    }
+
+    /**
+     * @see #setVisible(MarkupContainer, boolean, String...)
+     */
+    public static void setVisible(final MarkupContainer container, final boolean visibility,
+        final ComponentType... componentTypes) {
+        for (final ComponentType componentType : componentTypes) {
+            final String wicketId = componentType.getWicketId();
+            setVisible(container, visibility, wicketId);
+        }
+    }
+
+    private static void setVisible(final MarkupContainer container, final boolean visibility, final String wicketId) {
+        final Component childComponent = container.get(wicketId);
+        childComponent.setVisible(visibility);
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/util/CssClassAppender.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/util/CssClassAppender.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/util/CssClassAppender.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/util/CssClassAppender.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.util;
 
 import org.apache.wicket.behavior.AttributeAppender;
@@ -25,20 +24,18 @@ import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 
 /**
- * Implementation of {@link AttributeAppender} that appends the
- * provided CSS <tt>class</tt> attribute.
+ * Implementation of {@link AttributeAppender} that appends the provided CSS <tt>class</tt> attribute.
  */
 public class CssClassAppender extends AttributeAppender {
-	
-	private static final long serialVersionUID = 1L;
-	
-	public CssClassAppender(IModel<String> appendModel) {
-		super("class", appendModel, " ");
-	}
-
-	public CssClassAppender(String append) {
-		this(Model.of(append));
-	}
 
+    private static final long serialVersionUID = 1L;
+
+    public CssClassAppender(final IModel<String> appendModel) {
+        super("class", appendModel, " ");
+    }
+
+    public CssClassAppender(final String append) {
+        this(Model.of(append));
+    }
 
 }
\ No newline at end of file

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/util/EvenOrOddCssClassAppenderFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/util/EvenOrOddCssClassAppenderFactory.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/util/EvenOrOddCssClassAppenderFactory.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/util/EvenOrOddCssClassAppenderFactory.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.util;
 
 import org.apache.wicket.behavior.IBehavior;
@@ -25,10 +24,9 @@ import org.apache.wicket.behavior.IBehav
 public class EvenOrOddCssClassAppenderFactory {
 
     private enum EvenOrOdd {
-        EVEN,
-        ODD;
+        EVEN, ODD;
         private EvenOrOddCssClassAppenderFactory.EvenOrOdd next() {
-            return this==EVEN?ODD:EVEN;
+            return this == EVEN ? ODD : EVEN;
         }
 
         private String className() {
@@ -36,11 +34,11 @@ public class EvenOrOddCssClassAppenderFa
         }
     }
 
-   private EvenOrOddCssClassAppenderFactory.EvenOrOdd eo = EvenOrOdd.EVEN;
+    private EvenOrOddCssClassAppenderFactory.EvenOrOdd eo = EvenOrOdd.EVEN;
 
-   public IBehavior nextClass() {
-       final String className = eo.className();
-       eo = eo.next();
-       return new CssClassAppender(className);
-   }
+    public IBehavior nextClass() {
+        final String className = eo.className();
+        eo = eo.next();
+        return new CssClassAppender(className);
+    }
 }
\ No newline at end of file

Modified: incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/zzz/cssplaytime/CssPlaytimePage.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/zzz/cssplaytime/CssPlaytimePage.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/zzz/cssplaytime/CssPlaytimePage.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/zzz/cssplaytime/CssPlaytimePage.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.zzz.cssplaytime;
 
 import org.apache.isis.viewer.wicket.ui.pages.PageAbstract;
@@ -25,8 +24,8 @@ import org.apache.wicket.PageParameters;
 
 public class CssPlaytimePage extends PageAbstract {
 
-	public CssPlaytimePage() {
-		super(new PageParameters());
-	}
+    public CssPlaytimePage() {
+        super(new PageParameters());
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/ComponentType_ConstantsTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/ComponentType_ConstantsTest.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/ComponentType_ConstantsTest.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/ComponentType_ConstantsTest.java Tue May  3 07:44:41 2011
@@ -17,21 +17,21 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui;
 
 import static org.hamcrest.Matchers.is;
 import static org.junit.Assert.assertThat;
 
-import org.apache.isis.viewer.wicket.ui.ComponentType;
 import org.junit.Test;
 
 public class ComponentType_ConstantsTest {
 
-	@Test
-	public void testToString() {
-		assertThat(ComponentType.COLLECTION_CONTENTS.toString(), is("collectionContents"));
-	}
-
-	public enum X {FOO,BAR}
+    @Test
+    public void testToString() {
+        assertThat(ComponentType.COLLECTION_CONTENTS.toString(), is("collectionContents"));
+    }
+
+    public enum X {
+        FOO, BAR
+    }
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssMenuUtilsTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssMenuUtilsTest.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssMenuUtilsTest.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssMenuUtilsTest.java Tue May  3 07:44:41 2011
@@ -17,8 +17,6 @@
  *  under the License.
  */
 
-
-
 package org.apache.isis.viewer.wicket.ui.components.widgets.cssmenu;
 
 import static org.hamcrest.Matchers.is;
@@ -29,20 +27,6 @@ import static org.junit.Assert.assertTha
 import java.util.Collections;
 import java.util.List;
 
-import org.apache.wicket.markup.html.link.Link;
-import org.apache.wicket.util.tester.WicketTester;
-import org.jmock.Mockery;
-import org.jmock.integration.junit4.JMock;
-import org.jmock.integration.junit4.JUnit4Mockery;
-import org.jmock.lib.legacy.ClassImposteriser;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import com.google.common.collect.Lists;
-
 import org.apache.isis.applib.Identifier;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
@@ -57,123 +41,134 @@ import org.apache.isis.viewer.wicket.ui.
 import org.apache.isis.viewer.wicket.ui.fixtures.Customers;
 import org.apache.isis.viewer.wicket.ui.fixtures.SpecFixtures;
 import org.apache.isis.viewer.wicket.ui.fixtures.SystemFixtures;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.util.tester.WicketTester;
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JMock;
+import org.jmock.integration.junit4.JUnit4Mockery;
+import org.jmock.lib.legacy.ClassImposteriser;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.google.common.collect.Lists;
 
 @RunWith(JMock.class)
 public class CssMenuUtilsTest {
 
-	private Mockery context = new JUnit4Mockery() {{
-		setImposteriser(ClassImposteriser.INSTANCE);
-	}};
-
-	private ObjectAdapter mockAdapter;
-	private ObjectAdapterMemento mockAdapterMemento;
-	private Oid mockOid;
-
-	private ObjectAction setAction;
-
-	private ObjectAction mockUserAction;
-	private ObjectSpecification mockUserActionOnTypeSpec;
-
-	private CssMenuLinkFactory mockLinkBuilder;
-	private RuntimeContext mockRuntimeContext;
-
-	@SuppressWarnings("unused")
-	private WicketTester wicketTester;
-
-	private Link<String> fakeLink;
-
-
-
-	@Before
-	public void setUp() throws Exception {
-		wicketTester = new WicketTester();
-		
-		mockAdapter = context.mock(ObjectAdapter.class);
-		mockAdapterMemento = context.mock(ObjectAdapterMemento.class);
-		mockOid = context.mock(Oid.class);
-
-		mockUserAction = context.mock(ObjectAction.class, "userAction");
-		mockUserActionOnTypeSpec = context.mock(ObjectSpecification.class);
-		
-		fakeLink = new Link<String>(CssMenuItem.ID_MENU_LINK){
-			private static final long serialVersionUID = 1L;
-
-			@Override
-			public void onClick() {
-			}};
-
-		mockLinkBuilder = context.mock(CssMenuLinkFactory.class);
-		mockRuntimeContext = context.mock(RuntimeContext.class);
-	}
-
-	@After
-	public void tearDown() throws Exception {
-		wicketTester = null;
-	}
-	
-	@Ignore("broken...")
-	@Test
-	public void whenUserActionThenSingleMenuItem() throws Exception {
-
-		new ActionFixtures(context).isVisible(mockUserAction, true);
-		new ActionFixtures(context).isUsable(mockUserAction, true);
-		
-		new ActionFixtures(context).getName(mockUserAction, "findCustomers");
-		
-		new ActionFixtures(context).getParameterCount(mockUserAction, 0);
-		new AdapterFixtures(context).getOid(mockAdapter, mockOid);
-		new ActionFixtures(context).getOnType(mockUserAction, mockUserActionOnTypeSpec);
-		new SpecFixtures(context).getFullName(mockUserActionOnTypeSpec, Customers.class.getName());
-		new ActionFixtures(context).getType(mockUserAction, ActionType.USER);
-		new ActionFixtures(context).getIdentifier(context, mockUserAction, Identifier.actionIdentifier(Customers.class, "findCustomers", new Class[0]));
-
-		new SystemFixtures(context).newLink(mockLinkBuilder, "linkId", mockAdapterMemento, mockUserAction, fakeLink);
-
-		CssMenuItem parentMenuItem = CssMenuItem.newMenuItem("parent").build();
-		parentMenuItem.newSubMenuItem(mockAdapterMemento, mockUserAction, mockLinkBuilder).build();
-		
-		assertThat(parentMenuItem.hasSubMenuItems(), is(true));
-		assertThat(parentMenuItem.getSubMenuItems().size(), is(1));
-	}
-
-	
-	@Ignore("broken...")
-	@Test
-	public void whenSetActionWithNoChildrenThenNoMenuItem() throws Exception {
-
-		setAction = new ObjectActionSet("customers", "Customers", Lists.<ObjectAction>newArrayList());
-
-		new SystemFixtures(context).newLink(mockLinkBuilder, "linkId", mockAdapterMemento, setAction, fakeLink);
-
-		new AdapterFixtures(context).getOid(mockAdapter, mockOid);
-
-
-		CssMenuItem parentMenuItem = CssMenuItem.newMenuItem("parent").build();
-		parentMenuItem.newSubMenuItem(mockAdapterMemento, setAction, mockLinkBuilder);
-		
-		assertThat(parentMenuItem.hasSubMenuItems(), is(false));
-	}
-
-	
-	@Ignore("broken...")
-	@Test
-	public void whenSetActionWithOneChildThenMenuItemForSetActionAndMenuItemUnderneath() throws Exception {
-
-		setAction = new ObjectActionSet("customers", "Customers", Collections.singletonList(mockUserAction));
-
-		new AdapterFixtures(context).getOid(mockAdapter, mockOid);
-
-		new SystemFixtures(context).newLink(mockLinkBuilder, "linkId", mockAdapterMemento, setAction, fakeLink);
-
-		CssMenuItem parentMenuItem = CssMenuItem.newMenuItem("parent").build();
-		parentMenuItem.newSubMenuItem(mockAdapterMemento, setAction, mockLinkBuilder).build();
-		
-		assertThat(parentMenuItem.hasSubMenuItems(), is(true));
-		List<CssMenuItem> subMenuItems = parentMenuItem.getSubMenuItems();
-		assertThat(subMenuItems.size(), is(1));
-		CssMenuItem childMenuItem = subMenuItems.get(0);
-		assertThat(childMenuItem, is(not(nullValue(CssMenuItem.class))));
-	}
+    private final Mockery context = new JUnit4Mockery() {
+        {
+            setImposteriser(ClassImposteriser.INSTANCE);
+        }
+    };
+
+    private ObjectAdapter mockAdapter;
+    private ObjectAdapterMemento mockAdapterMemento;
+    private Oid mockOid;
+
+    private ObjectAction setAction;
+
+    private ObjectAction mockUserAction;
+    private ObjectSpecification mockUserActionOnTypeSpec;
+
+    private CssMenuLinkFactory mockLinkBuilder;
+    private RuntimeContext mockRuntimeContext;
+
+    @SuppressWarnings("unused")
+    private WicketTester wicketTester;
+
+    private Link<String> fakeLink;
+
+    @Before
+    public void setUp() throws Exception {
+        wicketTester = new WicketTester();
+
+        mockAdapter = context.mock(ObjectAdapter.class);
+        mockAdapterMemento = context.mock(ObjectAdapterMemento.class);
+        mockOid = context.mock(Oid.class);
+
+        mockUserAction = context.mock(ObjectAction.class, "userAction");
+        mockUserActionOnTypeSpec = context.mock(ObjectSpecification.class);
+
+        fakeLink = new Link<String>(CssMenuItem.ID_MENU_LINK) {
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public void onClick() {
+            }
+        };
+
+        mockLinkBuilder = context.mock(CssMenuLinkFactory.class);
+        mockRuntimeContext = context.mock(RuntimeContext.class);
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        wicketTester = null;
+    }
+
+    @Ignore("broken...")
+    @Test
+    public void whenUserActionThenSingleMenuItem() throws Exception {
+
+        new ActionFixtures(context).isVisible(mockUserAction, true);
+        new ActionFixtures(context).isUsable(mockUserAction, true);
+
+        new ActionFixtures(context).getName(mockUserAction, "findCustomers");
+
+        new ActionFixtures(context).getParameterCount(mockUserAction, 0);
+        new AdapterFixtures(context).getOid(mockAdapter, mockOid);
+        new ActionFixtures(context).getOnType(mockUserAction, mockUserActionOnTypeSpec);
+        new SpecFixtures(context).getFullName(mockUserActionOnTypeSpec, Customers.class.getName());
+        new ActionFixtures(context).getType(mockUserAction, ActionType.USER);
+        new ActionFixtures(context).getIdentifier(context, mockUserAction,
+            Identifier.actionIdentifier(Customers.class, "findCustomers", new Class[0]));
+
+        new SystemFixtures(context).newLink(mockLinkBuilder, "linkId", mockAdapterMemento, mockUserAction, fakeLink);
+
+        final CssMenuItem parentMenuItem = CssMenuItem.newMenuItem("parent").build();
+        parentMenuItem.newSubMenuItem(mockAdapterMemento, mockUserAction, mockLinkBuilder).build();
+
+        assertThat(parentMenuItem.hasSubMenuItems(), is(true));
+        assertThat(parentMenuItem.getSubMenuItems().size(), is(1));
+    }
+
+    @Ignore("broken...")
+    @Test
+    public void whenSetActionWithNoChildrenThenNoMenuItem() throws Exception {
+
+        setAction = new ObjectActionSet("customers", "Customers", Lists.<ObjectAction> newArrayList());
+
+        new SystemFixtures(context).newLink(mockLinkBuilder, "linkId", mockAdapterMemento, setAction, fakeLink);
+
+        new AdapterFixtures(context).getOid(mockAdapter, mockOid);
+
+        final CssMenuItem parentMenuItem = CssMenuItem.newMenuItem("parent").build();
+        parentMenuItem.newSubMenuItem(mockAdapterMemento, setAction, mockLinkBuilder);
+
+        assertThat(parentMenuItem.hasSubMenuItems(), is(false));
+    }
+
+    @Ignore("broken...")
+    @Test
+    public void whenSetActionWithOneChildThenMenuItemForSetActionAndMenuItemUnderneath() throws Exception {
+
+        setAction = new ObjectActionSet("customers", "Customers", Collections.singletonList(mockUserAction));
+
+        new AdapterFixtures(context).getOid(mockAdapter, mockOid);
+
+        new SystemFixtures(context).newLink(mockLinkBuilder, "linkId", mockAdapterMemento, setAction, fakeLink);
+
+        final CssMenuItem parentMenuItem = CssMenuItem.newMenuItem("parent").build();
+        parentMenuItem.newSubMenuItem(mockAdapterMemento, setAction, mockLinkBuilder).build();
 
+        assertThat(parentMenuItem.hasSubMenuItems(), is(true));
+        final List<CssMenuItem> subMenuItems = parentMenuItem.getSubMenuItems();
+        assertThat(subMenuItems.size(), is(1));
+        final CssMenuItem childMenuItem = subMenuItems.get(0);
+        assertThat(childMenuItem, is(not(nullValue(CssMenuItem.class))));
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/ActionFixtures.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/ActionFixtures.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/ActionFixtures.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/ActionFixtures.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.fixtures;
 
 import org.apache.isis.applib.Identifier;
@@ -33,84 +32,82 @@ import org.jmock.Mockery;
 
 public final class ActionFixtures {
 
-	private Mockery context;
-
-	public ActionFixtures(Mockery context) {
-		this.context = context;
-	}
-
-	public <T extends Facet> void getFacet(final ObjectAction mockAction, final Class<T> facetClass, final T returns) {
-		context.checking(new Expectations() {
-			{
-				allowing(mockAction).getFacet(with(facetClass));
-				will(returnValue(returns));
-			}
-		});
-	}
-
-	public void getName(final ObjectAction mockAction, final String returns) {
-		context.checking(new Expectations() {
-			{
-				allowing(mockAction).getName();
-				will(returnValue(returns));
-			}
-		});
-	}
-
-	public <T extends Facet> void getParameterCount(final ObjectAction mockAction, final int returns) {
-		context.checking(new Expectations() {
-			{
-				allowing(mockAction).getParameterCount();
-				will(returnValue(returns));
-			}
-		});
-	}
-
-	public void getType(final ObjectAction mockAction, final ActionType returns) {
-		context.checking(new Expectations() {
-			{
-				allowing(mockAction).getType();
-				will(returnValue(returns));
-			}
-		});
-	}
-
-	public void getIdentifier(Mockery context,
-			final ObjectAction mockAction, final Identifier returns) {
-		context.checking(new Expectations() {
-			{
-				allowing(mockAction).getIdentifier();
-				will(returnValue(returns));
-			}
-		});
-	}
-
-	public void getOnType(final ObjectAction mockAction, final ObjectSpecification returns) {
-		context.checking(new Expectations() {
-			{
-				allowing(mockAction).getOnType();
-				will(returnValue(returns));
-			}
-		});
-	}
-
-	public void isVisible(final ObjectAction mockAction, final boolean returns) {
-		context.checking(new Expectations() {
-			{
-				allowing(mockAction).isVisible(with(any(AuthenticationSession.class)), with(any(ObjectAdapter.class)));
-				will(returnValue(ConsentAbstract.allowIf(returns)));
-			}
-		});
-	}
-
-	public void isUsable(final ObjectAction mockAction, final boolean returns) {
-		context.checking(new Expectations() {
-			{
-				allowing(mockAction).isUsable(with(any(AuthenticationSession.class)), with(any(ObjectAdapter.class)));
-				will(returnValue(ConsentAbstract.allowIf(returns)));
-			}
-		});
-	}
+    private final Mockery context;
 
+    public ActionFixtures(final Mockery context) {
+        this.context = context;
+    }
+
+    public <T extends Facet> void getFacet(final ObjectAction mockAction, final Class<T> facetClass, final T returns) {
+        context.checking(new Expectations() {
+            {
+                allowing(mockAction).getFacet(with(facetClass));
+                will(returnValue(returns));
+            }
+        });
+    }
+
+    public void getName(final ObjectAction mockAction, final String returns) {
+        context.checking(new Expectations() {
+            {
+                allowing(mockAction).getName();
+                will(returnValue(returns));
+            }
+        });
+    }
+
+    public <T extends Facet> void getParameterCount(final ObjectAction mockAction, final int returns) {
+        context.checking(new Expectations() {
+            {
+                allowing(mockAction).getParameterCount();
+                will(returnValue(returns));
+            }
+        });
+    }
+
+    public void getType(final ObjectAction mockAction, final ActionType returns) {
+        context.checking(new Expectations() {
+            {
+                allowing(mockAction).getType();
+                will(returnValue(returns));
+            }
+        });
+    }
+
+    public void getIdentifier(final Mockery context, final ObjectAction mockAction, final Identifier returns) {
+        context.checking(new Expectations() {
+            {
+                allowing(mockAction).getIdentifier();
+                will(returnValue(returns));
+            }
+        });
+    }
+
+    public void getOnType(final ObjectAction mockAction, final ObjectSpecification returns) {
+        context.checking(new Expectations() {
+            {
+                allowing(mockAction).getOnType();
+                will(returnValue(returns));
+            }
+        });
+    }
+
+    public void isVisible(final ObjectAction mockAction, final boolean returns) {
+        context.checking(new Expectations() {
+            {
+                allowing(mockAction).isVisible(with(any(AuthenticationSession.class)), with(any(ObjectAdapter.class)));
+                will(returnValue(ConsentAbstract.allowIf(returns)));
+            }
+        });
+    }
+
+    public void isUsable(final ObjectAction mockAction, final boolean returns) {
+        context.checking(new Expectations() {
+            {
+                allowing(mockAction).isUsable(with(any(AuthenticationSession.class)), with(any(ObjectAdapter.class)));
+                will(returnValue(ConsentAbstract.allowIf(returns)));
+            }
+        });
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/AdapterFixtures.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/AdapterFixtures.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/AdapterFixtures.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/AdapterFixtures.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.fixtures;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -25,20 +24,20 @@ import org.jmock.Expectations;
 import org.jmock.Mockery;
 
 public final class AdapterFixtures {
-	
-	private Mockery context;
-	public AdapterFixtures(Mockery context) {
-		this.context = context;
-	}
-
-	public void getOid(final ObjectAdapter mockAdapter, final Object returns) {
-		context.checking(new Expectations() {
-			{
-				allowing(mockAdapter).getOid();
-				will(returnValue(returns));
-			}
-		});
-	}
 
+    private final Mockery context;
+
+    public AdapterFixtures(final Mockery context) {
+        this.context = context;
+    }
+
+    public void getOid(final ObjectAdapter mockAdapter, final Object returns) {
+        context.checking(new Expectations() {
+            {
+                allowing(mockAdapter).getOid();
+                will(returnValue(returns));
+            }
+        });
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/Customers.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/Customers.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/Customers.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/Customers.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.fixtures;
 
 public class Customers {

Modified: incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/SpecFixtures.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/SpecFixtures.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/SpecFixtures.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/SpecFixtures.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.fixtures;
 
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
@@ -26,21 +25,19 @@ import org.jmock.Mockery;
 
 public final class SpecFixtures {
 
-	private Mockery context;
-
-	public SpecFixtures(Mockery context) {
-		this.context = context;
-	}
-
-	public void getFullName(final ObjectSpecification mockNoSpec,
-			final String returns) {
-		context.checking(new Expectations() {
-			{
-				allowing(mockNoSpec).getFullIdentifier();
-				will(returnValue(returns));
-			}
-		});
-	}
+    private final Mockery context;
 
+    public SpecFixtures(final Mockery context) {
+        this.context = context;
+    }
+
+    public void getFullName(final ObjectSpecification mockNoSpec, final String returns) {
+        context.checking(new Expectations() {
+            {
+                allowing(mockNoSpec).getFullIdentifier();
+                will(returnValue(returns));
+            }
+        });
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/SystemFixtures.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/SystemFixtures.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/SystemFixtures.java (original)
+++ incubator/isis/trunk/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/SystemFixtures.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.ui.fixtures;
 
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
@@ -31,28 +30,29 @@ import org.jmock.Mockery;
 
 public final class SystemFixtures {
 
-	private Mockery context;
-	public SystemFixtures(Mockery context) {
-		this.context = context;
-	}
-
-	public void enstringOid(final OidStringifier mockOidStringifier, final Oid mockOid, final String returns) {
-		context.checking(new Expectations() {
-			{
-				allowing(mockOidStringifier).enString(mockOid);
-				will(returnValue(returns));
-			}
-		});
-	}
-
-	public <T> void newLink(final CssMenuLinkFactory mockLinkBuilder,
-			final String linkId, final ObjectAdapterMemento adapterMemento, final ObjectAction noAction, final Link<T> returns) {
-		context.checking(new Expectations() {
-			{
-				allowing(mockLinkBuilder).newLink(adapterMemento, noAction, linkId);
-				will(returnValue(returns));
-			}
-		});
-	}
+    private final Mockery context;
+
+    public SystemFixtures(final Mockery context) {
+        this.context = context;
+    }
+
+    public void enstringOid(final OidStringifier mockOidStringifier, final Oid mockOid, final String returns) {
+        context.checking(new Expectations() {
+            {
+                allowing(mockOidStringifier).enString(mockOid);
+                will(returnValue(returns));
+            }
+        });
+    }
+
+    public <T> void newLink(final CssMenuLinkFactory mockLinkBuilder, final String linkId,
+        final ObjectAdapterMemento adapterMemento, final ObjectAction noAction, final Link<T> returns) {
+        context.checking(new Expectations() {
+            {
+                allowing(mockLinkBuilder).newLink(adapterMemento, noAction, linkId);
+                will(returnValue(returns));
+            }
+        });
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/ApplicationCssUrl.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/ApplicationCssUrl.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/ApplicationCssUrl.java (original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/ApplicationCssUrl.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer;
 
 import java.lang.annotation.ElementType;
@@ -31,7 +30,7 @@ import com.google.inject.BindingAnnotati
  * Names the injection of a string representing the default application CSS link to be included.
  */
 @Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.FIELD})
+@Target({ ElementType.FIELD })
 @BindingAnnotation
 public @interface ApplicationCssUrl {
 

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java (original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java Tue May  3 07:44:41 2011
@@ -22,27 +22,6 @@ package org.apache.isis.viewer.wicket.vi
 
 import java.util.ServiceLoader;
 
-import org.apache.wicket.Application;
-import org.apache.wicket.IConverterLocator;
-import org.apache.wicket.Page;
-import org.apache.wicket.Request;
-import org.apache.wicket.RequestCycle;
-import org.apache.wicket.Response;
-import org.apache.wicket.authentication.AuthenticatedWebApplication;
-import org.apache.wicket.authentication.AuthenticatedWebSession;
-import org.apache.wicket.guice.GuiceComponentInjector;
-import org.apache.wicket.markup.html.IHeaderContributor;
-import org.apache.wicket.markup.html.IHeaderResponse;
-import org.apache.wicket.markup.html.WebPage;
-import org.apache.wicket.markup.html.internal.HtmlHeaderContainer;
-import org.apache.wicket.protocol.http.WebRequest;
-import org.apache.wicket.util.convert.ConverterLocator;
-
-import com.google.inject.Guice;
-import com.google.inject.Inject;
-import com.google.inject.Injector;
-import com.google.inject.Module;
-
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.config.IsisConfigurationBuilder;
 import org.apache.isis.core.commons.config.IsisConfigurationBuilderResourceStreams;
@@ -75,6 +54,26 @@ import org.apache.isis.viewer.wicket.vie
 import org.apache.isis.viewer.wicket.viewer.integration.wicket.ConverterForObjectAdapter;
 import org.apache.isis.viewer.wicket.viewer.integration.wicket.ConverterForObjectAdapterMemento;
 import org.apache.isis.viewer.wicket.viewer.integration.wicket.WebRequestCycleForIsis;
+import org.apache.wicket.Application;
+import org.apache.wicket.IConverterLocator;
+import org.apache.wicket.Page;
+import org.apache.wicket.Request;
+import org.apache.wicket.RequestCycle;
+import org.apache.wicket.Response;
+import org.apache.wicket.authentication.AuthenticatedWebApplication;
+import org.apache.wicket.authentication.AuthenticatedWebSession;
+import org.apache.wicket.guice.GuiceComponentInjector;
+import org.apache.wicket.markup.html.IHeaderContributor;
+import org.apache.wicket.markup.html.IHeaderResponse;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.internal.HtmlHeaderContainer;
+import org.apache.wicket.protocol.http.WebRequest;
+import org.apache.wicket.util.convert.ConverterLocator;
+
+import com.google.inject.Guice;
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+import com.google.inject.Module;
 
 /**
  * Main application, subclassing the Wicket {@link Application} and bootstrapping

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java (original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java Tue May  3 07:44:41 2011
@@ -17,11 +17,8 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer;
 
-import com.google.inject.AbstractModule;
-
 import org.apache.isis.viewer.wicket.ui.app.imagecache.ImageCache;
 import org.apache.isis.viewer.wicket.ui.app.registry.ComponentFactoryList;
 import org.apache.isis.viewer.wicket.ui.app.registry.ComponentFactoryRegistry;
@@ -33,6 +30,8 @@ import org.apache.isis.viewer.wicket.vie
 import org.apache.isis.viewer.wicket.viewer.registries.pages.PageClassListDefault;
 import org.apache.isis.viewer.wicket.viewer.registries.pages.PageClassRegistryDefault;
 
+import com.google.inject.AbstractModule;
+
 public class IsisWicketModule extends AbstractModule {
 
     @Override

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketUnsecuredApplication.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketUnsecuredApplication.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketUnsecuredApplication.java (original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketUnsecuredApplication.java Tue May  3 07:44:41 2011
@@ -19,26 +19,6 @@
 
 package org.apache.isis.viewer.wicket.viewer;
 
-import org.apache.wicket.Application;
-import org.apache.wicket.IConverterLocator;
-import org.apache.wicket.Page;
-import org.apache.wicket.Request;
-import org.apache.wicket.RequestCycle;
-import org.apache.wicket.Response;
-import org.apache.wicket.Session;
-import org.apache.wicket.guice.GuiceComponentInjector;
-import org.apache.wicket.markup.html.IHeaderContributor;
-import org.apache.wicket.markup.html.IHeaderResponse;
-import org.apache.wicket.markup.html.internal.HtmlHeaderContainer;
-import org.apache.wicket.protocol.http.WebApplication;
-import org.apache.wicket.protocol.http.WebRequest;
-import org.apache.wicket.util.convert.ConverterLocator;
-
-import com.google.inject.Guice;
-import com.google.inject.Inject;
-import com.google.inject.Injector;
-import com.google.inject.Module;
-
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.config.IsisConfigurationBuilder;
@@ -50,7 +30,6 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.runtime.authentication.AuthenticationManager;
 import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
 import org.apache.isis.core.runtime.authentication.standard.AuthenticationManagerStandard;
-import org.apache.isis.core.runtime.authentication.standard.Authenticator;
 import org.apache.isis.core.runtime.authentication.standard.AuthenticatorAbstract;
 import org.apache.isis.core.webapp.config.ResourceStreamSourceForWebInf;
 import org.apache.isis.runtimes.dflt.runtime.runner.IsisModule;
@@ -74,6 +53,25 @@ import org.apache.isis.viewer.wicket.vie
 import org.apache.isis.viewer.wicket.viewer.integration.wicket.ConverterForObjectAdapter;
 import org.apache.isis.viewer.wicket.viewer.integration.wicket.ConverterForObjectAdapterMemento;
 import org.apache.isis.viewer.wicket.viewer.integration.wicket.WebRequestCycleForIsis;
+import org.apache.wicket.Application;
+import org.apache.wicket.IConverterLocator;
+import org.apache.wicket.Page;
+import org.apache.wicket.Request;
+import org.apache.wicket.RequestCycle;
+import org.apache.wicket.Response;
+import org.apache.wicket.Session;
+import org.apache.wicket.guice.GuiceComponentInjector;
+import org.apache.wicket.markup.html.IHeaderContributor;
+import org.apache.wicket.markup.html.IHeaderResponse;
+import org.apache.wicket.markup.html.internal.HtmlHeaderContainer;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.protocol.http.WebRequest;
+import org.apache.wicket.util.convert.ConverterLocator;
+
+import com.google.inject.Guice;
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+import com.google.inject.Module;
 
 public class IsisWicketUnsecuredApplication extends WebApplication implements ComponentFactoryRegistryAccessor,
     PageClassRegistryAccessor, ImageCacheAccessor, ApplicationCssRenderer, AuthenticationSessionAccessor {
@@ -137,9 +135,9 @@ public class IsisWicketUnsecuredApplicat
         super.init();
         getResourceSettings().setParentFolderPlaceholder("$up$");
 
-        DeploymentType deploymentType = determineDeploymentType();
+        final DeploymentType deploymentType = determineDeploymentType();
 
-        IsisConfigurationBuilder isisConfigurationBuilder = createConfigBuilder();
+        final IsisConfigurationBuilder isisConfigurationBuilder = createConfigBuilder();
 
         final IsisModule isisModule = new IsisModule(deploymentType, isisConfigurationBuilder);
         final Injector injector = Guice.createInjector(isisModule, newIsisWicketModule());
@@ -160,7 +158,7 @@ public class IsisWicketUnsecuredApplicat
         final ResourceStreamSource rssServletContext = new ResourceStreamSourceForWebInf(getServletContext());
         final ResourceStreamSource rssTcl = new ResourceStreamSourceContextLoaderClassPath();
         final ResourceStreamSource rssClasspath = new ResourceStreamSourceCurrentClassClassPath();
-        IsisConfigurationBuilder isisConfigurationBuilder =
+        final IsisConfigurationBuilder isisConfigurationBuilder =
             new IsisConfigurationBuilderResourceStreams(rssTcl, rssClasspath, rssServletContext);
         return isisConfigurationBuilder;
     }
@@ -181,8 +179,8 @@ public class IsisWicketUnsecuredApplicat
     // /////////////////////////////////////////////////
 
     @Override
-    public Session newSession(Request request, Response response) {
-        AuthenticationManager authenticationManager = anonymousAuthenticationManager();
+    public Session newSession(final Request request, final Response response) {
+        final AuthenticationManager authenticationManager = anonymousAuthenticationManager();
 
         final AnonymousWebSessionForIsis anonymousWebSession =
             new AnonymousWebSessionForIsis(request, authenticationManager);
@@ -191,22 +189,23 @@ public class IsisWicketUnsecuredApplicat
     }
 
     private AuthenticationManager authenticationManager;
-    
+
     /**
      * Lazily creates an {@link AuthenticationManager} that will authenticate all requests.
      */
     private AuthenticationManager anonymousAuthenticationManager() {
-        if(authenticationManager == null) {
+        if (authenticationManager == null) {
             final IsisConfiguration configuration = IsisContext.getConfiguration();
-            AuthenticationManagerStandard authenticationManager = new AuthenticationManagerStandard(configuration);
+            final AuthenticationManagerStandard authenticationManager =
+                new AuthenticationManagerStandard(configuration);
             authenticationManager.addAuthenticator(new AuthenticatorAbstract(configuration) {
                 @Override
-                public boolean canAuthenticate(AuthenticationRequest request) {
+                public boolean canAuthenticate(final AuthenticationRequest request) {
                     return true;
                 }
 
                 @Override
-                public boolean isValid(AuthenticationRequest request) {
+                public boolean isValid(final AuthenticationRequest request) {
                     return true;
                 }
             });
@@ -225,7 +224,7 @@ public class IsisWicketUnsecuredApplicat
      * In general, it shouldn't be necessary to override this method.
      */
     @Override
-    public RequestCycle newRequestCycle(Request request, Response response) {
+    public RequestCycle newRequestCycle(final Request request, final Response response) {
         return new WebRequestCycleForIsis(this, (WebRequest) request, response);
     }
 
@@ -238,7 +237,7 @@ public class IsisWicketUnsecuredApplicat
      */
     @Override
     protected IConverterLocator newConverterLocator() {
-        ConverterLocator converterLocator = new ConverterLocator();
+        final ConverterLocator converterLocator = new ConverterLocator();
         converterLocator.set(ObjectAdapter.class, new ConverterForObjectAdapter());
         converterLocator.set(ObjectAdapterMemento.class, new ConverterForObjectAdapterMemento());
         return converterLocator;
@@ -261,7 +260,7 @@ public class IsisWicketUnsecuredApplicat
      * CSS. However, it still comes after any component-level CSS, so is not ideal.
      */
     @Override
-    public void renderApplicationCss(HtmlHeaderContainer container) {
+    public void renderApplicationCss(final HtmlHeaderContainer container) {
         final String cssUrl = getApplicationCssUrl();
         if (cssUrl == null) {
             return;

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/imagecache/ImageCacheClassPath.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/imagecache/ImageCacheClassPath.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/imagecache/ImageCacheClassPath.java (original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/imagecache/ImageCacheClassPath.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer.imagecache;
 
 import images.Images;
@@ -37,84 +36,85 @@ import com.google.inject.Singleton;
  * Caches images loaded up the <tt>images</tt> package (using the {@link Images} class).
  * 
  * <p>
- * Searches for a fixed set of suffixes: {@value #IMAGE_SUFFICES}. 
+ * Searches for a fixed set of suffixes: {@value #IMAGE_SUFFICES}.
  */
 @Singleton
 public class ImageCacheClassPath implements ImageCache {
 
-	public final static List<String> IMAGE_SUFFICES = Arrays.asList("png","gif","jpeg","jpg");
+    public final static List<String> IMAGE_SUFFICES = Arrays.asList("png", "gif", "jpeg", "jpg");
 
-	private Map<String, PackageResource> imagesByName = Maps.newHashMap();
+    private final Map<String, PackageResource> imagesByName = Maps.newHashMap();
 
-	public PackageResource findImage(ObjectSpecification noSpec) {
-		String specFullName = noSpec.getFullIdentifier();
-		PackageResource packageResource = findImage(specFullName);
-		if (packageResource != null) {
-			return packageResource;
-		} else {
-			return findAndCacheImage(noSpec);
-		}
-	}
-
-	public PackageResource findImage(String imageName) {
-		PackageResource packageResource = imagesByName.get(imageName);
-		if (packageResource != null) {
-			return packageResource;
-		} else {
-			return findAndCacheImage(imageName);
-		}
-	}
-
-	private PackageResource findAndCacheImage(String imageName) {
-		PackageResource packageResource = findImageSuffixed(imageName);
-		if (packageResource != null) {
-			imagesByName.put(imageName, packageResource);
-		}
-		return packageResource;
-	}
-	
-	private PackageResource findImageSuffixed(String imageName) {
-		for (String imageSuffix : IMAGE_SUFFICES) {
-			String path = buildImagePath(imageName, imageSuffix);
-			if (PackageResource.exists(Images.class, path, null, null)) {
-				return PackageResource.get(Images.class, path);
-			}
-		}
-		return null;
-	}
-
-	private synchronized PackageResource findAndCacheImage(ObjectSpecification noSpec) {
-	    PackageResource packageResource = findImageSearchUpHierarchy(noSpec);
-		imagesByName.put(noSpec.getFullIdentifier(), packageResource);
-		return packageResource;
-	}
-
-	private PackageResource findImageSearchUpHierarchy(
-			ObjectSpecification noSpec) {
-		for(String imageSuffix : IMAGE_SUFFICES) {
-			String fullName = noSpec.getFullIdentifier();
-			String path = buildImagePath(fullName, imageSuffix);
-			if (PackageResource.exists(Images.class, path, null, null)) {
-				return PackageResource.get(Images.class, path);
-			}
-		}
-		for (String imageSuffix : IMAGE_SUFFICES) {
-			String shortName = noSpec.getShortIdentifier();
-			String path = buildImagePath(shortName, imageSuffix);
-			if (PackageResource.exists(Images.class, path, null, null)) {
-				return PackageResource.get(Images.class, path);
-			}
-		}
-		ObjectSpecification superSpec = noSpec.superclass();
-		if (superSpec != null) {
-			return findAndCacheImage(superSpec);
-		}
-		// fallback
-		return PackageResource.get(Images.class, "Default.png");
-	}
-
-	private String buildImagePath(String name, String imageSuffix) {
-		return name + "." + imageSuffix;
-	}
+    @Override
+    public PackageResource findImage(final ObjectSpecification noSpec) {
+        final String specFullName = noSpec.getFullIdentifier();
+        final PackageResource packageResource = findImage(specFullName);
+        if (packageResource != null) {
+            return packageResource;
+        } else {
+            return findAndCacheImage(noSpec);
+        }
+    }
+
+    @Override
+    public PackageResource findImage(final String imageName) {
+        final PackageResource packageResource = imagesByName.get(imageName);
+        if (packageResource != null) {
+            return packageResource;
+        } else {
+            return findAndCacheImage(imageName);
+        }
+    }
+
+    private PackageResource findAndCacheImage(final String imageName) {
+        final PackageResource packageResource = findImageSuffixed(imageName);
+        if (packageResource != null) {
+            imagesByName.put(imageName, packageResource);
+        }
+        return packageResource;
+    }
+
+    private PackageResource findImageSuffixed(final String imageName) {
+        for (final String imageSuffix : IMAGE_SUFFICES) {
+            final String path = buildImagePath(imageName, imageSuffix);
+            if (PackageResource.exists(Images.class, path, null, null)) {
+                return PackageResource.get(Images.class, path);
+            }
+        }
+        return null;
+    }
+
+    private synchronized PackageResource findAndCacheImage(final ObjectSpecification noSpec) {
+        final PackageResource packageResource = findImageSearchUpHierarchy(noSpec);
+        imagesByName.put(noSpec.getFullIdentifier(), packageResource);
+        return packageResource;
+    }
+
+    private PackageResource findImageSearchUpHierarchy(final ObjectSpecification noSpec) {
+        for (final String imageSuffix : IMAGE_SUFFICES) {
+            final String fullName = noSpec.getFullIdentifier();
+            final String path = buildImagePath(fullName, imageSuffix);
+            if (PackageResource.exists(Images.class, path, null, null)) {
+                return PackageResource.get(Images.class, path);
+            }
+        }
+        for (final String imageSuffix : IMAGE_SUFFICES) {
+            final String shortName = noSpec.getShortIdentifier();
+            final String path = buildImagePath(shortName, imageSuffix);
+            if (PackageResource.exists(Images.class, path, null, null)) {
+                return PackageResource.get(Images.class, path);
+            }
+        }
+        final ObjectSpecification superSpec = noSpec.superclass();
+        if (superSpec != null) {
+            return findAndCacheImage(superSpec);
+        }
+        // fallback
+        return PackageResource.get(Images.class, "Default.png");
+    }
+
+    private String buildImagePath(final String name, final String imageSuffix) {
+        return name + "." + imageSuffix;
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/integration/nof/DeploymentTypeAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/integration/nof/DeploymentTypeAbstract.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/integration/nof/DeploymentTypeAbstract.java (original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/integration/nof/DeploymentTypeAbstract.java Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer.integration.nof;
 
 import org.apache.isis.runtimes.dflt.runtime.system.ContextCategory;
@@ -27,17 +26,16 @@ import org.apache.isis.runtimes.dflt.run
 import org.apache.wicket.Application;
 
 /**
- * Simple adapter for Isis' {@link DeploymentType} class,
- * specifying that the {@link IsisContextForWicket.WicketContextCategory}
- * is used as the {@link ContextCategory}.
+ * Simple adapter for Isis' {@link DeploymentType} class, specifying that the
+ * {@link IsisContextForWicket.WicketContextCategory} is used as the {@link ContextCategory}.
  * 
  * <p>
  * TODO: should somehow tie this in with Wicket's own {@link Application#getConfigurationType() configuration mode}.
  */
 public abstract class DeploymentTypeAbstract extends DeploymentType {
 
-	public DeploymentTypeAbstract(String name, DeploymentCategory category) {
-		super(name, category, new IsisContextForWicket.WicketContextCategory(), null, Splash.NO_SHOW);
-	}
+    public DeploymentTypeAbstract(final String name, final DeploymentCategory category) {
+        super(name, category, new IsisContextForWicket.WicketContextCategory(), null, Splash.NO_SHOW);
+    }
 
 }



Mime
View raw message