isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1098945 [22/25] - in /incubator/isis/trunk/viewer: bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/ bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/components/ bdd/common/src/main/java/org/apache/isis/viewer/bdd/commo...
Date Tue, 03 May 2011 07:18:38 GMT
Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/DefaultContentFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/DefaultContentFactory.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/DefaultContentFactory.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/DefaultContentFactory.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.viewer;
 
 import org.apache.isis.core.commons.ensure.Assert;
@@ -35,9 +34,9 @@ import org.apache.isis.viewer.dnd.view.f
 import org.apache.isis.viewer.dnd.view.field.OneToOneFieldImpl;
 import org.apache.isis.viewer.dnd.view.field.TextParseableFieldImpl;
 
-
 public class DefaultContentFactory implements ContentFactory {
 
+    @Override
     public Content createRootContent(final ObjectAdapter object) {
         Assert.assertNotNull(object);
         final ObjectSpecification objectSpec = object.getSpecification();
@@ -46,14 +45,15 @@ public class DefaultContentFactory imple
         }
         if (objectSpec.isNotCollection()) {
             return new RootObject(object);
-        } 
-    
+        }
+
         throw new IllegalArgumentException("Must be an object or collection: " + object);
     }
 
+    @Override
     public Content createFieldContent(final ObjectAssociation field, final ObjectAdapter object) {
         Content content;
-        ObjectAdapter associatedObject = field.get(object);
+        final ObjectAdapter associatedObject = field.get(object);
         if (field instanceof OneToManyAssociation) {
             content = new OneToManyFieldImpl(object, associatedObject, (OneToManyAssociation) field);
         } else if (field instanceof OneToOneAssociation) {

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/SkylarkViewFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/SkylarkViewFactory.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/SkylarkViewFactory.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/SkylarkViewFactory.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.viewer;
 
 import java.util.ArrayList;
@@ -26,7 +25,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Vector;
 
-import org.apache.log4j.Logger;
 import org.apache.isis.core.commons.debug.DebugBuilder;
 import org.apache.isis.core.commons.factory.InstanceUtil;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -50,7 +48,7 @@ import org.apache.isis.viewer.dnd.view.b
 import org.apache.isis.viewer.dnd.view.collection.CollectionContent;
 import org.apache.isis.viewer.dnd.viewer.basic.FallbackView;
 import org.apache.isis.viewer.dnd.viewer.basic.MinimizedView;
-
+import org.apache.log4j.Logger;
 
 /**
  * This class holds all the different view types that all the different objects can be viewed as.
@@ -67,21 +65,22 @@ public class SkylarkViewFactory implemen
     private final Vector subviews = new Vector();
     private ViewSpecification dragContentSpecification;
 
-    private List<ViewSpecification> viewSpecifications = new ArrayList<ViewSpecification>();
-    private List<ViewSpecification> designSpecifications = new ArrayList<ViewSpecification>();
+    private final List<ViewSpecification> viewSpecifications = new ArrayList<ViewSpecification>();
+    private final List<ViewSpecification> designSpecifications = new ArrayList<ViewSpecification>();
 
+    @Override
     public void addSpecification(final ViewSpecification specification) {
         viewSpecifications.add(specification);
     }
-    
-    public void addSpecification(String specClassName) {
-            ViewSpecification spec;
-            spec = (ViewSpecification) InstanceUtil.createInstance(specClassName);
-            LOG.info("adding view specification: " + spec);
-            addSpecification(spec);
+
+    public void addSpecification(final String specClassName) {
+        ViewSpecification spec;
+        spec = (ViewSpecification) InstanceUtil.createInstance(specClassName);
+        LOG.info("adding view specification: " + spec);
+        addSpecification(spec);
     }
 
-    public void addDesignSpecification(ViewSpecification specification) {
+    public void addDesignSpecification(final ViewSpecification specification) {
         designSpecifications.add(specification);
     }
 
@@ -89,6 +88,7 @@ public class SkylarkViewFactory implemen
         emptyFieldSpecification = spec;
     }
 
+    @Override
     public View createDialog(final Content content) {
         return createView(dialogSpec, content);
     }
@@ -103,16 +103,13 @@ public class SkylarkViewFactory implemen
         }
         // TODO this should be passed in so that factory created views can be related to the views that ask
         // for them
-        Axes axes = new Axes();
+        final Axes axes = new Axes();
         View createView = spec.createView(content, axes, -1);
 
         /*
-        ObjectSpecification contentSpecification = content.getSpecification();
-        if (contentSpecification != null) {
-            Options viewOptions = Properties.getViewConfigurationOptions(spec);
-            createView.loadOptions(viewOptions);
-        }   
-        */
+         * ObjectSpecification contentSpecification = content.getSpecification(); if (contentSpecification != null) {
+         * Options viewOptions = Properties.getViewConfigurationOptions(spec); createView.loadOptions(viewOptions); }
+         */
         if (content.isObject()) {
             final ObjectAdapter adapter = content.getAdapter();
             if (adapter != null && adapter.getResolveState().isDestroyed()) {
@@ -123,6 +120,7 @@ public class SkylarkViewFactory implemen
         return createView;
     }
 
+    @Override
     public void debugData(final DebugBuilder sb) {
         sb.append("RootsViews\n");
         Enumeration fields = rootViews.elements();
@@ -145,7 +143,7 @@ public class SkylarkViewFactory implemen
         sb.append("\n\n");
 
         sb.append("Specifications\n");
-        for (ViewSpecification spec : viewSpecifications) {
+        for (final ViewSpecification spec : viewSpecifications) {
             sb.append("  ");
             sb.append(spec);
             sb.append("\n");
@@ -153,6 +151,7 @@ public class SkylarkViewFactory implemen
         sb.append("\n\n");
     }
 
+    @Override
     public String debugTitle() {
         return "View factory entries";
     }
@@ -169,33 +168,37 @@ public class SkylarkViewFactory implemen
         this.dragContentSpecification = dragContentSpecification;
     }
 
+    @Override
     public View createDragViewOutline(final View view) {
         return new DragViewOutline(view);
     }
 
-    public DragEvent createDragContentOutline(View view, Location location) {
-        View dragOverlay = dragContentSpecification.createView(view.getContent(), new Axes(), -1);
+    @Override
+    public DragEvent createDragContentOutline(final View view, final Location location) {
+        final View dragOverlay = dragContentSpecification.createView(view.getContent(), new Axes(), -1);
         return new ContentDragImpl(view, location, dragOverlay);
     }
 
+    @Override
     public View createMinimizedView(final View view) {
         return new MinimizedView(view);
     }
 
-    public View createView(ViewRequirement requirement) {
+    @Override
+    public View createView(final ViewRequirement requirement) {
         final ViewSpecification objectFieldSpecification = getSpecificationForRequirement(requirement);
         return createView(objectFieldSpecification, requirement.getContent());
     }
 
     public ViewSpecification getSpecificationForRequirement(final ViewRequirement requirement) {
-        Content content = requirement.getContent();
-        ObjectSpecification specification = content.getSpecification();
-        boolean isValue = specification != null && specification.containsFacet(ValueFacet.class);
+        final Content content = requirement.getContent();
+        final ObjectSpecification specification = content.getSpecification();
+        final boolean isValue = specification != null && specification.containsFacet(ValueFacet.class);
         if (content.isObject() && !isValue && content.getAdapter() == null) {
             return getEmptyFieldSpecification();
         } else {
             if (specification != null) {
-                Options viewOptions = Properties.getDefaultViewOptions(specification);
+                final Options viewOptions = Properties.getDefaultViewOptions(specification);
                 String spec = viewOptions.getString("spec");
                 if (spec == null) {
                     if (content instanceof ObjectContent && requirement.isObject() && requirement.isClosed()) {
@@ -207,13 +210,13 @@ public class SkylarkViewFactory implemen
                     }
                 }
                 if (spec != null) {
-                    ViewSpecification lookSpec = lookupSpecByName(spec);
+                    final ViewSpecification lookSpec = lookupSpecByName(spec);
                     if (lookSpec != null && lookSpec.canDisplay(requirement)) {
                         return lookSpec;
                     }
                 }
             }
-            for (ViewSpecification viewSpecification : viewSpecifications) {
+            for (final ViewSpecification viewSpecification : viewSpecifications) {
                 if (viewSpecification.canDisplay(requirement)) {
                     return viewSpecification;
                 }
@@ -225,18 +228,18 @@ public class SkylarkViewFactory implemen
     }
 
     public void loadUserViewSpecifications() {
-        Options options = Properties.getOptions("views.user-defined");
-        Iterator<String> names = options.names();
+        final Options options = Properties.getOptions("views.user-defined");
+        final Iterator<String> names = options.names();
         while (names.hasNext()) {
-            String name = names.next();
-            Options viewOptions = options.getOptions(name);
-            String specName = viewOptions.getString("design");
+            final String name = names.next();
+            final Options viewOptions = options.getOptions(name);
+            final String specName = viewOptions.getString("design");
             addSpecification(specName);
         }
     }
-    
-    private ViewSpecification lookupSpecByName(String name) {
-        for (ViewSpecification viewSpecification : viewSpecifications) {
+
+    private ViewSpecification lookupSpecByName(final String name) {
+        for (final ViewSpecification viewSpecification : viewSpecifications) {
             if (viewSpecification.getName().equals(name)) {
                 return viewSpecification;
             }
@@ -244,9 +247,9 @@ public class SkylarkViewFactory implemen
         LOG.warn("No specification found for " + name);
         return null;
     }
-    
-    private ViewSpecification lookupSpecByClassName(String className) {
-        for (ViewSpecification viewSpecification : viewSpecifications) {
+
+    private ViewSpecification lookupSpecByClassName(final String className) {
+        for (final ViewSpecification viewSpecification : viewSpecifications) {
             if (viewSpecification.getClass().getName().equals(className)) {
                 return viewSpecification;
             }
@@ -255,17 +258,20 @@ public class SkylarkViewFactory implemen
         return null;
     }
 
+    @Override
     public Enumeration<ViewSpecification> availableViews(final ViewRequirement requirement) {
         return viewsFor(requirement, viewSpecifications);
     }
 
+    @Override
     public Enumeration<ViewSpecification> availableDesigns(final ViewRequirement requirement) {
         return viewsFor(requirement, designSpecifications);
     }
-    
-    private Enumeration<ViewSpecification> viewsFor(final ViewRequirement requirement, List<ViewSpecification> viewSpecifications) {
+
+    private Enumeration<ViewSpecification> viewsFor(final ViewRequirement requirement,
+        final List<ViewSpecification> viewSpecifications) {
         final Vector<ViewSpecification> v = new Vector<ViewSpecification>();
-        for (ViewSpecification specification : viewSpecifications) {
+        for (final ViewSpecification specification : viewSpecifications) {
             if (specification.canDisplay(requirement)) {
                 v.addElement(specification);
             }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspace.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspace.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspace.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspace.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.viewer.basic;
 
 import java.util.Enumeration;
@@ -70,28 +69,30 @@ import org.apache.isis.viewer.dnd.view.w
 import org.apache.isis.viewer.dnd.view.window.SubviewFocusManager;
 import org.apache.isis.viewer.dnd.view.window.WindowBorder;
 
-
 public final class ApplicationWorkspace extends CompositeViewUsingBuilder implements Workspace {
     protected Vector<View> serviceViews;
     protected Vector<View> iconViews;
 
-    public ApplicationWorkspace(final Content content, final Axes axes, final CompositeViewSpecification specification, Layout layout, ApplicationWorkspaceBuilder builder) {
+    public ApplicationWorkspace(final Content content, final Axes axes, final CompositeViewSpecification specification,
+        final Layout layout, final ApplicationWorkspaceBuilder builder) {
         super(content, specification, axes, layout, builder);
         serviceViews = new Vector<View>();
         iconViews = new Vector<View>();
         LookFactory.init();
     }
 
-    public void addDialog(final View dialogContent, Placement placement) {
-        DialogBorder dialogView = new DialogBorder(dialogContent, false);
+    @Override
+    public void addDialog(final View dialogContent, final Placement placement) {
+        final DialogBorder dialogView = new DialogBorder(dialogContent, false);
         addView(dialogView);
         placement.position(this, dialogView);
         // dialogView.setFocusManager( new SubviewFocusManager(dialogView));
     }
 
-    public void addWindow(View containedView, Placement placement) {
-        boolean scrollable = !containedView.getSpecification().isResizeable();
-        WindowBorder windowView = new WindowBorder(containedView, scrollable);
+    @Override
+    public void addWindow(final View containedView, final Placement placement) {
+        final boolean scrollable = !containedView.getSpecification().isResizeable();
+        final WindowBorder windowView = new WindowBorder(containedView, scrollable);
         addView(windowView);
         placement.position(this, windowView);
         windowView.setFocusManager(new SubviewFocusManager(windowView));
@@ -107,15 +108,16 @@ public final class ApplicationWorkspace 
     @Override
     public void replaceView(final View toReplace, final View replacement) {
         if (replacement.getSpecification().isOpen()) {
-            boolean scrollable = !replacement.getSpecification().isResizeable();
-            WindowBorder windowView = new WindowBorder(replacement, scrollable);
+            final boolean scrollable = !replacement.getSpecification().isResizeable();
+            final WindowBorder windowView = new WindowBorder(replacement, scrollable);
             super.replaceView(toReplace, windowView);
         } else {
             super.replaceView(toReplace, replacement);
         }
     }
 
-    public View addWindowFor(final ObjectAdapter object, Placement placement) {
+    @Override
+    public View addWindowFor(final ObjectAdapter object, final Placement placement) {
         final Content content = Toolkit.getContentFactory().createRootContent(object);
         final View view = Toolkit.getViewFactory().createView(new ViewRequirement(content, ViewRequirement.OPEN));
         addWindow(view, placement);
@@ -123,9 +125,11 @@ public final class ApplicationWorkspace 
         return view;
     }
 
-    public View addIconFor(final ObjectAdapter object, Placement placement) {
+    @Override
+    public View addIconFor(final ObjectAdapter object, final Placement placement) {
         final Content content = Toolkit.getContentFactory().createRootContent(object);
-        View icon = Toolkit.getViewFactory().createView(
+        final View icon =
+            Toolkit.getViewFactory().createView(
                 new ViewRequirement(content, ViewRequirement.CLOSED | ViewRequirement.ROOT));
         add(iconViews, icon);
         placement.position(this, icon);
@@ -134,7 +138,8 @@ public final class ApplicationWorkspace 
 
     public void addServiceIconFor(final ObjectAdapter service) {
         final Content content = new ServiceObject(service);
-        final View serviceIcon = Toolkit.getViewFactory().createView(
+        final View serviceIcon =
+            Toolkit.getViewFactory().createView(
                 new ViewRequirement(content, ViewRequirement.CLOSED | ViewRequirement.SUBVIEW));
         add(serviceViews, serviceIcon);
     }
@@ -182,7 +187,9 @@ public final class ApplicationWorkspace 
             dropLocation.subtract(drag.getOffset());
 
             if (drag.isShift()) {
-                newView = Toolkit.getViewFactory().createView(new ViewRequirement(getContent(), ViewRequirement.OPEN | ViewRequirement.SUBVIEW));
+                newView =
+                    Toolkit.getViewFactory().createView(
+                        new ViewRequirement(getContent(), ViewRequirement.OPEN | ViewRequirement.SUBVIEW));
                 drag.getTargetView().addView(newView);
                 newView.setLocation(dropLocation);
             } else {
@@ -190,8 +197,8 @@ public final class ApplicationWorkspace 
                 final View sourceView = drag.getSource();
                 if (!sourceView.getSpecification().isOpen()) {
                     final View[] subviews = getSubviews();
-                    for (int i = 0; i < subviews.length; i++) {
-                        if (subviews[i] == sourceView) {
+                    for (final View subview : subviews) {
+                        if (subview == sourceView) {
                             sourceView.markDamaged();
                             sourceView.setLocation(dropLocation);
                             sourceView.markDamaged();
@@ -199,7 +206,7 @@ public final class ApplicationWorkspace 
                         }
                     }
                 } else {
-                    for (View view : iconViews) {
+                    for (final View view : iconViews) {
                         if (view.getContent().getAdapter() == source) {
                             view.markDamaged();
                             view.setLocation(dropLocation);
@@ -215,7 +222,7 @@ public final class ApplicationWorkspace 
 
     @Override
     public void entered() {
-    // prevents status details about "Persective..."
+        // prevents status details about "Persective..."
     }
 
     private PerspectiveEntry getPerspective() {
@@ -233,8 +240,8 @@ public final class ApplicationWorkspace 
                 // TODO remove the open view from the container and place on
                 // workspace; replace the internal view with an icon
             } else if (sourceView.getContent() instanceof FieldContent) {
-                ViewRequirement requirement = new ViewRequirement(sourceView.getContent(), ViewRequirement.OPEN);
-                View view = Toolkit.getViewFactory().createView(requirement);
+                final ViewRequirement requirement = new ViewRequirement(sourceView.getContent(), ViewRequirement.OPEN);
+                final View view = Toolkit.getViewFactory().createView(requirement);
                 addWindow(view, new Placement(newLocation));
                 sourceView.getState().clearViewIdentified();
             } else {
@@ -259,6 +266,7 @@ public final class ApplicationWorkspace 
         return this;
     }
 
+    @Override
     public void lower(final View view) {
         if (views.contains(view)) {
             views.removeElement(view);
@@ -267,6 +275,7 @@ public final class ApplicationWorkspace 
         }
     }
 
+    @Override
     public void raise(final View view) {
         if (views.contains(view)) {
             views.removeElement(view);
@@ -291,7 +300,7 @@ public final class ApplicationWorkspace 
         }
     }
 
-    private void removeService(ObjectAdapter object) {
+    private void removeService(final ObjectAdapter object) {
         getPerspective().removeFromServices(object.getObject());
     }
 
@@ -321,8 +330,7 @@ public final class ApplicationWorkspace 
             @Override
             public void execute(final Workspace workspace, final View view, final Location at) {
                 final View views[] = getWindowViews();
-                for (int i = 0; i < views.length; i++) {
-                    final View v = views[i];
+                for (final View v : views) {
                     // if (v.getSpecification().isOpen()) {
                     v.dispose();
                     // }
@@ -357,10 +365,10 @@ public final class ApplicationWorkspace 
             @Override
             public void execute(final Workspace workspace, final View view, final Location at) {
                 final List<Object> services = IsisContext.getServices();
-                ObjectAdapter[] serviceObjects = new ObjectAdapter[services.size()];
+                final ObjectAdapter[] serviceObjects = new ObjectAdapter[services.size()];
                 int i = 0;
-                for (Object object : services) {
-                    AdapterManager adapterManager = IsisContext.getPersistenceSession().getAdapterManager();
+                for (final Object object : services) {
+                    final AdapterManager adapterManager = IsisContext.getPersistenceSession().getAdapterManager();
                     serviceObjects[i++] = adapterManager.adapterFor(object);
                 }
                 final ObjectSpecification spec = getSpecificationLoader().loadSpecification(Object.class);
@@ -372,11 +380,11 @@ public final class ApplicationWorkspace 
         menuForChangingLook(options);
 
         menuForChangingUsers(options);
-        
+
         options.add(new UserActionAbstract("Save User Profile", ActionType.USER) {
             @Override
             public void execute(final Workspace workspace, final View view, final Location at) {
-                Feedback feedbackManager = getFeedbackManager();
+                final Feedback feedbackManager = getFeedbackManager();
                 feedbackManager.showBusyState(ApplicationWorkspace.this);
                 getViewManager().saveOpenObjects();
                 feedbackManager.addMessage("Profile saved");
@@ -385,12 +393,12 @@ public final class ApplicationWorkspace 
         });
     }
 
-    private void menuForChangingLook(UserActionSet options) {
+    private void menuForChangingLook(final UserActionSet options) {
         final UserActionSet set = options.addNewActionSet("Change Look", ActionType.USER);
-        for (Look look : LookFactory.getAvailableLooks()) {
+        for (final Look look : LookFactory.getAvailableLooks()) {
             menuOptionForChangingLook(set, look, look.getName());
         }
-   }
+    }
 
     private void menuOptionForChangingLook(final UserActionSet set, final Look look, final String name) {
         set.add(new UserActionAbstract(name) {
@@ -399,24 +407,23 @@ public final class ApplicationWorkspace 
                 LookFactory.setLook(look);
                 ApplicationWorkspace.this.invalidateLayout();
                 ApplicationWorkspace.this.markDamaged();
-           }
+            }
 
             @Override
-            public Consent disabled(View view) {
+            public Consent disabled(final View view) {
                 return LookFactory.getInstalledLook() == look ? new Veto("Current look") : Allow.DEFAULT;
             }
         });
     }
 
-
     private void menuForChangingUsers(final UserActionSet options) {
         // TODO pick out users from the perspectives, but only show when in exploration mode
         if (getAuthenticationSession() instanceof MultiUserExplorationSession) {
-            MultiUserExplorationSession session = (MultiUserExplorationSession) getAuthenticationSession();
+            final MultiUserExplorationSession session = (MultiUserExplorationSession) getAuthenticationSession();
 
-            Set<String> users = session.getUserNames();
+            final Set<String> users = session.getUserNames();
             final UserActionSet set = options.addNewActionSet("Change user", ActionType.EXPLORATION);
-            for (String user : users) {
+            for (final String user : users) {
                 menuOptionForChangingUser(set, user, session.getUserName());
             }
         }
@@ -431,7 +438,7 @@ public final class ApplicationWorkspace 
             }
 
             @Override
-            public Consent disabled(View view) {
+            public Consent disabled(final View view) {
                 return user.equals(currentUser) ? new Veto("Current user") : Allow.DEFAULT;
             }
         });
@@ -439,11 +446,11 @@ public final class ApplicationWorkspace 
 
     @Override
     protected View[] subviews() {
-        Object[] viewsCopy = views.toArray();
-        Object[] serviceViewsCopy = serviceViews.toArray();
-        Object[] iconViewsCopy = iconViews.toArray();
+        final Object[] viewsCopy = views.toArray();
+        final Object[] serviceViewsCopy = serviceViews.toArray();
+        final Object[] iconViewsCopy = iconViews.toArray();
 
-        View v[] = new View[viewsCopy.length + serviceViewsCopy.length + iconViewsCopy.length];
+        final View v[] = new View[viewsCopy.length + serviceViewsCopy.length + iconViewsCopy.length];
         int offset = 0;
         Object[] src = serviceViewsCopy;
         System.arraycopy(src, 0, v, offset, src.length);
@@ -485,8 +492,7 @@ public final class ApplicationWorkspace 
     }
 
     private void tidyViews(final View[] views) {
-        for (int i = 0; i < views.length; i++) {
-            final View v = views[i];
+        for (final View v : views) {
             v.setLocation(ApplicationWorkspaceBuilder.UNPLACED);
         }
         invalidateLayout();

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspaceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspaceBuilder.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspaceBuilder.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspaceBuilder.java Tue May  3 07:18:19 2011
@@ -17,13 +17,9 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.viewer.basic;
 
-
-import org.apache.log4j.Logger;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facets.hide.HiddenFacet;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.runtime.userprofile.PerspectiveEntry;
 import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
@@ -35,12 +31,12 @@ import org.apache.isis.viewer.dnd.view.P
 import org.apache.isis.viewer.dnd.view.View;
 import org.apache.isis.viewer.dnd.view.base.Layout;
 import org.apache.isis.viewer.dnd.view.composite.AbstractViewBuilder;
-
+import org.apache.log4j.Logger;
 
 /**
- * WorkspaceBuilder builds a workspace view for an ObjectContent view by finding a collection of classes from
- * a field called 'classes' and adding an icon for each element. Similarly, if there is a collection called
- * 'objects' its elements are also added to the display.
+ * WorkspaceBuilder builds a workspace view for an ObjectContent view by finding a collection of classes from a field
+ * called 'classes' and adding an icon for each element. Similarly, if there is a collection called 'objects' its
+ * elements are also added to the display.
  * 
  * <p>
  * During lay-out any icons that have an UNPLACED location (-1, -1) are given a location. Objects of type
@@ -51,8 +47,9 @@ public class ApplicationWorkspaceBuilder
     private static final Logger LOG = Logger.getLogger(ApplicationWorkspaceBuilder.class);
     private static final int PADDING = 10;
     public static final Location UNPLACED = new Location(-1, -1);
-    
+
     public static class ApplicationLayout implements Layout {
+        @Override
         public Size getRequiredSize(final View view) {
             return new Size(600, 400);
         }
@@ -61,6 +58,7 @@ public class ApplicationWorkspaceBuilder
             return "Simple Workspace";
         }
 
+        @Override
         public void layout(final View view1, final Size maximumSize) {
             final ApplicationWorkspace view = (ApplicationWorkspace) view1;
 
@@ -83,8 +81,7 @@ public class ApplicationWorkspaceBuilder
             int yMinimized = maxHeight - 1;
 
             final View windows[] = view.getWindowViews();
-            for (int i = 0; i < windows.length; i++) {
-                final View v = windows[i];
+            for (final View v : windows) {
                 final Size componentSize = v.getRequiredSize(new Size(size));
                 v.setSize(componentSize);
                 if (v instanceof MinimizedView) {
@@ -105,8 +102,7 @@ public class ApplicationWorkspaceBuilder
                 v.limitBoundsWithin(maximumSize);
             }
 
-            for (int i = 0; i < windows.length; i++) {
-                final View window = windows[i];
+            for (final View window : windows) {
                 window.layout();
             }
         }
@@ -122,8 +118,7 @@ public class ApplicationWorkspaceBuilder
             int maxServiceWidth = 0;
 
             final View views[] = view.getServiceIconViews();
-            for (int i = 0; i < views.length; i++) {
-                final View v = views[i];
+            for (final View v : views) {
                 final Size componentSize = v.getRequiredSize(new Size(size));
                 v.setSize(componentSize);
                 final int height = componentSize.getHeight() + 6;
@@ -157,8 +152,7 @@ public class ApplicationWorkspaceBuilder
             int yObject = PADDING;
 
             final View views[] = view.getObjectIconViews();
-            for (int i = 0; i < views.length; i++) {
-                final View v = views[i];
+            for (final View v : views) {
                 final Size componentSize = v.getRequiredSize(new Size(size));
                 v.setSize(componentSize);
                 if (v.getLocation().equals(UNPLACED)) {
@@ -170,24 +164,24 @@ public class ApplicationWorkspaceBuilder
             }
         }
     }
-    
+
     @Override
-    public void build(final View view1, Axes axes) {
+    public void build(final View view1, final Axes axes) {
         final ApplicationWorkspace workspace = (ApplicationWorkspace) view1;
 
-        PerspectiveContent perspectiveContent = (PerspectiveContent) view1.getContent();
-        
+        final PerspectiveContent perspectiveContent = (PerspectiveContent) view1.getContent();
+
         // REVIEW is this needed?
         workspace.clearServiceViews();
 
-        PerspectiveEntry perspective = perspectiveContent.getPerspective();
-        for (Object object : perspective.getObjects()) {
-            ObjectAdapter adapter = IsisContext.getPersistenceSession().getAdapterManager().adapterFor(object);
+        final PerspectiveEntry perspective = perspectiveContent.getPerspective();
+        for (final Object object : perspective.getObjects()) {
+            final ObjectAdapter adapter = IsisContext.getPersistenceSession().getAdapterManager().adapterFor(object);
             workspace.addIconFor(adapter, new Placement(ApplicationWorkspaceBuilder.UNPLACED));
         }
-        
-        for (Object service : perspective.getServices()) {
-            ObjectAdapter adapter = IsisContext.getPersistenceSession().getAdapterManager().adapterFor(service);
+
+        for (final Object service : perspective.getServices()) {
+            final ObjectAdapter adapter = IsisContext.getPersistenceSession().getAdapterManager().adapterFor(service);
             if (isHidden(adapter)) {
                 continue;
             }
@@ -195,8 +189,8 @@ public class ApplicationWorkspaceBuilder
         }
     }
 
-    private boolean isHidden(ObjectAdapter serviceNO) {
-        ObjectSpecification serviceNoSpec = serviceNO.getSpecification();
+    private boolean isHidden(final ObjectAdapter serviceNO) {
+        final ObjectSpecification serviceNoSpec = serviceNO.getSpecification();
         return serviceNoSpec.isHidden();
     }
 

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/CollectionDisplayIterator.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/CollectionDisplayIterator.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/CollectionDisplayIterator.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/CollectionDisplayIterator.java Tue May  3 07:18:19 2011
@@ -17,12 +17,10 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.viewer.basic;
 
 import java.util.Enumeration;
 
-
 public interface CollectionDisplayIterator {
 
     /**

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/DragContentSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/DragContentSpecification.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/DragContentSpecification.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/DragContentSpecification.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.viewer.basic;
 
 import org.apache.isis.viewer.dnd.drawing.ColorsAndFonts;
@@ -28,11 +27,10 @@ import org.apache.isis.viewer.dnd.view.T
 import org.apache.isis.viewer.dnd.view.View;
 import org.apache.isis.viewer.dnd.view.border.LineBorder;
 
-
 public class DragContentSpecification extends IconSpecification {
 
     @Override
-    public View createView(final Content content, Axes axes, int sequence) {
+    public View createView(final Content content, final Axes axes, final int sequence) {
         final View icon = super.createView(content, axes, sequence);
         return new LineBorder(1, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1), icon);
     }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/FallbackView.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/FallbackView.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/FallbackView.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/FallbackView.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.viewer.basic;
 
 import org.apache.isis.viewer.dnd.drawing.Canvas;
@@ -33,38 +32,45 @@ import org.apache.isis.viewer.dnd.view.V
 import org.apache.isis.viewer.dnd.view.ViewSpecification;
 import org.apache.isis.viewer.dnd.view.base.ObjectView;
 
-
 public class FallbackView extends ObjectView {
 
     public static class Specification implements ViewSpecification {
-        public boolean canDisplay(ViewRequirement requirement) {
+        @Override
+        public boolean canDisplay(final ViewRequirement requirement) {
             return true;
         }
 
-        public View createView(final Content content, Axes axes, int sequence) {
+        @Override
+        public View createView(final Content content, final Axes axes, final int sequence) {
             return new FallbackView(content, this);
         }
 
+        @Override
         public String getName() {
             return "Fallback";
         }
 
+        @Override
         public boolean isAligned() {
             return false;
         }
 
+        @Override
         public boolean isOpen() {
             return false;
         }
 
+        @Override
         public boolean isReplaceable() {
             return false;
         }
-        
+
+        @Override
         public boolean isResizeable() {
             return false;
         }
 
+        @Override
         public boolean isSubView() {
             return false;
         }
@@ -85,7 +91,8 @@ public class FallbackView extends Object
         canvas.drawSolidRectangle(0, 0, 10, height, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2));
         canvas.drawLine(10, 0, 10, height - 2, Toolkit.getColor(ColorsAndFonts.COLOR_BLACK));
         canvas.drawRectangle(0, 0, width, height, Toolkit.getColor(ColorsAndFonts.COLOR_BLACK));
-        canvas.drawText(getContent().title(), 14, getBaseline(), Toolkit.getColor(ColorsAndFonts.COLOR_BLACK), Toolkit.getText(ColorsAndFonts.TEXT_NORMAL));
+        canvas.drawText(getContent().title(), 14, getBaseline(), Toolkit.getColor(ColorsAndFonts.COLOR_BLACK),
+            Toolkit.getText(ColorsAndFonts.TEXT_NORMAL));
     }
 
     @Override
@@ -94,7 +101,7 @@ public class FallbackView extends Object
     }
 
     @Override
-    public Size getRequiredSize(Size availableSpace) {
+    public Size getRequiredSize(final Size availableSpace) {
         return new Size(150, 20);
     }
 

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/Identifier.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/Identifier.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/Identifier.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/Identifier.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.viewer.basic;
 
 import org.apache.isis.core.commons.debug.DebugBuilder;
@@ -29,7 +28,6 @@ import org.apache.isis.viewer.dnd.view.T
 import org.apache.isis.viewer.dnd.view.View;
 import org.apache.isis.viewer.dnd.view.base.AbstractViewDecorator;
 
-
 public class Identifier extends AbstractViewDecorator {
     private boolean identified;
 

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/InnerWorkspaceSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/InnerWorkspaceSpecification.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/InnerWorkspaceSpecification.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/InnerWorkspaceSpecification.java Tue May  3 07:18:19 2011
@@ -17,17 +17,15 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.viewer.basic;
 
 import org.apache.isis.viewer.dnd.view.Axes;
 import org.apache.isis.viewer.dnd.view.Content;
 import org.apache.isis.viewer.dnd.view.View;
 
-
 public class InnerWorkspaceSpecification extends WorkspaceSpecification {
     @Override
-    public View createView(final Content content, Axes axes, int sequence) {
+    public View createView(final Content content, final Axes axes, final int sequence) {
         return super.createView(content, axes, sequence);
     }
 

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/LogoBackground.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/LogoBackground.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/LogoBackground.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/LogoBackground.java Tue May  3 07:18:19 2011
@@ -17,11 +17,8 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.viewer.basic;
 
-import org.apache.log4j.Logger;
-
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
 import org.apache.isis.viewer.dnd.drawing.Background;
@@ -31,7 +28,7 @@ import org.apache.isis.viewer.dnd.drawin
 import org.apache.isis.viewer.dnd.drawing.Location;
 import org.apache.isis.viewer.dnd.drawing.Size;
 import org.apache.isis.viewer.dnd.util.Properties;
-
+import org.apache.log4j.Logger;
 
 public class LogoBackground implements Background {
     private static final Logger LOG = Logger.getLogger(LogoBackground.class);
@@ -58,6 +55,7 @@ public class LogoBackground implements B
         }
     }
 
+    @Override
     public void draw(final Canvas canvas, final Size viewSize) {
         if (logo != null) {
             int x;
@@ -67,8 +65,12 @@ public class LogoBackground implements B
                 x = viewSize.getWidth() / 2 - logoSize.getWidth() / 2;
                 y = viewSize.getHeight() / 2 - logoSize.getHeight() / 2;
             } else {
-                x = (location.getX() >= 0) ? location.getX() : viewSize.getWidth() + location.getX() - logoSize.getWidth();
-                y = (location.getY() >= 0) ? location.getY() : viewSize.getHeight() + location.getY() - logoSize.getHeight();
+                x =
+                    (location.getX() >= 0) ? location.getX() : viewSize.getWidth() + location.getX()
+                        - logoSize.getWidth();
+                y =
+                    (location.getY() >= 0) ? location.getY() : viewSize.getHeight() + location.getY()
+                        - logoSize.getHeight();
             }
             canvas.drawImage(logo, x, y, logoSize.getWidth(), logoSize.getHeight());
         }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/MinimizedView.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/MinimizedView.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/MinimizedView.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/MinimizedView.java Tue May  3 07:18:19 2011
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.viewer.dnd.viewer.basic;
 
-package org.apache.isis.viewer.dnd.viewer.basic;
-
 import org.apache.isis.core.commons.debug.DebugBuilder;
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.metamodel.consent.Allow;
@@ -50,384 +49,406 @@ import org.apache.isis.viewer.dnd.view.W
 import org.apache.isis.viewer.dnd.view.base.AbstractView;
 import org.apache.isis.viewer.dnd.view.option.UserActionAbstract;
 import org.apache.isis.viewer.dnd.view.window.WindowControl;
-
-
-public class MinimizedView extends AbstractView {
-    private class CloseWindowControl extends WindowControl {
-
-        public CloseWindowControl(final View target) {
-            super(new UserAction() {
-                public Consent disabled(final View view) {
-                    return Allow.DEFAULT;
-                }
-
-                public void execute(final Workspace workspace, final View view, final Location at) {
-                    ((MinimizedView) view).close();
-                }
-
-                public String getDescription(final View view) {
-                    return "Close " + view.getSpecification().getName();
-                }
-
-                public String getHelp(final View view) {
-                    return null;
-                }
-
-                public String getName(final View view) {
-                    return "Close view";
-                }
-
-                public ActionType getType() {
-                    return ActionType.USER;
-                }
-            }, target);
-        }
-
-        @Override
-        public void draw(final Canvas canvas) {
-            final int x = 0;
-            final int y = 0;
-            final Color crossColor = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
-            canvas.drawLine(x + 4, y + 3, x + 10, y + 9, crossColor);
-            canvas.drawLine(x + 5, y + 3, x + 11, y + 9, crossColor);
-            canvas.drawLine(x + 10, y + 3, x + 4, y + 9, crossColor);
-            canvas.drawLine(x + 11, y + 3, x + 5, y + 9, crossColor);
-        }
-    }
-
-    private class RestoreWindowControl extends WindowControl {
-        public RestoreWindowControl(final View target) {
-            super(new UserAction() {
-
-                public Consent disabled(final View view) {
-                    return Allow.DEFAULT;
-                }
-
-                public void execute(final Workspace workspace, final View view, final Location at) {
-                    ((MinimizedView) view).restore();
-                }
-
-                public String getDescription(final View view) {
-                    return "Restore " + view.getSpecification().getName() + " to normal size";
-                }
-
-                public String getHelp(final View view) {
-                    return null;
-                }
-
-                public String getName(final View view) {
-                    return "Restore view";
-                }
-
-                public ActionType getType() {
-                    return ActionType.USER;
-                }
-            }, target);
-        }
-
-        @Override
-        public void draw(final Canvas canvas) {
-            final int x = 0;
-            final int y = 0;
-            Color black = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
-            canvas.drawRectangle(x + 1, y + 1, WIDTH - 1, HEIGHT - 1, black);
-            canvas.drawLine(x + 2, y + 2, x + WIDTH - 2, y + 2, black);
-            canvas.drawLine(x + 2, y + 3, x + WIDTH - 2, y + 3, black);
-        }
-    }
-
-    private static class Specification implements ViewSpecification {
-
-        public boolean canDisplay(ViewRequirement requirement) {
-            return false;
-        }
-
-        public View createView(final Content content, Axes axes, int sequence) {
-            return null;
-        }
-
-        public String getName() {
-            return "minimized view";
-        }
-
-        public boolean isAligned() {
-            return false;
-        }
-
-        public boolean isOpen() {
-            return false;
-        }
-
-        public boolean isReplaceable() {
-            return false;
-        }
-        
-        public boolean isResizeable() {
-            return false;
-        }
-
-        public boolean isSubView() {
-            return false;
-        }
-
-    }
-
-    private final static int BORDER_WIDTH = 5;
-    private final WindowControl controls[];
-    private View iconView;
-
-    private final View minimizedView;
-
-    public MinimizedView(final View viewToMinimize) {
-        super(viewToMinimize.getContent(), new Specification());
-        this.minimizedView = viewToMinimize;
-        iconView = new SubviewIconSpecification().createView(viewToMinimize.getContent(), viewToMinimize.getViewAxes(), -1);
-        iconView.setParent(this);
-        controls = new WindowControl[] { new RestoreWindowControl(this), new CloseWindowControl(this) };
-    }
-
-    @Override
-    public void debug(final DebugBuilder debug) {
-        super.debug(debug);
-        debug.appendln("minimized view", minimizedView);
-        debug.appendln();
-
-        debug.appendln("icon size", iconView.getSize());
-        debug.append(iconView);
-    }
-
-    @Override
-    public void dispose() {
-        super.dispose();
-        iconView.dispose();
-        // viewToMinimize.dispose();
-    }
-
-    @Override
-    public DragEvent dragStart(final DragStart drag) {
-        if (iconView.getBounds().contains(drag.getLocation())) {
-            drag.subtract(BORDER_WIDTH, BORDER_WIDTH);
-            return iconView.dragStart(drag);
-        } else {
-            return super.dragStart(drag);
-        }
-        // View dragOverlay = new DragViewOutline(getView());
-        // return new ViewDrag(this, new Offset(drag.getLocation()), dragOverlay);
-    }
-
-    @Override
-    public void draw(final Canvas canvas) {
-        super.draw(canvas);
-
-        final Size size = getSize();
-        final int width = size.getWidth();
-        final int height = size.getHeight();
-        final int left = 3;
-        final int top = 3;
-
-        final boolean hasFocus = containsFocus();
-        final Color lightColor = hasFocus ? Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1) : Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2);
-        clearBackground(canvas, Toolkit.getColor(ColorsAndFonts.COLOR_WINDOW));
-        canvas.drawRectangle(1, 0, width - 2, height, lightColor);
-        canvas.drawRectangle(0, 1, width, height - 2, lightColor);
-        for (int i = 2; i < left; i++) {
-            canvas.drawRectangle(i, i, width - 2 * i, height - 2 * i, lightColor);
-        }
-        final ViewState state = getState();
-        if (state.isActive()) {
-            final int i = left;
-            canvas.drawRectangle(i, top, width - 2 * i, height - 2 * i - top, Toolkit.getColor(ColorsAndFonts.COLOR_ACTIVE));
-        }
-
-        final int bw = controls[0].getLocation().getX() - 3; // controls.length * WindowControl.WIDTH;
-        canvas.drawSolidRectangle(bw, top, width - bw - 3, height - top * 2, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3));
-        canvas.drawLine(bw - 1, top, bw - 1, height - top * 2, lightColor);
-
-        for (int i = 0; controls != null && i < controls.length; i++) {
-            final Canvas controlCanvas = canvas.createSubcanvas(controls[i].getBounds());
-            controls[i].draw(controlCanvas);
-        }
-
-        final Canvas c = canvas.createSubcanvas(iconView.getBounds());
-        iconView.draw(c);
-    }
-
-    @Override
-    public Size getRequiredSize(Size availableSpace) {
-        final Size size = new Size();
-
-        size.extendWidth(BORDER_WIDTH);
-        final Size iconMaximumSize = iconView.getRequiredSize(Size.createMax());
-        size.extendWidth(iconMaximumSize.getWidth());
-
-        size.extendHeight(iconMaximumSize.getHeight());
-        size.ensureHeight(WindowControl.HEIGHT);
-        size.extendHeight(BORDER_WIDTH);
-        size.extendHeight(BORDER_WIDTH);
-
-        size.extendWidth(HPADDING);
-        size.extendWidth(controls.length * (WindowControl.WIDTH + HPADDING));
-        size.extendWidth(BORDER_WIDTH);
-        return size;
-    }
-
-    @Override
-    public Padding getPadding() {
-        return new Padding(BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH);
-    }
-
-    @Override
-    public void layout() {
-        final Size size = getRequiredSize(Size.createMax());
-
-        layoutControls(size.getWidth());
-
-        size.contractWidth(BORDER_WIDTH * 2);
-        size.contractWidth(HPADDING);
-        size.contractWidth(controls.length * (WindowControl.WIDTH + HPADDING));
-
-        size.contractHeight(BORDER_WIDTH * 2);
-
-        iconView.setLocation(new Location(BORDER_WIDTH, BORDER_WIDTH));
-        iconView.setSize(size);
-    }
-
-    private void layoutControls(final int width) {
-        final int widthControl = WindowControl.WIDTH + HPADDING;
-        int x = width - BORDER_WIDTH + HPADDING;
-        x -= widthControl * controls.length;
-        final int y = BORDER_WIDTH;
-
-        for (int i = 0; i < controls.length; i++) {
-            controls[i].setSize(controls[i].getRequiredSize(Size.createMax()));
-            controls[i].setLocation(new Location(x, y));
-            x += widthControl;
-        }
-    }
-
-    private void restore() {
-        final Workspace workspace = getWorkspace();
-        final View[] views = workspace.getSubviews();
-        for (int i = 0; i < views.length; i++) {
-            if (views[i] == this) {
-                dispose();
-
-                minimizedView.setParent(workspace);
-                // workspace.removeView(this);
-                workspace.addView(minimizedView);
-                workspace.invalidateLayout();
-
-                return;
-
-            }
-        }
-    }
-
-    private void close() {
-        final Workspace workspace = getWorkspace();
-        final View[] views = workspace.getSubviews();
-        for (int i = 0; i < views.length; i++) {
-            if (views[i] == this) {
-                dispose();
-
-                minimizedView.setParent(workspace);
-                workspace.invalidateLayout();
-                workspace.addView(minimizedView);
-                minimizedView.dispose();
-
-                return;
-
-            }
-        }
-    }
-
-    @Override
-    public void removeView(final View view) {
-        if (view == iconView) {
-            iconView = null;
-        } else {
-            throw new IsisException("No view " + view + " in " + this);
-        }
-    }
-
-    @Override
-    public void secondClick(final Click click) {
-        restore();
-    }
-
-    @Override
-    public ViewAreaType viewAreaType(final Location location) {
-        location.subtract(BORDER_WIDTH, BORDER_WIDTH);
-        return iconView.viewAreaType(location);
-    }
-
-    @Override
-    public void viewMenuOptions(final UserActionSet options) {
-        options.add(new UserActionAbstract("Restore") {
-
-            @Override
-            public void execute(final Workspace workspace, final View view, final Location at) {
-                restore();
-            }
-        });
-        super.viewMenuOptions(options);
-    }
-
-    @Override
-    public void firstClick(final Click click) {
-        final View button = overControl(click.getLocation());
-        if (button == null) {
-            /*
-             * if (overBorder(click.getLocation())) { Workspace workspace = getWorkspace(); if (workspace !=
-             * null) { if (click.button2()) { workspace.lower(getView()); } else if (click.button1()) {
-             * workspace.raise(getView()); } } } else { super.firstClick(click); }
-             * 
-             */} else {
-            button.firstClick(click);
-        }
-
-    }
-
-    private View overControl(final Location location) {
-        for (int i = 0; i < controls.length; i++) {
-            final WindowControl control = controls[i];
-            if (control.getBounds().contains(location)) {
-                return control;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public void dragIn(final ContentDrag drag) {
-        if (iconView.getBounds().contains(drag.getTargetLocation())) {
-            drag.subtract(BORDER_WIDTH, BORDER_WIDTH);
-            iconView.dragIn(drag);
-        }
-    }
-
-    @Override
-    public void dragOut(final ContentDrag drag) {
-        if (iconView.getBounds().contains(drag.getTargetLocation())) {
-            drag.subtract(BORDER_WIDTH, BORDER_WIDTH);
-            iconView.dragOut(drag);
-        }
-    }
-
-    @Override
-    public View identify(final Location location) {
-        if (iconView.getBounds().contains(location)) {
-            location.subtract(BORDER_WIDTH, BORDER_WIDTH);
-            return iconView.identify(location);
-        }
-        return this;
-    }
-
-    @Override
-    public void drop(final ContentDrag drag) {
-        if (iconView.getBounds().contains(drag.getTargetLocation())) {
-            drag.subtract(BORDER_WIDTH, BORDER_WIDTH);
-            iconView.drop(drag);
-        }
-    }
-}
+
+public class MinimizedView extends AbstractView {
+    private class CloseWindowControl extends WindowControl {
+
+        public CloseWindowControl(final View target) {
+            super(new UserAction() {
+                @Override
+                public Consent disabled(final View view) {
+                    return Allow.DEFAULT;
+                }
+
+                @Override
+                public void execute(final Workspace workspace, final View view, final Location at) {
+                    ((MinimizedView) view).close();
+                }
+
+                @Override
+                public String getDescription(final View view) {
+                    return "Close " + view.getSpecification().getName();
+                }
+
+                @Override
+                public String getHelp(final View view) {
+                    return null;
+                }
+
+                @Override
+                public String getName(final View view) {
+                    return "Close view";
+                }
+
+                @Override
+                public ActionType getType() {
+                    return ActionType.USER;
+                }
+            }, target);
+        }
+
+        @Override
+        public void draw(final Canvas canvas) {
+            final int x = 0;
+            final int y = 0;
+            final Color crossColor = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
+            canvas.drawLine(x + 4, y + 3, x + 10, y + 9, crossColor);
+            canvas.drawLine(x + 5, y + 3, x + 11, y + 9, crossColor);
+            canvas.drawLine(x + 10, y + 3, x + 4, y + 9, crossColor);
+            canvas.drawLine(x + 11, y + 3, x + 5, y + 9, crossColor);
+        }
+    }
+
+    private class RestoreWindowControl extends WindowControl {
+        public RestoreWindowControl(final View target) {
+            super(new UserAction() {
+
+                @Override
+                public Consent disabled(final View view) {
+                    return Allow.DEFAULT;
+                }
+
+                @Override
+                public void execute(final Workspace workspace, final View view, final Location at) {
+                    ((MinimizedView) view).restore();
+                }
+
+                @Override
+                public String getDescription(final View view) {
+                    return "Restore " + view.getSpecification().getName() + " to normal size";
+                }
+
+                @Override
+                public String getHelp(final View view) {
+                    return null;
+                }
+
+                @Override
+                public String getName(final View view) {
+                    return "Restore view";
+                }
+
+                @Override
+                public ActionType getType() {
+                    return ActionType.USER;
+                }
+            }, target);
+        }
+
+        @Override
+        public void draw(final Canvas canvas) {
+            final int x = 0;
+            final int y = 0;
+            final Color black = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
+            canvas.drawRectangle(x + 1, y + 1, WIDTH - 1, HEIGHT - 1, black);
+            canvas.drawLine(x + 2, y + 2, x + WIDTH - 2, y + 2, black);
+            canvas.drawLine(x + 2, y + 3, x + WIDTH - 2, y + 3, black);
+        }
+    }
+
+    private static class Specification implements ViewSpecification {
+
+        @Override
+        public boolean canDisplay(final ViewRequirement requirement) {
+            return false;
+        }
+
+        @Override
+        public View createView(final Content content, final Axes axes, final int sequence) {
+            return null;
+        }
+
+        @Override
+        public String getName() {
+            return "minimized view";
+        }
+
+        @Override
+        public boolean isAligned() {
+            return false;
+        }
+
+        @Override
+        public boolean isOpen() {
+            return false;
+        }
+
+        @Override
+        public boolean isReplaceable() {
+            return false;
+        }
+
+        @Override
+        public boolean isResizeable() {
+            return false;
+        }
+
+        @Override
+        public boolean isSubView() {
+            return false;
+        }
+
+    }
+
+    private final static int BORDER_WIDTH = 5;
+    private final WindowControl controls[];
+    private View iconView;
+
+    private final View minimizedView;
+
+    public MinimizedView(final View viewToMinimize) {
+        super(viewToMinimize.getContent(), new Specification());
+        this.minimizedView = viewToMinimize;
+        iconView =
+            new SubviewIconSpecification().createView(viewToMinimize.getContent(), viewToMinimize.getViewAxes(), -1);
+        iconView.setParent(this);
+        controls = new WindowControl[] { new RestoreWindowControl(this), new CloseWindowControl(this) };
+    }
+
+    @Override
+    public void debug(final DebugBuilder debug) {
+        super.debug(debug);
+        debug.appendln("minimized view", minimizedView);
+        debug.appendln();
+
+        debug.appendln("icon size", iconView.getSize());
+        debug.append(iconView);
+    }
+
+    @Override
+    public void dispose() {
+        super.dispose();
+        iconView.dispose();
+        // viewToMinimize.dispose();
+    }
+
+    @Override
+    public DragEvent dragStart(final DragStart drag) {
+        if (iconView.getBounds().contains(drag.getLocation())) {
+            drag.subtract(BORDER_WIDTH, BORDER_WIDTH);
+            return iconView.dragStart(drag);
+        } else {
+            return super.dragStart(drag);
+        }
+        // View dragOverlay = new DragViewOutline(getView());
+        // return new ViewDrag(this, new Offset(drag.getLocation()), dragOverlay);
+    }
+
+    @Override
+    public void draw(final Canvas canvas) {
+        super.draw(canvas);
+
+        final Size size = getSize();
+        final int width = size.getWidth();
+        final int height = size.getHeight();
+        final int left = 3;
+        final int top = 3;
+
+        final boolean hasFocus = containsFocus();
+        final Color lightColor =
+            hasFocus ? Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1) : Toolkit
+                .getColor(ColorsAndFonts.COLOR_SECONDARY2);
+        clearBackground(canvas, Toolkit.getColor(ColorsAndFonts.COLOR_WINDOW));
+        canvas.drawRectangle(1, 0, width - 2, height, lightColor);
+        canvas.drawRectangle(0, 1, width, height - 2, lightColor);
+        for (int i = 2; i < left; i++) {
+            canvas.drawRectangle(i, i, width - 2 * i, height - 2 * i, lightColor);
+        }
+        final ViewState state = getState();
+        if (state.isActive()) {
+            final int i = left;
+            canvas.drawRectangle(i, top, width - 2 * i, height - 2 * i - top,
+                Toolkit.getColor(ColorsAndFonts.COLOR_ACTIVE));
+        }
+
+        final int bw = controls[0].getLocation().getX() - 3; // controls.length * WindowControl.WIDTH;
+        canvas.drawSolidRectangle(bw, top, width - bw - 3, height - top * 2,
+            Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3));
+        canvas.drawLine(bw - 1, top, bw - 1, height - top * 2, lightColor);
+
+        for (int i = 0; controls != null && i < controls.length; i++) {
+            final Canvas controlCanvas = canvas.createSubcanvas(controls[i].getBounds());
+            controls[i].draw(controlCanvas);
+        }
+
+        final Canvas c = canvas.createSubcanvas(iconView.getBounds());
+        iconView.draw(c);
+    }
+
+    @Override
+    public Size getRequiredSize(final Size availableSpace) {
+        final Size size = new Size();
+
+        size.extendWidth(BORDER_WIDTH);
+        final Size iconMaximumSize = iconView.getRequiredSize(Size.createMax());
+        size.extendWidth(iconMaximumSize.getWidth());
+
+        size.extendHeight(iconMaximumSize.getHeight());
+        size.ensureHeight(WindowControl.HEIGHT);
+        size.extendHeight(BORDER_WIDTH);
+        size.extendHeight(BORDER_WIDTH);
+
+        size.extendWidth(HPADDING);
+        size.extendWidth(controls.length * (WindowControl.WIDTH + HPADDING));
+        size.extendWidth(BORDER_WIDTH);
+        return size;
+    }
+
+    @Override
+    public Padding getPadding() {
+        return new Padding(BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH);
+    }
+
+    @Override
+    public void layout() {
+        final Size size = getRequiredSize(Size.createMax());
+
+        layoutControls(size.getWidth());
+
+        size.contractWidth(BORDER_WIDTH * 2);
+        size.contractWidth(HPADDING);
+        size.contractWidth(controls.length * (WindowControl.WIDTH + HPADDING));
+
+        size.contractHeight(BORDER_WIDTH * 2);
+
+        iconView.setLocation(new Location(BORDER_WIDTH, BORDER_WIDTH));
+        iconView.setSize(size);
+    }
+
+    private void layoutControls(final int width) {
+        final int widthControl = WindowControl.WIDTH + HPADDING;
+        int x = width - BORDER_WIDTH + HPADDING;
+        x -= widthControl * controls.length;
+        final int y = BORDER_WIDTH;
+
+        for (final WindowControl control : controls) {
+            control.setSize(control.getRequiredSize(Size.createMax()));
+            control.setLocation(new Location(x, y));
+            x += widthControl;
+        }
+    }
+
+    private void restore() {
+        final Workspace workspace = getWorkspace();
+        final View[] views = workspace.getSubviews();
+        for (final View view : views) {
+            if (view == this) {
+                dispose();
+
+                minimizedView.setParent(workspace);
+                // workspace.removeView(this);
+                workspace.addView(minimizedView);
+                workspace.invalidateLayout();
+
+                return;
+
+            }
+        }
+    }
+
+    private void close() {
+        final Workspace workspace = getWorkspace();
+        final View[] views = workspace.getSubviews();
+        for (final View view : views) {
+            if (view == this) {
+                dispose();
+
+                minimizedView.setParent(workspace);
+                workspace.invalidateLayout();
+                workspace.addView(minimizedView);
+                minimizedView.dispose();
+
+                return;
+
+            }
+        }
+    }
+
+    @Override
+    public void removeView(final View view) {
+        if (view == iconView) {
+            iconView = null;
+        } else {
+            throw new IsisException("No view " + view + " in " + this);
+        }
+    }
+
+    @Override
+    public void secondClick(final Click click) {
+        restore();
+    }
+
+    @Override
+    public ViewAreaType viewAreaType(final Location location) {
+        location.subtract(BORDER_WIDTH, BORDER_WIDTH);
+        return iconView.viewAreaType(location);
+    }
+
+    @Override
+    public void viewMenuOptions(final UserActionSet options) {
+        options.add(new UserActionAbstract("Restore") {
+
+            @Override
+            public void execute(final Workspace workspace, final View view, final Location at) {
+                restore();
+            }
+        });
+        super.viewMenuOptions(options);
+    }
+
+    @Override
+    public void firstClick(final Click click) {
+        final View button = overControl(click.getLocation());
+        if (button == null) {
+            /*
+             * if (overBorder(click.getLocation())) { Workspace workspace = getWorkspace(); if (workspace != null) { if
+             * (click.button2()) { workspace.lower(getView()); } else if (click.button1()) { workspace.raise(getView());
+             * } } } else { super.firstClick(click); }
+             */} else {
+            button.firstClick(click);
+        }
+
+    }
+
+    private View overControl(final Location location) {
+        for (final WindowControl control : controls) {
+            if (control.getBounds().contains(location)) {
+                return control;
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public void dragIn(final ContentDrag drag) {
+        if (iconView.getBounds().contains(drag.getTargetLocation())) {
+            drag.subtract(BORDER_WIDTH, BORDER_WIDTH);
+            iconView.dragIn(drag);
+        }
+    }
+
+    @Override
+    public void dragOut(final ContentDrag drag) {
+        if (iconView.getBounds().contains(drag.getTargetLocation())) {
+            drag.subtract(BORDER_WIDTH, BORDER_WIDTH);
+            iconView.dragOut(drag);
+        }
+    }
+
+    @Override
+    public View identify(final Location location) {
+        if (iconView.getBounds().contains(location)) {
+            location.subtract(BORDER_WIDTH, BORDER_WIDTH);
+            return iconView.identify(location);
+        }
+        return this;
+    }
+
+    @Override
+    public void drop(final ContentDrag drag) {
+        if (iconView.getBounds().contains(drag.getTargetLocation())) {
+            drag.subtract(BORDER_WIDTH, BORDER_WIDTH);
+            iconView.drop(drag);
+        }
+    }
+}

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/NullFocusManager.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/NullFocusManager.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/NullFocusManager.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/NullFocusManager.java Tue May  3 07:18:19 2011
@@ -17,32 +17,44 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.viewer.basic;
 
 import org.apache.isis.viewer.dnd.view.FocusManager;
 import org.apache.isis.viewer.dnd.view.View;
 
-
 public class NullFocusManager implements FocusManager {
     private View focus;
 
-    public void focusNextView() {}
+    @Override
+    public void focusNextView() {
+    }
 
-    public void focusPreviousView() {}
+    @Override
+    public void focusPreviousView() {
+    }
 
-    public void focusParentView() {}
+    @Override
+    public void focusParentView() {
+    }
 
-    public void focusFirstChildView() {}
+    @Override
+    public void focusFirstChildView() {
+    }
 
-    public void focusLastChildView() {}
+    @Override
+    public void focusLastChildView() {
+    }
 
-    public void focusInitialChildView() {}
+    @Override
+    public void focusInitialChildView() {
+    }
 
+    @Override
     public View getFocus() {
         return focus;
     }
 
+    @Override
     public void setFocus(final View view) {
         focus = view;
     }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/RootWorkspaceSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/RootWorkspaceSpecification.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/RootWorkspaceSpecification.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/RootWorkspaceSpecification.java Tue May  3 07:18:19 2011
@@ -17,17 +17,15 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.viewer.basic;
 
 import org.apache.isis.viewer.dnd.view.Axes;
 import org.apache.isis.viewer.dnd.view.Content;
 import org.apache.isis.viewer.dnd.view.View;
 
-
 public class RootWorkspaceSpecification extends WorkspaceSpecification {
     @Override
-    public View createView(final Content content, Axes axes, int sequence) {
+    public View createView(final Content content, final Axes axes, final int sequence) {
         View workspace;
         workspace = super.createView(content, axes, sequence);
         workspace.setFocusManager(new WorkspaceFocusManager());

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/SimpleIdentifier.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/SimpleIdentifier.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/SimpleIdentifier.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/SimpleIdentifier.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.viewer.basic;
 
 import org.apache.isis.core.commons.debug.DebugBuilder;
@@ -30,7 +29,6 @@ import org.apache.isis.viewer.dnd.view.T
 import org.apache.isis.viewer.dnd.view.View;
 import org.apache.isis.viewer.dnd.view.base.AbstractViewDecorator;
 
-
 public class SimpleIdentifier extends AbstractViewDecorator {
 
     public SimpleIdentifier(final View wrappedView) {

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/TableFocusManager.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/TableFocusManager.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/TableFocusManager.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/TableFocusManager.java Tue May  3 07:18:19 2011
@@ -17,147 +17,156 @@
  *  under the License.
  */
 
+package org.apache.isis.viewer.dnd.viewer.basic;
 
-package org.apache.isis.viewer.dnd.viewer.basic;
-
 import org.apache.isis.core.commons.lang.ToString;
 import org.apache.isis.viewer.dnd.view.FocusManager;
 import org.apache.isis.viewer.dnd.view.View;
-
-
-public class TableFocusManager implements FocusManager {
-    private int row;
-    private int cell;
-    private final View table;
-
-    public TableFocusManager(final View table) {
-        this.table = table;
-
-        focusInitialChildView();
-    }
-
-    public void focusNextView() {
-        View r = table.getSubviews()[row];
-        View[] cells = r.getSubviews();
-        for (int j = cell + 1; j < cells.length; j++) {
-            if (cells[j].canFocus()) {
-                cells[cell].markDamaged();
-                cell = j;
-                // setFocus(cells[cell]);
-                cells[j].markDamaged();
-                return;
-            }
-        }
-
-        row++;
-        if (row == table.getSubviews().length) {
-            row = 0;
-        }
-
-        r = table.getSubviews()[row];
-        cells = r.getSubviews();
-        for (int j = 0; j < cells.length; j++) {
-            if (cells[j].canFocus()) {
-                cells[cell].markDamaged();
-                cell = j;
-                cells[j].markDamaged();
-                // setFocus(cells[cell]);
-                return;
-            }
-        }
-    }
-
-    public void focusPreviousView() {
-        View r = table.getSubviews()[row];
-        View[] cells = r.getSubviews();
-        for (int j = cell - 1; j >= 0; j--) {
-            if (cells[j].canFocus()) {
-                cells[cell].markDamaged();
-                cell = j;
-                cells[j].markDamaged();
-                return;
-            }
-        }
-
-        row--;
-        if (row == -1) {
-            row = table.getSubviews().length - 1;
-        }
-
-        r = table.getSubviews()[row];
-        cells = r.getSubviews();
-        for (int j = cells.length - 1; j >= 0; j--) {
-            if (cells[j].canFocus()) {
-                cells[cell].markDamaged();
-                cell = j;
-                cells[j].markDamaged();
-                return;
-            }
-        }
-    }
-
-    public void focusParentView() {}
-
-    public void focusFirstChildView() {}
-
-    public void focusLastChildView() {}
-
-    public void focusInitialChildView() {
-        row = cell = 0;
-
-        final View[] rows = table.getSubviews();
-        if (rows.length > 0) {
-            row = 0;
-            final View[] cells = rows[0].getSubviews();
-            for (int j = 0; j < cells.length; j++) {
-                if (cells[j].canFocus()) {
-                    cells[cell].markDamaged();
-                    cell = j;
-                    cells[j].markDamaged();
-                    // setFocus(cells[cell]);
-                    return;
-                }
-            }
-        }
-    }
-
-    public View getFocus() {
-        final View[] rows = table.getSubviews();
-        if (row < 0 || row >= rows.length) {
-            return table;
-        }
-        final View rowView = rows[row];
-        final View[] cells = rowView.getSubviews();
-        if (cell < 0 || cell >= cells.length) {
-            return rowView;
-        }
-        return cells[cell];
-    }
-
-    public void setFocus(final View view) {
-        if (view == table) {
-            return;
-        }
-
-        final View[] rows = table.getSubviews();
-        for (row = 0; row < rows.length; row++) {
-            final View[] cells = rows[row].getSubviews();
-            for (int j = 0; j < cells.length; j++) {
-                if (view == cells[j] && cells[j].canFocus()) {
-                    cells[cell].markDamaged();
-                    cell = j;
-                    cells[j].markDamaged();
-                    return;
-                }
-            }
-        }
-    }
-
-    @Override
-    public String toString() {
-        final ToString str = new ToString(this);
-        str.append("row", row);
-        str.append("cell", cell);
-        return str.toString();
-    }
-}
+
+public class TableFocusManager implements FocusManager {
+    private int row;
+    private int cell;
+    private final View table;
+
+    public TableFocusManager(final View table) {
+        this.table = table;
+
+        focusInitialChildView();
+    }
+
+    @Override
+    public void focusNextView() {
+        View r = table.getSubviews()[row];
+        View[] cells = r.getSubviews();
+        for (int j = cell + 1; j < cells.length; j++) {
+            if (cells[j].canFocus()) {
+                cells[cell].markDamaged();
+                cell = j;
+                // setFocus(cells[cell]);
+                cells[j].markDamaged();
+                return;
+            }
+        }
+
+        row++;
+        if (row == table.getSubviews().length) {
+            row = 0;
+        }
+
+        r = table.getSubviews()[row];
+        cells = r.getSubviews();
+        for (int j = 0; j < cells.length; j++) {
+            if (cells[j].canFocus()) {
+                cells[cell].markDamaged();
+                cell = j;
+                cells[j].markDamaged();
+                // setFocus(cells[cell]);
+                return;
+            }
+        }
+    }
+
+    @Override
+    public void focusPreviousView() {
+        View r = table.getSubviews()[row];
+        View[] cells = r.getSubviews();
+        for (int j = cell - 1; j >= 0; j--) {
+            if (cells[j].canFocus()) {
+                cells[cell].markDamaged();
+                cell = j;
+                cells[j].markDamaged();
+                return;
+            }
+        }
+
+        row--;
+        if (row == -1) {
+            row = table.getSubviews().length - 1;
+        }
+
+        r = table.getSubviews()[row];
+        cells = r.getSubviews();
+        for (int j = cells.length - 1; j >= 0; j--) {
+            if (cells[j].canFocus()) {
+                cells[cell].markDamaged();
+                cell = j;
+                cells[j].markDamaged();
+                return;
+            }
+        }
+    }
+
+    @Override
+    public void focusParentView() {
+    }
+
+    @Override
+    public void focusFirstChildView() {
+    }
+
+    @Override
+    public void focusLastChildView() {
+    }
+
+    @Override
+    public void focusInitialChildView() {
+        row = cell = 0;
+
+        final View[] rows = table.getSubviews();
+        if (rows.length > 0) {
+            row = 0;
+            final View[] cells = rows[0].getSubviews();
+            for (int j = 0; j < cells.length; j++) {
+                if (cells[j].canFocus()) {
+                    cells[cell].markDamaged();
+                    cell = j;
+                    cells[j].markDamaged();
+                    // setFocus(cells[cell]);
+                    return;
+                }
+            }
+        }
+    }
+
+    @Override
+    public View getFocus() {
+        final View[] rows = table.getSubviews();
+        if (row < 0 || row >= rows.length) {
+            return table;
+        }
+        final View rowView = rows[row];
+        final View[] cells = rowView.getSubviews();
+        if (cell < 0 || cell >= cells.length) {
+            return rowView;
+        }
+        return cells[cell];
+    }
+
+    @Override
+    public void setFocus(final View view) {
+        if (view == table) {
+            return;
+        }
+
+        final View[] rows = table.getSubviews();
+        for (row = 0; row < rows.length; row++) {
+            final View[] cells = rows[row].getSubviews();
+            for (int j = 0; j < cells.length; j++) {
+                if (view == cells[j] && cells[j].canFocus()) {
+                    cells[cell].markDamaged();
+                    cell = j;
+                    cells[j].markDamaged();
+                    return;
+                }
+            }
+        }
+    }
+
+    @Override
+    public String toString() {
+        final ToString str = new ToString(this);
+        str.append("row", row);
+        str.append("cell", cell);
+        return str.toString();
+    }
+}

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/UnlinedTextFieldSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/UnlinedTextFieldSpecification.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/UnlinedTextFieldSpecification.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/UnlinedTextFieldSpecification.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.viewer.basic;
 
 import org.apache.isis.viewer.dnd.field.SingleLineTextField;
@@ -28,20 +27,21 @@ import org.apache.isis.viewer.dnd.view.V
 import org.apache.isis.viewer.dnd.view.base.AbstractFieldSpecification;
 import org.apache.isis.viewer.dnd.view.content.TextParseableContent;
 
-
 /**
  * Creates a single line text field without the baseline being drawn.
  */
 public class UnlinedTextFieldSpecification extends AbstractFieldSpecification {
     @Override
-    public boolean canDisplay(ViewRequirement requirement) {
-        return requirement.isTextParseable()   && ((TextParseableContent)  requirement.getContent()).getNoLines() == 1;
+    public boolean canDisplay(final ViewRequirement requirement) {
+        return requirement.isTextParseable() && ((TextParseableContent) requirement.getContent()).getNoLines() == 1;
     }
 
-    public View createView(final Content content, Axes axes, int sequence) {
+    @Override
+    public View createView(final Content content, final Axes axes, final int sequence) {
         return new SingleLineTextField((TextParseableContent) content, this, false);
     }
 
+    @Override
     public String getName() {
         return "Single Line Text Field";
     }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/WorkspaceFocusManager.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/WorkspaceFocusManager.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/WorkspaceFocusManager.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/WorkspaceFocusManager.java Tue May  3 07:18:19 2011
@@ -17,35 +17,48 @@
  *  under the License.
  */
 
+package org.apache.isis.viewer.dnd.viewer.basic;
 
-package org.apache.isis.viewer.dnd.viewer.basic;
-
 import org.apache.isis.viewer.dnd.view.FocusManager;
 import org.apache.isis.viewer.dnd.view.View;
-
-
-public class WorkspaceFocusManager implements FocusManager {
-
-    public WorkspaceFocusManager() {
-        super();
-    }
-
-    public void focusNextView() {}
-
-    public void focusPreviousView() {}
-
-    public void focusParentView() {}
-
-    public void focusFirstChildView() {}
-
-    public void focusLastChildView() {}
-
-    public void focusInitialChildView() {}
-
-    public View getFocus() {
-        return null;
-    }
-
-    public void setFocus(final View view) {}
-
-}
+
+public class WorkspaceFocusManager implements FocusManager {
+
+    public WorkspaceFocusManager() {
+        super();
+    }
+
+    @Override
+    public void focusNextView() {
+    }
+
+    @Override
+    public void focusPreviousView() {
+    }
+
+    @Override
+    public void focusParentView() {
+    }
+
+    @Override
+    public void focusFirstChildView() {
+    }
+
+    @Override
+    public void focusLastChildView() {
+    }
+
+    @Override
+    public void focusInitialChildView() {
+    }
+
+    @Override
+    public View getFocus() {
+        return null;
+    }
+
+    @Override
+    public void setFocus(final View view) {
+    }
+
+}



Mime
View raw message