Révision 581
tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/cmdparameters/ParametersView.java (revision 581) | ||
---|---|---|
96 | 96 |
|
97 | 97 |
try { |
98 | 98 |
// Command preferences |
99 |
//String[] keys = result.getCommandPreferencesKeys(); |
|
100 |
String[] keys = (String[])ArrayUtils.addAll(result.getCommandPreferencesKeys(), result.getDefaultPreferencesKeys()); |
|
101 |
Arrays.sort(keys); |
|
102 |
|
|
103 |
buffer.append("Command preferences (count = " + keys.length + ", node path = " + result.getPreferencesNodeQualifier() + "): \n"); |
|
104 |
for (String key : keys) { |
|
105 |
buffer.append(key + "=" + result.getStringParameterValue(key) + "\n"); |
|
106 |
} |
|
99 |
buffer.append(result.dumpPreferences()); |
|
107 | 100 |
buffer.append("\n"); |
108 | 101 |
|
109 |
// Parameters
|
|
102 |
// Object parameters
|
|
110 | 103 |
buffer.append(result.dumpParameters()); |
111 | 104 |
|
112 | 105 |
|
tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java (revision 581) | ||
---|---|---|
895 | 895 |
|
896 | 896 |
|
897 | 897 |
|
898 |
public static String getKeysAndValues(IScopeContext scope, String nodeQualifier) { |
|
899 |
|
|
900 |
StringBuilder str = new StringBuilder(); |
|
901 |
|
|
902 |
IEclipsePreferences preferences = scope.getNode(nodeQualifier); |
|
903 |
|
|
904 |
str.append("Path = " + preferences .absolutePath() + ")\n"); |
|
905 |
|
|
906 |
try { |
|
907 |
String[] keys = preferences.keys(); |
|
908 |
for(int i = 0; i < keys.length; i++) { |
|
909 |
str.append(keys[i] + " = " + preferences.get(keys[i], "") + "\n"); |
|
910 |
} |
|
911 |
} |
|
912 |
catch(BackingStoreException e) { |
|
913 |
// TODO Auto-generated catch block |
|
914 |
e.printStackTrace(); |
|
915 |
} |
|
916 |
|
|
917 |
return str.toString(); |
|
918 |
|
|
919 |
} |
|
920 |
|
|
921 |
|
|
922 |
|
|
898 | 923 |
|
899 | 924 |
/** |
900 | 925 |
* Dumps the keys and values of the specified node, of the specified result node and also of the alternative nodes. |
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 581) | ||
---|---|---|
7 | 7 |
import java.text.SimpleDateFormat; |
8 | 8 |
import java.util.ArrayList; |
9 | 9 |
import java.util.Arrays; |
10 |
import java.util.Collections; |
|
10 | 11 |
import java.util.Date; |
11 | 12 |
import java.util.HashMap; |
12 | 13 |
import java.util.List; |
... | ... | |
16 | 17 |
|
17 | 18 |
import org.apache.commons.lang.StringUtils; |
18 | 19 |
import org.eclipse.core.runtime.IProgressMonitor; |
20 |
import org.eclipse.core.runtime.preferences.DefaultScope; |
|
19 | 21 |
import org.osgi.framework.FrameworkUtil; |
20 | 22 |
import org.osgi.service.prefs.BackingStoreException; |
21 | 23 |
import org.txm.core.preferences.TXMPreferences; |
... | ... | |
231 | 233 |
} |
232 | 234 |
|
233 | 235 |
|
236 |
public String dumpPreferences() { |
|
237 |
|
|
238 |
StringBuilder str = new StringBuilder(); |
|
239 |
|
|
240 |
str.append("Command preferences\n"); |
|
241 |
str.append(TXMPreferences.getKeysAndValues(TXMPreferences.scope, this.preferencesNodeQualifier)); |
|
242 |
str.append("Default preferences\n"); |
|
243 |
str.append(TXMPreferences.getKeysAndValues(DefaultScope.INSTANCE, this.preferencesNodeQualifier)); |
|
244 |
|
|
245 |
return str.toString(); |
|
246 |
} |
|
234 | 247 |
|
235 | 248 |
|
236 | 249 |
public String dumpParameters() { |
Formats disponibles : Unified diff