View | Details | Raw Unified | Return to bug 109445 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/gmf/runtime/common/core/command/AbstractCommand.java (-7 / +2 lines)
Lines 22-28 Link Here
22
import org.eclipse.gmf.runtime.common.core.internal.CommonCoreDebugOptions;
22
import org.eclipse.gmf.runtime.common.core.internal.CommonCoreDebugOptions;
23
import org.eclipse.gmf.runtime.common.core.internal.CommonCorePlugin;
23
import org.eclipse.gmf.runtime.common.core.internal.CommonCorePlugin;
24
import org.eclipse.gmf.runtime.common.core.internal.CommonCoreStatusCodes;
24
import org.eclipse.gmf.runtime.common.core.internal.CommonCoreStatusCodes;
25
import org.eclipse.gmf.runtime.common.core.internal.l10n.ResourceManager;
25
import org.eclipse.gmf.runtime.common.core.internal.l10n.CommonCoreMessages;
26
import org.eclipse.gmf.runtime.common.core.util.Log;
26
import org.eclipse.gmf.runtime.common.core.util.Log;
27
import org.eclipse.gmf.runtime.common.core.util.Trace;
27
import org.eclipse.gmf.runtime.common.core.util.Trace;
28
28
Lines 53-63 Link Here
53
	protected static final String EMPTY_STRING = ""; //$NON-NLS-1$
53
	protected static final String EMPTY_STRING = ""; //$NON-NLS-1$
54
54
55
	/**
55
	/**
56
	 * The status message for a cancelled command.
57
	 */
58
	protected static final String CANCELLED_MESSAGE = ResourceManager.getInstance().getString("AbstractCommand._INFO_.cancelOperation"); //$NON-NLS-1$
59
	
60
	/**
61
	 * The label for this command.
56
	 * The label for this command.
62
	 */
57
	 */
63
	private final String label;
58
	private final String label;
Lines 278-284 Link Here
278
				IStatus.ERROR,
273
				IStatus.ERROR,
279
				getPluginId(),
274
				getPluginId(),
280
				CommonCoreStatusCodes.CANCELLED,
275
				CommonCoreStatusCodes.CANCELLED,
281
				CANCELLED_MESSAGE,
276
				CommonCoreMessages.AbstractCommand__INFO__cancelOperation,
282
				null),
277
				null),
283
			null);
278
			null);
284
	}
279
	}
(-)src/org/eclipse/gmf/runtime/common/core/command/CompositeCommand.java (-8 / +2 lines)
Lines 26-32 Link Here
26
26
27
import org.eclipse.gmf.runtime.common.core.internal.CommonCorePlugin;
27
import org.eclipse.gmf.runtime.common.core.internal.CommonCorePlugin;
28
import org.eclipse.gmf.runtime.common.core.internal.CommonCoreStatusCodes;
28
import org.eclipse.gmf.runtime.common.core.internal.CommonCoreStatusCodes;
29
import org.eclipse.gmf.runtime.common.core.internal.l10n.ResourceManager;
29
import org.eclipse.gmf.runtime.common.core.internal.l10n.CommonCoreMessages;
30
30
31
/**
31
/**
32
 * A command that is composed of other
32
 * A command that is composed of other
Lines 53-64 Link Here
53
	protected static final String EMPTY_STRING = ""; //$NON-NLS-1$
53
	protected static final String EMPTY_STRING = ""; //$NON-NLS-1$
54
54
55
	/**
55
	/**
56
	 * The status message for a cancelled command.
57
	 */
58
	protected static final String CANCELLED_MESSAGE = ResourceManager
59
		.getInstance().getString("AbstractCommand._INFO_.cancelOperation"); //$NON-NLS-1$
60
61
	/**
62
	 * The commands of which this composite command is composed.
56
	 * The commands of which this composite command is composed.
63
	 */
57
	 */
64
	private final List commands = new ArrayList();
58
	private final List commands = new ArrayList();
Lines 497-503 Link Here
497
	 */
491
	 */
