Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrkulp2005-06-16 20:14:27 +0000
committerrkulp2005-06-16 20:14:27 +0000
commit312915d9421e35593e5f5570bf913bf34ef854af (patch)
tree1b5161938f4e6fa84baa0cbd0a173687a6b32f17 /plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench
parentbe838872d72b85540c9b6b56133c58530f83f049 (diff)
downloadwebtools.common-312915d9421e35593e5f5570bf913bf34ef854af.tar.gz
webtools.common-312915d9421e35593e5f5570bf913bf34ef854af.tar.xz
webtools.common-312915d9421e35593e5f5570bf913bf34ef854af.zip
Fix problem with initializing EMF nature contributors and Java EMF nature not being registered.
Diffstat (limited to 'plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench')
-rw-r--r--plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/EMFWorkbenchContextFactory.java28
1 files changed, 14 insertions, 14 deletions
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/EMFWorkbenchContextFactory.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/EMFWorkbenchContextFactory.java
index f75372238..698a4352b 100644
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/EMFWorkbenchContextFactory.java
+++ b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/internal/util/emf/workbench/EMFWorkbenchContextFactory.java
@@ -10,7 +10,7 @@
*******************************************************************************/
/*
* $$RCSfile: EMFWorkbenchContextFactory.java,v $$
- * $$Revision: 1.3 $$ $$Date: 2005/05/13 15:17:15 $$
+ * $$Revision: 1.4 $$ $$Date: 2005/06/16 20:14:27 $$
*/
package org.eclipse.jem.internal.util.emf.workbench;
@@ -103,31 +103,31 @@ public class EMFWorkbenchContextFactory {
if (!aProject.isAccessible())
throw new IllegalStateException("[EMFWorkbenchContextBase]" + EMFWorkbenchResourceHandler.getString("EMFWorkbenchContextFactory_UI_1", new Object[]{aProject.getName()})); //$NON-NLS-1$ //$NON-NLS-2$
EMFWorkbenchContextBase context = getCachedEMFContext(aProject);
+ boolean contributorFound = false;
if (context == null) {
context = primCreateEMFContext(aProject);
cacheEMFContext(aProject, context);
- if (contributor == null)
- initializeEMFContextFromContributors(aProject, context);
+ contributorFound = initializeEMFContextFromContributors(aProject, context, contributor);
}
- if (contributor != null && context != null)
+ if (contributor != null && context != null && !contributorFound)
contributor.primaryContributeToContext(context);
return context;
}
-
- protected void initializeEMFContextFromContributors(IProject aProject, EMFWorkbenchContextBase emfContext) {
+
+ protected boolean initializeEMFContextFromContributors(IProject aProject, EMFWorkbenchContextBase emfContext, IEMFContextContributor contributor) {
+ boolean contributorFound = false;
if (aProject == null || emfContext == null)
- return;
+ return contributorFound;
List runtimes = EMFNature.getRegisteredRuntimes(aProject);
- boolean primary = true;
for (int i = 0; i < runtimes.size(); i++) {
IProjectNature nature = (IProjectNature) runtimes.get(i);
- if (nature != null && CONTRIBUTOR_CLASS.isInstance(nature))
- if (primary) {
- primary = false;
- ((IEMFContextContributor) nature).primaryContributeToContext(emfContext);
- } else
- ((IEMFContextContributor) nature).secondaryContributeToContext(emfContext);
+ if (nature != null && CONTRIBUTOR_CLASS.isInstance(nature)) {
+ if (nature == contributor)
+ contributorFound = true;
+ ((IEMFContextContributor) nature).primaryContributeToContext(emfContext);
+ }
}
+ return contributorFound;
}
protected boolean isNatureEnabled(IProject aProject, String natureId) {

Back to the top