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

Collapse All | Expand All

(-)src/org/eclipse/gmf/runtime/emf/core/internal/plugin/MSLPlugin.java (-19 / +2 lines)
Lines 11-24 Link Here
11
11
12
package org.eclipse.gmf.runtime.emf.core.internal.plugin;
12
package org.eclipse.gmf.runtime.emf.core.internal.plugin;
13
13
14
import org.eclipse.core.runtime.Platform;
15
16
import org.eclipse.gmf.runtime.common.core.l10n.AbstractResourceManager;
14
import org.eclipse.gmf.runtime.common.core.l10n.AbstractResourceManager;
17
import org.eclipse.gmf.runtime.common.core.plugin.XToolsPlugin;
15
import org.eclipse.gmf.runtime.common.core.plugin.XToolsPlugin;
18
import org.eclipse.gmf.runtime.common.core.util.Trace;
16
import org.eclipse.gmf.runtime.common.core.util.Trace;
19
import org.eclipse.gmf.runtime.emf.core.internal.l10n.ResourceManager;
17
import org.eclipse.gmf.runtime.emf.core.internal.l10n.ResourceManager;
20
import org.eclipse.gmf.runtime.emf.core.internal.resources.MSLPathmap;
21
import org.eclipse.gmf.runtime.emf.core.internal.services.metamodel.MetamodelSupportService;
22
import org.eclipse.gmf.runtime.emf.core.internal.util.MSLAdapterFactoryManager;
18
import org.eclipse.gmf.runtime.emf.core.internal.util.MSLAdapterFactoryManager;
23
19
24
/**
20
/**
Lines 30-46 Link Here
30
	extends XToolsPlugin {
26
	extends XToolsPlugin {
31
27
32
	private static MSLPlugin plugin;
28
	private static MSLPlugin plugin;
33
34
	// extension points.
35
	protected static final String METAMODEL_PROVIDERS_EXT_P_NAME = "MetaModelProviders"; //$NON-NLS-1$
36
37
	protected static final String PATHMAPS_EXT_P_NAME = "Pathmaps"; //$NON-NLS-1$
38
		
29
		
39
	/**
30
	/**
40
	 * Constructor.
31
	 * Constructor.
41
	 */
32
	 */
42
	public MSLPlugin() {
33
	public MSLPlugin() {
43
44
		super();
34
		super();
45
		plugin = this;
35
		plugin = this;
46
	}
36
	}
Lines 56-62 Link Here
56
	 * Get plugin ID.
46
	 * Get plugin ID.
57
	 */
47
	 */
58
	public static String getPluginId() {
48
	public static String getPluginId() {
59
		return getDefault().getBundle().getSymbolicName();
49
		return getDefault().getSymbolicName();
60
	}
50
	}
61
51
62
	/**
52
	/**
Lines 70-84 Link Here
70
	 * @see org.eclipse.gmf.runtime.common.core.plugin.XToolsPlugin#doStartup()
60
	 * @see org.eclipse.gmf.runtime.common.core.plugin.XToolsPlugin#doStartup()
71
	 */
61
	 */
