From fa5a1861dfc54e5f385629e1a4632551f2705e4e Mon Sep 17 00:00:00 2001 From: lehtonen Date: Fri, 13 Jul 2012 13:00:02 +0000 Subject: [PATCH] Deprecated UIModelManager, ProjectElements and ProjectElementType. These will be removed from Simantics 1.8. NewComponentTypeHandler, NewModelHandler and NewStateHandler, NewExperiment and NewState removed from os.modeling.ui. Dummy model manager implementation was removed from SysdynProject - useless. fixes #3566 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@25329 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../sysdyn/ui/project/SysdynProject.java | 53 ------------------- 1 file changed, 53 deletions(-) diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynProject.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynProject.java index fe6423b0..1fe30c40 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynProject.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynProject.java @@ -16,15 +16,12 @@ import java.io.IOException; import java.util.HashMap; import org.eclipse.core.runtime.Platform; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PartInitException; import org.simantics.databoard.accessor.Accessor; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.Session; import org.simantics.db.WriteGraph; import org.simantics.db.common.changeset.GenericChangeListener; -import org.simantics.db.common.request.Queries; import org.simantics.db.common.request.ReadRequest; import org.simantics.db.common.request.WriteRequest; import org.simantics.db.exception.DatabaseException; @@ -35,7 +32,6 @@ import org.simantics.db.layer0.genericrelation.DependencyChanges; import org.simantics.db.layer0.service.ActivationManager; import org.simantics.db.request.Read; import org.simantics.db.service.GraphChangeListenerSupport; -import org.simantics.db.service.LifecycleSupport; import org.simantics.db.service.VirtualGraphSupport; import org.simantics.issues.common.IssueUtils; import org.simantics.layer0.Layer0; @@ -43,8 +39,6 @@ import org.simantics.modelica.fmi.FMUControlJNI; import org.simantics.modeling.services.CaseInsensitiveComponentNamingStrategy2; import org.simantics.modeling.services.ComponentNamingStrategy; import org.simantics.project.IProject; -import org.simantics.project.ProjectElementType; -import org.simantics.project.ProjectElements; import org.simantics.project.ProjectKeys; import org.simantics.project.exception.ProjectException; import org.simantics.project.features.AbstractProjectFeature; @@ -54,51 +48,11 @@ import org.simantics.simulation.project.IExperimentManager; import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.ui.editor.SysdynEditorNamingService; import org.simantics.ui.workbench.IEditorNamingService; -import org.simantics.ui.workbench.action.ChooseActionRequest; -import org.simantics.ui.workbench.project.UIModelManager; -import org.simantics.ui.workbench.project.UIModelManagerBase; import org.simantics.utils.FileUtils; -import org.simantics.utils.datastructures.Callback; -import org.simantics.utils.ui.workbench.WorkbenchUtils; public class SysdynProject extends AbstractProjectFeature { private static final String DEFAULT_PERSPECTIVE = "org.simantics.sysdyn.ui.perspective"; - class ModelManager extends UIModelManagerBase { - @Override - public void create(ProjectElementType kind, Shell parentShell, Session session, Resource container, - Callback callback, Callback errorCallback) { - - if (ProjectElements.MODEL.equals(kind)) { - //FIXME: Should not be needed anymore - // request(session, container, callback, errorCallback, CREATE_MODEL); - return; - } - - super.create(kind, parentShell, session, container, callback, errorCallback); - } - - /** - * - * - * @see org.simantics.ui.workbench.project.UIModelManager#openEditor(org.simantics.db.Session, java.lang.String) - */ - @Override - public void openEditor(Session session, String uri) throws PartInitException { - try { - Resource resource = session.syncRequest(Queries.resource(uri)); - session.syncRequest(new ChooseActionRequest(null, resource, WorkbenchUtils.getCurrentPerspectiveId())); - } catch (DatabaseException e) { - LifecycleSupport ls = session.getService(LifecycleSupport.class); - throw new PartInitException("Failed to open editor for URI '" + uri + "' with session '" + ls.getSessionReference() + "', see exception for details.", e); - } - } - } - - - - ModelManager mm; - @Override public void configure() throws ProjectException { final IProject project = getProject(); @@ -108,9 +62,6 @@ public class SysdynProject extends AbstractProjectFeature { getProjectElement().setHint(IEditorNamingService.KEY_EDITOR_NAMING_SERVICE, new SysdynEditorNamingService()); - mm = new ModelManager(); - getProjectElement().setHint(UIModelManager.KEY_MODEL_MANAGER, mm); - // Install naming strategy for model components. GraphChangeListenerSupport changeSupport = session.peekService(GraphChangeListenerSupport.class); if (changeSupport != null) { @@ -220,10 +171,6 @@ public class SysdynProject extends AbstractProjectFeature { @Override public void deconfigure() throws ProjectException { - if (getProjectElement().getHint(UIModelManager.KEY_MODEL_MANAGER) == mm) - getProjectElement().removeHint(UIModelManager.KEY_MODEL_MANAGER); - mm = null; - getProjectElement().removeHint(ComponentNamingStrategy.PROJECT_KEY); } -- 2.47.1