498
	protected CommandResult newCancelledCommandResult() {
492
	protected CommandResult newCancelledCommandResult() {
499
		return new CommandResult(new Status(IStatus.ERROR, getPluginId(),
493
		return new CommandResult(new Status(IStatus.ERROR, getPluginId(),
500
			CommonCoreStatusCodes.CANCELLED, CANCELLED_MESSAGE, null), null);
494
			CommonCoreStatusCodes.CANCELLED, CommonCoreMessages.AbstractCommand__INFO__cancelOperation, null), null);
501
	}
495
	}
502
496
503
	/**
497
	/**
(-)src/org/eclipse/gmf/runtime/common/core/internal/CommonCorePlugin.java (-13 lines)
Lines 17-24 Link Here
17
import org.eclipse.core.runtime.ILogListener;
17
import org.eclipse.core.runtime.ILogListener;
18
import org.eclipse.core.runtime.Platform;
18
import org.eclipse.core.runtime.Platform;
19
19
20
import org.eclipse.gmf.runtime.common.core.internal.l10n.ResourceManager;
21
import org.eclipse.gmf.runtime.common.core.l10n.AbstractResourceManager;
22
import org.eclipse.gmf.runtime.common.core.plugin.XToolsPlugin;
20
import org.eclipse.gmf.runtime.common.core.plugin.XToolsPlugin;
23
21
24
/**
22
/**
Lines 79-95 Link Here
79
	}
77
	}
80
78
81
	/**
79
	/**
82
	 * Retrieves the resource manager for this plug-in.
83
	 * 
84
	 * @return The resource manager for this plug-in.
85
	 * 
86
	 * @see org.eclipse.gmf.runtime.common.core.plugin.XToolsPlugin#getResourceManager()
87
	 */
88
	public AbstractResourceManager getResourceManager() {
89
		return ResourceManager.getInstance();
90
	}
91
92
	/**
93
	 * Starts up this plug-in.
80
	 * Starts up this plug-in.
94
	 */
81
	 */
