Changeset 14699
- Timestamp:
- 07/21/10 21:09:21 (7 weeks ago)
- Location:
- framework/trunk
- Files:
-
- 23 modified
-
core/runtime/src/main/java/org/nakedobjects/runtime/util/Dump.java (modified) (4 diffs)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/awt/DebugOptions.java (modified) (10 diffs)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/awt/XViewer.java (modified) (4 diffs)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/bootstrap/DndViewer.java (modified) (2 diffs)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/tree/TreeDisplayRules.java (modified) (1 diff)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/Viewer.java (modified) (1 diff)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/action/OptionFactory.java (modified) (2 diffs)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/base/AbstractView.java (modified) (11 diffs)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/collection/AbstractCollectionContent.java (modified) (3 diffs)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/content/AbstractObjectContent.java (modified) (1 diff)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/debug/DebugDumpSnapshotOption.java (modified) (2 diffs)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/debug/DebugOption.java (modified) (2 diffs)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/debug/LoggingOptions.java (modified) (2 diffs)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/menu/PopupMenu.java (modified) (1 diff)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/menu/PopupMenuContainer.java (modified) (2 diffs)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/menu/UserActionSetImpl.java (modified) (2 diffs)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/option/DisposeObjectOption.java (modified) (2 diffs)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/window/ResizeWindowControl.java (modified) (1 diff)
-
plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/viewer/basic/MinimizedView.java (modified) (2 diffs)
-
plugins/dnd-viewer/src/test/java/org/nakedobjects/plugins/dnd/TestToolkit.java (modified) (1 diff)
-
plugins/html-viewer/src/main/java/org/nakedobjects/plugins/html/action/view/util/MenuUtil.java (modified) (2 diffs)
-
plugins/scimpi/dispatcher/src/main/java/org/nakedobjects/webapp/debug/DebugAction.java (modified) (1 diff)
-
plugins/scimpi/dispatcher/src/main/java/org/nakedobjects/webapp/util/MethodsUtils.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
framework/trunk/core/runtime/src/main/java/org/nakedobjects/runtime/util/Dump.java
r14698 r14699 318 318 final NakedObjectAction[] userActions = specification.getObjectActions(NakedObjectActionType.USER); 319 319 final NakedObjectAction[] explActions = specification.getObjectActions(NakedObjectActionType.EXPLORATION); 320 final NakedObjectAction[] prototypeActions = specification.getObjectActions(NakedObjectActionType.PROTOTYPE); 320 321 final NakedObjectAction[] debActions = specification.getObjectActions(NakedObjectActionType.DEBUG); 321 specificationMethods(userActions, explActions, debActions, debug);322 specificationMethods(userActions, explActions, prototypeActions, debActions, debug); 322 323 } catch (final RuntimeException e) { 323 324 debug.appendException(e); … … 329 330 final NakedObjectAction[] userActions = specification.getServiceActionsFor(NakedObjectActionType.USER); 330 331 final NakedObjectAction[] explActions = specification.getServiceActionsFor(NakedObjectActionType.EXPLORATION); 332 final NakedObjectAction[] prototypeActions = specification.getServiceActionsFor(NakedObjectActionType.PROTOTYPE); 331 333 final NakedObjectAction[] debActions = specification.getServiceActionsFor(NakedObjectActionType.DEBUG); 332 specificationMethods(userActions, explActions, debActions, debug);334 specificationMethods(userActions, explActions, prototypeActions,debActions, debug); 333 335 } catch (final RuntimeException e) { 334 336 debug.appendException(e); … … 408 410 debug.unindent(); 409 411 debug.indent(); 410 411 } 412 412 } 413 413 } 414 414 } catch (final RuntimeException e) { … … 421 421 final NakedObjectAction[] userActions, 422 422 final NakedObjectAction[] explActions, 423 final NakedObjectAction[] debActions, 423 final NakedObjectAction[] prototypeActions, 424 final NakedObjectAction[] debugActions, 424 425 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) { 426 427 debug.appendln("no actions..."); 427 428 } 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 } 450 445 451 446 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 6 6 import org.nakedobjects.metamodel.commons.debug.DebugInfo; 7 7 import org.nakedobjects.metamodel.commons.debug.DebugString; 8 import org.nakedobjects.metamodel.spec.feature.NakedObjectActionType; 8 9 import org.nakedobjects.plugins.dnd.drawing.Location; 9 10 import org.nakedobjects.plugins.dnd.view.MenuOptions; 10 11 import org.nakedobjects.plugins.dnd.view.Toolkit; 11 import org.nakedobjects.plugins.dnd.view.UserAction;12 12 import org.nakedobjects.plugins.dnd.view.UserActionSet; 13 13 import org.nakedobjects.plugins.dnd.view.View; … … 27 27 public void menuOptions(final UserActionSet options) { 28 28 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) { 30 30 @Override 31 31 public void execute(final Workspace workspace, final View view, final Location at) { … … 36 36 37 37 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) { 39 39 @Override 40 40 public void execute(final Workspace workspace, final View view, final Location at) { … … 45 45 46 46 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) { 48 48 @Override 49 49 public void execute(final Workspace workspace, final View view, final Location at) { … … 54 54 55 55 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) { 57 57 @Override 58 58 public void execute(final Workspace workspace, final View view, final Location at) { … … 70 70 // }); 71 71 72 options.add(new UserActionAbstract("Diagnostics...", UserAction.DEBUG) {72 options.add(new UserActionAbstract("Diagnostics...", NakedObjectActionType.DEBUG) { 73 73 @Override 74 74 public void execute(final Workspace workspace, final View view, final Location at) { … … 94 94 95 95 96 options.add(new UserActionAbstract("Debug system...", UserAction.DEBUG) {96 options.add(new UserActionAbstract("Debug system...", NakedObjectActionType.DEBUG) { 97 97 @Override 98 98 public void execute(final Workspace workspace, final View view, final Location at) { … … 105 105 106 106 107 options.add(new UserActionAbstract("Debug session...", UserAction.DEBUG) {107 options.add(new UserActionAbstract("Debug session...", NakedObjectActionType.DEBUG) { 108 108 @Override 109 109 public void execute(final Workspace workspace, final View view, final Location at) { … … 115 115 }); 116 116 117 options.add(new UserActionAbstract("Debug viewer...", UserAction.DEBUG) {117 options.add(new UserActionAbstract("Debug viewer...", NakedObjectActionType.DEBUG) { 118 118 @Override 119 119 public void execute(final Workspace workspace, final View view, final Location at) { … … 124 124 }); 125 125 126 options.add(new UserActionAbstract("Debug overlay...", UserAction.DEBUG) {126 options.add(new UserActionAbstract("Debug overlay...", NakedObjectActionType.DEBUG) { 127 127 @Override 128 128 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 80 80 private String status; 81 81 private boolean runningAsExploration; 82 private boolean runningAsPrototype; 82 83 private InteractionSpy spy; 83 84 private int statusBarHeight; … … 293 294 } 294 295 296 public boolean isRunningAsPrototype() { 297 return runningAsPrototype; 298 } 299 295 300 public boolean isShowingMouseSpy() { 296 301 return spy.isVisible(); … … 503 508 } 504 509 final boolean showExplorationOptions = includeExploration || showExplorationMenuByDefault; 505 menu.show(forView, includeDebug, showExplorationOptions); 510 final boolean showPrototypeOptions = isRunningAsPrototype(); 511 menu.show(forView, includeDebug, showExplorationOptions, showPrototypeOptions); 506 512 feedbackManager.clearBusy(over); 507 513 } … … 560 566 } 561 567 568 public void setPrototype(final boolean asPrototype) { 569 this.runningAsPrototype = asPrototype; 570 } 571 562 572 public void setListener(final ShutdownListener listener) { 563 573 this.listener = listener; -
framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/bootstrap/DndViewer.java
r14557 r14699 278 278 viewer.setListener(shutdownListener); 279 279 viewer.setExploration(isInExplorationMode()); 280 viewer.setPrototype(isInPrototypeMode()); 280 281 281 282 if (helpViewer == null) { … … 327 328 private boolean isInExplorationMode() { 328 329 return getDeploymentType().isExploring(); 330 } 331 332 private boolean isInPrototypeMode() { 333 return getDeploymentType().isPrototyping(); 329 334 } 330 335 -
framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/tree/TreeDisplayRules.java
r14451 r14699 42 42 43 43 public NakedObjectActionType getType() { 44 return USER;44 return NakedObjectActionType.USER; 45 45 } 46 46 -
framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/Viewer.java
r14548 r14699 23 23 24 24 boolean isRunningAsExploration(); 25 boolean isRunningAsPrototype(); 25 26 26 27 void clearAction(); -
framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/action/OptionFactory.java
r14698 r14699 21 21 // actions for all the types 22 22 actions = specification.getServiceActionsFor(NakedObjectActionType.USER, NakedObjectActionType.EXPLORATION, 23 NakedObjectActionType. DEBUG);23 NakedObjectActionType.PROTOTYPE, NakedObjectActionType.DEBUG); 24 24 menuOptions(actions, null, options); 25 25 } … … 32 32 NakedObjectSpecification noSpec = adapter.getSpecification(); 33 33 menuOptions(noSpec.getObjectActions(NakedObjectActionType.USER, NakedObjectActionType.EXPLORATION, 34 NakedObjectActionType.DEBUG), adapter, options);34 NakedObjectActionType.PROTOTYPE, NakedObjectActionType.DEBUG), adapter, options); 35 35 36 36 // 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 12 12 import org.nakedobjects.metamodel.facets.collections.modify.CollectionFacet; 13 13 import org.nakedobjects.metamodel.spec.NakedObjectSpecification; 14 import org.nakedobjects.metamodel.spec.feature.NakedObjectActionType; 14 15 import org.nakedobjects.plugins.dnd.drawing.Bounds; 15 16 import org.nakedobjects.plugins.dnd.drawing.Canvas; … … 34 35 import org.nakedobjects.plugins.dnd.view.Toolkit; 35 36 import org.nakedobjects.plugins.dnd.view.UndoStack; 36 import org.nakedobjects.plugins.dnd.view.UserAction;37 37 import org.nakedobjects.plugins.dnd.view.UserActionSet; 38 38 import org.nakedobjects.plugins.dnd.view.View; … … 684 684 685 685 private void addViewDebugMenuItems(final UserActionSet options) { 686 options.add(new UserActionAbstract("Refresh view", UserAction.DEBUG) {686 options.add(new UserActionAbstract("Refresh view", NakedObjectActionType.DEBUG) { 687 687 public void execute(final Workspace workspace, final View view, final Location at) { 688 688 refresh(); … … 690 690 }); 691 691 692 options.add(new UserActionAbstract("Invalidate content", UserAction.DEBUG) {692 options.add(new UserActionAbstract("Invalidate content", NakedObjectActionType.DEBUG) { 693 693 public void execute(final Workspace workspace, final View view, final Location at) { 694 694 invalidateContent(); … … 696 696 }); 697 697 698 options.add(new UserActionAbstract("Invalidate layout", UserAction.DEBUG) {698 options.add(new UserActionAbstract("Invalidate layout", NakedObjectActionType.DEBUG) { 699 699 public void execute(final Workspace workspace, final View view, final Location at) { 700 700 invalidateLayout(); … … 705 705 private void addNewViewMenuItems(final UserActionSet options, final Content content) { 706 706 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) { 708 708 public void execute(final Workspace workspace, final View view, final Location at) { 709 709 Properties.setStringOption("view.object-default", getSpecification().getName()); … … 716 716 } 717 717 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) { 719 719 public void execute(final Workspace workspace, final View view, final Location at) { 720 720 Properties.setStringOption("view.collection-default", getSpecification().getName()); … … 727 727 } 728 728 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) { 730 730 public void execute(final Workspace workspace, final View view, final Location at) { 731 731 Properties.setStringOption("view.icon-default", getSpecification().getName()); … … 739 739 740 740 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) { 742 742 public void execute(final Workspace workspace, final View view, final Location at) { 743 743 Options viewOptions = Properties.getViewConfigurationOptions(getSpecification()); … … 766 766 }); 767 767 */ 768 options.add(new UserActionAbstract("Save specification", UserAction.USER) {768 options.add(new UserActionAbstract("Save specification", NakedObjectActionType.USER) { 769 769 public void execute(final Workspace workspace, final View view, final Location at) { 770 770 Options viewOptions = Properties.getViewConfigurationOptions(getSpecification()); … … 799 799 while (possibleViews.hasMoreElements()) { 800 800 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) { 802 802 public void execute(final Workspace workspace, final View view, final Location at) { 803 803 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 12 12 import org.nakedobjects.metamodel.facets.collections.modify.CollectionFacet; 13 13 import org.nakedobjects.metamodel.spec.NakedObjectSpecification; 14 import org.nakedobjects.metamodel.spec.feature.NakedObjectActionType; 14 15 import org.nakedobjects.metamodel.spec.feature.NakedObjectAssociation; 15 16 import org.nakedobjects.metamodel.util.CollectionFacetUtils; … … 17 18 import org.nakedobjects.plugins.dnd.drawing.ImageFactory; 18 19 import org.nakedobjects.plugins.dnd.drawing.Location; 19 import org.nakedobjects.plugins.dnd.view.UserAction;20 20 import org.nakedobjects.plugins.dnd.view.UserActionSet; 21 21 import org.nakedobjects.plugins.dnd.view.View; … … 101 101 * if (option != null) { options.add(option); } } 102 102 */ 103 options.add(new UserActionAbstract("Clear resolved", UserAction.DEBUG) {103 options.add(new UserActionAbstract("Clear resolved", NakedObjectActionType.DEBUG) { 104 104 @Override 105 105 public Consent disabled(final View component) { -
framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/content/AbstractObjectContent.java
r14698 r14699 87 87 workspace.objectActionResult(clone, new Placement(view)); 88 88 } 89 90 89 } 91 90 -
framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/debug/DebugDumpSnapshotOption.java
r14524 r14699 11 11 import org.nakedobjects.metamodel.consent.Consent; 12 12 import org.nakedobjects.metamodel.consent.Veto; 13 import org.nakedobjects.metamodel.spec.feature.NakedObjectActionType; 13 14 import org.nakedobjects.plugins.dnd.drawing.Location; 14 import org.nakedobjects.plugins.dnd.view.UserAction;15 15 import org.nakedobjects.plugins.dnd.view.View; 16 16 import org.nakedobjects.plugins.dnd.view.Workspace; … … 23 23 public class DebugDumpSnapshotOption extends UserActionAbstract { 24 24 public DebugDumpSnapshotOption() { 25 super("Dump log snapshot", UserAction.DEBUG);25 super("Dump log snapshot", NakedObjectActionType.DEBUG); 26 26 } 27 27 -
framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/debug/DebugOption.java
r14526 r14699 6 6 import org.nakedobjects.metamodel.adapter.NakedObject; 7 7 import org.nakedobjects.metamodel.commons.debug.DebugInfo; 8 import org.nakedobjects.metamodel.spec.feature.NakedObjectActionType; 8 9 import org.nakedobjects.plugins.dnd.drawing.Location; 9 10 import org.nakedobjects.plugins.dnd.service.PerspectiveContent; 10 11 import org.nakedobjects.plugins.dnd.view.Content; 11 12 import org.nakedobjects.plugins.dnd.view.Toolkit; 12 import org.nakedobjects.plugins.dnd.view.UserAction;13 13 import org.nakedobjects.plugins.dnd.view.View; 14 14 import org.nakedobjects.plugins.dnd.view.Workspace; … … 22 22 public class DebugOption extends UserActionAbstract { 23 23 public DebugOption() { 24 super("Debug...", UserAction.DEBUG);24 super("Debug...", NakedObjectActionType.DEBUG); 25 25 } 26 26 -
framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/debug/LoggingOptions.java
r14524 r14699 5 5 import org.nakedobjects.metamodel.consent.Consent; 6 6 import org.nakedobjects.metamodel.consent.ConsentAbstract; 7 import org.nakedobjects.metamodel.spec.feature.NakedObjectActionType; 7 8 import org.nakedobjects.plugins.dnd.drawing.Location; 8 9 import org.nakedobjects.plugins.dnd.view.MenuOptions; 9 import org.nakedobjects.plugins.dnd.view.UserAction;10 10 import org.nakedobjects.plugins.dnd.view.UserActionSet; 11 11 import org.nakedobjects.plugins.dnd.view.View; … … 27 27 28 28 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) { 30 30 @Override 31 31 public Consent disabled(final View component) { -
framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/menu/PopupMenu.java
r14501 r14699 537 537 } else { 538 538 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); 542 543 items = new Item[list.size()]; 543 544 list.copyInto(items); -
framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/menu/PopupMenuContainer.java
r14524 r14699 6 6 7 7 import org.nakedobjects.metamodel.commons.debug.DebugString; 8 import org.nakedobjects.metamodel.spec.feature.NakedObjectActionType; 8 9 import org.nakedobjects.plugins.dnd.drawing.Canvas; 9 10 import org.nakedobjects.plugins.dnd.drawing.Color; … … 153 154 154 155 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) { 156 157 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); 159 162 if (forView) { 160 163 target.viewMenuOptions(optionSet); -
framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/menu/UserActionSetImpl.java
r14451 r14699 21 21 22 22 public 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; 25 27 private final boolean includeDebug; 26 28 private final boolean includeExploration; 29 private final boolean includePrototype; 27 30 private final Vector options = new Vector(); 28 31 private final NakedObjectActionType type; 29 32 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)); 35 35 } 36 36 37 37 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()); 43 39 } 44 40 45 41 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) { 46 46 this.groupName = groupName; 47 this.includeExploration = parent.includeExploration;48 this.includeDebug = parent.includeDebug;49 47 this.type = type; 50 this.backgroundColor = parent.getColor(); 48 this.includeExploration = includeExploration; 49 this.includePrototype = includePrototype; 50 this.includeDebug = includeDebug; 51 this.backgroundColor = backgroundColor; 51 52 } 52 53 … … 68 69 public void add(final UserAction option) { 69 70 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)) { 71 75 options.addElement(option); 72 76 } -
framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/option/DisposeObjectOption.java
r14447 r14699 5 5 import org.nakedobjects.metamodel.consent.Consent; 6 6 import org.nakedobjects.metamodel.consent.Veto; 7 import org.nakedobjects.metamodel.spec.feature.NakedObjectActionType; 7 8 import org.nakedobjects.plugins.dnd.drawing.Location; 8 9 import org.nakedobjects.plugins.dnd.view.ObjectContent; … … 19 20 public class DisposeObjectOption extends UserActionAbstract { 20 21 public DisposeObjectOption() { 21 super("Dispose Object", EXPLORATION);22 super("Dispose Object", NakedObjectActionType.EXPLORATION); 22 23 } 23 24 -
framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/view/window/ResizeWindowControl.java
r14449 r14699 36 36 37 37 public NakedObjectActionType getType() { 38 return USER;38 return NakedObjectActionType.USER; 39 39 } 40 40 -
framework/trunk/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/viewer/basic/MinimizedView.java
r14502 r14699 59 59 60 60 public NakedObjectActionType getType() { 61 return USER;61 return NakedObjectActionType.USER; 62 62 } 63 63 }, target); … … 101 101 102 102 public NakedObjectActionType getType() { 103 return USER;103 return NakedObjectActionType.USER; 104 104 } 105 105 }, target); -
framework/trunk/plugins/dnd-viewer/src/test/java/org/nakedobjects/plugins/dnd/TestToolkit.java
r14557 r14699 100 100 } 101 101 102 public boolean isRunningAsPrototype() { 103 return false; 104 } 105 102 106 public void markDamaged(final Bounds bounds) {} 103 107 -
framework/trunk/plugins/html-viewer/src/main/java/org/nakedobjects/plugins/html/action/view/util/MenuUtil.java
r14698 r14699 20 20 final NakedObjectAction[] actions1 = specification.getObjectActions(NakedObjectActionType.USER); 21 21 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); 25 24 final Component[] menuItems = createMenu("Actions", target, actions, context, targetObjectId); 26 25 return menuItems; 27 26 } 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 } 28 36 29 37 private static Component[] createMenu( … … 49 57 // carry on, process this action 50 58 } else if (action.getType() == NakedObjectActionType.EXPLORATION) { 51 //boolean isExploring = SessionAccess.inExplorationMode();52 59 boolean isExploring = NakedObjectsContext.getDeploymentType().isExploring(); 53 60 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) { 54 69 // carry on, process this action 55 70 } else { -
framework/trunk/plugins/scimpi/dispatcher/src/main/java/org/nakedobjects/webapp/debug/DebugAction.java
r14698 r14699 125 125 specificationMembers(view, "User Actions", userActions); 126 126 specificationMembers(view, "Exploration Actions", spec.getObjectActions(NakedObjectActionType.EXPLORATION)); 127 specificationMembers(view, "Prototype Actions", spec.getObjectActions(NakedObjectActionType.PROTOTYPE)); 127 128 specificationMembers(view, "Debug Actions", spec.getObjectActions(NakedObjectActionType.DEBUG)); 128 129 -
framework/trunk/plugins/scimpi/dispatcher/src/main/java/org/nakedobjects/webapp/util/MethodsUtils.java
r14698 r14699 62 62 63 63 NakedObjectAction[] actions = object.getSpecification().getObjectActions(NakedObjectActionType.USER, 64 NakedObjectActionType.EXPLORATION, NakedObjectActionType. DEBUG);64 NakedObjectActionType.EXPLORATION, NakedObjectActionType.PROTOTYPE, NakedObjectActionType.DEBUG); 65 65 NakedObjectAction action = findAction(actions, methodName); 66 66 /* if (action == null) {
