Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Redor2014-04-10 13:09:08 +0000
committerLaurent Redor2014-04-16 14:38:14 +0000
commit976694c726d6a3147fddede1a5a883f5412465c6 (patch)
tree99d039ccb77577f4f05cd61b26c87b08a4be352f
parent6168f11d61f41a0821a103ca490d87c335d5f93c (diff)
downloadorg.eclipse.sirius-976694c726d6a3147fddede1a5a883f5412465c6.tar.gz
org.eclipse.sirius-976694c726d6a3147fddede1a5a883f5412465c6.tar.xz
org.eclipse.sirius-976694c726d6a3147fddede1a5a883f5412465c6.zip
[430263] Remove the ModelingProjectManagerStartup startup extension
This extension implies that if Sirius is installed, a large part of Sirius plugins are getting loaded and started even if your are not using it. The sessionManagerListener of ModelingProjectManagerImpl, previously added by this extension point, is now added during the loading of the first session. The initialization of a modeling project (detect if the modeling project is valid, ie with one and only one representations file) is now done at the first access of this project and not at the Eclipse start. Warning: If the Sirius Content Management is active (for example in "Project Explorer"), Sirius plugins are getting loaded and started even with this fix. Change-Id: I3c3c3891bca0f2531935931b8ad97abaef01b320 Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release Notes.html5
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release Notes.textile1
-rw-r--r--plugins/org.eclipse.sirius.ui/plugin.xml5
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/project/ModelingProjectManager.java9
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/modelingproject/manager/ModelingProjectManagerImpl.java24
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/modelingproject/manager/ModelingProjectManagerStartup.java30
6 files changed, 12 insertions, 62 deletions
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release Notes.html
index 5357677409..c23180479a 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.html
+++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.html
@@ -367,6 +367,9 @@
<code>Map&lt;String, Collection&lt;String&gt;&gt;</code> instead of Guava&#8217;s
<code>Multimap</code>.
</li>
+ <li>
+ <code>org.eclipse.sirius.ui.tools.api.project.ModelingProjectManager.initializeAfterLoad()</code> method has been removed. There is no replacement for this method documented as &#171;Not intended to be used by client&#187;.
+ </li>
</ul>
<h4 id="Changesinorg.eclipse.sirius.ext.base">Changes in
<code>org.eclipse.sirius.ext.base</code>
@@ -1318,4 +1321,4 @@ void removeSelectedView(DView view);
</li>
</ul>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
index ed6cfa7119..5d1acfdc86 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
@@ -106,6 +106,7 @@ h4. Changes in @org.eclipse.sirius.ui@
* @org.eclipse.sirius.ui.business.api.preferences.DesignerUIPreferencesKeys@ has been renamed into @org.eclipse.sirius.ui.business.api.preferences.SiriusUIPreferencesKeys@
* Methods @getMissingDependencies()@ and @getMissingDependenciesErrorMessage()@ from @org.eclipse.sirius.ui.business.api.viewpoint.ViewpointSelection@ now use @Map<String, Collection<String>>@ instead of Guava's @Multimap@.
+* @org.eclipse.sirius.ui.tools.api.project.ModelingProjectManager.initializeAfterLoad()@ method has been removed. There is no replacement for this method documented as "Not intended to be used by client".
h4. Changes in @org.eclipse.sirius.ext.base@
diff --git a/plugins/org.eclipse.sirius.ui/plugin.xml b/plugins/org.eclipse.sirius.ui/plugin.xml
index 1a86148adc..3d86177d32 100644
--- a/plugins/org.eclipse.sirius.ui/plugin.xml
+++ b/plugins/org.eclipse.sirius.ui/plugin.xml
@@ -662,11 +662,6 @@
</objectContribution>
</extension>
-->
- <extension point="org.eclipse.ui.startup">
- <startup
- class="org.eclipse.sirius.ui.tools.internal.views.common.modelingproject.manager.ModelingProjectManagerStartup">
- </startup>
- </extension>
<extension
point="org.eclipse.ui.commands">
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/project/ModelingProjectManager.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/project/ModelingProjectManager.java
index ed91ab3a23..3b85f67370 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/project/ModelingProjectManager.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/project/ModelingProjectManager.java
@@ -31,15 +31,6 @@ public interface ModelingProjectManager {
ModelingProjectManager INSTANCE = ModelingProjectManagerImpl.init();
/**
- * Initialize the modeling project manager. This method should be called
- * only once by the
- * {@link org.eclipse.sirius.ui.tools.internal.views.common.modelingproject.manager.ui.tools.internal.views.common.modelingproject.manager.ModelingProjectManagerStartup}
- * .<BR>
- * Not intended to be used by client.
- */
- void initializeAfterLoad();
-
- /**
* Load and open a representations file.
*
* @param representationsFileURI
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/modelingproject/manager/ModelingProjectManagerImpl.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/modelingproject/manager/ModelingProjectManagerImpl.java
index e4bbd83312..2c5e0fcc33 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/modelingproject/manager/ModelingProjectManagerImpl.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/modelingproject/manager/ModelingProjectManagerImpl.java
@@ -13,6 +13,7 @@ package org.eclipse.sirius.ui.tools.internal.views.common.modelingproject.manage
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
@@ -41,7 +42,6 @@ import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.business.api.session.SessionListener;
import org.eclipse.sirius.business.api.session.SessionManager;
import org.eclipse.sirius.business.api.session.SessionManagerListener;
-import org.eclipse.sirius.business.internal.modelingproject.manager.InitializeModelingProjectJob;
import org.eclipse.sirius.business.internal.modelingproject.marker.ModelingMarker;
import org.eclipse.sirius.business.internal.query.ModelingProjectQuery;
import org.eclipse.sirius.common.tools.api.resource.ResourceSetFactory;
@@ -56,6 +56,7 @@ import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
/**
* A manager for modeling projects.
@@ -92,11 +93,11 @@ public class ModelingProjectManagerImpl implements ModelingProjectManager {
};
/**
- * List of representations files that are currently loading. There can be
+ * Set of representations files that are currently loading. There can be
* only one representations file in loading at same time. However there may
* be many waiting to be loaded.
*/
- private List<URI> sessionFileLoading = Lists.newArrayList();
+ private Set<URI> sessionFileLoading = Sets.newHashSet();
/**
* Avoid instantiation.
@@ -116,20 +117,6 @@ public class ModelingProjectManagerImpl implements ModelingProjectManager {
/**
* {@inheritDoc}
*
- * @see org.eclipse.sirius.ui.tools.api.project.ModelingProjectManager#initializeAfterLoad()
- */
- public void initializeAfterLoad() {
- SessionManager.INSTANCE.addSessionsListener(sessionManagerListener);
- // Look over all projects to determine the main representations file of
- // each modeling project.
- Job job = new InitializeModelingProjectJob();
- job.setPriority(Job.SHORT);
- job.schedule();
- }
-
- /**
- * {@inheritDoc}
- *
* @see org.eclipse.sirius.ui.tools.api.project.ModelingProjectManager#loadAndOpenRepresentationsFile(org.eclipse.emf.common.util.URI)
*/
public void loadAndOpenRepresentationsFile(final URI representationsFileURI) {
@@ -142,6 +129,9 @@ public class ModelingProjectManagerImpl implements ModelingProjectManager {
* @see org.eclipse.sirius.ui.tools.api.project.ModelingProjectManager#loadAndOpenRepresentationsFiles(java.util.List)
*/
public void loadAndOpenRepresentationsFiles(final List<URI> representationsFilesURIs) {
+ // Add the specific sessions listener (if not already added).
+ SessionManager.INSTANCE.addSessionsListener(sessionManagerListener);
+
// List only the representations files that are not already loaded or
// that are not currently in loading.
Iterator<URI> representationsFilesURIsToLoadIterator = Iterators.filter(representationsFilesURIs.iterator(),
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/modelingproject/manager/ModelingProjectManagerStartup.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/modelingproject/manager/ModelingProjectManagerStartup.java
deleted file mode 100644
index 855244f176..0000000000
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/modelingproject/manager/ModelingProjectManagerStartup.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 THALES GLOBAL SERVICES.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.sirius.ui.tools.internal.views.common.modelingproject.manager;
-
-import org.eclipse.sirius.ui.tools.api.project.ModelingProjectManager;
-import org.eclipse.ui.IStartup;
-
-/**
- * A startup to initialize the ModelingProjectManager.
- *
- * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a>
- */
-public class ModelingProjectManagerStartup implements IStartup {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.ui.IStartup#earlyStartup()
- */
- public void earlyStartup() {
- ModelingProjectManager.INSTANCE.initializeAfterLoad();
- }
-}

Back to the top