95
	protected void doStartup() {
82
	protected void doStartup() {
(-)src/org/eclipse/gmf/runtime/common/core/internal/l10n/messages.properties (-71 lines)
Removed Link Here
1
# ==============================================================================
2
#*+------------------------------------------------------------------------+
3
#*| Copyright (c) 2005  IBM Corporation and others.                        |
4
#*| All rights reserved. This program and the accompanying materials       |
5
#*| are made available under the terms of the Eclipse Public License v1.0  |
6
#*| which accompanies this distribution, and is available at               |
7
#*| http://www.eclipse.org/legal/epl-v10.html                              |
8
#*|                                                                        |
9
#*| Contributors:                                                          |
10
#*|    IBM Corporation - initial API and implementation                    |
11
#*+------------------------------------------------------------------------+
12
# ==============================================================================
13
# Error message used when startup of a plug-in fails.
14
# {0} = Plugin name
15
XToolsPlugin._ERROR_.startupErrorMessage= IRJA0278E Error starting up {0} plug-in
16
# Error message used when shutdown of a plug-in fails.
17
# {0} = Plugin name
18
XToolsPlugin._ERROR_.shutdownErrorMessage= IRJA0279E Error shutting down {0} plug-in
19
20
# Location message to display in a dialog box
21
ComboDirectoryFieldEditor.SpecifyLocation.label=Specify the location:
22
# The text on a button
23
ComboDirectoryFieldEditor.BrowseButton.label=Browse...
24
25
# Error message used when a command is cancelled
26
AbstractCommand._INFO_.cancelOperation = IRJA0280I The operation has been cancelled.
27
28
# ---------------------------------------------------------------------
29
# Resources used by the AbstractResourceManager class
30
# for formatting lists of items.
31
# ---------------------------------------------------------------------
32
33
# The text that typically appears between items in a list.
34
# *** note the trailing space. ***
35
list.separator= , 
36
37
# The text that typically appears between a pair of items (i.e., when there is
38
# only one separator).
39
# *** note the leading and trailing spaces. ***
40
list.separator.only= \ and 
41
42
# The first separator in a list, when the list has more than two items.
43
# *** note the trailing space. ***
44
list.separator.first= , 
45
46
# The last separator in a list, when the list has more than two items.
47
# *** note the trailing space. ***
48
list.separator.last= , and 
49
50
# These two items are text that should precede and follow any list of more than
51
# two items.
52
# The prefix and suffix are not defined for English locales.
53
list.prefix=
54
list.suffix=
55
56
57
# Used in log and trace statements for invalid XML.
58
# {0} = Declaring XML extension name (followed by) ':' (followed by) XML element name
59
NavigatorCategoryDescriptor._ERROR_.invalidXML= IRJA0281E Invalid XML element ({0}).
60
NavigatorContentTypeDescriptor._ERROR_.invalidXML= IRJA0282E Invalid XML element ({0}).
61
62
# Read only file management
63
# {0} = String describing the reason for editing the file
64
FileModificationValidator.EditProblemDialogTitle={0} Problems
65
# {0} = String describing the reason for editing the file
66
FileModificationValidator.EditProblemDialogMessage.part1={0} could not be completed.
67
FileModificationValidator.EditProblemDialogMessage.part2=Reason
68
# {0} = String describing the why file could not be edited
69
FileModificationValidator.EditProblemDialogMessage.part3={0}
70
71
FileModificationValidator.EditProblemDialogMessage.workspace=File is not in the active workspace.
(-)src/org/eclipse/gmf/runtime/common/core/l10n/AbstractResourceManager.java (-1 / +3 lines)
Lines 24-29 Link Here
24
import org.eclipse.gmf.runtime.common.core.internal.CommonCorePlugin;
24
import org.eclipse.gmf.runtime.common.core.internal.CommonCorePlugin;
25
import org.eclipse.gmf.runtime.common.core.internal.CommonCoreStatusCodes;
25
import org.eclipse.gmf.runtime.common.core.internal.CommonCoreStatusCodes;
26
import org.eclipse.gmf.runtime.common.core.internal.l10n.ResourceManager;
26
import org.eclipse.gmf.runtime.common.core.internal.l10n.ResourceManager;
27
//import org.eclipse.gmf.runtime.common.core.internal.l10n.ResourceManager;
27
import org.eclipse.gmf.runtime.common.core.util.Log;
28
import org.eclipse.gmf.runtime.common.core.util.Log;
28
import org.eclipse.gmf.runtime.common.core.util.StringStatics;
29
import org.eclipse.gmf.runtime.common.core.util.StringStatics;
29
import org.eclipse.gmf.runtime.common.core.util.Trace;
30
import org.eclipse.gmf.runtime.common.core.util.Trace;
Lines 90-95 Link Here
90
 * @see java.util.ResourceBundle
91
 * @see java.util.ResourceBundle
91
 * @author Natalia Balaba
92
 * @author Natalia Balaba
92
 * @canBeSeenBy %partners
93
 * @canBeSeenBy %partners
94
 * @deprecated
93
 */
95
 */
94
96
95
public abstract class AbstractResourceManager {
97
public abstract class AbstractResourceManager {
Lines 320-326 Link Here
320
			Trace.catching(
322
			Trace.catching(
321
					getPlugin(),
323
					getPlugin(),
322
					CommonCoreDebugOptions.EXCEPTIONS_CATCHING,
324
					CommonCoreDebugOptions.EXCEPTIONS_CATCHING,
323
					ResourceManager.class,
325
					AbstractResourceManager.class,
324
					"messageFormat", //$NON-NLS-1$
326
					"messageFormat", //$NON-NLS-1$
325
					e);
327
					e);
326
			
328
			
(-)src/org/eclipse/gmf/runtime/common/core/plugin/XToolsPlugin.java (-17 / +7 lines)
Lines 23-29 Link Here
23
import org.eclipse.gmf.runtime.common.core.internal.CommonCoreDebugOptions;
23
import org.eclipse.gmf.runtime.common.core.internal.CommonCoreDebugOptions;
24
import org.eclipse.gmf.runtime.common.core.internal.CommonCorePlugin;
24
import org.eclipse.gmf.runtime.common.core.internal.CommonCorePlugin;
25
import org.eclipse.gmf.runtime.common.core.internal.CommonCoreStatusCodes;
25
import org.eclipse.gmf.runtime.common.core.internal.CommonCoreStatusCodes;
26
import org.eclipse.gmf.runtime.common.core.internal.l10n.ResourceManager;
26
import org.eclipse.gmf.runtime.common.core.internal.l10n.CommonCoreMessages;
27
import org.eclipse.gmf.runtime.common.core.l10n.AbstractResourceManager;
27
import org.eclipse.gmf.runtime.common.core.l10n.AbstractResourceManager;
28
import org.eclipse.gmf.runtime.common.core.util.Log;
28
import org.eclipse.gmf.runtime.common.core.util.Log;
29
import org.eclipse.gmf.runtime.common.core.util.Trace;
29
import org.eclipse.gmf.runtime.common.core.util.Trace;
Lines 34-55 Link Here
34
 * @author khussey
34
 * @author khussey
35
 * @canBeSeenBy %partners
35
 * @canBeSeenBy %partners
36
 */
36
 */
37
public abstract class XToolsPlugin
37
public class XToolsPlugin
38
	extends Plugin {
38
	extends Plugin {
39
39
40
	/**
40
	/**
41
	 * Error message used when startup of a plug-in fails.
42
	 */
43
	protected static final String STARTUP_ERROR_MESSAGE = ResourceManager
44
		.getI18NString("XToolsPlugin._ERROR_.startupErrorMessage"); //$NON-NLS-1$
45
46
	/**
47
	 * Error message used when shutdown of a plug-in fails.
48
	 */
49
	protected static final String SHUTDOWN_ERROR_MESSAGE = ResourceManager
50
		.getI18NString("XToolsPlugin._ERROR_.shutdownErrorMessage"); //$NON-NLS-1$
51
52
	/**
53
	 * Creates a new plug-in runtime object.
41
	 * Creates a new plug-in runtime object.
54
	 */
42
	 */
55
	protected XToolsPlugin() {
43
	protected XToolsPlugin() {
Lines 73-79 Link Here
73
	 * 
61
	 * 
74
	 * @return A resource manager instance for this plug-in.
62
	 * @return A resource manager instance for this plug-in.
75
	 */
63
	 */
76
	public abstract AbstractResourceManager getResourceManager();
64
	public AbstractResourceManager getResourceManager() {
65
		return null;
66
	}
77
67
78
	/**
68
	/**
79
	 * Starts up this plug-in.
69
	 * Starts up this plug-in.
Lines 98-104 Link Here
98
	 *            The name of this plug-in.
88
	 *            The name of this plug-in.
99
	 */
89
	 */
100
	protected String getStartupErrorMessage(String pluginName) {
90
	protected String getStartupErrorMessage(String pluginName) {
101
		return MessageFormat.format(STARTUP_ERROR_MESSAGE,
91
		return MessageFormat.format(CommonCoreMessages.XToolsPlugin__ERROR__startupErrorMessage,
102
			new Object[] {pluginName});
92
			new Object[] {pluginName});
103
	}
93
	}
104
94
Lines 111-117 Link Here
111
	 *            The name of this plug-in.
101
	 *            The name of this plug-in.
112
	 */
102
	 */
113
	protected String getShutdownErrorMessage(String pluginName) {
103
	protected String getShutdownErrorMessage(String pluginName) {
114
		return MessageFormat.format(SHUTDOWN_ERROR_MESSAGE,
104
		return MessageFormat.format(CommonCoreMessages.XToolsPlugin__ERROR__shutdownErrorMessage,
115
			new Object[] {pluginName});
105
			new Object[] {pluginName});
116
	}
106
	}
117
107
(-)src/org/eclipse/gmf/runtime/common/core/internal/l10n/CommonCoreMessages.java (+45 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.gmf.runtime.common.core.internal.l10n;
12
13
import org.eclipse.osgi.util.NLS;
14
15
public final class CommonCoreMessages extends NLS {
16
17
	private static final String BUNDLE_NAME = "org.eclipse.gmf.runtime.common.core.internal.l10n.CommonCoreMessages";//$NON-NLS-1$
18
19
	private CommonCoreMessages() {
20
		// Do not instantiate
21
	}
22
23
	public static String XToolsPlugin__ERROR__startupErrorMessage;
24
	public static String XToolsPlugin__ERROR__shutdownErrorMessage;
25
	public static String ComboDirectoryFieldEditor_SpecifyLocation_label;
26
	public static String ComboDirectoryFieldEditor_BrowseButton_label;
27
	public static String AbstractCommand__INFO__cancelOperation;
28
	public static String list_separator;
29
	public static String list_separator_only;
30
	public static String list_separator_first;
31
	public static String list_separator_last;
32
	public static String list_prefix;
33
	public static String list_suffix;
34
	public static String NavigatorCategoryDescriptor__ERROR__invalidXML;
35
	public static String NavigatorContentTypeDescriptor__ERROR__invalidXML;
36
	public static String FileModificationValidator_EditProblemDialogTitle;
37
	public static String FileModificationValidator_EditProblemDialogMessage_part1;
38
	public static String FileModificationValidator_EditProblemDialogMessage_part2;
39
	public static String FileModificationValidator_EditProblemDialogMessage_part3;
40
	public static String FileModificationValidator_EditProblemDialogMessage_workspace;
41
42
	static {
43
		NLS.initializeMessages(BUNDLE_NAME, CommonCoreMessages.class);
44
	}
45
}
(-)src/org/eclipse/gmf/runtime/common/core/internal/l10n/CommonCoreMessages.properties (+71 lines)
Added Link Here
1
# ==============================================================================
2
#*+------------------------------------------------------------------------+
3
#*| Copyright (c) 2005  IBM Corporation and others.                        |
4
#*| All rights reserved. This program and the accompanying materials       |
5
#*| are made available under the terms of the Eclipse Public License v1.0  |
6
#*| which accompanies this distribution, and is available at               |
7
#*| http://www.eclipse.org/legal/epl-v10.html                              |
8
#*|                                                                        |
9
#*| Contributors:                                                          |
10
#*|    IBM Corporation - initial API and implementation                    |
11
#*+------------------------------------------------------------------------+
12
# ==============================================================================
13
# Error message used when startup of a plug-in fails.
14
# {0} = Plugin name
15
XToolsPlugin__ERROR__startupErrorMessage= IRJA0278E Error starting up {0} plug-in
16
# Error message used when shutdown of a plug-in fails.
17
# {0} = Plugin name
18
XToolsPlugin__ERROR__shutdownErrorMessage= IRJA0279E Error shutting down {0} plug-in
19
20
# Location message to display in a dialog box
21
ComboDirectoryFieldEditor_SpecifyLocation_label=Specify the location:
22
# The text on a button
23
ComboDirectoryFieldEditor_BrowseButton_label=Browse...
24
25
# Error message used when a command is cancelled
26
AbstractCommand__INFO__cancelOperation = IRJA0280I The operation has been cancelled.
27
28
# ---------------------------------------------------------------------
29
# Resources used by the AbstractResourceManager class
30
# for formatting lists of items.
31
# ---------------------------------------------------------------------
32
33
# The text that typically appears between items in a list.
34
# *** note the trailing space. ***
35
list_separator= ,
36
37
# The text that typically appears between a pair of items (i.e., when there is
38
# only one separator).
39
# *** note the leading and trailing spaces. ***
40
list_separator_only= \ and
41
42
# The first separator in a list, when the list has more than two items.
43
# *** note the trailing space. ***
44
list_separator_first= ,
45
46
# The last separator in a list, when the list has more than two items.
47
# *** note the trailing space. ***
48
list_separator_last= , and
49
50
# These two items are text that should precede and follow any list of more than
51
# two items.
52
# The prefix and suffix are not defined for English locales.
53
list_prefix=
54
list_suffix=
55
56
57
# Used in log and trace statements for invalid XML.
58
# {0} = Declaring XML extension name (followed by) ':' (followed by) XML element name
59
NavigatorCategoryDescriptor__ERROR__invalidXML= IRJA0281E Invalid XML element ({0}).
60
NavigatorContentTypeDescriptor__ERROR__invalidXML= IRJA0282E Invalid XML element ({0}).
61
62
# Read only file management
63
# {0} = String describing the reason for editing the file
64
FileModificationValidator_EditProblemDialogTitle={0} Problems
65
# {0} = String describing the reason for editing the file
66
FileModificationValidator_EditProblemDialogMessage_part1={0} could not be completed.
67
FileModificationValidator_EditProblemDialogMessage_part2=Reason
68
# {0} = String describing the why file could not be edited
69
FileModificationValidator_EditProblemDialogMessage_part3={0}
70
71
FileModificationValidator_EditProblemDialogMessage_workspace=File is not in the active workspace.

Return to bug 109445