From: lempinen Date: Wed, 18 Aug 2010 12:47:33 +0000 (+0000) Subject: git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@17335 ac1ea38d-2e2b... X-Git-Tag: simantics-1.2.0~101 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=fd1fd157555fd45d51fafced8d25868b7efcbede;p=simantics%2Fsysdyn.git git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@17335 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.feature/feature.xml b/org.simantics.sysdyn.feature/feature.xml index 949cb85a..2dd54208 100644 --- a/org.simantics.sysdyn.feature/feature.xml +++ b/org.simantics.sysdyn.feature/feature.xml @@ -28,7 +28,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - + + + + + - + - + + + + + + + + + + + @@ -487,32 +442,30 @@ - - + + - - - - - - + + + + + + @@ -693,5 +650,46 @@ class="org.simantics.sysdyn.ui.properties.ResourceSelectionProcessor"> + + + + + + + + + + + + + + + + diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/LibraryViewpointContributor.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/LibraryViewpointContributor.java deleted file mode 100644 index 7eea1213..00000000 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/LibraryViewpointContributor.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * 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: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.sysdyn.ui.browser.contributions; - -import java.util.ArrayList; -import java.util.Collection; - -import org.simantics.browsing.ui.graph.contributor.viewpoint.ViewpointContributor; -import org.simantics.db.ReadGraph; -import org.simantics.db.Resource; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.request.Read; -import org.simantics.sysdyn.SysdynResource; -import org.simantics.sysdyn.ui.browser.nodes.AbstractNode; - -/** - * @author Tuukka Lehtonen - * - * @param input library node type - */ -public abstract class LibraryViewpointContributor extends ViewpointContributor { - - protected abstract Read> getChildRequest(ReadGraph graph, T lib) throws DatabaseException; - - @Override - public final Collection getContribution(ReadGraph graph, T lib) throws DatabaseException { - ArrayList result = new ArrayList(); - for (Resource r : graph.syncRequest(getChildRequest(graph, lib))) { - try { - AbstractNode n = graph.adapt(r, AbstractNode.class); - result.add(n); - } catch (DatabaseException e) { - e.printStackTrace(); - } - } - return result; - } - - @Override - public String getViewpointId() { - return "Standard"; - } - -} diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Module.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Module.java index 59945da3..cad29d60 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Module.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Module.java @@ -9,12 +9,13 @@ import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.common.request.ObjectsWithType; import org.simantics.db.exception.DatabaseException; +import org.simantics.modeling.ModelingResources; import org.simantics.structural.stubs.StructuralResource2; import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.ui.browser.nodes.AbstractNode; import org.simantics.sysdyn.ui.browser.nodes.ModuleNode; -public class Module extends ViewpointContributor { +public class Module extends ViewpointContributor { @Override public Collection getContribution(ReadGraph graph, ModuleNode module) throws DatabaseException { @@ -22,7 +23,14 @@ public class Module extends ViewpointContributor { Builtins b = graph.getBuiltins(); SysdynResource sr = SysdynResource.getInstance(graph); StructuralResource2 str = StructuralResource2.getInstance(graph); + + // ModuleTypeNode extends ModuleNode, so we get the instance in two different ways Resource instance = graph.getPossibleObject(module.resource, b.InstanceOf); + if(graph.isInheritedFrom(module.resource, sr.ModuleSymbol)) { + ModelingResources mr = ModelingResources.getInstance(graph); + instance = graph.getPossibleObject(module.resource, mr.SymbolToComponentType); + } + if(instance == null) return result; Resource conf = graph.getSingleObject(instance, str.IsDefinedBy); for(Resource r : graph.syncRequest(new ObjectsWithType(conf, b.ConsistsOf, sr.IndependentVariable))) { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ExperimentNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ExperimentNode.java index a04e5968..b9e2ed19 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ExperimentNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ExperimentNode.java @@ -11,19 +11,29 @@ *******************************************************************************/ package org.simantics.sysdyn.ui.browser.nodes; -import org.simantics.browsing.ui.common.node.IDeletable; +import java.util.Collection; + +import org.simantics.browsing.ui.common.node.DeleteException; +import org.simantics.browsing.ui.common.node.IDeletableNode; import org.simantics.browsing.ui.common.node.IDoubleClickableNode; import org.simantics.browsing.ui.common.node.IModifiableNode; import org.simantics.browsing.ui.content.Labeler.Modifier; import org.simantics.browsing.ui.graph.impl.LabelModifier; +import org.simantics.db.Builtins; import org.simantics.db.Resource; +import org.simantics.db.WriteGraph; +import org.simantics.db.common.request.WriteRequest; +import org.simantics.db.exception.CancelTransactionException; +import org.simantics.db.exception.DatabaseException; import org.simantics.project.IProject; import org.simantics.simulation.project.IExperimentManager; +import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.ui.handlers.SysdynExperimentActivator; import org.simantics.ui.SimanticsUI; import org.simantics.utils.ui.ErrorLogger; +import org.simantics.utils.ui.ExceptionUtils; -public class ExperimentNode extends AbstractNode implements IDoubleClickableNode, IDeletable, IModifiableNode{ +public class ExperimentNode extends AbstractNode implements IDoubleClickableNode, IDeletableNode, IModifiableNode{ public ExperimentNode(Resource resource) { super(resource); @@ -42,7 +52,7 @@ public class ExperimentNode extends AbstractNode implements IDoubleClickableNode SysdynExperimentActivator.scheduleActivation(SimanticsUI.getSession(), project, experimentManager, resource); return true; } - + @Override public Modifier getModifier(String columnId) { LabelModifier modifier = new LabelModifier(SimanticsUI.getSession(), resource) { @@ -56,4 +66,23 @@ public class ExperimentNode extends AbstractNode implements IDoubleClickableNode return modifier; } + @Override + public void delete() throws DeleteException { + try { + SimanticsUI.getSession().syncRequest(new WriteRequest() { + @Override + public void perform(WriteGraph graph) throws DatabaseException, CancelTransactionException { + Builtins b = graph.getBuiltins(); + Collection results = graph.getObjects(resource, SysdynResource.getInstance(graph).HasResult); + if(results != null) + for(Resource result : results) + SimulationResultNode.unlinkResult(graph, result); + graph.deny(resource, b.PartOf); + } + }); + } catch (DatabaseException e) { + ExceptionUtils.logAndShowError(e); + } + } + } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModelNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModelNode.java index b79582cc..c26a8df7 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModelNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModelNode.java @@ -1,13 +1,21 @@ package org.simantics.sysdyn.ui.browser.nodes; -import org.simantics.browsing.ui.common.node.IDeletable; +import org.simantics.browsing.ui.common.node.DeleteException; +import org.simantics.browsing.ui.common.node.IDeletableNode; import org.simantics.browsing.ui.common.node.IModifiableNode; import org.simantics.browsing.ui.content.Labeler.Modifier; import org.simantics.browsing.ui.graph.impl.LabelModifier; +import org.simantics.db.Builtins; import org.simantics.db.Resource; +import org.simantics.db.WriteGraph; +import org.simantics.db.common.request.WriteRequest; +import org.simantics.db.exception.CancelTransactionException; +import org.simantics.db.exception.DatabaseException; +import org.simantics.sysdyn.SysdynResource; import org.simantics.ui.SimanticsUI; +import org.simantics.utils.ui.ExceptionUtils; -public class ModelNode extends AbstractNode implements IDeletable, IModifiableNode { +public class ModelNode extends AbstractNode implements IDeletableNode, IModifiableNode { public ModelNode(Resource resource) { super(resource); @@ -28,4 +36,25 @@ public class ModelNode extends AbstractNode implements IDeletable, IModifiableNo return modifier; } + @Override + public void delete() throws DeleteException { + try { + SimanticsUI.getSession().syncRequest(new WriteRequest() { + @Override + public void perform(WriteGraph graph) throws DatabaseException, CancelTransactionException { + Builtins b = graph.getBuiltins(); + + for(Resource r : graph.getObjects(resource, b.ConsistsOf)) + if(graph.isInstanceOf(r, SysdynResource.getInstance(graph).Result)) + SimulationResultNode.deleteResultFiles(graph, r); + + graph.deny(resource, b.PartOf); + } + }); + } catch (DatabaseException e) { + ExceptionUtils.logAndShowError(e); + } + + } + } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModuleNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModuleNode.java index 1689c075..2241a7ca 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModuleNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModuleNode.java @@ -1,9 +1,8 @@ package org.simantics.sysdyn.ui.browser.nodes; -import org.simantics.browsing.ui.common.node.IDeletable; import org.simantics.db.Resource; -public class ModuleNode extends AbstractNode implements IDeletable { +public class ModuleNode extends AbstractNode { public ModuleNode(Resource resource) { super(resource); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModuleTypeNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModuleTypeNode.java index fdbad703..68738690 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModuleTypeNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModuleTypeNode.java @@ -1,11 +1,95 @@ package org.simantics.sysdyn.ui.browser.nodes; -import org.simantics.browsing.ui.common.node.IDeletable; +import java.util.Collection; + +import org.simantics.browsing.ui.common.node.DeleteException; +import org.simantics.browsing.ui.common.node.IDeletableNode; +import org.simantics.browsing.ui.common.node.IModifiableNode; +import org.simantics.browsing.ui.content.Labeler.Modifier; +import org.simantics.browsing.ui.graph.impl.LabelModifier; +import org.simantics.db.Builtins; +import org.simantics.db.ReadGraph; import org.simantics.db.Resource; +import org.simantics.db.WriteGraph; +import org.simantics.db.common.request.ObjectsWithType; +import org.simantics.db.common.request.WriteRequest; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.exception.ManyObjectsForFunctionalRelationException; +import org.simantics.db.exception.ServiceException; +import org.simantics.db.request.Read; +import org.simantics.modeling.ModelingResources; +import org.simantics.structural.stubs.StructuralResource2; +import org.simantics.ui.SimanticsUI; -public class ModuleTypeNode extends AbstractNode implements IDeletable { +public class ModuleTypeNode extends ModuleNode implements IDeletableNode, IModifiableNode { public ModuleTypeNode(Resource resource) { super(resource); } + + @Override + public Modifier getModifier(String columnId) { + Modifier modifier = null; + try { + modifier = SimanticsUI.getSession().syncRequest(new Read() { + + @Override + public Modifier perform(ReadGraph graph) throws ManyObjectsForFunctionalRelationException, ServiceException { + ModelingResources mr = ModelingResources.getInstance(graph); + Builtins b = graph.getBuiltins(); + Resource type = graph.getPossibleObject(resource, mr.SymbolToComponentType); + + LabelModifier modifier = new LabelModifier(SimanticsUI.getSession(), type, b.HasName) { + @Override + public String isValid(String label) { + if (label.isEmpty()) + return "Empty name not allowed"; + return null; + } + }; + + + return modifier; + } + }); + } catch (DatabaseException e) { + e.printStackTrace(); + } + + return modifier; + } + + @Override + public void delete() throws DeleteException { + try { + SimanticsUI.getSession().syncRequest(new WriteRequest() { + + @Override + public void perform(WriteGraph graph) throws DatabaseException { + Builtins b = graph.getBuiltins(); + StructuralResource2 st = StructuralResource2.getInstance(graph); + ModelingResources mr = ModelingResources.getInstance(graph); + + Resource type = graph.getPossibleObject(resource, mr.SymbolToComponentType); + Resource model = graph.getSingleObject(type, b.PartOf); + Resource modelConfiguration = graph.getSingleObject(model, b.HasConfiguration); + if (!graph.syncRequest(new ObjectsWithType(modelConfiguration, b.ConsistsOf, type)).isEmpty()) { + System.out.println("The module is used at the model configuration"); + return; + } + Collection moduleTypes = graph.syncRequest(new ObjectsWithType(model, b.ConsistsOf, st.ComponentType)); + for(Resource r : moduleTypes) { + Resource configuration = graph.getSingleObject(r, st.IsDefinedBy); + if(!graph.syncRequest(new ObjectsWithType(configuration, b.ConsistsOf, type)).isEmpty()) { + System.out.println("The module is used at another module: " + graph.getRelatedValue(r, b.HasName)); + return; + } + } + graph.deny(model, b.ConsistsOf, type); + } + }); + } catch (DatabaseException e) { + e.printStackTrace(); + } + } } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/SimulationResultNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/SimulationResultNode.java index ef28f83e..79dd7e69 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/SimulationResultNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/SimulationResultNode.java @@ -1,13 +1,23 @@ package org.simantics.sysdyn.ui.browser.nodes; -import org.simantics.browsing.ui.common.node.IDeletable; +import java.io.File; + +import org.simantics.browsing.ui.common.node.DeleteException; +import org.simantics.browsing.ui.common.node.IDeletableNode; import org.simantics.browsing.ui.common.node.IModifiableNode; import org.simantics.browsing.ui.content.Labeler.Modifier; import org.simantics.browsing.ui.graph.impl.LabelModifier; +import org.simantics.db.Builtins; import org.simantics.db.Resource; +import org.simantics.db.WriteGraph; +import org.simantics.db.common.request.WriteRequest; +import org.simantics.db.exception.CancelTransactionException; +import org.simantics.db.exception.DatabaseException; +import org.simantics.sysdyn.SysdynResource; import org.simantics.ui.SimanticsUI; +import org.simantics.utils.ui.ExceptionUtils; -public class SimulationResultNode extends AbstractNode implements IDeletable, IModifiableNode { +public class SimulationResultNode extends AbstractNode implements IDeletableNode, IModifiableNode { public SimulationResultNode(Resource resource) { super(resource); @@ -26,4 +36,41 @@ public class SimulationResultNode extends AbstractNode implements IDeletable, I }; return modifier; } + + + @Override + public void delete() throws DeleteException { + try { + SimanticsUI.getSession().syncRequest(new WriteRequest() { + @Override + public void perform(WriteGraph graph) throws DatabaseException, CancelTransactionException { + unlinkResult(graph, resource); + } + }); + } catch (DatabaseException e) { + ExceptionUtils.logAndShowError(e); + } + + } + + + public static void unlinkResult(WriteGraph graph, Resource result) throws DatabaseException { + Builtins b = graph.getBuiltins(); + deleteResultFiles(graph, result); + graph.deny(result, b.PartOf); + graph.deny(result, graph.getInverse(SysdynResource.getInstance(graph).HasResult)); + + } + + public static void deleteResultFiles(WriteGraph graph, Resource result) throws DatabaseException { + String path; + path = graph.getPossibleRelatedValue(result, SysdynResource.getInstance(graph).HasResultFile); + if(path != null) { + File file = new File(path); + file.delete(); + File parent = file.getParentFile(); + if(parent.listFiles().length == 0) + parent.delete(); + } + } } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/OpenDiagramFromConfigurationAdapter.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/OpenDiagramFromConfigurationAdapter.java index c2fcda8e..2c4c6e09 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/OpenDiagramFromConfigurationAdapter.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/OpenDiagramFromConfigurationAdapter.java @@ -1,5 +1,15 @@ package org.simantics.sysdyn.ui.editor; +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.request.Read; +import org.simantics.modeling.ComponentUtils; +import org.simantics.modeling.ModelingResources; +import org.simantics.structural.stubs.StructuralResource2; +import org.simantics.sysdyn.SysdynResource; +import org.simantics.ui.SimanticsUI; + public class OpenDiagramFromConfigurationAdapter extends org.simantics.modeling.ui.diagramEditor.OpenDiagramFromConfigurationAdapter { @@ -14,4 +24,44 @@ public class OpenDiagramFromConfigurationAdapter extends org.simantics.modeling. return EDITOR_ID; } + @Override + public boolean canHandle(ReadGraph g, Resource r) throws DatabaseException { + if(g.isInheritedFrom(r, SysdynResource.getInstance(g).ModuleSymbol)) { + ModelingResources mr = ModelingResources.getInstance(g); + StructuralResource2 sr2 = StructuralResource2.getInstance(g); + Resource componentType = g.getSingleObject(r, mr.SymbolToComponentType); + r = g.getSingleObject(componentType, sr2.IsDefinedBy); + } + return ComponentUtils.compositeHasDiagram(g, r) /*|| ComponentUtils.componentHasDiagram(g, r)*/; + } + + @Override + public void openEditor(final Resource r) throws Exception { + Resource configuration = null; + try { + configuration = SimanticsUI.getSession().syncRequest(new Read() { + + @Override + public Resource perform(ReadGraph graph) throws DatabaseException { + if(graph.isInheritedFrom(r, SysdynResource.getInstance(graph).ModuleSymbol)) { + ModelingResources mr = ModelingResources.getInstance(graph); + StructuralResource2 sr2 = StructuralResource2.getInstance(graph); + Resource componentType = graph.getSingleObject(r, mr.SymbolToComponentType); + Resource configuration = graph.getSingleObject(componentType, sr2.IsDefinedBy); + return configuration; + } + else { + return null; + } + } + }); + } catch (DatabaseException e1) { + e1.printStackTrace(); + } + if (configuration != null) + super.openEditor(configuration); + else + super.openEditor(r); + } + } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/ModuleFactory.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/ModuleFactory.java index c542c1a2..1008a77c 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/ModuleFactory.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/ModuleFactory.java @@ -50,7 +50,7 @@ public class ModuleFactory extends SysdynElementFactory { new StaticObjectAdapter(elementType), new StaticSymbolImpl(DEFAULT_IMAGE), StaticSymbolImageInitializer.INSTANCE, - new HoverTextElementHandler(0, 0, Alignment.LEADING, 1f , 7, 7, false), + new HoverTextElementHandler(0, 0, Alignment.LEADING, 1f , 7, 7, true), BoundsOutline.INSTANCE, new WholeElementTerminals(terminals) ).setId(ModuleFactory.class.getSimpleName()); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/UnlinkNodeHandler2.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/UnlinkNodeHandler2.java new file mode 100644 index 00000000..8598b9b5 --- /dev/null +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/UnlinkNodeHandler2.java @@ -0,0 +1,33 @@ +package org.simantics.sysdyn.ui.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.handlers.HandlerUtil; +import org.simantics.db.Resource; +import org.simantics.modeling.ui.modelBrowser.handlers.DeleteNodeHandler; +import org.simantics.ui.utils.ResourceAdaptionUtils; + +public class UnlinkNodeHandler2 extends DeleteNodeHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + Shell shell = HandlerUtil.getActiveShellChecked(event); + ISelection sel = HandlerUtil.getCurrentSelection(event); + Resource[] resources = ResourceAdaptionUtils.toResources(sel); + if (resources.length == 0) + return null; + + MessageDialog dialog = new MessageDialog(shell, "Remove Item", null, "Are you sure?", 0, + new String[] { "OK", "Cancel" }, 0); + dialog.create(); + if (dialog.open() == 0) { + //TODO: deletenodehandler for all resources + super.execute(event); + } + return null; + } + +} diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynPerspectiveFactory.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynPerspectiveFactory.java index 0d86050e..29f047ba 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynPerspectiveFactory.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynPerspectiveFactory.java @@ -11,30 +11,14 @@ *******************************************************************************/ package org.simantics.sysdyn.ui.project; -import org.eclipse.ui.IFolderLayout; import org.eclipse.ui.IPageLayout; import org.eclipse.ui.IPerspectiveFactory; -import org.eclipse.ui.console.IConsoleConstants; public class SysdynPerspectiveFactory implements IPerspectiveFactory { @Override public void createInitialLayout(IPageLayout layout) { layout.setEditorAreaVisible(true); - String editorArea = layout.getEditorArea(); - - IFolderLayout bottom1 = layout.createFolder("bottom1", IPageLayout.BOTTOM, 0.75f, editorArea); - IFolderLayout bottom2 = layout.createFolder("bottom2", IPageLayout.LEFT, 0.4f, "bottom1"); - bottom1.addView("org.simantics.browsing.ui.graph.propertyView"); - bottom1.addView(IConsoleConstants.ID_CONSOLE_VIEW); - bottom2.addView("org.simantics.sysdyn.ui.trend.view"); - bottom2.addView("org.simantics.sysdyn.ui.dependencies.view"); - - IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT, 0.25f, editorArea); - left.addView("org.simantics.sysdyn.ui.browser"); - - IFolderLayout right = layout.createFolder("right", IPageLayout.RIGHT, 0.7f, editorArea); - right.addView("org.simantics.diagram.symbollibrary"); } }