Changeset 14699

Show
Ignore:
Timestamp:
07/21/10 21:09:21 (7 weeks ago)
Author:
dkhaywood
Message:

updating DnD and HTML viewers to support @Prototype annotation

Location:
framework/trunk
Files:
23 modified

Legend:

Unmodified
Added
Removed
  • framework/trunk/core/runtime/src/main/java/org/nakedobjects/runtime/util/Dump.java

    r14698 r14699  
    318318            final NakedObjectAction[] userActions = specification.getObjectActions(NakedObjectActionType.USER); 
    319319            final NakedObjectAction[] explActions = specification.getObjectActions(NakedObjectActionType.EXPLORATION); 
     320            final NakedObjectAction[] prototypeActions = specification.getObjectActions(NakedObjectActionType.PROTOTYPE); 
    320321            final NakedObjectAction[] debActions = specification.getObjectActions(NakedObjectActionType.DEBUG); 
    321             specificationMethods(userActions, explActions, debActions, debug); 
     322            specificationMethods(userActions, explActions, prototypeActions, debActions, debug); 
    322323        } catch (final RuntimeException e) { 
    323324            debug.appendException(e); 
     
    329330            final NakedObjectAction[] userActions = specification.getServiceActionsFor(NakedObjectActionType.USER); 
    330331            final NakedObjectAction[] explActions = specification.getServiceActionsFor(NakedObjectActionType.EXPLORATION); 
     332            final NakedObjectAction[] prototypeActions = specification.getServiceActionsFor(NakedObjectActionType.PROTOTYPE); 
    331333            final NakedObjectAction[] debActions = specification.getServiceActionsFor(NakedObjectActionType.DEBUG); 
    332             specificationMethods(userActions, explActions, debActions, debug); 
     334            specificationMethods(userActions, explActions, prototypeActions,debActions, debug); 
    333335        } catch (final RuntimeException e) { 
    334336            debug.appendException(e); 
     
    408410                    debug.unindent(); 
    409411                    debug.indent(); 
    410  
    411                 } 
    412  
     412                } 
    413413            } 
    414414        } catch (final RuntimeException e) { 
     
    421421            final NakedObjectAction[] userActions, 
    422422            final NakedObjectAction[] explActions, 
    423             final NakedObjectAction[] debActions, 
     423            final NakedObjectAction[] prototypeActions, 
     424            final NakedObjectAction[] debugActions, 
    424425            final DebugString debug) { 
    425         if (userActions.length == 0 && explActions.length == 0 && debActions.length == 0) { 
     426                if (userActions.length == 0 && explActions.length == 0 && prototypeActions.length == 0 && debugActions.length == 0) { 
    426427            debug.appendln("no actions..."); 
    427428        } else { 
    428             debug.appendln("User actions"); 
    429             debug.indent(); 
    430             for (int i = 0; i < userActions.length; i++) { 
    431                 actionDetails(debug, userActions[i], 8, i); 
    432             } 
    433             debug.unindent(); 
    434  
    435             debug.appendln("Exploration actions"); 
    436             debug.indent(); 
    437             for (int i = 0; i < explActions.length; i++) { 
    438                 actionDetails(debug, explActions[i], 8, i); 
    439             } 
    440             debug.unindent(); 
    441  
    442             debug.appendln("Debug actions"); 
    443             debug.indent(); 
    444             for (int i = 0; i < debActions.length; i++) { 
    445                 actionDetails(debug, debActions[i], 8, i); 
    446             } 
    447             debug.unindent(); 
    448         } 
    449     } 
     429            appendActionDetails(debug, "User actions", userActions); 
     430            appendActionDetails(debug, "Exploration actions", explActions); 
     431            appendActionDetails(debug, "Prototype actions", prototypeActions); 
     432            appendActionDetails(debug, "Debug actions", debugActions); 
     433        } 
     434    } 
     435 
     436        private static void appendActionDetails(final DebugString debug, String desc, 
     437                        NakedObjectAction[] actions) { 
     438                debug.appendln(desc); 
     439                debug.indent(); 
     440                for (int i = 0; i < actions.length; i++) { 
     441                    actionDetails(debug, actions[i], 8, i); 
     442                } 
     443                debug.unindent(); 
     444        } 
    450445 
    451446    private static void actionDetails(final DebugString debug, final NakedObjectAction a, final int indent, final int count) { 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/awt/DebugOptions.java

    r14450 r14699  
    66import org.nakedobjects.metamodel.commons.debug.DebugInfo; 
    77import org.nakedobjects.metamodel.commons.debug.DebugString; 
     8import org.nakedobjects.metamodel.spec.feature.NakedObjectActionType; 
    89import org.nakedobjects.plugins.dnd.drawing.Location; 
    910import org.nakedobjects.plugins.dnd.view.MenuOptions; 
    1011import org.nakedobjects.plugins.dnd.view.Toolkit; 
    11 import org.nakedobjects.plugins.dnd.view.UserAction; 
    1212import org.nakedobjects.plugins.dnd.view.UserActionSet; 
    1313import org.nakedobjects.plugins.dnd.view.View; 
     
    2727    public void menuOptions(final UserActionSet options) { 
    2828        final String showExplorationMenu = "Always show exploration menu " + (viewer.showExplorationMenuByDefault ? "off" : "on"); 
    29         options.add(new UserActionAbstract(showExplorationMenu, UserAction.DEBUG) { 
     29        options.add(new UserActionAbstract(showExplorationMenu, NakedObjectActionType.DEBUG) { 
    3030            @Override 
    3131            public void execute(final Workspace workspace, final View view, final Location at) { 
     
    3636 
    3737        final String repaint = "Show painting area  " + (viewer.showRepaintArea ? "off" : "on"); 
    38         options.add(new UserActionAbstract(repaint, UserAction.DEBUG) { 
     38        options.add(new UserActionAbstract(repaint, NakedObjectActionType.DEBUG) { 
    3939            @Override 
    4040            public void execute(final Workspace workspace, final View view, final Location at) { 
     
    4545 
    4646        final String debug = "Debug graphics " + (Toolkit.debug ? "off" : "on"); 
    47         options.add(new UserActionAbstract(debug, UserAction.DEBUG) { 
     47        options.add(new UserActionAbstract(debug, NakedObjectActionType.DEBUG) { 
    4848            @Override 
    4949            public void execute(final Workspace workspace, final View view, final Location at) { 
     
    5454 
    5555        final String action = viewer.isShowingMouseSpy() ? "Hide" : "Show"; 
    56         options.add(new UserActionAbstract(action + " mouse spy", UserAction.DEBUG) { 
     56        options.add(new UserActionAbstract(action + " mouse spy", NakedObjectActionType.DEBUG) { 
    5757            @Override 
    5858            public void execute(final Workspace workspace, final View view, final Location at) { 
     
    7070//        }); 
    7171         
    72         options.add(new UserActionAbstract("Diagnostics...", UserAction.DEBUG) { 
     72        options.add(new UserActionAbstract("Diagnostics...", NakedObjectActionType.DEBUG) { 
    7373            @Override 
    7474            public void execute(final Workspace workspace, final View view, final Location at) { 
     
    9494 
    9595 
    96         options.add(new UserActionAbstract("Debug system...", UserAction.DEBUG) { 
     96        options.add(new UserActionAbstract("Debug system...", NakedObjectActionType.DEBUG) { 
    9797            @Override 
    9898            public void execute(final Workspace workspace, final View view, final Location at) { 
     
    105105 
    106106 
    107         options.add(new UserActionAbstract("Debug session...", UserAction.DEBUG) { 
     107        options.add(new UserActionAbstract("Debug session...", NakedObjectActionType.DEBUG) { 
    108108            @Override 
    109109            public void execute(final Workspace workspace, final View view, final Location at) { 
     
    115115        }); 
    116116 
    117         options.add(new UserActionAbstract("Debug viewer...", UserAction.DEBUG) { 
     117        options.add(new UserActionAbstract("Debug viewer...", NakedObjectActionType.DEBUG) { 
    118118            @Override 
    119119            public void execute(final Workspace workspace, final View view, final Location at) { 
     
    124124        }); 
    125125 
    126         options.add(new UserActionAbstract("Debug overlay...", UserAction.DEBUG) { 
     126        options.add(new UserActionAbstract("Debug overlay...", NakedObjectActionType.DEBUG) { 
    127127            @Override 
    128128            public void execute(final Workspace workspace, final View view, final Location at) { 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/awt/XViewer.java

    r14537 r14699  
    8080    private String status; 
    8181    private boolean runningAsExploration; 
     82    private boolean runningAsPrototype; 
    8283    private InteractionSpy spy; 
    8384    private int statusBarHeight; 
     
    293294    } 
    294295 
     296    public boolean isRunningAsPrototype() { 
     297        return runningAsPrototype; 
     298    } 
     299 
    295300    public boolean isShowingMouseSpy() { 
    296301        return spy.isVisible(); 
     
    503508        } 
    504509        final boolean showExplorationOptions = includeExploration || showExplorationMenuByDefault; 
    505         menu.show(forView, includeDebug, showExplorationOptions); 
     510        final boolean showPrototypeOptions = isRunningAsPrototype(); 
     511        menu.show(forView, includeDebug, showExplorationOptions, showPrototypeOptions); 
    506512        feedbackManager.clearBusy(over); 
    507513    } 
     
    560566    } 
    561567 
     568    public void setPrototype(final boolean asPrototype) { 
     569        this.runningAsPrototype = asPrototype; 
     570    } 
     571 
    562572    public void setListener(final ShutdownListener listener) { 
    563573        this.listener = listener; 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/bootstrap/DndViewer.java

    r14557 r14699  
    278278        viewer.setListener(shutdownListener); 
    279279        viewer.setExploration(isInExplorationMode()); 
     280        viewer.setPrototype(isInPrototypeMode()); 
    280281 
    281282        if (helpViewer == null) { 
     
    327328    private boolean isInExplorationMode() { 
    328329        return getDeploymentType().isExploring(); 
     330    } 
     331 
     332    private boolean isInPrototypeMode() { 
     333        return getDeploymentType().isPrototyping(); 
    329334    } 
    330335 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/tree/TreeDisplayRules.java

    r14451 r14699  
    4242 
    4343            public NakedObjectActionType getType() { 
    44                 return USER; 
     44                return NakedObjectActionType.USER; 
    4545            } 
    4646 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/Viewer.java

    r14548 r14699  
    2323 
    2424    boolean isRunningAsExploration(); 
     25    boolean isRunningAsPrototype(); 
    2526 
    2627    void clearAction(); 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/action/OptionFactory.java

    r14698 r14699  
    2121        // actions for all the types 
    2222        actions = specification.getServiceActionsFor(NakedObjectActionType.USER, NakedObjectActionType.EXPLORATION, 
    23                 NakedObjectActionType.DEBUG); 
     23                NakedObjectActionType.PROTOTYPE, NakedObjectActionType.DEBUG); 
    2424        menuOptions(actions, null, options); 
    2525    } 
     
    3232        NakedObjectSpecification noSpec = adapter.getSpecification(); 
    3333        menuOptions(noSpec.getObjectActions(NakedObjectActionType.USER, NakedObjectActionType.EXPLORATION, 
    34                 NakedObjectActionType.DEBUG), adapter, options); 
     34                        NakedObjectActionType.PROTOTYPE, NakedObjectActionType.DEBUG), adapter, options); 
    3535 
    3636        // TODO: this looks like a bit of a hack; can we improve it by looking at the facets? 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/base/AbstractView.java

    r14557 r14699  
    1212import org.nakedobjects.metamodel.facets.collections.modify.CollectionFacet; 
    1313import org.nakedobjects.metamodel.spec.NakedObjectSpecification; 
     14import org.nakedobjects.metamodel.spec.feature.NakedObjectActionType; 
    1415import org.nakedobjects.plugins.dnd.drawing.Bounds; 
    1516import org.nakedobjects.plugins.dnd.drawing.Canvas; 
     
    3435import org.nakedobjects.plugins.dnd.view.Toolkit; 
    3536import org.nakedobjects.plugins.dnd.view.UndoStack; 
    36 import org.nakedobjects.plugins.dnd.view.UserAction; 
    3737import org.nakedobjects.plugins.dnd.view.UserActionSet; 
    3838import org.nakedobjects.plugins.dnd.view.View; 
     
    684684 
    685685    private void addViewDebugMenuItems(final UserActionSet options) { 
    686         options.add(new UserActionAbstract("Refresh view", UserAction.DEBUG) { 
     686        options.add(new UserActionAbstract("Refresh view", NakedObjectActionType.DEBUG) { 
    687687            public void execute(final Workspace workspace, final View view, final Location at) { 
    688688                refresh(); 
     
    690690        }); 
    691691 
    692         options.add(new UserActionAbstract("Invalidate content", UserAction.DEBUG) { 
     692        options.add(new UserActionAbstract("Invalidate content", NakedObjectActionType.DEBUG) { 
    693693            public void execute(final Workspace workspace, final View view, final Location at) { 
    694694                invalidateContent(); 
     
    696696        }); 
    697697 
    698         options.add(new UserActionAbstract("Invalidate layout", UserAction.DEBUG) { 
     698        options.add(new UserActionAbstract("Invalidate layout", NakedObjectActionType.DEBUG) { 
    699699            public void execute(final Workspace workspace, final View view, final Location at) { 
    700700                invalidateLayout(); 
     
    705705    private void addNewViewMenuItems(final UserActionSet options, final Content content) { 
    706706        if (getContent() instanceof ObjectContent) { 
    707             options.add(new UserActionAbstract("Use as default view for objects", UserAction.USER) { 
     707            options.add(new UserActionAbstract("Use as default view for objects", NakedObjectActionType.USER) { 
    708708                public void execute(final Workspace workspace, final View view, final Location at) { 
    709709                    Properties.setStringOption("view.object-default", getSpecification().getName()); 
     
    716716        } 
    717717        if (getContent() instanceof CollectionContent) { 
    718             options.add(new UserActionAbstract("Use as default view for collection", UserAction.USER) { 
     718            options.add(new UserActionAbstract("Use as default view for collection", NakedObjectActionType.USER) { 
    719719                public void execute(final Workspace workspace, final View view, final Location at) { 
    720720                    Properties.setStringOption("view.collection-default", getSpecification().getName()); 
     
    727727        } 
    728728        if (getContent() instanceof ObjectContent && !getSpecification().isOpen()) { 
    729             options.add(new UserActionAbstract("Use as default view for icon", UserAction.USER) { 
     729            options.add(new UserActionAbstract("Use as default view for icon", NakedObjectActionType.USER) { 
    730730                public void execute(final Workspace workspace, final View view, final Location at) { 
    731731                    Properties.setStringOption("view.icon-default", getSpecification().getName()); 
     
    739739 
    740740        if (getContent() instanceof RootObject || getContent() instanceof RootCollection) { 
    741             options.add(new UserActionAbstract("Use as default view for " + getContent().getSpecification().getSingularName(), UserAction.USER) { 
     741            options.add(new UserActionAbstract("Use as default view for " + getContent().getSpecification().getSingularName(), NakedObjectActionType.USER) { 
    742742                public void execute(final Workspace workspace, final View view, final Location at) { 
    743743                    Options viewOptions = Properties.getViewConfigurationOptions(getSpecification()); 
     
    766766        }); 
    767767        */ 
    768         options.add(new UserActionAbstract("Save specification", UserAction.USER) { 
     768        options.add(new UserActionAbstract("Save specification", NakedObjectActionType.USER) { 
    769769            public void execute(final Workspace workspace, final View view, final Location at) { 
    770770                Options viewOptions = Properties.getViewConfigurationOptions(getSpecification()); 
     
    799799            while (possibleViews.hasMoreElements()) { 
    800800                final ViewSpecification specification = (ViewSpecification) possibleViews.nextElement(); 
    801                 final UserActionAbstract viewAs = new UserActionAbstract(specification.getName(), UserAction.USER) { 
     801                final UserActionAbstract viewAs = new UserActionAbstract(specification.getName(), NakedObjectActionType.USER) { 
    802802                    public void execute(final Workspace workspace, final View view, final Location at) { 
    803803                        UserViewSpecification newSpec = new UserViewSpecification(specification, "new " + specification.getName()); 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/collection/AbstractCollectionContent.java

    r14448 r14699  
    1212import org.nakedobjects.metamodel.facets.collections.modify.CollectionFacet; 
    1313import org.nakedobjects.metamodel.spec.NakedObjectSpecification; 
     14import org.nakedobjects.metamodel.spec.feature.NakedObjectActionType; 
    1415import org.nakedobjects.metamodel.spec.feature.NakedObjectAssociation; 
    1516import org.nakedobjects.metamodel.util.CollectionFacetUtils; 
     
    1718import org.nakedobjects.plugins.dnd.drawing.ImageFactory; 
    1819import org.nakedobjects.plugins.dnd.drawing.Location; 
    19 import org.nakedobjects.plugins.dnd.view.UserAction; 
    2020import org.nakedobjects.plugins.dnd.view.UserActionSet; 
    2121import org.nakedobjects.plugins.dnd.view.View; 
     
    101101         * if (option != null) { options.add(option); } } 
    102102         */ 
    103         options.add(new UserActionAbstract("Clear resolved", UserAction.DEBUG) { 
     103        options.add(new UserActionAbstract("Clear resolved", NakedObjectActionType.DEBUG) { 
    104104            @Override 
    105105            public Consent disabled(final View component) { 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/content/AbstractObjectContent.java

    r14698 r14699  
    8787            workspace.objectActionResult(clone, new Placement(view)); 
    8888        } 
    89  
    9089    } 
    9190 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/debug/DebugDumpSnapshotOption.java

    r14524 r14699  
    1111import org.nakedobjects.metamodel.consent.Consent; 
    1212import org.nakedobjects.metamodel.consent.Veto; 
     13import org.nakedobjects.metamodel.spec.feature.NakedObjectActionType; 
    1314import org.nakedobjects.plugins.dnd.drawing.Location; 
    14 import org.nakedobjects.plugins.dnd.view.UserAction; 
    1515import org.nakedobjects.plugins.dnd.view.View; 
    1616import org.nakedobjects.plugins.dnd.view.Workspace; 
     
    2323public class DebugDumpSnapshotOption extends UserActionAbstract { 
    2424    public DebugDumpSnapshotOption() { 
    25         super("Dump log snapshot", UserAction.DEBUG); 
     25        super("Dump log snapshot", NakedObjectActionType.DEBUG); 
    2626    } 
    2727 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/debug/DebugOption.java

    r14526 r14699  
    66import org.nakedobjects.metamodel.adapter.NakedObject; 
    77import org.nakedobjects.metamodel.commons.debug.DebugInfo; 
     8import org.nakedobjects.metamodel.spec.feature.NakedObjectActionType; 
    89import org.nakedobjects.plugins.dnd.drawing.Location; 
    910import org.nakedobjects.plugins.dnd.service.PerspectiveContent; 
    1011import org.nakedobjects.plugins.dnd.view.Content; 
    1112import org.nakedobjects.plugins.dnd.view.Toolkit; 
    12 import org.nakedobjects.plugins.dnd.view.UserAction; 
    1313import org.nakedobjects.plugins.dnd.view.View; 
    1414import org.nakedobjects.plugins.dnd.view.Workspace; 
     
    2222public class DebugOption extends UserActionAbstract { 
    2323    public DebugOption() { 
    24         super("Debug...", UserAction.DEBUG); 
     24        super("Debug...", NakedObjectActionType.DEBUG); 
    2525    } 
    2626 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/debug/LoggingOptions.java

    r14524 r14699  
    55import org.nakedobjects.metamodel.consent.Consent; 
    66import org.nakedobjects.metamodel.consent.ConsentAbstract; 
     7import org.nakedobjects.metamodel.spec.feature.NakedObjectActionType; 
    78import org.nakedobjects.plugins.dnd.drawing.Location; 
    89import org.nakedobjects.plugins.dnd.view.MenuOptions; 
    9 import org.nakedobjects.plugins.dnd.view.UserAction; 
    1010import org.nakedobjects.plugins.dnd.view.UserActionSet; 
    1111import org.nakedobjects.plugins.dnd.view.View; 
     
    2727 
    2828    private UserActionAbstract loggingOption(final String name, final Level level) { 
    29         return new UserActionAbstract("Log level " + level, UserAction.DEBUG) { 
     29        return new UserActionAbstract("Log level " + level, NakedObjectActionType.DEBUG) { 
    3030            @Override 
    3131            public Consent disabled(final View component) { 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/menu/PopupMenu.java

    r14501 r14699  
    537537        } else { 
    538538            final Vector list = new Vector(); 
    539             addItems(target, options, len, list, UserAction.USER); 
    540             addItems(target, options, len, list, UserAction.EXPLORATION); 
    541             addItems(target, options, len, list, UserAction.DEBUG); 
     539            addItems(target, options, len, list, NakedObjectActionType.USER); 
     540            addItems(target, options, len, list, NakedObjectActionType.EXPLORATION); 
     541            addItems(target, options, len, list, NakedObjectActionType.PROTOTYPE); 
     542            addItems(target, options, len, list, NakedObjectActionType.DEBUG); 
    542543            items = new Item[list.size()]; 
    543544            list.copyInto(items); 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/menu/PopupMenuContainer.java

    r14524 r14699  
    66 
    77import org.nakedobjects.metamodel.commons.debug.DebugString; 
     8import org.nakedobjects.metamodel.spec.feature.NakedObjectActionType; 
    89import org.nakedobjects.plugins.dnd.drawing.Canvas; 
    910import org.nakedobjects.plugins.dnd.drawing.Color; 
     
    153154 
    154155 
    155     public void show(final boolean forView, final boolean includeDebug, final boolean includeExploration) { 
     156    public void show(final boolean forView, final boolean includeDebug, final boolean includeExploration, final boolean includePrototype) { 
    156157        final boolean withExploration = getViewManager().isRunningAsExploration() && includeExploration; 
    157  
    158         final UserActionSet optionSet = new UserActionSetImpl(withExploration, includeDebug, UserAction.USER); 
     158        final boolean withPrototype = getViewManager().isRunningAsPrototype() && includePrototype; 
     159         
     160 
     161        final UserActionSet optionSet = new UserActionSetImpl(withExploration, withPrototype, includeDebug, NakedObjectActionType.USER); 
    159162        if (forView) { 
    160163            target.viewMenuOptions(optionSet); 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/menu/UserActionSetImpl.java

    r14451 r14699  
    2121 
    2222public class UserActionSetImpl implements UserActionSet { 
    23     private Color backgroundColor = Toolkit.getColor(ColorsAndFonts.COLOR_DEBUG_BASELINE); 
    24     private final String groupName; 
     23 
     24        private Color backgroundColor; 
     25 
     26        private final String groupName; 
    2527    private final boolean includeDebug; 
    2628    private final boolean includeExploration; 
     29    private final boolean includePrototype; 
    2730    private final Vector options = new Vector(); 
    2831    private final NakedObjectActionType type; 
    2932 
    30     public UserActionSetImpl(final boolean includeExploration, final boolean includeDebug, final NakedObjectActionType type) { 
    31         this.type = type; 
    32         this.groupName = ""; 
    33         this.includeExploration = includeExploration; 
    34         this.includeDebug = includeDebug; 
     33    public UserActionSetImpl(final boolean includeExploration, final boolean includePrototype, final boolean includeDebug, final NakedObjectActionType type) { 
     34        this("", type, includeExploration, includePrototype, includeDebug, Toolkit.getColor(ColorsAndFonts.COLOR_DEBUG_BASELINE));  
    3535    } 
    3636 
    3737    private UserActionSetImpl(final String groupName, final UserActionSetImpl parent) { 
    38         this.groupName = groupName; 
    39         this.includeExploration = parent.includeExploration; 
    40         this.includeDebug = parent.includeDebug; 
    41         this.type = parent.getType(); 
    42         this.backgroundColor = parent.getColor(); 
     38        this(groupName, parent, parent.getType()); 
    4339    } 
    4440 
    4541    private UserActionSetImpl(final String groupName, final UserActionSetImpl parent, final NakedObjectActionType type) { 
     42        this(groupName, type, parent.includeExploration, parent.includePrototype, parent.includeDebug, parent.getColor()); 
     43    } 
     44 
     45    private UserActionSetImpl(final String groupName, final NakedObjectActionType type, final boolean includeExploration, final boolean includePrototype, final boolean includeDebug, final Color backgroundColor) { 
    4646        this.groupName = groupName; 
    47         this.includeExploration = parent.includeExploration; 
    48         this.includeDebug = parent.includeDebug; 
    4947        this.type = type; 
    50         this.backgroundColor = parent.getColor(); 
     48        this.includeExploration = includeExploration; 
     49        this.includePrototype = includePrototype; 
     50        this.includeDebug = includeDebug; 
     51        this.backgroundColor = backgroundColor; 
    5152    } 
    5253 
     
    6869    public void add(final UserAction option) { 
    6970        final NakedObjectActionType section = option.getType(); 
    70         if (section == USER || (includeExploration && section == EXPLORATION) || (includeDebug && section == DEBUG)) { 
     71        if (section == NakedObjectActionType.USER ||  
     72                (includeExploration && section == NakedObjectActionType.EXPLORATION) ||  
     73                (includePrototype && section == NakedObjectActionType.PROTOTYPE) ||  
     74                (includeDebug && section == NakedObjectActionType.DEBUG)) { 
    7175            options.addElement(option); 
    7276        } 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/option/DisposeObjectOption.java

    r14447 r14699  
    55import org.nakedobjects.metamodel.consent.Consent; 
    66import org.nakedobjects.metamodel.consent.Veto; 
     7import org.nakedobjects.metamodel.spec.feature.NakedObjectActionType; 
    78import org.nakedobjects.plugins.dnd.drawing.Location; 
    89import org.nakedobjects.plugins.dnd.view.ObjectContent; 
     
    1920public class DisposeObjectOption extends UserActionAbstract { 
    2021    public DisposeObjectOption() { 
    21         super("Dispose Object", EXPLORATION); 
     22        super("Dispose Object", NakedObjectActionType.EXPLORATION); 
    2223    } 
    2324 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/window/ResizeWindowControl.java

    r14449 r14699  
    3636 
    3737            public NakedObjectActionType getType() { 
    38                 return USER; 
     38                return NakedObjectActionType.USER; 
    3939            } 
    4040 
  • framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/viewer/basic/MinimizedView.java

    r14502 r14699  
    5959 
    6060                public NakedObjectActionType getType() { 
    61                     return USER; 
     61                    return NakedObjectActionType.USER; 
    6262                } 
    6363            }, target); 
     
    101101 
    102102                public NakedObjectActionType getType() { 
    103                     return USER; 
     103                    return NakedObjectActionType.USER; 
    104104                } 
    105105            }, target); 
  • framework/trunk/plugins/dnd-viewer/src/test/java/org/nakedobjects/plugins/dnd/TestToolkit.java

    r14557 r14699  
    100100            } 
    101101 
     102            public boolean isRunningAsPrototype() { 
     103                return false; 
     104            } 
     105 
    102106            public void markDamaged(final Bounds bounds) {} 
    103107 
  • framework/trunk/plugins/html-viewer/src/main/java/org/nakedobjects/plugins/html/action/view/util/MenuUtil.java

    r14698 r14699  
    2020        final NakedObjectAction[] actions1 = specification.getObjectActions(NakedObjectActionType.USER); 
    2121        final NakedObjectAction[] actions2 = specification.getObjectActions(NakedObjectActionType.EXPLORATION); 
    22         final NakedObjectAction[] actions = new NakedObjectAction[actions1.length + actions2.length]; 
    23         System.arraycopy(actions1, 0, actions, 0, actions1.length); 
    24         System.arraycopy(actions2, 0, actions, actions1.length, actions2.length); 
     22        final NakedObjectAction[] actions3 = specification.getObjectActions(NakedObjectActionType.PROTOTYPE); 
     23        final NakedObjectAction[] actions = concat(concat(actions1, actions2), actions3); 
    2524        final Component[] menuItems = createMenu("Actions", target, actions, context, targetObjectId); 
    2625        return menuItems; 
    2726    } 
     27 
     28        private static NakedObjectAction[] concat( 
     29                        final NakedObjectAction[] actions1, 
     30                        final NakedObjectAction[] actions2) { 
     31                final NakedObjectAction[] actions = new NakedObjectAction[actions1.length + actions2.length]; 
     32        System.arraycopy(actions1, 0, actions, 0, actions1.length); 
     33        System.arraycopy(actions2, 0, actions, actions1.length, actions2.length); 
     34                return actions; 
     35        } 
    2836 
    2937    private static Component[] createMenu( 
     
    4957                        // carry on, process this action 
    5058                } else if (action.getType() == NakedObjectActionType.EXPLORATION) { 
    51                         //boolean isExploring = SessionAccess.inExplorationMode(); 
    5259                        boolean isExploring = NakedObjectsContext.getDeploymentType().isExploring(); 
    5360                                        if (isExploring) { 
     61                                // carry on, process this action 
     62                        } else { 
     63                        // ignore this action, skip onto next 
     64                                continue; 
     65                        } 
     66                } else if (action.getType() == NakedObjectActionType.PROTOTYPE) { 
     67                        boolean isPrototyping = NakedObjectsContext.getDeploymentType().isPrototyping(); 
     68                                        if (isPrototyping) { 
    5469                                // carry on, process this action 
    5570                        } else { 
  • framework/trunk/plugins/scimpi/dispatcher/src/main/java/org/nakedobjects/webapp/debug/DebugAction.java

    r14698 r14699  
    125125        specificationMembers(view, "User Actions", userActions); 
    126126        specificationMembers(view, "Exploration Actions", spec.getObjectActions(NakedObjectActionType.EXPLORATION)); 
     127        specificationMembers(view, "Prototype Actions", spec.getObjectActions(NakedObjectActionType.PROTOTYPE)); 
    127128        specificationMembers(view, "Debug Actions", spec.getObjectActions(NakedObjectActionType.DEBUG)); 
    128129 
  • framework/trunk/plugins/scimpi/dispatcher/src/main/java/org/nakedobjects/webapp/util/MethodsUtils.java

    r14698 r14699  
    6262 
    6363        NakedObjectAction[] actions = object.getSpecification().getObjectActions(NakedObjectActionType.USER, 
    64                 NakedObjectActionType.EXPLORATION, NakedObjectActionType.DEBUG); 
     64                NakedObjectActionType.EXPLORATION, NakedObjectActionType.PROTOTYPE, NakedObjectActionType.DEBUG); 
    6565        NakedObjectAction action = findAction(actions, methodName); 
    6666       /* if (action == null) {