72
	protected void doStartup() {
62
	protected void doStartup() {
73
		MetamodelSupportService.configure(Platform.getExtensionRegistry()
74
			.getExtensionPoint(getPluginId(), METAMODEL_PROVIDERS_EXT_P_NAME)
75
			.getConfigurationElements());
76
77
		MSLPathmap.configure(Platform.getExtensionRegistry().getExtensionPoint(
78
			getPluginId(), PATHMAPS_EXT_P_NAME).getConfigurationElements());
79
		
80
		MSLAdapterFactoryManager.init();
63
		MSLAdapterFactoryManager.init();
81
		
64
82
		// This event listener must be registered _after_ all of the rest of
65
		// This event listener must be registered _after_ all of the rest of
83
		//  the MSL stuff is initialized. Otherwise, strange problems occur when
66
		//  the MSL stuff is initialized. Otherwise, strange problems occur when
84
		//  tracing is turned on.
67
		//  tracing is turned on.
(-)src/org/eclipse/gmf/runtime/emf/core/internal/resources/MSLPathmap.java (-5 / +13 lines)
Lines 1-5 Link Here
1
/******************************************************************************
1
/******************************************************************************
2
 * Copyright (c) 2002, 2004 IBM Corporation and others.
2
 * Copyright (c) 2002, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 54-62 Link Here
54
	private static final String PATH = "path"; //$NON-NLS-1$
54
	private static final String PATH = "path"; //$NON-NLS-1$
55
55
56
	// The path map as defined by the extensions
56
	// The path map as defined by the extensions
57
	private static final Map PATH_MAP = Collections.synchronizedMap(new HashMap());
57
	private static final Map PATH_MAP = Collections.synchronizedMap(configure());
58
58
59
	private MSLEditingDomain domain = null;
59
	private final MSLEditingDomain domain;
60
60
61
	/**
61
	/**
62
	 * Constructor.
62
	 * Constructor.
Lines 153-159 Link Here
153
	/**
153
	/**
154
	 * Configure the Pathmaps extension point.
154
	 * Configure the Pathmaps extension point.
155
	 */
155
	 */
156
	public static void configure(IConfigurationElement[] configs) {
156
	private static Map configure() {
157
		Map paths = new HashMap();
158
		
159
		IConfigurationElement[] configs = Platform.getExtensionRegistry()
160
				.getExtensionPoint(MSLPlugin.getPluginId(), "Pathmaps") //$NON-NLS-1$
161
				.getConfigurationElements();
162
157
		for (int i = 0; i < configs.length; ++i) {
163
		for (int i = 0; i < configs.length; ++i) {
158
164
159
			IConfigurationElement element = configs[i];
165
			IConfigurationElement element = configs[i];
Lines 190-196 Link Here
190
				if (url == null)
196
				if (url == null)
191
					continue;
197
					continue;
192
198
193
				PATH_MAP.put(var, url.toString());
199
				paths.put(var, url.toString());
194
200
195
			} catch (IOException e) {
201
			} catch (IOException e) {
196
202
Lines 199-204 Link Here
199
					"configure", e); //$NON-NLS-1$
205
					"configure", e); //$NON-NLS-1$
200
			}
206
			}
201
		}
207
		}
208
209
		return paths;
202
	}
210
	}
203
211
204
	/**
212
	/**
(-)src/org/eclipse/gmf/runtime/emf/core/internal/services/metamodel/MetamodelSupportService.java (-9 / +6 lines)
Lines 1-5 Link Here
1
/******************************************************************************
1
/******************************************************************************
2
 * Copyright (c) 2004 IBM Corporation and others.
2
 * Copyright (c) 2004, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 17-26 Link Here
17
17
18
import org.eclipse.core.runtime.IConfigurationElement;
18
import org.eclipse.core.runtime.IConfigurationElement;
19
import org.eclipse.emf.ecore.EPackage;
19
import org.eclipse.emf.ecore.EPackage;
20
21
import org.eclipse.gmf.runtime.common.core.service.ExecutionStrategy;
20
import org.eclipse.gmf.runtime.common.core.service.ExecutionStrategy;
22
import org.eclipse.gmf.runtime.common.core.service.IOperation;
21
import org.eclipse.gmf.runtime.common.core.service.IOperation;
23
import org.eclipse.gmf.runtime.common.core.service.Service;
22
import org.eclipse.gmf.runtime.common.core.service.Service;
23
import org.eclipse.gmf.runtime.emf.core.internal.plugin.MSLPlugin;
24
import org.eclipse.gmf.runtime.emf.core.services.metamodel.GetMetamodelSupportOperation;
24
import org.eclipse.gmf.runtime.emf.core.services.metamodel.GetMetamodelSupportOperation;
25
import org.eclipse.gmf.runtime.emf.core.services.metamodel.IMetamodelSupport;
25
import org.eclipse.gmf.runtime.emf.core.services.metamodel.IMetamodelSupport;
26
import org.eclipse.gmf.runtime.emf.core.services.metamodel.IMetamodelSupportProvider;
26
import org.eclipse.gmf.runtime.emf.core.services.metamodel.IMetamodelSupportProvider;
Lines 37-42 Link Here
37
	// the one instance of the service.
37
	// the one instance of the service.
38
	public final static MetamodelSupportService instance = new MetamodelSupportService(
38
	public final static MetamodelSupportService instance = new MetamodelSupportService(
39
		true);
39
		true);
40
	
41
	static {
42
		 instance.configureProviders(MSLPlugin.getPluginId(), "MetaModelProviders"); //$NON-NLS-1$
43
	}
40
44
41
	// cache the operations.
45
	// cache the operations.
42
	public final static Map operations = new HashMap();
46
	public final static Map operations = new HashMap();
Lines 72-84 Link Here
72
	}
76
	}
73
77
74
	/**
78
	/**
75
	 * Configures the meta-model service.
76
	 */
77
	public static void configure(IConfigurationElement[] elements) {
78
		instance.configureProviders(elements);
79
	}
80
81
	/**
82
	 * Executes a service request.
79
	 * Executes a service request.
83
	 */
80
	 */
84
	private Object execute(IOperation operation) {
81
	private Object execute(IOperation operation) {

Return to bug 110635