Changeset 70:46a6e0e6ccd4
- Timestamp:
- 05/21/08 19:36:46 (7 months ago)
- Files:
-
- dwtx/core/commands/AbstractHandler.d (modified) (4 diffs)
- dwtx/core/commands/Command.d (modified) (5 diffs)
- dwtx/core/commands/CommandManager.d (modified) (6 diffs)
- dwtx/core/commands/IHandler.d (modified) (3 diffs)
- dwtx/core/commands/IHandler2.d (added)
- dwtx/core/commands/ParameterizedCommand.d (modified) (7 diffs)
- dwtx/core/commands/common/CommandException.d (modified) (2 diffs)
- dwtx/core/commands/common/IIdentifiable.d (modified) (3 diffs)
- dwtx/core/commands/common/NamedHandleObjectComparator.d (modified) (2 diffs)
- dwtx/core/commands/operations/AbstractOperation.d (modified) (3 diffs)
- dwtx/core/commands/operations/IUndoableOperation.d (modified) (2 diffs)
- dwtx/core/internal/runtime/LocalizationUtils.d (modified) (1 diff)
- dwtx/core/internal/runtime/PrintStackUtil.d (added)
- dwtx/core/internal/runtime/messages.properties (added)
- dwtx/core/runtime/Assert.d (modified) (2 diffs)
- dwtx/core/runtime/AssertionFailedException.d (modified) (2 diffs)
- dwtx/core/runtime/IAdapterManager.d (modified) (2 diffs)
- dwtx/core/runtime/ILogListener.d (modified) (2 diffs)
- dwtx/core/runtime/IPath.d (modified) (3 diffs)
- dwtx/core/runtime/IProgressMonitorWithBlocking.d (modified) (1 diff)
- dwtx/core/runtime/ISafeRunnable.d (modified) (4 diffs)
- dwtx/core/runtime/OperationCanceledException.d (modified) (2 diffs)
- dwtx/core/runtime/Path.d (modified) (6 diffs)
- dwtx/core/runtime/QualifiedName.d (modified) (2 diffs)
- dwtx/core/runtime/SubMonitor.d (modified) (3 diffs)
- dwtx/jface/action/Action.d (modified) (4 diffs)
- dwtx/jface/action/ActionContributionItem.d (modified) (17 diffs)
- dwtx/jface/action/ContributionItem.d (modified) (2 diffs)
- dwtx/jface/action/ContributionManager.d (modified) (4 diffs)
- dwtx/jface/action/CoolBarManager.d (modified) (1 diff)
- dwtx/jface/action/ExternalActionManager.d (modified) (15 diffs)
- dwtx/jface/action/ExternalActionManager.properties (added)
- dwtx/jface/action/IAction.d (modified) (1 diff)
- dwtx/jface/action/IContributionManager.d (modified) (2 diffs)
- dwtx/jface/action/IContributionManagerOverrides.d (modified) (1 diff)
- dwtx/jface/action/MenuManager.d (modified) (23 diffs)
- dwtx/jface/action/StatusLine.d (modified) (25 diffs)
- dwtx/jface/action/StatusLineContributionItem.d (added)
- dwtx/jface/action/SubMenuManager.d (modified) (3 diffs)
- dwtx/jface/action/ToolBarManager.d (modified) (4 diffs)
- dwtx/jface/action/images/stop.gif (added)
- dwtx/jface/bindings/Binding.d (modified) (2 diffs)
- dwtx/jface/bindings/BindingManager.d (modified) (5 diffs)
- dwtx/jface/bindings/keys/KeySequenceText.d (modified) (8 diffs)
- dwtx/jface/commands/RadioState.d (modified) (5 diffs)
- dwtx/jface/commands/ToggleState.d (modified) (4 diffs)
- dwtx/jface/dialogs/Dialog.d (modified) (5 diffs)
- dwtx/jface/dialogs/ErrorDialog.d (modified) (6 diffs)
- dwtx/jface/dialogs/IconAndMessageDialog.d (modified) (3 diffs)
- dwtx/jface/dialogs/InputDialog.d (modified) (3 diffs)
- dwtx/jface/dialogs/MessageDialogWithToggle.d (modified) (2 diffs)
- dwtx/jface/dialogs/PopupDialog.d (modified) (40 diffs)
- dwtx/jface/dialogs/ProgressIndicator.d (modified) (4 diffs)
- dwtx/jface/dialogs/ProgressMonitorDialog.d (modified) (7 diffs)
- dwtx/jface/dialogs/TrayDialog.d (modified) (1 diff)
- dwtx/jface/fieldassist/ComboContentAdapter.d (modified) (6 diffs)
- dwtx/jface/fieldassist/ContentProposalAdapter.d (modified) (20 diffs)
- dwtx/jface/fieldassist/ControlDecoration.d (modified) (9 diffs)
- dwtx/jface/fieldassist/DecoratedField.d (modified) (3 diffs)
- dwtx/jface/fieldassist/IControlContentAdapter2.d (added)
- dwtx/jface/fieldassist/SimpleContentProposalProvider.d (modified) (5 diffs)
- dwtx/jface/fieldassist/TextContentAdapter.d (modified) (4 diffs)
- dwtx/jface/internal/ConfigureColumnsDialog.d (added)
- dwtx/jface/layout/AbstractColumnLayout.d (modified) (8 diffs)
- dwtx/jface/operation/AccumulatingProgressMonitor.d (modified) (4 diffs)
- dwtx/jface/operation/ModalContext.d (modified) (24 diffs)
- dwtx/jface/preference/ComboFieldEditor.d (modified) (3 diffs)
- dwtx/jface/preference/FieldEditorPreferencePage.d (modified) (1 diff)
- dwtx/jface/preference/FileFieldEditor.d (modified) (4 diffs)
- dwtx/jface/preference/IntegerFieldEditor.d (modified) (3 diffs)
- dwtx/jface/preference/JFacePreferences.d (modified) (5 diffs)
- dwtx/jface/preference/PreferenceDialog.d (modified) (7 diffs)
- dwtx/jface/preference/PreferenceManager.d (modified) (4 diffs)
- dwtx/jface/preference/PreferencePage.d (modified) (12 diffs)
- dwtx/jface/preference/StringFieldEditor.d (modified) (2 diffs)
- dwtx/jface/resource/ColorRegistry.d (modified) (4 diffs)
- dwtx/jface/resource/FileImageDescriptor.d (modified) (10 diffs)
- dwtx/jface/resource/ImageRegistry.d (modified) (2 diffs)
- dwtx/jface/resource/JFaceResources.d (modified) (6 diffs)
- dwtx/jface/resource/StringConverter.d (modified) (2 diffs)
- dwtx/jface/resource/URLImageDescriptor.d (modified) (8 diffs)
- dwtx/jface/util/Geometry.d (modified) (2 diffs)
- dwtx/jface/util/Policy.d (modified) (7 diffs)
- dwtx/jface/util/SafeRunnable.d (modified) (6 diffs)
- dwtx/jface/util/SafeRunnableDialog.d (modified) (2 diffs)
- dwtx/jface/util/StatusHandler.d (added)
- dwtx/jface/util/Util.d (modified) (2 diffs)
- dwtx/jface/viewers/AbstractComboBoxCellEditor.d (added)
- dwtx/jface/viewers/AbstractListViewer.d (modified) (2 diffs)
- dwtx/jface/viewers/AbstractTableViewer.d (modified) (10 diffs)
- dwtx/jface/viewers/AbstractTreeViewer.d (modified) (30 diffs)
- dwtx/jface/viewers/CellEditor.d (modified) (60 diffs)
- dwtx/jface/viewers/CellLabelProvider.d (modified) (2 diffs)
- dwtx/jface/viewers/CheckboxCellEditor.d (modified) (3 diffs)
- dwtx/jface/viewers/CheckboxTreeViewer.d (modified) (2 diffs)
- dwtx/jface/viewers/ColumnViewer.d (modified) (47 diffs)
- dwtx/jface/viewers/ColumnViewerEditor.d (modified) (22 diffs)
- dwtx/jface/viewers/ColumnViewerEditorActivationEvent.d (modified) (1 diff)
- dwtx/jface/viewers/ColumnViewerEditorDeactivationEvent.d (modified) (3 diffs)
- dwtx/jface/viewers/ColumnViewerToolTipSupport.d (modified) (14 diffs)
- dwtx/jface/viewers/ComboBoxCellEditor.d (modified) (16 diffs)
- dwtx/jface/viewers/ComboBoxViewerCellEditor.d (added)
- dwtx/jface/viewers/ComboViewer.d (modified) (2 diffs)
- dwtx/jface/viewers/ContentViewer.d (modified) (3 diffs)
- dwtx/jface/viewers/DecoratingLabelProvider.d (modified) (1 diff)
- dwtx/jface/viewers/DecoratingStyledCellLabelProvider.d (added)
- dwtx/jface/viewers/DecorationContext.d (modified) (1 diff)
- dwtx/jface/viewers/DecorationOverlayIcon.d (modified) (3 diffs)
- dwtx/jface/viewers/DelegatingStyledCellLabelProvider.d (added)
- dwtx/jface/viewers/EditingSupport.d (modified) (1 diff)
- dwtx/jface/viewers/FocusCellHighlighter.d (modified) (3 diffs)
- dwtx/jface/viewers/FocusCellOwnerDrawHighlighter.d (modified) (10 diffs)
- dwtx/jface/viewers/IDecoration.d (modified) (2 diffs)
- dwtx/jface/viewers/IStructuredContentProvider.d (modified) (1 diff)
- dwtx/jface/viewers/IStructuredSelection.d (modified) (2 diffs)
- dwtx/jface/viewers/ITreeSelection.d (modified) (2 diffs)
- dwtx/jface/viewers/NamedHandleObjectLabelProvider.d (modified) (3 diffs)
- dwtx/jface/viewers/SWTFocusCellManager.d (modified) (6 diffs)
- dwtx/jface/viewers/StructuredSelection.d (modified) (5 diffs)
- dwtx/jface/viewers/StructuredViewer.d (modified) (10 diffs)
- dwtx/jface/viewers/StyledCellLabelProvider.d (added)
- dwtx/jface/viewers/StyledString.d (added)
- dwtx/jface/viewers/TableLayout.d (modified) (2 diffs)
- dwtx/jface/viewers/TableViewer.d (modified) (18 diffs)
- dwtx/jface/viewers/TableViewerEditor.d (modified) (4 diffs)
- dwtx/jface/viewers/TableViewerFocusCellManager.d (modified) (5 diffs)
- dwtx/jface/viewers/TableViewerRow.d (modified) (3 diffs)
- dwtx/jface/viewers/TextCellEditor.d (modified) (1 diff)
- dwtx/jface/viewers/TreeNode.d (modified) (10 diffs)
- dwtx/jface/viewers/TreeNodeContentProvider.d (modified) (9 diffs)
- dwtx/jface/viewers/TreeViewer.d (modified) (18 diffs)
- dwtx/jface/viewers/TreeViewerEditor.d (modified) (4 diffs)
- dwtx/jface/viewers/TreeViewerFocusCellManager.d (modified) (7 diffs)
- dwtx/jface/viewers/TreeViewerRow.d (modified) (29 diffs)
- dwtx/jface/viewers/ViewerCell.d (modified) (12 diffs)
- dwtx/jface/viewers/ViewerColumn.d (modified) (14 diffs)
- dwtx/jface/viewers/ViewerDropAdapter.d (modified) (3 diffs)
- dwtx/jface/viewers/ViewerRow.d (modified) (6 diffs)
- dwtx/jface/viewers/deferred/DeferredContentProvider.d (modified) (2 diffs)
- dwtx/jface/window/ToolTip.d (modified) (13 diffs)
- dwtx/jface/window/Window.d (modified) (2 diffs)
- dwtx/jface/wizard/ProgressMonitorPart.d (modified) (5 diffs)
- dwtx/jface/wizard/WizardDialog.d (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwtx/core/commands/AbstractHandler.d
r3 r70 1 1 /******************************************************************************* 2 * Copyright (c) 2004, 200 6IBM Corporation and others.2 * Copyright (c) 2004, 2008 IBM Corporation and others. 3 3 * All rights reserved. This program and the accompanying materials 4 4 * are made available under the terms of the Eclipse Public License v1.0 … … 14 14 15 15 import dwtx.core.commands.common.EventManager; 16 import dwtx.core.commands.IHandler ;16 import dwtx.core.commands.IHandler2; 17 17 import dwtx.core.commands.IHandlerListener; 18 18 import dwtx.core.commands.HandlerEvent; … … 33 33 * @since 3.1 34 34 */ 35 public abstract class AbstractHandler : EventManager, IHandler { 35 public abstract class AbstractHandler : EventManager, IHandler2 { 36 37 /** 38 * Track this base class enabled state. 39 * 40 * @since 3.4 41 */ 42 private bool baseEnabled = true; 36 43 37 44 /** … … 82 89 /** 83 90 * Whether this handler is capable of executing at this time. Subclasses may 84 * override this method. 91 * override this method. If clients override this method they should also 92 * consider overriding {@link #setEnabled(Object)} so they can be notified 93 * about framework execution contexts. 85 94 * 86 95 * @return <code>true</code> 96 * @see #setEnabled(Object) 97 * @see #setBaseEnabled(bool) 87 98 */ 88 99 public bool isEnabled() { 89 return true; 100 return baseEnabled; 101 } 102 103 /** 104 * Allow the default {@link #isEnabled()} to answer our enabled state. It 105 * will fire a HandlerEvent if necessary. If clients use this method they 106 * should also consider overriding {@link #setEnabled(Object)} so they can 107 * be notified about framework execution contexts. 108 * 109 * @param state 110 * the enabled state 111 * @since 3.4 112 */ 113 protected void setBaseEnabled(bool state) { 114 if (baseEnabled is state) { 115 return; 116 } 117 baseEnabled = state; 118 fireHandlerChanged(new HandlerEvent(this, true, false)); 119 } 120 121 /** 122 * Called by the framework to allow the handler to update its enabled state 123 * by extracting the same information available at execution time. Clients 124 * may override if they need to extract information from the application 125 * context. 126 * 127 * @param evaluationContext 128 * the application context. May be <code>null</code> 129 * @since 3.4 130 * @see #setBaseEnabled(bool) 131 */ 132 public void setEnabled(Object evaluationContext) { 90 133 } 91 134 dwtx/core/commands/Command.d
r43 r70 1 1 /******************************************************************************* 2 * Copyright (c) 2004, 200 7IBM Corporation and others.2 * Copyright (c) 2004, 2008 IBM Corporation and others. 3 3 * All rights reserved. This program and the accompanying materials 4 4 * are made available under the terms of the Eclipse Public License v1.0 … … 500 500 // Perform the execution, if there is a handler. 501 501 if ((handler !is null) && (handler.isHandled())) { 502 setEnabled(event.getApplicationContext()); 502 503 if (!isEnabled()) { 503 504 NotEnabledException exception = new NotEnabledException( … … 736 737 * Returns the help context identifier associated with this command. This 737 738 * method should not be called by clients. Clients should use 738 * {@link CommandManager#getHelpContextId( String)} instead.739 * {@link CommandManager#getHelpContextId(Command)} instead. 739 740 * 740 741 * @return The help context identifier for this command; may be … … 862 863 863 864 return handler.isEnabled(); 865 } 866 867 /** 868 * Called be the framework to allow the handler to update its enabled state. 869 * 870 * @param evaluationContext 871 * the state to evaluate against. May be <code>null</code> 872 * which indicates that the handler can query whatever model that 873 * is necessary. This context must not be cached. 874 * @since 3.4 875 */ 876 public void setEnabled(Object evaluationContext) { 877 if (handler instanceof IHandler2) { 878 ((IHandler2) handler).setEnabled(evaluationContext); 879 } 864 880 } 865 881 … … 1005 1021 1006 1022 /** 1007 * @return 1023 * @return the handler listener 1008 1024 */ 1009 1025 private IHandlerListener getHandlerListener() { dwtx/core/commands/CommandManager.d
r40 r70 1 1 /******************************************************************************* 2 * Copyright (c) 2004, 200 6IBM Corporation and others.2 * Copyright (c) 2004, 2007 IBM Corporation and others. 3 3 * All rights reserved. This program and the accompanying materials 4 4 * are made available under the terms of the Eclipse Public License v1.0 … … 207 207 /** 208 208 * Unescapes special characters in the command id, parameter ids and 209 * parameter values for {@link #deserialize( )}. The special characters209 * parameter values for {@link #deserialize(String)}. The special characters 210 210 * {@link #PARAMETER_START_CHAR}, {@link #PARAMETER_END_CHAR}, 211 211 * {@link #ID_VALUE_CHAR}, {@link #PARAMETER_SEPARATOR_CHAR} and 212 212 * {@link #ESCAPE_CHAR} are escaped by prepending an {@link #ESCAPE_CHAR} 213 213 * character. 214 * <p> 215 * See also ParameterizedCommand.escape(String) 216 * </p> 214 217 * 215 218 * @param escapedText … … 221 224 * if <code>escapedText</code> contains an invalid escape 222 225 * sequence 223 * @see ParameterizedCommand#escape(String)224 226 * @since 3.2 225 227 */ … … 297 299 * manager. 298 300 */ 299 private IExecutionListener executionListener = null;301 private IExecutionListenerWithChecks executionListener = null; 300 302 301 303 /** … … 730 732 * <code>null</code>. 731 733 * @return an array of parameterizations; may be <code>null</code>. 732 * @throws NotDefinedException733 * if the command is not defined734 734 * @throws SerializationException 735 735 * if there is an error deserializing the parameters … … 988 988 989 989 } 990 /** 991 * Fires the <code>notEnabled</code> event for 992 * <code>executionListeners</code>. 993 * <p> 994 * <b>Note:</b> This supports bridging actions to the command framework, 995 * and should not be used outside the framework. 996 * </p> 997 * 998 * @param commandId 999 * The command id of the command about to execute, never 1000 * <code>null</code>. 1001 * @param exception 1002 * The exception, never <code>null</code>. 1003 * @since 3.4 1004 */ 1005 public void fireNotEnabled(String commandId, NotEnabledException exception) { 1006 if (executionListener !is null) { 1007 executionListener.notEnabled(commandId, exception); 1008 } 1009 } 1010 1011 /** 1012 * Fires the <code>notDefined</code> event for 1013 * <code>executionListeners</code>. 1014 * <p> 1015 * <b>Note:</b> This supports bridging actions to the command framework, 1016 * and should not be used outside the framework. 1017 * </p> 1018 * 1019 * @param commandId 1020 * The command id of the command about to execute, never 1021 * <code>null</code>. 1022 * @param exception 1023 * The exception, never <code>null</code>. 1024 * @since 3.4 1025 */ 1026 public void fireNotDefined(String commandId, NotDefinedException exception) { 1027 if (executionListener !is null) { 1028 executionListener.notDefined(commandId, exception); 1029 } 1030 } 1031 1032 /** 1033 * Fires the <code>preExecute</code> event for 1034 * <code>executionListeners</code>. 1035 * <p> 1036 * <b>Note:</b> This supports bridging actions to the command framework, 1037 * and should not be used outside the framework. 1038 * </p> 1039 * 1040 * @param commandId 1041 * The command id of the command about to execute, never 1042 * <code>null</code>. 1043 * @param event 1044 * The event that triggered the command, may be <code>null</code>. 1045 * @since 3.4 1046 */ 1047 public void firePreExecute(String commandId, ExecutionEvent event) { 1048 if (executionListener !is null) { 1049 executionListener.preExecute(commandId, event); 1050 } 1051 } 1052 1053 /** 1054 * Fires the <code>postExecuteSuccess</code> event for 1055 * <code>executionListeners</code>. 1056 * <p> 1057 * <b>Note:</b> This supports bridging actions to the command framework, 1058 * and should not be used outside the framework. 1059 * </p> 1060 * 1061 * @param commandId 1062 * The command id of the command executed, never 1063 * <code>null</code>. 1064 * @param returnValue 1065 * The value returned from the command, may be <code>null</code>. 1066 * @since 3.4 1067 */ 1068 public void firePostExecuteSuccess(String commandId, Object returnValue) { 1069 if (executionListener !is null) { 1070 executionListener.postExecuteSuccess(commandId, returnValue); 1071 } 1072 } 1073 1074 /** 1075 * Fires the <code>postExecuteFailure</code> event for 1076 * <code>executionListeners</code>. 1077 * <p> 1078 * <b>Note:</b> This supports bridging actions to the command framework, 1079 * and should not be used outside the framework. 1080 * </p> 1081 * 1082 * @param commandId 1083 * The command id of the command executed, never 1084 * <code>null</code>. 1085 * @param exception 1086 * The exception, never <code>null</code>. 1087 * @since 3.4 1088 */ 1089 public void firePostExecuteFailure(String commandId, 1090 ExecutionException exception) { 1091 if (executionListener !is null) { 1092 executionListener.postExecuteFailure(commandId, exception); 1093 } 1094 } 990 1095 } dwtx/core/commands/IHandler.d
r3 r70 1 1 /******************************************************************************* 2 * Copyright (c) 2004, 200 5IBM Corporation and others.2 * Copyright (c) 2004, 2008 IBM Corporation and others. 3 3 * All rights reserved. This program and the accompanying materials 4 4 * are made available under the terms of the Eclipse Public License v1.0 … … 15 15 import dwtx.core.commands.IHandlerListener; 16 16 import dwtx.core.commands.ExecutionEvent; 17 18 17 19 18 /** … … 62 61 /** 63 62 * Returns whether this handler is capable of executing at this moment in 64 * time. 63 * time. If the enabled state is other than true clients should also 64 * consider implementing IHandler2 so they can be notified about framework 65 * execution contexts. 65 66 * 66 67 * @return <code>true</code> if the command is enabled; <code>false</code> 67 68 * otherwise. 69 * @see IHandler2#setEnabled(Object) 68 70 */ 69 71 public bool isEnabled(); dwtx/core/commands/ParameterizedCommand.d
r43 r70 1 1 /******************************************************************************* 2 * Copyright (c) 2005, 200 7IBM Corporation and others.2 * Copyright (c) 2005, 2008 IBM Corporation and others. 3 3 * All rights reserved. This program and the accompanying materials 4 4 * are made available under the terms of the Eclipse Public License v1.0 … … 8 8 * Contributors: 9 9 * IBM Corporation - initial API and implementation 10 * Benjamin Muskalla - bug 222861 [Commands] ParameterizedCommand#equals broken 10 11 * Port to the D programming language: 11 12 * Frank Benoit <benoit@tionex.de> … … 122 123 * @return a <code>String</code> representing <code>rawText</code> with 123 124 * special serialization characters escaped 124 * @see CommandManager#unescape(String)125 125 * @since 3.2 126 126 */ … … 319 319 320 320 /** 321 * Take a command and a map of parameter IDs to values, and generate the 322 * appropriate parameterized command. 323 * 324 * @param command 325 * The command object. Must not be <code>null</code>. 326 * @param parameters 327 * A map of String parameter ids to objects. May be 328 * <code>null</code>. 329 * @return the parameterized command, or <code>null</code> if it could not 330 * be generated 331 * @since 3.4 332 */ 333 public static final ParameterizedCommand generateCommand(Command command, 334 Map parameters) { 335 // no parameters 336 if (parameters is null || parameters.isEmpty()) { 337 return new ParameterizedCommand(command, null); 338 } 339 340 try { 341 ArrayList parms = new ArrayList(); 342 Iterator i = parameters.keySet().iterator(); 343 344 // iterate over given parameters 345 while (i.hasNext()) { 346 String key = (String) i.next(); 347 IParameter parameter = null; 348 // get the parameter from the command 349 parameter = command.getParameter(key); 350 351 // if the parameter is defined add it to the parameter list 352 if (parameter is null) { 353 return null; 354 } 355 ParameterType parameterType = command.getParameterType(key); 356 if (parameterType is null) { 357 parms.add(new Parameterization(parameter, 358 (String) parameters.get(key))); 359 } else { 360 AbstractParameterValueConverter valueConverter = parameterType 361 .getValueConverter(); 362 if (valueConverter !is null) { 363 String val = valueConverter.convertToString(parameters 364 .get(key)); 365 parms.add(new Parameterization(parameter, val)); 366 } else { 367 parms.add(new Parameterization(parameter, 368 (String) parameters.get(key))); 369 } 370 } 371 } 372 373 // convert the parameters to an Parameterization array and create 374 // the command 375 return new ParameterizedCommand(command, (Parameterization[]) parms 376 .toArray(new Parameterization[parms.size()])); 377 } catch (NotDefinedException e) { 378 } catch (ParameterValueConversionException e) { 379 } 380 return null; 381 } 382 383 /** 321 384 * The base command which is being parameterized. This value is never 322 385 * <code>null</code>. … … 347 410 * @param parameterizations 348 411 * An array of parameterizations binding parameters to values for 349 * the command. This value may be <code>null</code>. This 350 * argument is not copied; if you need to make changes to it 351 * after constructing this parameterized command, then make a 352 * copy yourself. 412 * the command. This value may be <code>null</code>. 353 413 */ 354 414 public this(Command command, … … 360 420 361 421 this.command = command; 362 this.parameterizations = (parameterizations is null || parameterizations.length is 0) ? null 363 : parameterizations; 422 IParameter[] parms = null; 423 try { 424 parms = command.getParameters(); 425 } catch (NotDefinedException e) { 426 // This should not happen. 427 } 428 if (parameterizations !is null && parameterizations.length>0 && parms !is null) { 429 int parmIndex = 0; 430 Parameterization[] params = new Parameterization[parameterizations.length]; 431 for (int j = 0; j < parms.length; j++) { 432 for (int i = 0; i < parameterizations.length; i++) { 433 Parameterization pm = parameterizations[i]; 434 if (parms[j].equals(pm.getParameter())) { 435 params[parmIndex++] = pm; 436 } 437 } 438 } 439 this.parameterizations = params; 440 } else { 441 this.parameterizations = null; 442 } 364 443 } 365 444 … … 549 628 } 550 629 551 /* (non-Javadoc) 630 /* 631 * (non-Javadoc) 632 * 552 633 * @see java.lang.Object#hashCode() 553 634 */ dwtx/core/commands/common/CommandException.d
r43 r70 1 1 /******************************************************************************* 2 * Copyright (c) 2004, 200 5IBM Corporation and others.2 * Copyright (c) 2004, 2007 IBM Corporation and others. 3 3 * All rights reserved. This program and the accompanying materials 4 4 * are made available under the terms of the Eclipse Public License v1.0 … … 22 22 * 23 23 * @since 3.1 24 * @noextend This class is not intended to be subclassed by clients. 24 25 */ 25 26 public abstract class CommandException : Exception { 26 27 28 /** 29 * Generated serial version UID for this class. 30 * 31 * @since 3.4 32 */ 33 private static final long serialVersionUID = 5389763628699257234L; 34 27 35 /** 28 36 * This member variable is required here to allow us to compile against JCL dwtx/core/commands/common/IIdentifiable.d
r3 r70 1 1 /******************************************************************************* 2 * Copyright (c) 2006 IBM Corporation and others.2 * Copyright (c) 2006, 2007 IBM Corporation and others. 3 3 * All rights reserved. This program and the accompanying materials 4 4 * are made available under the terms of the Eclipse Public License v1.0 … … 10 10 * Port to the D programming language: 11 11 * Frank Benoit <benoit@tionex.de> 12 ******************************************************************************/ 13 12 *******************************************************************************/ 14 13 module dwtx.core.commands.common.IIdentifiable; 15 14 import dwt.dwthelper.utils; … … 30 29 * @return The identifier; never <code>null</code>. 31 30 */ 32 String getId();31 String getId(); 33 32 } dwtx/core/commands/common/NamedHandleObjectComparator.d
r3 r70 1 1 /******************************************************************************* 2 * Copyright (c) 2005 IBM Corporation and others.2 * Copyright (c) 2005, 2007 IBM Corporation and others. 3 3 * All rights reserved. This program and the accompanying materials 4 4 * are made available under the terms of the Eclipse Public License v1.0 … … 10 10 * Port to the D programming language: 11 11 * Frank Benoit <benoit@tionex.de> 12 ******************************************************************************/ 13 12 *******************************************************************************/ 14 13 module dwtx.core.commands.common.NamedHandleObjectComparator; 15 14 16 // import java.util.Comparator;17 15 import dwtx.core.commands.common.NotDefinedException; 18 16 import dwtx.core.commands.common.NamedHandleObject; 19 17 import dwtx.core.internal.commands.util.Util; 20 18 import dwt.dwthelper.utils; 21 22 19 /** 23 20 * Comparator for instances of <code>NamedHandleObject</code> for display to dwtx/core/commands/operations/AbstractOperation.d
r43 r70 1 1 /******************************************************************************* 2 * Copyright (c) 2005, 200 6IBM Corporation and others.2 * Copyright (c) 2005, 2008 IBM Corporation and others. 3 3 * All rights reserved. This program and the accompanying materials 4 4 * are made available under the terms of the Eclipse Public License v1.0 … … 52 52 * 53 53 * @param label 54 * the label to be used for the operation. 54 * the label to be used for the operation. Should never be 55 * <code>null</code>. 55 56 */ 56 57 public this(String label) { 58 Assert.isNotNull(label); 57 59 this.label = label; 58 60 contexts = new ArraySeq!(IUndoContext); … … 144 146 * 145 147 * @param name 146 * the string to be used for the label. 148 * the string to be used for the label. Should never be 149 * <code>null</code>. 147 150 */ 148 151 public void setLabel(String name) { dwtx/core/commands/operations/IUndoableOperation.d
r3 r70 1 1 /******************************************************************************* 2 * Copyright (c) 2005 IBM Corporation and others.2 * Copyright (c) 2005, 2008 IBM Corporation and others. 3 3 * All rights reserved. This program and the accompanying materials 4 4 * are made available under the terms of the Eclipse Public License v1.0 … … 159 159  
