annotate dwtx/core/commands/ParameterizedCommand.d @ 70:46a6e0e6ccd4

Merge with d-fied sources of 3.4M7
author Frank Benoit <benoit@tionex.de>
date Thu, 22 May 2008 01:36:46 +0200
parents ea8ff534f622
children 4878bef4a38e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1 /*******************************************************************************
70
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
2 * Copyright (c) 2005, 2008 IBM Corporation and others.
3
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3 * All rights reserved. This program and the accompanying materials
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4 * are made available under the terms of the Eclipse Public License v1.0
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
5 * which accompanies this distribution, and is available at
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
6 * http://www.eclipse.org/legal/epl-v10.html
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
7 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
8 * Contributors:
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
9 * IBM Corporation - initial API and implementation
70
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
10 * Benjamin Muskalla - bug 222861 [Commands] ParameterizedCommand#equals broken
3
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
11 * Port to the D programming language:
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
12 * Frank Benoit <benoit@tionex.de>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
13 *******************************************************************************/
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
14
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
15 module dwtx.core.commands.ParameterizedCommand;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
16
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
17 // import java.util.ArrayList;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
18 // import java.util.Collection;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
19 // import java.util.Collections;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
20 // import java.util.HashMap;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
21 // import java.util.Iterator;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
22 // import java.util.List;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
23 // import java.util.Map;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
24
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
25 import tango.util.collection.model.Seq;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
26 import tango.util.collection.model.Map;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
27 import tango.util.collection.model.Set;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
28 import tango.util.collection.ArraySeq;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
29 import tango.util.collection.HashSet;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
30 import tango.util.collection.HashMap;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
31
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
32 import dwtx.core.commands.Command;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
33 import dwtx.core.commands.CommandManager;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
34 import dwtx.core.commands.IParameter;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
35 import dwtx.core.commands.IParameterValues;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
36 import dwtx.core.commands.Parameterization;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
37 import dwtx.core.commands.ParameterValuesException;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
38 import dwtx.core.commands.ExecutionEvent;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
39 import dwtx.core.commands.common.NotDefinedException;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
40 import dwtx.core.internal.commands.util.Util;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
41
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
42 import dwt.dwthelper.utils;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
43 import tango.text.convert.Format;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
44
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
45 static import tango.text.Text;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
46 alias tango.text.Text.Text!(char) StringBuffer;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
47
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
48 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
49 * <p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
50 * A command that has had one or more of its parameters specified. This class
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
51 * serves as a utility class for developers that need to manipulate commands
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
52 * with parameters. It handles the behaviour of generating a parameter map and a
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
53 * human-readable name.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
54 * </p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
55 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
56 * @since 3.1
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
57 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
58 public final class ParameterizedCommand : Comparable {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
59 private static const Map!(String,String) EMPTY_MAP;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
60 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
61 * The constant integer hash code value meaning the hash code has not yet
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
62 * been computed.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
63 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
64 private static const int HASH_CODE_NOT_COMPUTED = -1;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
65
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
66 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
67 * A factor for computing the hash code for all parameterized commands.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
68 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
69 private static const int HASH_FACTOR = 89;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
70
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
71 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
72 * The seed for the hash code for all parameterized commands.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
73 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
74 private static const int HASH_INITIAL;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
75
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
76 static this(){
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
77 HASH_INITIAL = dwt.dwthelper.utils.toHash(ParameterizedCommand.classinfo.name );
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
78 EMPTY_MAP = new HashMap!(String,String);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
79 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
80 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
81 * The index of the parameter id in the parameter values.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
82 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
83 * @deprecated no longer used
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
84 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
85 public static const int INDEX_PARAMETER_ID = 0;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
86
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
87 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
88 * The index of the human-readable name of the parameter itself, in the
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
89 * parameter values.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
90 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
91 * @deprecated no longer used
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
92 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
93 public static const int INDEX_PARAMETER_NAME = 1;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
94
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
95 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
96 * The index of the human-readable name of the value of the parameter for
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
97 * this command.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
98 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
99 * @deprecated no longer used
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
100 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
101 public static const int INDEX_PARAMETER_VALUE_NAME = 2;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
102
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
103 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
104 * The index of the value of the parameter that the command can understand.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
105 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
106 * @deprecated no longer used
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
107 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
108 public static const int INDEX_PARAMETER_VALUE_VALUE = 3;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
109
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
110 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
111 * Escapes special characters in the command id, parameter ids and parameter
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
112 * values for {@link #serialize()}. The special characters
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
113 * {@link CommandManager#PARAMETER_START_CHAR},
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
114 * {@link CommandManager#PARAMETER_END_CHAR},
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
115 * {@link CommandManager#ID_VALUE_CHAR},
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
116 * {@link CommandManager#PARAMETER_SEPARATOR_CHAR} and
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
117 * {@link CommandManager#ESCAPE_CHAR} are escaped by prepending a
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
118 * {@link CommandManager#ESCAPE_CHAR} character.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
119 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
120 * @param rawText
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
121 * a <code>String</code> to escape special characters in for
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
122 * serialization.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
123 * @return a <code>String</code> representing <code>rawText</code> with
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
124 * special serialization characters escaped
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
125 * @since 3.2
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
126 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
127 private static final String escape(String rawText) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
128
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
129 // defer initialization of a StringBuffer until we know we need one
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
130 StringBuffer buffer;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
131
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
132 for (int i = 0; i < rawText.length; i++) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
133
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
134 char c = rawText.charAt(i);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
135 switch (c) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
136 case CommandManager.PARAMETER_START_CHAR:
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
137 case CommandManager.PARAMETER_END_CHAR:
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
138 case CommandManager.ID_VALUE_CHAR:
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
139 case CommandManager.PARAMETER_SEPARATOR_CHAR:
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
140 case CommandManager.ESCAPE_CHAR:
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
141 if (buffer is null) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
142 buffer = new StringBuffer(rawText.substring(0, i));
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
143 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
144 buffer.append(CommandManager.ESCAPE_CHAR);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
145 buffer.append(c);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
146 break;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
147 default:
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
148 if (buffer !is null) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
149 buffer.append(c);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
150 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
151 break;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
152 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
153
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
154 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
155
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
156 if (buffer is null) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
157 return rawText;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
158 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
159 return buffer.toString();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
160 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
161
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
162 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
163 * Generates every possible combination of parameter values for the given
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
164 * parameters. Parameters values that cannot be initialized are just
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
165 * ignored. Optional parameters are considered.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
166 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
167 * @param startIndex
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
168 * The index in the <code>parameters</code> that we should
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
169 * process. This must be a valid index.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
170 * @param parameters
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
171 * The parameters in to process; must not be <code>null</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
172 * @return A collection (<code>Collection</code>) of combinations (<code>List</code>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
173 * of <code>Parameterization</code>).
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
174 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
175 private static final Seq!(Object) expandParameters(int startIndex,
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
176 IParameter[] parameters) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
177 int nextIndex = startIndex + 1;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
178 bool noMoreParameters = (nextIndex >= parameters.length);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
179
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
180 IParameter parameter = parameters[startIndex];
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
181 auto parameterizations = new ArraySeq!(Object);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
182 if (parameter.isOptional()) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
183 parameterizations.append( cast(Object) null);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
184 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
185
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
186 IParameterValues values = null;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
187 try {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
188 values = parameter.getValues();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
189 } catch (ParameterValuesException e) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
190 if (noMoreParameters) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
191 return parameterizations;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
192 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
193
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
194 // Make recursive call
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
195 return expandParameters(nextIndex, parameters);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
196 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
197
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
198 // Iterator parameterValueItr = parameterValues.entrySet()
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
199 // .iterator();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
200 auto parameterValues = values.getParameterValues();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
201 auto set = new HashSet!(String);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
202 foreach( k,v; parameterValues ){
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
203 set.add( v );
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
204 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
205
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
206
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
207 //while (parameterValueItr.hasNext()) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
208 foreach( v; set ){
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
209 //Map.Entry entry = (Map.Entry) parameterValueItr.next();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
210 Parameterization parameterization = new Parameterization(
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
211 parameter, v);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
212 parameterizations.append(parameterization);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
213 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
214
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
215 // Check if another iteration will produce any more names.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
216 int parameterizationCount = parameterizations.size();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
217 if (noMoreParameters) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
218 // This is it, so just return the current parameterizations.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
219 for (int i = 0; i < parameterizationCount; i++) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
220 Parameterization parameterization = cast(Parameterization) parameterizations
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
221 .get(i);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
222 auto combination = new ArraySeq!(Object);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
223 combination.append(parameterization);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
224 parameterizations.replaceAt(i, combination);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
225 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
226 return parameterizations;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
227 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
228
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
229 // Make recursive call
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
230 auto suffixes = expandParameters(nextIndex, parameters);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
231 suffixes.removeAll(cast(Object)null);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
232 if (suffixes.drained()) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
233 // This is it, so just return the current parameterizations.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
234 for (int i = 0; i < parameterizationCount; i++) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
235 Parameterization parameterization = cast(Parameterization) parameterizations
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
236 .get(i);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
237 auto combination = new ArraySeq!(Object);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
238 combination.append(parameterization);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
239 parameterizations.replaceAt(i, combination);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
240 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
241 return parameterizations;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
242 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
243 auto returnValue = new ArraySeq!(Object);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
244 // Iterator suffixItr = suffixes.iterator();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
245 // while (suffixItr.hasNext()) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
246 foreach( v; suffixes ){
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
247 // final List combination = (List) suffixItr.next();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
248 auto combination = cast(Seq!(Object)) v;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
249 int combinationSize = combination.size();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
250 for (int i = 0; i < parameterizationCount; i++) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
251 Parameterization parameterization = cast(Parameterization) parameterizations
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
252 .get(i);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
253 auto newCombination = new ArraySeq!(Object);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
254 newCombination.capacity(combinationSize + 1);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
255 newCombination.append(parameterization);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
256 foreach( c; combination ){
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
257 newCombination.append(c);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
258 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
259 returnValue.append(newCombination);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
260 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
261 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
262
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
263 return returnValue;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
264 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
265
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
266 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
267 * <p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
268 * Generates all the possible combinations of command parameterizations for
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
269 * the given command. If the command has no parameters, then this is simply
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
270 * a parameterized version of that command. If a parameter is optional, both
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
271 * the included and not included cases are considered.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
272 * </p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
273 * <p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
274 * If one of the parameters cannot be loaded due to a
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
275 * <code>ParameterValuesException</code>, then it is simply ignored.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
276 * </p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
277 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
278 * @param command
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
279 * The command for which the parameter combinations should be
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
280 * generated; must not be <code>null</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
281 * @return A collection of <code>ParameterizedCommand</code> instances
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
282 * representing all of the possible combinations. This value is
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
283 * never empty and it is never <code>null</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
284 * @throws NotDefinedException
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
285 * If the command is not defined.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
286 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
287 public static final Seq!(Object) generateCombinations(Command command) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
288 IParameter[] parameters = command.getParameters();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
289 if (parameters is null) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
290 auto res = new ArraySeq!(Object);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
291 res.append( new ParameterizedCommand(command, null) );
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
292 return res;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
293 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
294
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
295 auto expansion = expandParameters(0, parameters);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
296 auto combinations = new ArraySeq!(Object);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
297 combinations.capacity(expansion.size());
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
298 foreach( v; expansion ){
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
299 // Iterator expansionItr = expansion.iterator();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
300 // while (expansionItr.hasNext()) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
301 auto combination = cast(Seq!(Object)) v;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
302 if (combination is null) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
303 combinations.append(new ParameterizedCommand(command, null));
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
304 } else {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
305 combination.removeAll(cast(Object)null);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
306 if (combination.drained()) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
307 combinations.append(new ParameterizedCommand(command, null));
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
308 } else {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
309 Parameterization[] parameterizations = cast(Parameterization[]) combination
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
310 .toArray();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
311 combinations.append(new ParameterizedCommand(command,
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
312 parameterizations));
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
313 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
314 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
315 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
316
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
317 return combinations;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
318 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
319
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
320 /**
70
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
321 * Take a command and a map of parameter IDs to values, and generate the
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
322 * appropriate parameterized command.
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
323 *
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
324 * @param command
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
325 * The command object. Must not be <code>null</code>.
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
326 * @param parameters
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
327 * A map of String parameter ids to objects. May be
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
328 * <code>null</code>.
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
329 * @return the parameterized command, or <code>null</code> if it could not
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
330 * be generated
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
331 * @since 3.4
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
332 */
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
333 public static final ParameterizedCommand generateCommand(Command command,
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
334 Map parameters) {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
335 // no parameters
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
336 if (parameters is null || parameters.isEmpty()) {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
337 return new ParameterizedCommand(command, null);
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
338 }
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
339
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
340 try {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
341 ArrayList parms = new ArrayList();
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
342 Iterator i = parameters.keySet().iterator();
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
343
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
344 // iterate over given parameters
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
345 while (i.hasNext()) {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
346 String key = (String) i.next();
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
347 IParameter parameter = null;
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
348 // get the parameter from the command
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
349 parameter = command.getParameter(key);
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
350
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
351 // if the parameter is defined add it to the parameter list
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
352 if (parameter is null) {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
353 return null;
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
354 }
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
355 ParameterType parameterType = command.getParameterType(key);
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
356 if (parameterType is null) {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
357 parms.add(new Parameterization(parameter,
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
358 (String) parameters.get(key)));
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
359 } else {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
360 AbstractParameterValueConverter valueConverter = parameterType
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
361 .getValueConverter();
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
362 if (valueConverter !is null) {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
363 String val = valueConverter.convertToString(parameters
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
364 .get(key));
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
365 parms.add(new Parameterization(parameter, val));
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
366 } else {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
367 parms.add(new Parameterization(parameter,
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
368 (String) parameters.get(key)));
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
369 }
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
370 }
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
371 }
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
372
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
373 // convert the parameters to an Parameterization array and create
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
374 // the command
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
375 return new ParameterizedCommand(command, (Parameterization[]) parms
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
376 .toArray(new Parameterization[parms.size()]));
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
377 } catch (NotDefinedException e) {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
378 } catch (ParameterValueConversionException e) {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
379 }
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
380 return null;
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
381 }
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
382
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
383 /**
3
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
384 * The base command which is being parameterized. This value is never
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
385 * <code>null</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
386 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
387 private const Command command;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
388
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
389 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
390 * The hash code for this object. This value is computed lazily, and marked
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
391 * as invalid when one of the values on which it is based changes.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
392 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
393 private /+transient+/ int hashCode = HASH_CODE_NOT_COMPUTED;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
394
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
395 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
396 * This is an array of parameterization defined for this command. This value
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
397 * may be <code>null</code> if the command has no parameters.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
398 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
399 private const Parameterization[] parameterizations;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
400
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
401 private String name;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
402
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
403 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
404 * Constructs a new instance of <code>ParameterizedCommand</code> with
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
405 * specific values for zero or more of its parameters.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
406 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
407 * @param command
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
408 * The command that is parameterized; must not be
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
409 * <code>null</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
410 * @param parameterizations
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
411 * An array of parameterizations binding parameters to values for
70
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
412 * the command. This value may be <code>null</code>.
3
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
413 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
414 public this(Command command,
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
415 Parameterization[] parameterizations) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
416 if (command is null) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
417 throw new NullPointerException(
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
418 "A parameterized command cannot have a null command"); //$NON-NLS-1$
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
419 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
420
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
421 this.command = command;
70
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
422 IParameter[] parms = null;
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
423 try {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
424 parms = command.getParameters();
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
425 } catch (NotDefinedException e) {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
426 // This should not happen.
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
427 }
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
428 if (parameterizations !is null && parameterizations.length>0 && parms !is null) {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
429 int parmIndex = 0;
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
430 Parameterization[] params = new Parameterization[parameterizations.length];
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
431 for (int j = 0; j < parms.length; j++) {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
432 for (int i = 0; i < parameterizations.length; i++) {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
433 Parameterization pm = parameterizations[i];
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
434 if (parms[j].equals(pm.getParameter())) {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
435 params[parmIndex++] = pm;
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
436 }
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
437 }
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
438 }
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
439 this.parameterizations = params;
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
440 } else {
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
441 this.parameterizations = null;
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
442 }
3
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
443 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
444
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
445 /*
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
446 * (non-Javadoc)
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
447 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
448 * @see java.lang.Comparable#compareTo(java.lang.Object)
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
449 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
450 public final int compareTo(Object object) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
451 ParameterizedCommand command = cast(ParameterizedCommand) object;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
452 bool thisDefined = this.command.isDefined();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
453 bool otherDefined = command.command.isDefined();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
454 if (!thisDefined || !otherDefined) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
455 return Util.compare(thisDefined, otherDefined);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
456 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
457
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
458 try {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
459 int compareTo = getName() < command.getName();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
460 if (compareTo is 0) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
461 return getId() < command.getId();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
462 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
463 return compareTo;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
464 } catch (NotDefinedException e) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
465 throw new Exception (
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
466 "Concurrent modification of a command's defined state"); //$NON-NLS-1$
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
467 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
468 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
469
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
470 /*
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
471 * (non-Javadoc)
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
472 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
473 * @see java.lang.Object#equals(java.lang.Object)
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
474 */
43
ea8ff534f622 Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents: 3
diff changeset
475 public override final int opEquals(Object object) {
3
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
476 if (this is object) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
477 return true;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
478 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
479
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
480 if (!(cast(ParameterizedCommand)object)) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
481 return false;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
482 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
483
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
484 ParameterizedCommand command = cast(ParameterizedCommand) object;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
485 if (!Util.equals(this.command, command.command)) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
486 return false;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
487 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
488
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
489 return Util.equals(this.parameterizations, command.parameterizations);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
490 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
491
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
492 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
493 * Executes this command with its parameters. This method will succeed
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
494 * regardless of whether the command is enabled or defined. It is
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
495 * preferrable to use {@link #executeWithChecks(Object, Object)}.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
496 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
497 * @param trigger
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
498 * The object that triggered the execution; may be
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
499 * <code>null</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
500 * @param applicationContext
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
501 * The state of the application at the time the execution was
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
502 * triggered; may be <code>null</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
503 * @return The result of the execution; may be <code>null</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
504 * @throws ExecutionException
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
505 * If the handler has problems executing this command.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
506 * @throws NotHandledException
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
507 * If there is no handler.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
508 * @deprecated Please use {@link #executeWithChecks(Object, Object)}
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
509 * instead.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
510 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
511 public final Object execute(Object trigger,
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
512 Object applicationContext) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
513 return command.execute(new ExecutionEvent(command, getParameterMap(),
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
514 trigger, applicationContext));
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
515 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
516
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
517 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
518 * Executes this command with its parameters. This does extra checking to
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
519 * see if the command is enabled and defined. If it is not both enabled and
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
520 * defined, then the execution listeners will be notified and an exception
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
521 * thrown.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
522 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
523 * @param trigger
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
524 * The object that triggered the execution; may be
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
525 * <code>null</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
526 * @param applicationContext
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
527 * The state of the application at the time the execution was
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
528 * triggered; may be <code>null</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
529 * @return The result of the execution; may be <code>null</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
530 * @throws ExecutionException
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
531 * If the handler has problems executing this command.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
532 * @throws NotDefinedException
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
533 * If the command you are trying to execute is not defined.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
534 * @throws NotEnabledException
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
535 * If the command you are trying to execute is not enabled.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
536 * @throws NotHandledException
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
537 * If there is no handler.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
538 * @since 3.2
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
539 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
540 public final Object executeWithChecks(Object trigger,
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
541 Object applicationContext) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
542 return command.executeWithChecks(new ExecutionEvent(command,
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
543 getParameterMap(), trigger, applicationContext));
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
544 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
545
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
546 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
547 * Returns the base command. It is possible for more than one parameterized
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
548 * command to have the same identifier.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
549 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
550 * @return The command; never <code>null</code>, but may be undefined.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
551 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
552 public final Command getCommand() {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
553 return command;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
554 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
555
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
556 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
557 * Returns the command's base identifier. It is possible for more than one
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
558 * parameterized command to have the same identifier.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
559 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
560 * @return The command id; never <code>null</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
561 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
562 public final String getId() {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
563 return command.getId();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
564 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
565
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
566 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
567 * Returns a human-readable representation of this command with all of its
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
568 * parameterizations.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
569 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
570 * @return The human-readable representation of this parameterized command;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
571 * never <code>null</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
572 * @throws NotDefinedException
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
573 * If the underlying command is not defined.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
574 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
575 public final String getName() {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
576 if (name is null) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
577 StringBuffer nameBuffer = new StringBuffer();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
578 nameBuffer.append(command.getName());
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
579 if (parameterizations !is null) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
580 nameBuffer.append(" ("); //$NON-NLS-1$
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
581 int parameterizationCount = parameterizations.length;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
582 for (int i = 0; i < parameterizationCount; i++) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
583 Parameterization parameterization = parameterizations[i];
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
584 nameBuffer
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
585 .append(parameterization.getParameter().getName());
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
586 nameBuffer.append(": "); //$NON-NLS-1$
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
587 try {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
588 nameBuffer.append(parameterization.getValueName());
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
589 } catch (ParameterValuesException e) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
590 /*
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
591 * Just let it go for now. If someone complains we can
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
592 * add more info later.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
593 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
594 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
595
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
596 // If there is another item, append a separator.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
597 if (i + 1 < parameterizationCount) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
598 nameBuffer.append(", "); //$NON-NLS-1$
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
599 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
600 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
601 nameBuffer.append(')');
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
602 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
603 name = nameBuffer.toString();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
604 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
605 return name;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
606 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
607
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
608 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
609 * Returns the parameter map, as can be used to construct an
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
610 * <code>ExecutionEvent</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
611 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
612 * @return The map of parameter ids (<code>String</code>) to parameter
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
613 * values (<code>String</code>). This map is never
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
614 * <code>null</code>, but may be empty.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
615 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
616 public final Map!(String,String) getParameterMap() {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
617 if ((parameterizations is null) || (parameterizations.length is 0)) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
618 return EMPTY_MAP;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
619 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
620
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
621 auto parameterMap = new HashMap!(String,String);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
622 for (int i = 0; i < parameterizations.length; i++) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
623 Parameterization parameterization = parameterizations[i];
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
624 parameterMap.add(parameterization.getParameter().getId(),
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
625 parameterization.getValue());
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
626 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
627 return parameterMap;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
628 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
629
70
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
630 /*
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
631 * (non-Javadoc)
46a6e0e6ccd4 Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 43
diff changeset
632 *
3
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
633 * @see java.lang.Object#hashCode()
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
634 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
635 public override final hash_t toHash() {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
636 if (hashCode is HASH_CODE_NOT_COMPUTED) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
637 hashCode = HASH_INITIAL * HASH_FACTOR + Util.toHash(command);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
638 hashCode = hashCode * HASH_FACTOR;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
639 if (parameterizations !is null) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
640 for (int i = 0; i < parameterizations.length; i++) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
641 hashCode += Util.toHash(parameterizations[i]);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
642 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
643 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
644 if (hashCode is HASH_CODE_NOT_COMPUTED) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
645 hashCode++;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
646 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
647 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
648 return hashCode;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
649 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
650
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
651 /**
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
652 * Returns a {@link String} containing the command id, parameter ids and
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
653 * parameter values for this {@link ParameterizedCommand}. The returned
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
654 * {@link String} can be stored by a client and later used to reconstruct an
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
655 * equivalent {@link ParameterizedCommand} using the
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
656 * {@link CommandManager#deserialize(String)} method.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
657 * <p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
658 * The syntax of the returned {@link String} is as follows:
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
659 * </p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
660 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
661 * <blockquote>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
662 * <code>serialization = <u>commandId</u> [ '(' parameters ')' ]</code><br>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
663 * <code>parameters = parameter [ ',' parameters ]</code><br>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
664 * <code>parameter = <u>parameterId</u> [ '=' <u>parameterValue</u> ]</code>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
665 * </blockquote>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
666 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
667 * <p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
668 * In the syntax above, sections inside square-brackets are optional. The
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
669 * characters in single quotes (<code>(</code>, <code>)</code>,
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
670 * <code>,</code> and <code>=</code>) indicate literal characters.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
671 * </p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
672 * <p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
673 * <code><u>commandId</u></code> represents the command id encoded with
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
674 * separator characters escaped. <code><u>parameterId</u></code> and
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
675 * <code><u>parameterValue</u></code> represent the parameter ids and
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
676 * values encoded with separator characters escaped. The separator
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
677 * characters <code>(</code>, <code>)</code>, <code>,</code> and
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
678 * <code>=</code> are escaped by prepending a <code>%</code>. This
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
679 * requires <code>%</code> to be escaped, which is also done by prepending
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
680 * a <code>%</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
681 * </p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
682 * <p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
683 * The order of the parameters is not defined (and not important). A missing
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
684 * <code><u>parameterValue</u></code> indicates that the value of the
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
685 * parameter is <code>null</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
686 * </p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
687 * <p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
688 * For example, the string shown below represents a serialized parameterized
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
689 * command that can be used to show the Resource perspective:
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
690 * </p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
691 * <p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
692 * <code>dwtx.ui.perspectives.showPerspective(dwtx.ui.perspectives.showPerspective.perspectiveId=dwtx.ui.resourcePerspective)</code>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
693 * </p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
694 * <p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
695 * This example shows the more general form with multiple parameters,
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
696 * <code>null</code> value parameters, and escaped <code>=</code> in the
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
697 * third parameter value.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
698 * </p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
699 * <p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
700 * <code>command.id(param1.id=value1,param2.id,param3.id=esc%=val3)</code>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
701 * </p>
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
702 *
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
703 * @return A string containing the escaped command id, parameter ids and
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
704 * parameter values; never <code>null</code>.
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
705 * @see CommandManager#deserialize(String)
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
706 * @since 3.2
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
707 */
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
708 public final String serialize() {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
709 String escapedId = escape(getId());
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
710
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
711 if ((parameterizations is null) || (parameterizations.length is 0)) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
712 return escapedId;
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
713 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
714
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
715 StringBuffer buffer = new StringBuffer(escapedId);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
716 buffer.append(CommandManager.PARAMETER_START_CHAR);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
717
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
718 for (int i = 0; i < parameterizations.length; i++) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
719
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
720 if (i > 0) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
721 // insert separator between parameters
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
722 buffer.append(CommandManager.PARAMETER_SEPARATOR_CHAR);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
723 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
724
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
725 Parameterization parameterization = parameterizations[i];
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
726 String parameterId = parameterization.getParameter().getId();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
727 String escapedParameterId = escape(parameterId);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
728
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
729 buffer.append(escapedParameterId);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
730
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
731 String parameterValue = parameterization.getValue();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
732 if (parameterValue !is null) {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
733 String escapedParameterValue = escape(parameterValue);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
734 buffer.append(CommandManager.ID_VALUE_CHAR);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
735 buffer.append(escapedParameterValue);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
736 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
737 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
738
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
739 buffer.append(CommandManager.PARAMETER_END_CHAR);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
740
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
741 return buffer.toString();
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
742 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
743
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
744 public override final String toString() {
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
745 return Format( "ParameterizedCommand({},{})", command, parameterizations);
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
746 }
6518c18a01f7 eclipse.core package without osgi dependencies
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
747 }