Remove usage of deprecated SimanticsUI-methods 55/2055/1
authorjsimomaa <jani.simomaa@gmail.com>
Thu, 30 Aug 2018 08:11:29 +0000 (11:11 +0300)
committerjsimomaa <jani.simomaa@gmail.com>
Thu, 30 Aug 2018 08:11:29 +0000 (11:11 +0300)
gitlab #95

Change-Id: Ia5a4dfc13d4a9ecce0b3182ee1b38f63fb67731d

157 files changed:
bundles/org.simantics.annotation.ui/src/org/simantics/annotation/ui/wizard/AnnotationTypeExportWizard.java
bundles/org.simantics.annotation.ui/src/org/simantics/annotation/ui/wizard/AnnotationTypeImportWizard.java
bundles/org.simantics.browsing.ui.platform/src/org/simantics/browsing/ui/platform/PropertyPageView.java
bundles/org.simantics.browsing.ui.platform/src/org/simantics/browsing/ui/platform/VariablesPageView.java
bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/DefaultMouseListener.java
bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/GraphExplorerComposite.java
bundles/org.simantics.charts/src/org/simantics/charts/editor/ChartEditorAdapter.java
bundles/org.simantics.charts/src/org/simantics/charts/editor/PropertiesAction.java
bundles/org.simantics.charts/src/org/simantics/charts/ui/CSVExportWizard.java
bundles/org.simantics.charts/src/org/simantics/charts/ui/PropertiesHandler.java
bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionImplSocket.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/GraphDebuggerView.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/VariableDebuggerView.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/graph/GraphicalDebuggerView.java
bundles/org.simantics.diagram/src/org/simantics/diagram/elements/ElementPropertyTester.java
bundles/org.simantics.diagram/src/org/simantics/diagram/elements/ElementTransforms.java
bundles/org.simantics.diagram/src/org/simantics/diagram/flag/FlagPropertyTester.java
bundles/org.simantics.diagram/src/org/simantics/diagram/function/PredefinedVariables.java
bundles/org.simantics.diagram/src/org/simantics/diagram/handler/ConnectionCommandHandler.java
bundles/org.simantics.diagram/src/org/simantics/diagram/handler/SimpleElementTransformHandler.java
bundles/org.simantics.diagram/src/org/simantics/diagram/symbolcontribution/ElementSymbolItem.java
bundles/org.simantics.diagram/src/org/simantics/diagram/symbollibrary/ui/SymbolLibraryComposite.java
bundles/org.simantics.diagram/src/org/simantics/diagram/symbollibrary/ui/SymbolPageView.java
bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/ge/RemoveSourceAction.java
bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/ge/ReplaceWithLatestAction.java
bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/ge/ShowDocumentAction.java
bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/ge/ShowDocumentWithAction.java
bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/ge/SourceLinkExplorerComposite.java
bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/ge/SourceObjectDropAction.java
bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/report/evaluator/PredefinedVariables.java
bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/views/SourceView.java
bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/wizard/ReportSelectionPage.java
bundles/org.simantics.document.ui/src/org/simantics/document/ui/actions/ExportDocumentFile.java
bundles/org.simantics.document.ui/src/org/simantics/document/ui/actions/FolderDropAction.java
bundles/org.simantics.document.ui/src/org/simantics/document/ui/actions/NewDocumentFolder.java
bundles/org.simantics.document.ui/src/org/simantics/document/ui/actions/NewFileDocument.java
bundles/org.simantics.document.ui/src/org/simantics/document/ui/graphfile/UrlEditorAdapter.java
bundles/org.simantics.equation/src/org/simantics/equation/Activator.java
bundles/org.simantics.export.ui/src/org/simantics/export/ui/ExportCoreWizard.java
bundles/org.simantics.image.ui/src/org/simantics/image/ui/ImportImagesActionFactory.java
bundles/org.simantics.image.ui/src/org/simantics/image/ui/modelBrowser/handlers/ImportImageHandler.java
bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/All.java
bundles/org.simantics.message.ui/src/org/simantics/message/ui/scheme/ResourceReferenceSerializer.java
bundles/org.simantics.message.ui/src/org/simantics/message/ui/scheme/ResourceSchemeHandler.java
bundles/org.simantics.message.ui/src/org/simantics/message/ui/test/TestResourceStatusHandler.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/actions/ChangePageOrientation.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/actions/MoveDown.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/actions/MoveUp.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/actions/NewDrawingTemplate.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/actions/NewFlagTable.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/actions/NewFlagTableColumn.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/actions/NewFlagTableColumnData.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/actions/NewFlagTableColumnHeader.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/actions/NewFlagTypeVisual.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/actions/NewFlagTypeVisualFilter.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/actions/NewMonitor.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/actions/NewSVGImage.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/actions/NewText.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/actions/SetBorderColor.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/diagram/dialogs/BindToIOTableDialog.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/wizard/DrawingTemplateExportWizard.java
bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/wizard/DrawingTemplateImportWizard.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/CreateShapeHandler.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/ImportSVG.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/ModelingProjectOperationsContribution.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/NewComponentTypeAction.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/NewDocument.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/NewLibrary.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/NewSubscription.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/e4/ImportSVGPNG.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/style/EditStyle.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagram/PageSettingsDialog.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/DiagramViewer.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/OpenDiagramAdapter.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/OpenDiagramFromConfigurationAdapter.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/OpenDiagramFromSymbolAdapter.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/OpenSheetAdapter.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/SheetViewer.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/TerminalInformer.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/WikiDiagramViewer.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/e4/DiagramViewer.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/handlers/AlignHorizontalHandler.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/handlers/AlignVerticalHandler.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/handlers/DisconnectFlagHandler.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/tools/AlignTools.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/documents/OpenPlainTextDocumentAdapter.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/ModelEvaluators.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/handlers/CreateConnectionPoint.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/handlers/CreateIssue.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/handlers/DeleteNodeHandler.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/handlers/NewSpreadsheetHandler.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/handlers/ToggleExternalFlag.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/model/Node.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser2/contributions/SetSubscriptionEnabledContribution.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser2/model/ChartNode.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser2/model/StateNode.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser2/model/SubscriptionItemNode.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser2/model/SubscriptionNode.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser2/model/TrendItemNode.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/pdf/PDFDiagramExportWizard.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/property/ComponentTypePropertyTester.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/property/RestoreDefaultValueHandler.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/sg/DiagramSceneGraphProvider.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/sharedontology/wizard/ModelExportWizard.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/sharedontology/wizard/ModelImportWizard.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/sharedontology/wizard/SharedOntologyExportWizard.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/sharedontology/wizard/SharedOntologyImportWizard.java
bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/TypicalUtil.java
bundles/org.simantics.simulation.ui/src/org/simantics/simulation/ui/handlers/ActivateExperimentAction.java
bundles/org.simantics.simulation.ui/src/org/simantics/simulation/ui/handlers/ActivateExperimentHandler.java
bundles/org.simantics.simulation.ui/src/org/simantics/simulation/ui/handlers/Dispose.java
bundles/org.simantics.simulation.ui/src/org/simantics/simulation/ui/handlers/Pause.java
bundles/org.simantics.simulation.ui/src/org/simantics/simulation/ui/handlers/Reload.java
bundles/org.simantics.simulation.ui/src/org/simantics/simulation/ui/handlers/SaveState.java
bundles/org.simantics.simulation.ui/src/org/simantics/simulation/ui/handlers/TimerContribution.java
bundles/org.simantics.simulation.ui/src/org/simantics/simulation/ui/handlers/e4/Reload.java
bundles/org.simantics.simulation.ui/src/org/simantics/simulation/ui/handlers/e4/TimerContribution.java
bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/GraphBackend.java
bundles/org.simantics.structural.ui/src/org/simantics/structural/ui/compositeViewer/CompositeViewer.java
bundles/org.simantics.structural.ui/src/org/simantics/structural/ui/modelBrowser/ModelBrowser.java
bundles/org.simantics.structural.ui/src/org/simantics/structural/ui/modelBrowser/ModelBrowser2.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/HistoryView.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/RedoView.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/StagingView.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/SynchroniseView.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/UndoView.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/CommitAllHandler.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/DebugHandler.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/DumpToSelectedRevisionHandler.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/GetOutgoingHandler.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/RevertToSelectedRevisionHandler.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/RevertToSelectedRevisionHandlerStopOnError.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/StageEditHandler.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/StageInitHandler.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/StagingOutHandler.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/SynchroniseAllHandler.java
bundles/org.simantics.ui/src/org/simantics/ui/SimanticsUI.java
bundles/org.simantics.ui/src/org/simantics/ui/contribution/DynamicMenuContribution.java
bundles/org.simantics.ui/src/org/simantics/ui/contribution/OperationsMenuContribution.java
bundles/org.simantics.ui/src/org/simantics/ui/dnd/ResourceReferenceTransfer.java
bundles/org.simantics.ui/src/org/simantics/ui/internal/SessionUtils.java
bundles/org.simantics.ui/src/org/simantics/ui/tester/UndoPropertyTester.java
bundles/org.simantics.ui/src/org/simantics/ui/workbench/GraphAccessViewPart.java
bundles/org.simantics.ui/src/org/simantics/ui/workbench/ResourceEditorPart.java
bundles/org.simantics.ui/src/org/simantics/ui/workbench/ResourceEditorSupport.java
bundles/org.simantics.ui/src/org/simantics/ui/workbench/ResourceFormEditor.java
bundles/org.simantics.ui/src/org/simantics/ui/workbench/SharedHeaderResourceFormEditor.java
bundles/org.simantics.ui/src/org/simantics/ui/workbench/ToolTipRequest.java
bundles/org.simantics.ui/src/org/simantics/ui/workbench/action/PerformDefaultAction.java
bundles/org.simantics.ui/src/org/simantics/ui/workbench/dialogs/ResourceSelectionDialog.java
bundles/org.simantics.ui/src/org/simantics/ui/workbench/dialogs/ResourceSelectionDialog2.java
bundles/org.simantics.ui/src/org/simantics/ui/workbench/dialogs/ResourceSelectionDialog3.java
bundles/org.simantics.ui/src/org/simantics/ui/workbench/editor/AbstractResourceEditorAdapter.java
bundles/org.simantics.ui/src/org/simantics/ui/workbench/handler/e4/UndoRedoTester.java
bundles/org.simantics.workbench/src/org/simantics/workbench/internal/ApplicationUtil.java
bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchAdvisor.java
bundles/org.simantics.workbench/src/org/simantics/workbench/internal/contributions/GraphRequestStatusContribution.java

index 95b416aef70191bc637f2df1535836db1ac367af..72318b3f40ed36c34c06f59faceb102c08babc15 100644 (file)
@@ -26,12 +26,12 @@ import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.ui.IExportWizard;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.simantics.Simantics;
 import org.simantics.annotation.ui.Activator;
 import org.simantics.db.management.ISessionContext;
 import org.simantics.modeling.ui.utils.NoProjectPage;
 import org.simantics.project.IProject;
 import org.simantics.project.ProjectKeys;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ErrorLogger;
 import org.simantics.utils.ui.ExceptionUtils;
 
@@ -78,7 +78,7 @@ public class AnnotationTypeExportWizard extends Wizard implements IExportWizard
     public void init(IWorkbench workbench, IStructuredSelection selection) {
         readPreferences();
 
-        ISessionContext ctx = SimanticsUI.getSessionContext();
+        ISessionContext ctx = Simantics.getSessionContext();
         if (ctx == null)
             return;
         IProject project = ctx.getHint(ProjectKeys.KEY_PROJECT);
index e51ab092c543b455e7446caf2cd8551153925eb9..ce3d8c1daabd991cd07d62c4b4eda52742441a6e 100644 (file)
@@ -28,6 +28,7 @@ import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.ui.IImportWizard;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.simantics.Simantics;
 import org.simantics.annotation.ui.Activator;
 import org.simantics.databoard.binding.Binding;
 import org.simantics.databoard.container.DataContainer;
@@ -35,7 +36,6 @@ import org.simantics.databoard.container.DataContainers;
 import org.simantics.databoard.container.DataFormatException;
 import org.simantics.databoard.container.FormatHandler;
 import org.simantics.databoard.serialization.SerializationException;
-import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
 import org.simantics.db.exception.DatabaseException;
@@ -46,7 +46,6 @@ import org.simantics.graph.representation.TransferableGraph1;
 import org.simantics.modeling.ui.utils.NoProjectPage;
 import org.simantics.project.IProject;
 import org.simantics.project.ProjectKeys;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.utils.ResourceAdaptionUtils;
 import org.simantics.utils.ui.ErrorLogger;
 import org.simantics.utils.ui.ExceptionUtils;
@@ -66,7 +65,7 @@ public class AnnotationTypeImportWizard extends Wizard implements IImportWizard
         String recentPathsPref = store.getString(Preferences.RECENT_ANNOTATION_TYPE_IMPORT_LOCATIONS);
         Deque<String> recentImportPaths = Preferences.decodePaths(recentPathsPref);
 
-        ISessionContext ctx = SimanticsUI.getSessionContext();
+        ISessionContext ctx = Simantics.getSessionContext();
         if (ctx == null)
             return false;
         IProject project = ctx.getHint(ProjectKeys.KEY_PROJECT);
index 4376ae370b50a3d2fb4a97c205a81d1d6c00c62d..0d4fc055b6ed2e7a8846052faba1e55ff3d3c310 100644 (file)
@@ -44,9 +44,9 @@ import org.eclipse.ui.part.IContributedContentsView;
 import org.eclipse.ui.part.IPage;
 import org.eclipse.ui.part.IPageBookViewPage;
 import org.eclipse.ui.part.PageBook;
+import org.simantics.Simantics;
 import org.simantics.db.management.ISessionContextProvider;
 import org.simantics.selectionview.PropertyPage;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.IPropertyPage;
 import org.simantics.ui.workbench.ResourceInput;
 import org.simantics.utils.threads.SWTThread;
@@ -213,7 +213,7 @@ public class PropertyPageView extends PageBookView implements ISelectionListener
         // desirable.
 //        site.setSelectionProvider(null);
 
-        contextProvider = SimanticsUI.getSessionContextProvider();
+        contextProvider = Simantics.getSessionContextProvider();
 
         if (!bootstrapOnly) {
             site.getPage().addSelectionListener(immediateSelectionListener);
index cfa988b88c22300d918229d8e46f6da32e4d1ede..d0e904e3a34a652163fc44f0e456cd1441224b9d 100644 (file)
@@ -32,10 +32,10 @@ import org.eclipse.ui.part.IContributedContentsView;
 import org.eclipse.ui.part.IPage;
 import org.eclipse.ui.part.PageBook;
 import org.eclipse.ui.part.PageBookView;
+import org.simantics.Simantics;
 import org.simantics.browsing.ui.swt.IVariablesPage;
 import org.simantics.db.management.ISessionContextProvider;
 import org.simantics.selectionview.PropertyPage;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.IPropertyPage;
 import org.simantics.ui.workbench.ResourceInput;
 import org.simantics.utils.ui.BundleUtils;
@@ -188,7 +188,7 @@ public class VariablesPageView extends PageBookView implements ISelectionListene
         // desirable.
         site.setSelectionProvider(null);
 
-        contextProvider = SimanticsUI.getSessionContextProvider();
+        contextProvider = Simantics.getSessionContextProvider();
 
         if (!bootstrapOnly) {
             site.getPage().addSelectionListener(immediateSelectionListener);
index 58d9703ec24d533f1c7dad3fb16b1a18566945c8..6731b396aec9528ba6e4da52eb905ccd26af2398 100644 (file)
@@ -13,10 +13,10 @@ package org.simantics.browsing.ui.swt;
 
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.swt.widgets.Control;
+import org.simantics.Simantics;
 import org.simantics.browsing.ui.GraphExplorer;
 import org.simantics.browsing.ui.common.node.IDoubleClickableNode;
 import org.simantics.db.common.procedure.adapter.ProcedureAdapter;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.action.ChooseActionRequest;
 import org.simantics.utils.ui.AdaptionUtils;
 import org.simantics.utils.ui.ErrorLogger;
@@ -55,7 +55,7 @@ public class DefaultMouseListener extends GraphExplorerMouseAdapter {
 
         // Try the doubleClick-extensions
         final String perspectiveId = WorkbenchUtils.getCurrentPerspectiveId();
-        SimanticsUI.getSession().asyncRequest(new ChooseActionRequest(tree.getShell(), ge, selection, perspectiveId), new ProcedureAdapter<Object>() {
+        Simantics.getSession().asyncRequest(new ChooseActionRequest(tree.getShell(), ge, selection, perspectiveId), new ProcedureAdapter<Object>() {
             @Override
             public void exception(Throwable t) {
                 ErrorLogger.defaultLogError(ChooseActionRequest.class.getName() + " failed, see exception for details.", t);
index 0ee36b3659507240d8ae817dc1ea9ca14a88acfe..42ee2bdf812fe788e20b040139ac9ae9df4fdce6 100644 (file)
@@ -50,6 +50,7 @@ import org.eclipse.swt.widgets.TreeItem;
 import org.eclipse.ui.ISelectionListener;
 import org.eclipse.ui.IWorkbenchSite;
 import org.eclipse.ui.contexts.IContextService;
+import org.simantics.Simantics;
 import org.simantics.browsing.ui.BuiltinKeys;
 import org.simantics.browsing.ui.Column;
 import org.simantics.browsing.ui.ExplorerState;
@@ -409,7 +410,7 @@ public class GraphExplorerComposite extends Composite implements Widget, IAdapta
         if(site != null)
             return SimanticsUI.getSessionContextProvider(site.getWorkbenchWindow());
         else
-            return SimanticsUI.getSessionContextProvider();
+            return Simantics.getSessionContextProvider();
     }
 
     public GraphExplorer getExplorer() {
index 45c96b66446ba6943300af071a98f50bc8ba336d..7e9e3eaf8c8c6f0a1da5bf0d32679ae05afdb03d 100644 (file)
 package org.simantics.charts.editor;
 
 import org.eclipse.jface.resource.ImageDescriptor;
+import org.simantics.Simantics;
 import org.simantics.charts.Activator;
 import org.simantics.charts.ontology.ChartResource;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.common.request.Queries;
 import org.simantics.db.exception.DatabaseException;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.utils.ResourceAdaptionUtils;
 import org.simantics.ui.workbench.ResourceEditorInput;
 import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter;
@@ -49,7 +49,7 @@ public class ChartEditorAdapter extends AbstractResourceEditorAdapter {
 
     @Override
     public void openEditor(Resource input) throws Exception {
-        if (!SimanticsUI.getSession().syncRequest(Queries.isInstanceOf(input, ChartResource.URIs.TimeSeriesChart)))
+        if (!Simantics.getSession().syncRequest(Queries.isInstanceOf(input, ChartResource.URIs.TimeSeriesChart)))
             return;
         //E4WorkbenchUtils.openEditor(TimeSeriesEditor.ID, TimeSeriesEditor.CONTRIBUTION_URI, null, input);
         openEditorWithId(TimeSeriesEditor.ID, new ResourceEditorInput(TimeSeriesEditor.ID, input));
index 2ec342f369748e635ac5e83dca551f395d87ca37..ec63767298574b03167214534ec66be9b85b5d8a 100644 (file)
@@ -3,13 +3,13 @@ package org.simantics.charts.editor;
 import org.eclipse.jface.action.Action;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
+import org.simantics.Simantics;
 import org.simantics.charts.ontology.ChartResource;
 import org.simantics.charts.ui.ChartDoubleClickHandler;
 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.ui.SimanticsUI;
 
 /**
  * @author Tuukka Lehtonen
@@ -28,7 +28,7 @@ public class PropertiesAction extends Action {
     @Override
     public void run() {
         final Shell shell = control.getShell();
-        SimanticsUI.getSession().asyncRequest(new Read<Object>() {
+        Simantics.getSession().asyncRequest(new Read<Object>() {
                        @Override
                        public Object perform(ReadGraph graph) throws DatabaseException {
                                ChartResource CHART = ChartResource.getInstance(graph);
index f23db80b2c3c637f36ce26a736b32357a3d76b27..4632d2696ad510e6ac053013ad537c9a925eef8e 100644 (file)
@@ -26,12 +26,12 @@ import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.ui.IExportWizard;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.simantics.Simantics;
 import org.simantics.db.management.ISessionContext;
 import org.simantics.modeling.ui.Activator;
 import org.simantics.modeling.ui.utils.NoProjectPage;
 import org.simantics.project.IProject;
 import org.simantics.project.ProjectKeys;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ErrorLogger;
 import org.simantics.utils.ui.ExceptionUtils;
 
@@ -76,7 +76,7 @@ public class CSVExportWizard extends Wizard implements IExportWizard {
     public void init(IWorkbench workbench, IStructuredSelection selection) {
         readPreferences();
 
-        ISessionContext ctx = SimanticsUI.getSessionContext();
+        ISessionContext ctx = Simantics.getSessionContext();
         if (ctx == null)
             return;
         IProject project = ctx.getHint(ProjectKeys.KEY_PROJECT);
index 327e5ba45992de2ceecdc6641c01a7638f9d58e1..af053dc5782d397f123520929592c2de537c9cd7 100644 (file)
@@ -19,6 +19,7 @@ import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.Simantics;
 import org.simantics.charts.ontology.ChartResource;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
@@ -26,7 +27,6 @@ import org.simantics.db.Session;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.SelectionHints;
 import org.simantics.db.request.Read;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ISelectionUtils;
 
 public class PropertiesHandler extends AbstractHandler {
@@ -36,7 +36,7 @@ public class PropertiesHandler extends AbstractHandler {
         ISelection selection = HandlerUtil.getCurrentSelection(event);
         List<Resource> list = ISelectionUtils.getPossibleKeys(selection, SelectionHints.KEY_MAIN, Resource.class);
         final Shell shell = HandlerUtil.getActiveShell(event);
-        Session session = SimanticsUI.getSession();
+        Session session = Simantics.getSession();
         for ( final Resource item : list ) {           
             session.asyncRequest(new Read<Object>() {
                        @Override
index a08011fed1172615a2f937cb9de08bc099f3f1de..62b7e382522e78cf726c589507824ec7df95242d 100644 (file)
@@ -3179,9 +3179,11 @@ public abstract class SessionImplSocket implements Session, WriteRequestSchedule
         });
 
         Throwable t = exception.get();
-        if(t != null) {
-            if(t instanceof DatabaseException) throw (DatabaseException)t;
-            else throw new DatabaseException("Unexpected exception in ReadGraph.syncRequest(Read)", t);
+        if (t != null) {
+            if (t instanceof DatabaseException)
+                throw (DatabaseException) t;
+            else
+                throw new DatabaseException("Unexpected exception in ReadGraph.syncRequest(Read)", t);
         }
 
         return result;
@@ -3387,28 +3389,6 @@ public abstract class SessionImplSocket implements Session, WriteRequestSchedule
         asyncRequest(request, (Procedure<T>)procedure);
     }
 
-
-
-    void check(Throwable t) throws DatabaseException {
-        if(t != null) {
-            if(t instanceof DatabaseException) throw (DatabaseException)t;
-            else throw new DatabaseException("Unexpected exception", t);
-        }
-    }
-
-    void check(DataContainer<Throwable> container) throws DatabaseException {
-        Throwable t = container.get();
-        if(t != null) {
-            if(t instanceof DatabaseException) throw (DatabaseException)t;
-            else throw new DatabaseException("Unexpected exception", t);
-        }
-    }
-
-
-
-
-
-
     boolean sameProvider(Write request) {
         if(writeState.getGraph().provider != null) {
             return writeState.getGraph().provider.equals(request.getProvider());
@@ -3425,9 +3405,11 @@ public abstract class SessionImplSocket implements Session, WriteRequestSchedule
 
 
     public static final ThreadGroup SessionThreadGroup = new ThreadGroup("Session Thread Group");
+
     private void assertNotSession() throws DatabaseException {
         Thread current = Thread.currentThread();
-        if(sessionThreads.contains(current)) throw new DatabaseException("Caller is already inside a transaction.");
+        if (sessionThreads.contains(current))
+            throw new ServiceException("Caller is already inside a transaction.");
     }
 
     void assertAlive() {
index 1840d2e62aa7f2377bcc143ea053cdb97562b509..7d9d67b2ad3161506e584e139d6cf75afe79e266 100644 (file)
@@ -60,7 +60,7 @@ public class GraphDebuggerView extends ViewPart {
     @Override
     public void createPartControl(Composite parent) {
 //      System.out.println("koss: " + getViewSite().getSecondaryId());
-        session = SimanticsUI.getSession();
+        session = Simantics.getSession();
 
         // Initialize input
         String sid = getViewSite().getSecondaryId();
index 56736670115fa7956b78e69b01a02dc83e8240f8..6edd79ad299d87a10bfaf9719f06f77ba87e72ee 100644 (file)
@@ -20,6 +20,7 @@ import org.eclipse.ui.IActionBars;
 import org.eclipse.ui.ISharedImages;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.part.ViewPart;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
 import org.simantics.db.common.uri.ResourceToPossibleURI;
@@ -50,7 +51,7 @@ public class VariableDebuggerView extends ViewPart {
     @Override
     public void createPartControl(Composite parent) {
 
-        session = SimanticsUI.getSession();
+        session = Simantics.getSession();
 
         // Initialize input
         String sid = getViewSite().getSecondaryId();
index ca2089a39ddc2efee90cd6767bb994c814660ab2..1c17001f012e6ff26f6b6901b0fce70cd492f43c 100644 (file)
@@ -20,6 +20,7 @@ import org.eclipse.ui.IActionBars;
 import org.eclipse.ui.ISharedImages;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.part.ViewPart;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
 import org.simantics.db.exception.DatabaseException;
@@ -52,7 +53,7 @@ public class GraphicalDebuggerView extends ViewPart {
     @Override
     public void createPartControl(Composite parent) {
 //      System.out.println("koss: " + getViewSite().getSecondaryId());
-        session = SimanticsUI.getSession();
+        session = Simantics.getSession();
 
         // Initialize input
         String sid = getViewSite().getSecondaryId();
index 4e4cea2c0d4ee6fd8681d0ec8a8b28999ecd0b4c..0db03632089eb7ab8e579d843509212a894248cc 100644 (file)
@@ -13,6 +13,7 @@ package org.simantics.diagram.elements;
 
 import org.eclipse.core.expressions.PropertyTester;
 import org.simantics.DatabaseJob;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
@@ -42,7 +43,7 @@ public class ElementPropertyTester extends PropertyTester {
         if (resource == null)
             return false;
 
-        Session session = SimanticsUI.peekSession();
+        Session session = Simantics.peekSession();
         if (session == null)
             return false;
 
index 51d37b99ac844a1ab9ec1f05b0b6adec08514f4c..916c274886e2b40a3474f32db1c4af838235fb4f 100644 (file)
@@ -9,6 +9,7 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.UndoContext;
@@ -34,7 +35,6 @@ import org.simantics.g2d.element.impl.Element;
 import org.simantics.g2d.utils.GeometryUtils;
 import org.simantics.scl.commands.Command;
 import org.simantics.scl.commands.Commands;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * Tools to align, rotate, and flip diagram elements.
@@ -66,7 +66,7 @@ public final class ElementTransforms {
         if (side == SIDE.HORIZ_BTW || side == SIDE.VERT_BTW )
             return;
 
-        SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+        Simantics.getSession().asyncRequest(new WriteRequest() {
 
             @Override
             public void perform(WriteGraph graph) throws DatabaseException {
@@ -182,7 +182,7 @@ public final class ElementTransforms {
         if (resources.length < 3)
             return;
 
-        SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+        Simantics.getSession().asyncRequest(new WriteRequest() {
 
             @Override
             public void perform(WriteGraph graph) throws DatabaseException {
@@ -412,7 +412,7 @@ public final class ElementTransforms {
      *        <code>false</code> to rotate 90 degrees counter-clockwise
      */
     public static void rotate(final Resource resources[], final boolean clockwise) {
-        SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+        Simantics.getSession().asyncRequest(new WriteRequest() {
             @Override
             public void perform(WriteGraph graph) throws DatabaseException {
                 graph.markUndoPoint();
@@ -496,7 +496,7 @@ public final class ElementTransforms {
      *        for y-axis
      */
     public static void flip(final Resource resources[], final boolean xAxis) {
-        SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+        Simantics.getSession().asyncRequest(new WriteRequest() {
             @Override
             public void perform(WriteGraph graph) throws DatabaseException {
                 graph.markUndoPoint();
index ade5987ab85398b502b76adf215808858131e657..84f8ecc80ea21329930a8a9f2088e9685bb8864d 100644 (file)
@@ -13,6 +13,7 @@ package org.simantics.diagram.flag;
 
 import org.eclipse.core.expressions.PropertyTester;
 import org.simantics.DatabaseJob;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
@@ -58,7 +59,7 @@ public class FlagPropertyTester extends PropertyTester {
         if (resource == null)
             return false;
 
-        Session session = SimanticsUI.peekSession();
+        Session session = Simantics.peekSession();
         if (session == null)
             return false;
 
index db47b99041daeff305e414149f8f57b21688f86f..fcd10ae9cdc7f4155052d8f2bcc92c1d20c27e67 100644 (file)
@@ -4,6 +4,7 @@ import java.util.Collection;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.simantics.Simantics;
 import org.simantics.annotation.ontology.AnnotationResource;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
@@ -17,7 +18,6 @@ import org.simantics.layer0.Layer0;
 import org.simantics.modeling.ModelingResources;
 import org.simantics.modeling.template2d.ontology.Template2dResource;
 import org.simantics.structural.stubs.StructuralResource2;
-import org.simantics.ui.SimanticsUI;
 
 public class PredefinedVariables {
        public static final String root = "root";
@@ -239,7 +239,7 @@ public class PredefinedVariables {
         if (id.equals(root))
                predefined = graph.getRootLibrary();
         else if (id.equals(project))
-               predefined = SimanticsUI.getProject().get();
+               predefined = Simantics.getProject().get();
         else if (id.equals(model))
                predefined = Variables.getPossibleModel(graph, selection);
         else if (id.equals(template)){
index ec2bc6a6f185e660107544f57cd439160d434e80..ad3d510def3568d9103af86e8446933cc13606d1 100644 (file)
@@ -133,7 +133,7 @@ public class ConnectionCommandHandler extends AbstractDiagramParticipant {
 
         // Rotate branch points.
         try {
-            SimanticsUI.getSession().syncRequest(new WriteRequest() {
+            Simantics.getSession().syncRequest(new WriteRequest() {
                 @Override
                 public void perform(WriteGraph graph) throws DatabaseException {
                     DiagramResource DIA = DiagramResource.getInstance(graph);
@@ -186,7 +186,7 @@ public class ConnectionCommandHandler extends AbstractDiagramParticipant {
         final AffineTransform splitPos = AffineTransform.getTranslateInstance(mousePos.getX(), mousePos.getY());
 
         try {
-            SimanticsUI.getSession().syncRequest(new WriteRequest() {
+            Simantics.getSession().syncRequest(new WriteRequest() {
                 @Override
                 public void perform(WriteGraph graph) throws DatabaseException {
                     DiagramResource DIA = DiagramResource.getInstance(graph);
index 6d55112c2847c9471408f778dc1e4a1670c128b4..6e720f4a7bd2ab01697efcbad5192afbe8ea1a99 100644 (file)
@@ -17,6 +17,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.exception.DatabaseException;
@@ -36,7 +37,6 @@ import org.simantics.g2d.participant.MouseUtil.MouseInfo;
 import org.simantics.scenegraph.g2d.events.EventHandlerReflection.EventHandler;
 import org.simantics.scenegraph.g2d.events.command.CommandEvent;
 import org.simantics.scenegraph.g2d.events.command.Commands;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ErrorLogger;
 
 /**
@@ -145,7 +145,7 @@ public class SimpleElementTransformHandler extends AbstractDiagramParticipant {
                 resources.add((Resource) o);
         }
         try {
-            return SimanticsUI.getSession().syncRequest(new Read<Resource[]>() {
+            return Simantics.getSession().syncRequest(new Read<Resource[]>() {
                 @Override
                 public Resource[] perform(ReadGraph graph) throws DatabaseException {
                     List<Resource> result = getSelection(graph, resources);
index 8a8a796f527234072b7f88db60f65143d8b72b54..9800fb720a05dda61a228b8c36ae708ceabd524e 100644 (file)
@@ -11,6 +11,7 @@
  *******************************************************************************/
 package org.simantics.diagram.symbolcontribution;
 
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.RequestProcessor;
 import org.simantics.db.Resource;
@@ -24,7 +25,6 @@ import org.simantics.diagram.symbollibrary.ISymbolItem;
 import org.simantics.diagram.synchronization.graph.BasicResources;
 import org.simantics.g2d.element.ElementClass;
 import org.simantics.g2d.element.handler.StaticSymbol;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.datastructures.cache.ProvisionException;
 import org.simantics.utils.datastructures.hints.IHintObservable;
 
@@ -65,7 +65,7 @@ public class ElementSymbolItem extends SymbolItem {
     @Override
     public ElementClass getElementClass(IHintObservable hints) {
         Resource item = adapt(Resource.class);
-        RequestProcessor sgrp = SimanticsUI.peekSession();
+        RequestProcessor sgrp = Simantics.peekSession();
         if (sgrp == null)
             throw new ProvisionException("No RequestProcessor available for querying an ElementClass for resource " + item);
         try {
index 4ec3258a7822554f228ccbf0ddd83af6b8dce909..af58be479ec1c7bf7ac4687d11ed478e26995155 100644 (file)
@@ -78,6 +78,7 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Widget;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.common.procedure.adapter.ListenerAdapter;
@@ -128,7 +129,6 @@ import org.simantics.scenegraph.g2d.events.MouseEvent;
 import org.simantics.scenegraph.g2d.events.MouseEvent.MouseDoubleClickedEvent;
 import org.simantics.scenegraph.g2d.events.MouseEvent.MouseDragBegin;
 import org.simantics.scl.runtime.tuple.Tuple2;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.dnd.LocalObjectTransfer;
 import org.simantics.ui.dnd.LocalObjectTransferable;
 import org.simantics.ui.dnd.MultiTransferable;
@@ -290,7 +290,7 @@ public class SymbolLibraryComposite extends Composite {
     public SymbolLibraryComposite(final Composite parent, int style, SymbolProviderFactory symbolProvider) {
         super(parent, style);
         init(parent, style);
-        SimanticsUI.getSession().asyncRequest(new CreateSymbolProvider(symbolProvider), new SymbolProviderListener());
+        Simantics.getSession().asyncRequest(new CreateSymbolProvider(symbolProvider), new SymbolProviderListener());
         addDisposeListener(new DisposeListener() {
             @Override
             public void widgetDisposed(DisposeEvent e) {
index 5724cbcfeffa3a5df14047bd7f9a226bd81a74b9..e47487377f4e7af89f7d74b1166bf28c4c2ed54f 100644 (file)
@@ -24,10 +24,10 @@ import org.eclipse.ui.part.IPage;
 import org.eclipse.ui.part.Page;
 import org.eclipse.ui.part.PageBook;
 import org.eclipse.ui.part.PageBookView;
+import org.simantics.Simantics;
 import org.simantics.db.management.ISessionContextProvider;
 import org.simantics.diagram.symbolcontribution.EmptySymbolProviderFactory;
 import org.simantics.diagram.symbolcontribution.SymbolProviderFactory;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.datastructures.BijectionMap;
 
 /**
@@ -124,7 +124,7 @@ public class SymbolPageView extends PageBookView {
         // desirable.
         site.setSelectionProvider(null);
 
-        contextProvider = SimanticsUI.getSessionContextProvider();
+        contextProvider = Simantics.getSessionContextProvider();
     }
 
     @Override
index b4bb6acc27a5caeddfbb6c58b874279ef89796fc..b797bacf868348e675b40a91cde005609501addc 100644 (file)
@@ -1,5 +1,6 @@
 package org.simantics.document.linking.ge;
 
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
 import org.simantics.db.common.request.WriteRequest;
@@ -7,7 +8,6 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.adapter.ActionFactory;
 import org.simantics.db.layer0.variable.Variable;
 import org.simantics.document.linking.ontology.DocumentLink;
-import org.simantics.ui.SimanticsUI;
 
 public class RemoveSourceAction implements ActionFactory{
        
@@ -23,7 +23,7 @@ public class RemoveSourceAction implements ActionFactory{
                        
                        @Override
                        public void run() {
-                               SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                               Simantics.getSession().asyncRequest(new WriteRequest() {
                                        
                                        @Override
                                        public void perform(WriteGraph graph) throws DatabaseException {
index 98f1cbd277d71f9d17bac882eae8800d56950e5d..2b2f237287a57a9bd7fd9793d09940075d9594f2 100644 (file)
@@ -1,5 +1,6 @@
 package org.simantics.document.linking.ge;
 
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
 import org.simantics.db.common.request.WriteRequest;
@@ -7,7 +8,6 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.adapter.ActionFactory;
 import org.simantics.db.layer0.variable.Variable;
 import org.simantics.document.linking.utils.SourceLinkUtil;
-import org.simantics.ui.SimanticsUI;
 
 
 public class ReplaceWithLatestAction implements ActionFactory{
@@ -24,7 +24,7 @@ public class ReplaceWithLatestAction implements ActionFactory{
                        
                        @Override
                        public void run() {
-                               SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                               Simantics.getSession().asyncRequest(new WriteRequest() {
                                        
                                        @Override
                                        public void perform(WriteGraph graph) throws DatabaseException {
index 4ba2cc914f5a334b4e611340b88696d1136c791b..47d59bc604d3df5871edeac4def7bfe41e0d0746 100644 (file)
@@ -1,6 +1,7 @@
 package org.simantics.document.linking.ge;
 
 import org.eclipse.swt.widgets.Display;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.common.request.ReadRequest;
@@ -9,7 +10,6 @@ import org.simantics.db.layer0.adapter.ActionFactory;
 import org.simantics.db.layer0.variable.Variable;
 import org.simantics.document.linking.ontology.DocumentLink;
 import org.simantics.document.linking.utils.SourceLinkUtil;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.editor.EditorAdapter;
 import org.simantics.ui.workbench.editor.EditorRegistry;
 import org.simantics.utils.ui.ExceptionUtils;
@@ -28,7 +28,7 @@ public class ShowDocumentAction implements ActionFactory{
                        
                        @Override
                        public void run() {
-                               SimanticsUI.getSession().asyncRequest(new ReadRequest() {
+                               Simantics.getSession().asyncRequest(new ReadRequest() {
                                        
                                        @Override
                                        public void run(ReadGraph graph) throws DatabaseException {
index 3b272910d0b2e4903c20100af3672ec8157cec36..be2d5e33ead0bd51d851f8a938f6f4f063277f9c 100644 (file)
@@ -12,6 +12,7 @@ import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.dialogs.ListDialog;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.common.request.ReadRequest;
@@ -20,7 +21,6 @@ import org.simantics.db.layer0.adapter.ActionFactory;
 import org.simantics.db.layer0.variable.Variable;
 import org.simantics.document.linking.ontology.DocumentLink;
 import org.simantics.document.linking.utils.SourceLinkUtil;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.editor.EditorAdapter;
 import org.simantics.ui.workbench.editor.EditorRegistry;
 import org.simantics.utils.ui.ExceptionUtils;
@@ -39,7 +39,7 @@ public class ShowDocumentWithAction implements ActionFactory{
                        
                        @Override
                        public void run() {
-                               SimanticsUI.getSession().asyncRequest(new ReadRequest() {
+                               Simantics.getSession().asyncRequest(new ReadRequest() {
                                        
                                        @Override
                                        public void run(ReadGraph graph) throws DatabaseException {
index 8fbd0494e17b53ee7982418baa852d14044a6bb3..22b00517b08e19d490be2ac1b2520194afa7e678 100644 (file)
@@ -6,6 +6,7 @@ import java.util.Map;
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IWorkbenchSite;
+import org.simantics.Simantics;
 import org.simantics.browsing.ui.NodeContext;
 import org.simantics.browsing.ui.common.ErrorLogger;
 import org.simantics.browsing.ui.model.InvalidContribution;
@@ -19,7 +20,6 @@ import org.simantics.db.common.request.ReadRequest;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.procedure.Procedure;
 import org.simantics.db.request.Read;
-import org.simantics.ui.SimanticsUI;
 
 public class SourceLinkExplorerComposite extends GraphExplorerComposite {
        
@@ -44,7 +44,7 @@ public class SourceLinkExplorerComposite extends GraphExplorerComposite {
     }
     
     private void attachDND() {
-       SimanticsUI.getSession().asyncRequest(new ReadRequest() {
+       Simantics.getSession().asyncRequest(new ReadRequest() {
             @Override
             public void run(ReadGraph graph) throws DatabaseException { 
                 ArrayList<Resource> browseContexts = new ArrayList<Resource>();
@@ -67,7 +67,7 @@ public class SourceLinkExplorerComposite extends GraphExplorerComposite {
         if (target == null)
             return;
 
-        SimanticsUI.getSession().asyncRequest(new Read<Runnable>() {
+        Simantics.getSession().asyncRequest(new Read<Runnable>() {
             @Override
             public Runnable perform(ReadGraph graph) throws DatabaseException {
                 if (dndBrowseContext == null)
index 663e630f7fe5131a9c74101bdf86dd945f483893..ec2da54a10f97597396a23747aecb1133d801f66 100644 (file)
@@ -2,6 +2,7 @@ package org.simantics.document.linking.ge;
 
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.widgets.Display;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
@@ -13,7 +14,6 @@ import org.simantics.db.layer0.variable.Variable;
 import org.simantics.document.linking.ontology.DocumentLink;
 import org.simantics.document.linking.utils.SourceLinkUtil;
 import org.simantics.layer0.Layer0;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.AdaptionUtils;
 
 public class SourceObjectDropAction implements DropActionFactory {
@@ -44,7 +44,7 @@ public class SourceObjectDropAction implements DropActionFactory {
                        
                        @Override
                        public void run() {
-                               SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                               Simantics.getSession().asyncRequest(new WriteRequest() {
                                        
                                        @Override
                                        public void perform(WriteGraph graph) throws DatabaseException {
index 577f48e46dbb969cfa8395f357a1e23cf784718e..86afc31b8c30990d1c3d8294e82b698b4f19e62a 100644 (file)
@@ -2,6 +2,7 @@ package org.simantics.document.linking.report.evaluator;
 
 import java.util.Collection;
 
+import org.simantics.Simantics;
 import org.simantics.annotation.ontology.AnnotationResource;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
@@ -9,7 +10,6 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.variable.Variable;
 import org.simantics.db.layer0.variable.Variables;
 import org.simantics.layer0.Layer0;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * Copy-paste from org.simantics.diagram.function.PredefinedVariables (removed diagram specific stuff)
@@ -63,7 +63,7 @@ public class PredefinedVariables {
         if (id.equals(root))
                predefined = graph.getRootLibrary();
         else if (id.equals(project))
-               predefined = SimanticsUI.getProject().get();
+               predefined = Simantics.getProject().get();
         else if (id.equals(model))
                predefined = Variables.getModel(graph, selection);
         else if (id.equals(template)){
index 68c2b0045cc719b87b8350f3bd72cae864d46bde..e3b1c55d3ab4f0961f02383ad6a018b2a2bde025 100644 (file)
@@ -147,11 +147,11 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis
                browseComposite.setLayout(new GridLayout(2,false));
                modelCombo = new CCombo(browseComposite, SWT.BORDER|SWT.READ_ONLY);
                final WidgetSupport support = new WidgetSupportImpl();
-               SimanticsUI.getSession().asyncRequest(new ReadRequest() {
+               Simantics.getSession().asyncRequest(new ReadRequest() {
                        
                        @Override
                        public void run(ReadGraph graph) throws DatabaseException {
-                               Resource project = SimanticsUI.getProject().get();
+                               Resource project = Simantics.getProject().get();
                                modelToComboListener = new ModelToComboListener(modelCombo) {
                                        @Override
                                        public Resource getCurrentModel() {
@@ -317,7 +317,7 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis
                if (res == null)
                        return;
                try {
-                       final Resource selected  = SimanticsUI.getSession().syncRequest(new Read<Resource>() {
+                       final Resource selected  = Simantics.getSession().syncRequest(new Read<Resource>() {
                                @Override
                                public Resource perform(ReadGraph graph) throws DatabaseException {
                                        try {
@@ -335,8 +335,8 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis
                                        return;
                        }
                        ISelection realSelection = new StructuredSelection(selected);
-                       objectExplorer.setInput(SimanticsUI.getSessionContext(), realSelection);
-                       propertyExplorer.setInput(SimanticsUI.getSessionContext(), realSelection);
+                       objectExplorer.setInput(Simantics.getSessionContext(), realSelection);
+                       propertyExplorer.setInput(Simantics.getSessionContext(), realSelection);
                        Simantics.getSession().asyncRequest(new ReadRequest() {
                                
                                @Override
@@ -453,13 +453,13 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis
                        if (model.equals(r)) {
                                modelCombo.select(i);
                                ISelection realSelection = new StructuredSelection(currentModel);
-                               browseExplorer.setInput(SimanticsUI.getSessionContext(), realSelection);
+                               browseExplorer.setInput(Simantics.getSessionContext(), realSelection);
                                return;
                        }
                }
                modelCombo.select(-1);
                ISelection realSelection = new StructuredSelection();
-               browseExplorer.setInput(SimanticsUI.getSessionContext(), realSelection);
+               browseExplorer.setInput(Simantics.getSessionContext(), realSelection);
        }
        
        @SuppressWarnings("rawtypes")
index da8ff028a00ba9d677cb829ff1fa40c76e5f6606..93423fc4182b3f50eed9ef9b30fd07ed46b9992a 100644 (file)
@@ -19,6 +19,7 @@ import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.common.request.ReadRequest;
@@ -125,11 +126,11 @@ public class ReportSelectionPage extends WizardPage{
                        reportSelectionButtons.add(b);
                }
                
-               SimanticsUI.getSession().asyncRequest(new ReadRequest() {
+               Simantics.getSession().asyncRequest(new ReadRequest() {
                        
                        @Override
                        public void run(ReadGraph graph) throws DatabaseException {
-                               Resource project = SimanticsUI.getProject().get();
+                               Resource project = Simantics.getProject().get();
                                modelToComboListener = new ModelToComboListener(modelCombo) {
                                        @Override
                                        public Resource getCurrentModel() {
index 4a02837261f0374cdbcbd2ca9633214e742c8077..652476d907058187e8593ea407587a108fa6d002 100644 (file)
@@ -16,6 +16,7 @@ import java.io.File;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.FileDialog;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.exception.DatabaseException;
@@ -25,7 +26,6 @@ import org.simantics.document.DocumentResource;
 import org.simantics.graphfile.ontology.GraphFileResource;
 import org.simantics.graphfile.util.GraphFileUtil;
 import org.simantics.layer0.Layer0;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ExceptionUtils;
 
 /**
@@ -49,7 +49,7 @@ public class ExportDocumentFile implements ActionFactory {
                        @Override
                        public void run() {
                                try {
-                                       String name = SimanticsUI.getSession().syncRequest(new Read<String>() {
+                                       String name = Simantics.getSession().syncRequest(new Read<String>() {
                                                public String perform(ReadGraph graph) throws DatabaseException {
                                                        DocumentResource doc = DocumentResource.getInstance(graph);
                                                        GraphFileResource gf = GraphFileResource.getInstance(graph);
index e5eef2e4aba93df661ffb52e3e46fb44292fd4cb..7991f328f7dcdb7789f6e182d765d89ba81cb3d3 100644 (file)
@@ -2,6 +2,7 @@ package org.simantics.document.ui.actions;
 
 import java.util.List;
 
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
@@ -10,7 +11,6 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.SelectionHints;
 import org.simantics.db.layer0.adapter.DropActionFactory;
 import org.simantics.document.DocumentResource;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ISelectionUtils;
 
 public class FolderDropAction implements DropActionFactory {
@@ -48,7 +48,7 @@ public class FolderDropAction implements DropActionFactory {
 
                        @Override
                        public void run() {
-                               SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                               Simantics.getSession().asyncRequest(new WriteRequest() {
 
                                        @Override
                                        public void perform(WriteGraph graph) throws DatabaseException {
index f30cf6a14d12a3742ea4f0404886b684bcf90999..2feadfdcb10c634c4f9d70e2c9dd2785453be03f 100644 (file)
@@ -1,5 +1,6 @@
 package org.simantics.document.ui.actions;
 
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
@@ -8,7 +9,6 @@ import org.simantics.db.common.utils.NameUtils;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.adapter.ActionFactory;
 import org.simantics.layer0.Layer0;
-import org.simantics.ui.SimanticsUI;
 
 public class NewDocumentFolder implements ActionFactory {
        Resource folderType;
@@ -30,7 +30,7 @@ public class NewDocumentFolder implements ActionFactory {
                return new Runnable() {
                        @Override
                        public void run() {
-                               SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                               Simantics.getSession().asyncRequest(new WriteRequest() {
                                        
                                        @Override
                                        public void perform(WriteGraph graph) throws DatabaseException {
index fa34f241fea6cbb54ee44654b9723aa2e575627a..0ab824e918bf0aa3f7f7cd95540cc1ca7438bbe3 100644 (file)
@@ -2,6 +2,7 @@ package org.simantics.document.ui.actions;
 
 import java.io.IOException;
 
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
@@ -12,7 +13,6 @@ import org.simantics.db.layer0.adapter.ActionFactory;
 import org.simantics.document.DocumentResource;
 import org.simantics.graphfile.util.GraphFileUtil;
 import org.simantics.layer0.Layer0;
-import org.simantics.ui.SimanticsUI;
 
 public class NewFileDocument implements ActionFactory {
        Resource relation;
@@ -34,7 +34,7 @@ public class NewFileDocument implements ActionFactory {
                return new Runnable() {
                        @Override
                        public void run() {
-                               SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                               Simantics.getSession().asyncRequest(new WriteRequest() {
                                        
                                        @Override
                                        public void perform(WriteGraph graph) throws DatabaseException {
index ef64529551dc33de7bb2c535e990884671f46249..15e4d6e74f456c507e239334a76e9b7840e82d08 100644 (file)
@@ -8,13 +8,13 @@ import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.browser.IWebBrowser;
 import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.common.request.ReadRequest;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.document.DocumentResource;
 import org.simantics.document.ui.Activator;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter;
 import org.simantics.ui.workbench.editor.EditorAdapter;
 import org.simantics.utils.ui.ExceptionUtils;
@@ -37,7 +37,7 @@ public class UrlEditorAdapter extends AbstractResourceEditorAdapter implements E
        
        @Override
        protected void openEditor(final Resource input) throws Exception {
-               SimanticsUI.getSession().asyncRequest(new ReadRequest() {
+               Simantics.getSession().asyncRequest(new ReadRequest() {
                        
                        @Override
                        public void run(ReadGraph graph) throws DatabaseException {
index 3b5d4799712cf3e64aae29a226562af71a7bdc8f..e47b5a4616243e12b110abc5ba21e3097432eed7 100644 (file)
@@ -13,12 +13,12 @@ package org.simantics.equation;
 
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.common.request.ReadRequest;
 import org.simantics.db.management.ISessionContext;
 import org.simantics.db.management.ISessionContextChangedListener;
 import org.simantics.db.management.SessionContextChangedEvent;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * The activator class controls the plug-in life cycle
@@ -45,7 +45,7 @@ public class Activator extends AbstractUIPlugin {
                super.start(context);
                plugin = this;
                
-               SimanticsUI.getSessionContextProvider().addContextChangedListener(new ISessionContextChangedListener() {
+               Simantics.getSessionContextProvider().addContextChangedListener(new ISessionContextChangedListener() {
                        @Override
                        public void sessionContextChanged(SessionContextChangedEvent event) {
                                ISessionContext ctx = event.getNewValue();
@@ -63,7 +63,7 @@ public class Activator extends AbstractUIPlugin {
                });
                
                try {
-                       SimanticsUI.getSession().syncRequest(new ReadRequest() {
+                       Simantics.getSession().syncRequest(new ReadRequest() {
                            @Override
                            public void run(ReadGraph g) {
                                EquationResources.initialize(g);
index 708bb86696f32b5d0e09ad033f391c6fb8a2ea87..ea2cb05dc9c1bdaaf9755dfcb3176f8d8e567705 100644 (file)
@@ -14,6 +14,7 @@ import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.ui.IExportWizard;
 import org.eclipse.ui.IWorkbench;
 import org.osgi.service.prefs.BackingStoreException;
+import org.simantics.Simantics;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.export.core.ExportContext;
 import org.simantics.export.core.Exports;
@@ -22,7 +23,6 @@ import org.simantics.export.core.manager.ExportManager;
 import org.simantics.export.core.manager.ExportPlan;
 import org.simantics.export.core.manager.ExportWizardResult;
 import org.simantics.export.core.util.ExporterUtils;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.datastructures.collections.CollectionUtils;
 import org.simantics.utils.ui.ErrorLogger;
 import org.simantics.utils.ui.ExceptionUtils;
@@ -43,7 +43,7 @@ public class ExportCoreWizard extends Wizard implements IExportWizard {
        public void init(IWorkbench workbench, final IStructuredSelection selection) {
                try {
                        // Create export context
-                       ctx = ExportContext.create( SimanticsUI.getSessionContext(), selection );
+                       ctx = ExportContext.create( Simantics.getSessionContext(), selection );
 
                        // Create extension point registry
                        ctx.eep = Exports.createExtensionPoint();
index a0e966f98f947df987e5f0842eab0a630be68260..d9286b00411355de066600e85be0211c5407da2a 100644 (file)
@@ -22,9 +22,9 @@ import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PlatformUI;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.layer0.adapter.ActionFactory;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.FileUtils;
 import org.simantics.utils.ui.AdaptionUtils;
 
@@ -49,8 +49,8 @@ public class ImportImagesActionFactory implements ActionFactory {
                 if (files.isEmpty())
                     return;
 
-                SimanticsUI.getSession().markUndoPoint();
-                SimanticsUI.getSession().asyncRequest( new CreateImages(container, files) );
+                Simantics.getSession().markUndoPoint();
+                Simantics.getSession().asyncRequest( new CreateImages(container, files) );
             }
         };
     }
index d95498cbc4148c83fd32b5101d418aed7aba1f5f..6d8885ed177b64da3566813c4e8179f223207ef5 100644 (file)
@@ -20,11 +20,11 @@ import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.image.ui.CreateImages;
 import org.simantics.image.ui.ImportImagesActionFactory;
 import org.simantics.image.ui.modelBrowser.ImagesNode;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.AdaptionUtils;
 
 /**
@@ -46,7 +46,7 @@ public class ImportImageHandler extends AbstractHandler {
         if (files.isEmpty())
             return null;
 
-        SimanticsUI.getSession().asyncRequest( new CreateImages(container, files) );
+        Simantics.getSession().asyncRequest( new CreateImages(container, files) );
 
         return null;
     }
index 958a3b063337dfd6f1b6f92b83c23502c001d269..9a40b357770090b0563d80bb0ae42514420c7220 100644 (file)
@@ -2,6 +2,7 @@ package org.simantics.issues.ui;
 
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.TreeItem;
+import org.simantics.Simantics;
 import org.simantics.browsing.ui.NodeContext;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
@@ -15,7 +16,6 @@ import org.simantics.issues.ontology.IssueResource;
 import org.simantics.scenegraph.loader.ScenegraphLoaderUtils;
 import org.simantics.scl.reflection.annotations.SCLValue;
 import org.simantics.scl.runtime.function.FunctionImpl1;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.utils.ResourceAdaptionUtils;
 import org.simantics.utils.ui.ErrorLogger;
 
@@ -40,8 +40,8 @@ public class All {
                 final boolean checked = item.getChecked();
                 final Resource issueSource = ResourceAdaptionUtils.toSingleResource(context);
                 try {
-                    VirtualGraphSupport support = SimanticsUI.getSession().getService(VirtualGraphSupport.class);
-                    SimanticsUI.getSession().syncRequest(new WriteRequest(support.getWorkspacePersistent("preferences")) {
+                    VirtualGraphSupport support = Simantics.getSession().getService(VirtualGraphSupport.class);
+                    Simantics.getSession().syncRequest(new WriteRequest(support.getWorkspacePersistent("preferences")) {
                         @Override
                         public void perform(WriteGraph graph) throws DatabaseException {
                                IssueResource ISSUE = IssueResource.getInstance(graph);
index 52a04c9111fa3d0be9b327ff3cfb954cabacad51..aaef79028d2b8b16ca6fa63e0e9546ac79512351 100644 (file)
@@ -13,12 +13,12 @@ package org.simantics.message.ui.scheme;
 
 import java.net.URI;
 
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
 import org.simantics.message.IReferenceSerializer;
 import org.simantics.message.ReferenceSerializationException;
 import org.simantics.message.util.ResourceSerializerUtil;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * @author Tuukka Lehtonen
@@ -28,7 +28,7 @@ public class ResourceReferenceSerializer implements IReferenceSerializer {
     Session s;
 
     public ResourceReferenceSerializer() {
-        this.s = SimanticsUI.getSession();
+        this.s = Simantics.getSession();
     }
 
     public ResourceReferenceSerializer(Session s) {
index 2f536eb6f3810fc5d8a1bcfc007f401e4eae3605..1d400dcfc247e649fe06beb09d4a10cea4c27aae 100644 (file)
@@ -13,10 +13,10 @@ package org.simantics.message.ui.scheme;
 
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PlatformUI;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
 import org.simantics.message.AbstractMessageSchemeHandler;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.action.ChooseActionRequest;
 import org.simantics.utils.ui.workbench.WorkbenchUtils;
 
@@ -31,7 +31,7 @@ public class ResourceSchemeHandler extends AbstractMessageSchemeHandler<Resource
 
     @Override
     public void doPerform(Resource r) {
-        Session session = SimanticsUI.peekSession();
+        Session session = Simantics.peekSession();
         if (session == null) {
             // FIXME: not stdout.
             System.out.println("ResourceSchemeHandler: no session");
index 907ca90f6b8e0922e648b327239bc945459903e4..de7468d8e7dd9b06ea3678c565738fc1a5898246 100644 (file)
@@ -16,6 +16,7 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
 import org.simantics.message.DetailStatus;
@@ -25,7 +26,6 @@ import org.simantics.message.MessageService;
 import org.simantics.message.ReferenceSerializationException;
 import org.simantics.message.ui.Activator;
 import org.simantics.message.util.MessageUtil;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.utils.ResourceAdaptionUtils;
 
 /**
@@ -38,7 +38,7 @@ public class TestResourceStatusHandler extends AbstractHandler {
         Resource[] rs = ResourceAdaptionUtils.toResources(HandlerUtil.getCurrentSelection(event));
         ILogger log = MessageService.getDefault();
     
-        Session s = SimanticsUI.peekSession();
+        Session s = Simantics.peekSession();
         if (s == null)
             return null;
 
index 023828c07721056a4809a70a245d1b0f82ff00e5..4f21b81dca27cb49102446714b7e32509db5f9ba 100644 (file)
  *******************************************************************************/
 package org.simantics.modeling.template2d.ui.actions;
 
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
 import org.simantics.db.common.request.WriteRequest;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.adapter.ActionFactory;
 import org.simantics.modeling.template2d.ontology.Template2dResource;
-import org.simantics.ui.SimanticsUI;
 
 public class ChangePageOrientation implements ActionFactory {
 
@@ -30,7 +30,7 @@ public class ChangePageOrientation implements ActionFactory {
         return new Runnable() {
             @Override
             public void run() {
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph g) throws DatabaseException {
                         g.markUndoPoint();
index 5055491c5e0823faaace87fc9683f09ffed38375..637962d05cef2abcd051dd5d3c2c705863dc9816 100644 (file)
@@ -11,6 +11,7 @@
  *******************************************************************************/
 package org.simantics.modeling.template2d.ui.actions;
 
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
 import org.simantics.db.common.request.WriteRequest;
@@ -19,7 +20,6 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.adapter.ActionFactory;
 import org.simantics.layer0.Layer0;
 import org.simantics.scenegraph.ontology.ScenegraphResources;
-import org.simantics.ui.SimanticsUI;
 
 public class MoveDown implements ActionFactory {
 
@@ -32,7 +32,7 @@ public class MoveDown implements ActionFactory {
         return new Runnable() {
             @Override
             public void run() {
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph g) throws DatabaseException {
                         g.markUndoPoint();
index 50b2a004e5df429c10b93354b879292d897a70d9..1805956db6721bcdcf31c7c702da13b6ac553adb 100644 (file)
@@ -11,6 +11,7 @@
  *******************************************************************************/
 package org.simantics.modeling.template2d.ui.actions;
 
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
 import org.simantics.db.common.request.WriteRequest;
@@ -19,7 +20,6 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.adapter.ActionFactory;
 import org.simantics.layer0.Layer0;
 import org.simantics.scenegraph.ontology.ScenegraphResources;
-import org.simantics.ui.SimanticsUI;
 
 public class MoveUp implements ActionFactory {
 
@@ -32,7 +32,7 @@ public class MoveUp implements ActionFactory {
         return new Runnable() {
             @Override
             public void run() {
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph g) throws DatabaseException {
                         g.markUndoPoint();
index a187102f61e816d6a2544fb0e9e21162e07c93fb..f917bf25f8014f841e95e912e3ad8285c4610a71 100644 (file)
@@ -11,6 +11,7 @@
  *******************************************************************************/
 package org.simantics.modeling.template2d.ui.actions;
 
+import org.simantics.Simantics;
 import org.simantics.databoard.Bindings;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
@@ -23,7 +24,6 @@ import org.simantics.db.layer0.adapter.ActionFactory;
 import org.simantics.diagram.stubs.G2DResource;
 import org.simantics.layer0.Layer0;
 import org.simantics.modeling.template2d.ontology.Template2dResource;
-import org.simantics.ui.SimanticsUI;
 
 public class NewDrawingTemplate implements ActionFactory {
 
@@ -36,7 +36,7 @@ public class NewDrawingTemplate implements ActionFactory {
         return new Runnable() {
             @Override
             public void run() {
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph g) throws DatabaseException {
                         g.markUndoPoint();
index 5786d135cabf02ab1cb707c4b5316965dcf89577..9c48d2329effef089ebb77d731299ff169086f88 100644 (file)
@@ -14,6 +14,7 @@ package org.simantics.modeling.template2d.ui.actions;
 import java.util.ArrayList;
 import java.util.Arrays;
 
+import org.simantics.Simantics;
 import org.simantics.databoard.Bindings;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
@@ -27,7 +28,6 @@ import org.simantics.diagram.stubs.G2DResource;
 import org.simantics.layer0.Layer0;
 import org.simantics.modeling.template2d.ontology.Template2dResource;
 import org.simantics.scenegraph.ontology.ScenegraphResources;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * @author Teemu Matasniemi
@@ -43,7 +43,7 @@ public class NewFlagTable implements ActionFactory {
         return new Runnable() {
             @Override
             public void run() {
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph g) throws DatabaseException {
                         g.markUndoPoint();
index b5c2f528d3ad3780a7a0efad3260927ec59e214f..d3aec4e7e0e09557ac7ffef216f533b5ea41ec88 100644 (file)
@@ -14,6 +14,7 @@ package org.simantics.modeling.template2d.ui.actions;
 import java.util.ArrayList;
 import java.util.Arrays;
 
+import org.simantics.Simantics;
 import org.simantics.databoard.Bindings;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
@@ -27,7 +28,6 @@ import org.simantics.diagram.stubs.G2DResource;
 import org.simantics.layer0.Layer0;
 import org.simantics.modeling.template2d.ontology.Template2dResource;
 import org.simantics.scenegraph.ontology.ScenegraphResources;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * @author Teemu Matasniemi
@@ -43,7 +43,7 @@ public class NewFlagTableColumn implements ActionFactory {
         return new Runnable() {
             @Override
             public void run() {
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph g) throws DatabaseException {
                         g.markUndoPoint();
index 403e3c7a97341ad6e6ddb15912062d41e952f395..c4928339a6332d3527fc982bb114cf8e9625d2b9 100644 (file)
@@ -13,6 +13,7 @@ package org.simantics.modeling.template2d.ui.actions;
 
 import java.util.Arrays;
 
+import org.simantics.Simantics;
 import org.simantics.databoard.Bindings;
 import org.simantics.datatypes.DatatypeResource;
 import org.simantics.datatypes.literal.Font;
@@ -29,7 +30,6 @@ import org.simantics.diagram.stubs.G2DResource;
 import org.simantics.layer0.Layer0;
 import org.simantics.modeling.template2d.ontology.Template2dResource;
 import org.simantics.scenegraph.ontology.ScenegraphResources;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * @author Teemu Matasniemi
@@ -45,7 +45,7 @@ public class NewFlagTableColumnData implements ActionFactory {
         return new Runnable() {
             @Override
             public void run() {
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph g) throws DatabaseException {
                         g.markUndoPoint();
index 2cd7ee67629845f05c759a9376ed70fdf02c6571..dbf360e4add6f6fea324979446a0e9da24a6d17e 100644 (file)
@@ -13,6 +13,7 @@ package org.simantics.modeling.template2d.ui.actions;
 
 import java.util.Arrays;
 
+import org.simantics.Simantics;
 import org.simantics.databoard.Bindings;
 import org.simantics.datatypes.DatatypeResource;
 import org.simantics.datatypes.literal.Font;
@@ -29,7 +30,6 @@ import org.simantics.diagram.stubs.G2DResource;
 import org.simantics.layer0.Layer0;
 import org.simantics.modeling.template2d.ontology.Template2dResource;
 import org.simantics.scenegraph.ontology.ScenegraphResources;
-import org.simantics.ui.SimanticsUI;
 
 public class NewFlagTableColumnHeader implements ActionFactory {
 
@@ -42,7 +42,7 @@ public class NewFlagTableColumnHeader implements ActionFactory {
         return new Runnable() {
             @Override
             public void run() {
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph g) throws DatabaseException {
                         g.markUndoPoint();
index 758a89da1fc001408fe240cc5a25a82fc40b8355..01eef8c348991e0e5497e8165b74941129efda36 100644 (file)
@@ -14,6 +14,7 @@ package org.simantics.modeling.template2d.ui.actions;
 import java.util.ArrayList;
 import java.util.Arrays;
 
+import org.simantics.Simantics;
 import org.simantics.databoard.Bindings;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
@@ -25,7 +26,6 @@ import org.simantics.db.layer0.adapter.ActionFactory;
 import org.simantics.layer0.Layer0;
 import org.simantics.modeling.template2d.ontology.Template2dResource;
 import org.simantics.scenegraph.ontology.ScenegraphResources;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * @author Teemu Matasniemi
@@ -41,7 +41,7 @@ public class NewFlagTypeVisual implements ActionFactory {
         return new Runnable() {
             @Override
             public void run() {
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph g) throws DatabaseException {
                         g.markUndoPoint();
index 91d7949dd2fc730178ffb05178d7b0ef19430e03..7090bb8284e186863e049e27dd84e9b79c9ccb3b 100644 (file)
@@ -13,6 +13,7 @@ package org.simantics.modeling.template2d.ui.actions;
 
 import java.util.Arrays;
 
+import org.simantics.Simantics;
 import org.simantics.databoard.Bindings;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
@@ -24,7 +25,6 @@ import org.simantics.db.layer0.adapter.ActionFactory;
 import org.simantics.layer0.Layer0;
 import org.simantics.modeling.template2d.ontology.Template2dResource;
 import org.simantics.scenegraph.ontology.ScenegraphResources;
-import org.simantics.ui.SimanticsUI;
 
 public class NewFlagTypeVisualFilter  implements ActionFactory {
 
@@ -37,7 +37,7 @@ public class NewFlagTypeVisualFilter  implements ActionFactory {
         return new Runnable() {
             @Override
             public void run() {
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph g) throws DatabaseException {
                         g.markUndoPoint();
index 739b66327f5b15f7fd204940d6b9bf9e000d67d3..afec86c4e17f85fb962299dc40de22694908aa82 100644 (file)
@@ -13,6 +13,7 @@ package org.simantics.modeling.template2d.ui.actions;
 
 import java.util.Arrays;
 
+import org.simantics.Simantics;
 import org.simantics.databoard.Bindings;
 import org.simantics.datatypes.DatatypeResource;
 import org.simantics.datatypes.literal.Font;
@@ -29,7 +30,6 @@ import org.simantics.diagram.stubs.DiagramResource;
 import org.simantics.diagram.stubs.G2DResource;
 import org.simantics.layer0.Layer0;
 import org.simantics.scenegraph.ontology.ScenegraphResources;
-import org.simantics.ui.SimanticsUI;
 
 public class NewMonitor implements ActionFactory {
 
@@ -42,7 +42,7 @@ public class NewMonitor implements ActionFactory {
         return new Runnable() {
             @Override
             public void run() {
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph g) throws DatabaseException {
                         g.markUndoPoint();
index 5a64bdc902285b47f8cba62bd0b4dc95583020af..22fe5bd51593635ce929c1b166bc36e3ffc31b9c 100644 (file)
@@ -13,6 +13,7 @@ package org.simantics.modeling.template2d.ui.actions;
 
 import java.util.Arrays;
 
+import org.simantics.Simantics;
 import org.simantics.databoard.Bindings;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
@@ -26,7 +27,6 @@ import org.simantics.diagram.stubs.G2DResource;
 import org.simantics.layer0.Layer0;
 import org.simantics.modeling.template2d.ontology.Template2dResource;
 import org.simantics.scenegraph.ontology.ScenegraphResources;
-import org.simantics.ui.SimanticsUI;
 
 public class NewSVGImage implements ActionFactory {
 
@@ -39,7 +39,7 @@ public class NewSVGImage implements ActionFactory {
         return new Runnable() {
             @Override
             public void run() {
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph g) throws DatabaseException {
                         g.markUndoPoint();
index c33dd4cef7b7dc546f462bac357754a904eec635..c372fde94d4ea592233a73e779c11f96c89597e8 100644 (file)
@@ -13,6 +13,7 @@ package org.simantics.modeling.template2d.ui.actions;
 
 import java.util.Arrays;
 
+import org.simantics.Simantics;
 import org.simantics.databoard.Bindings;
 import org.simantics.datatypes.DatatypeResource;
 import org.simantics.datatypes.literal.Font;
@@ -28,7 +29,6 @@ import org.simantics.diagram.stubs.DiagramResource;
 import org.simantics.diagram.stubs.G2DResource;
 import org.simantics.layer0.Layer0;
 import org.simantics.scenegraph.ontology.ScenegraphResources;
-import org.simantics.ui.SimanticsUI;
 
 public class NewText implements ActionFactory {
 
@@ -41,7 +41,7 @@ public class NewText implements ActionFactory {
         return new Runnable() {
             @Override
             public void run() {
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph g) throws DatabaseException {
                         g.markUndoPoint();
index befc86cc050001ecad262e4541d8fc8371ca7948..b9c9747d77ab698d1d302de42b99353990d49648 100644 (file)
@@ -18,6 +18,7 @@ import org.eclipse.swt.widgets.ColorDialog;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PlatformUI;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
 import org.simantics.db.common.request.WriteRequest;
@@ -26,7 +27,6 @@ import org.simantics.db.layer0.adapter.ActionFactory;
 import org.simantics.diagram.G2DUtils;
 import org.simantics.diagram.stubs.G2DResource;
 import org.simantics.modeling.template2d.ontology.Template2dResource;
-import org.simantics.ui.SimanticsUI;
 
 public class SetBorderColor implements ActionFactory {
 
@@ -55,7 +55,7 @@ public class SetBorderColor implements ActionFactory {
                        return;
 
 
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph g) throws DatabaseException {
                         g.markUndoPoint();
index 27a1739e1db5b092dd048bcf9431adabe36c5228..5233ae7d7b62e1b66a52333b4e19c452ba5c1b36 100644 (file)
@@ -28,6 +28,7 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.Simantics;
 import org.simantics.databoard.Bindings;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
@@ -40,7 +41,6 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.diagram.stubs.DiagramResource;
 import org.simantics.layer0.Layer0;
 import org.simantics.modeling.template2d.ontology.Template2dResource;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.utils.ResourceAdaptionUtils;
 import org.simantics.utils.ui.dialogs.ShowError;
 
@@ -64,7 +64,7 @@ public class BindToIOTableDialog extends Dialog {
         if (flag == null)
             return false;
 
-        session = SimanticsUI.getSession();
+        session = Simantics.getSession();
         if (session == null)
                return false;
         try {
index 49447eeb37641ced33fb48608f3be7bc31c7cebd..58ba3baa17d1110170e7794774bae470b9f09a2d 100644 (file)
@@ -26,12 +26,12 @@ import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.ui.IExportWizard;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.simantics.Simantics;
 import org.simantics.db.management.ISessionContext;
 import org.simantics.modeling.template2d.ui.Activator;
 import org.simantics.modeling.ui.utils.NoProjectPage;
 import org.simantics.project.IProject;
 import org.simantics.project.ProjectKeys;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ErrorLogger;
 import org.simantics.utils.ui.ExceptionUtils;
 
@@ -77,7 +77,7 @@ public class DrawingTemplateExportWizard extends Wizard implements IExportWizard
     public void init(IWorkbench workbench, IStructuredSelection selection) {
         readPreferences();
 
-        ISessionContext ctx = SimanticsUI.getSessionContext();
+        ISessionContext ctx = Simantics.getSessionContext();
         if (ctx == null)
             return;
         IProject project = ctx.getHint(ProjectKeys.KEY_PROJECT);
index ae1e0049bbb5fc912dcc84c3067daa130539c1d7..4f27996c3ac038ccaef5a76ffaac93036b76ab05 100644 (file)
@@ -26,6 +26,7 @@ import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.ui.IImportWizard;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.management.ISessionContext;
 import org.simantics.modeling.template2d.DiagramTemplates;
@@ -33,7 +34,6 @@ import org.simantics.modeling.template2d.ui.Activator;
 import org.simantics.modeling.ui.utils.NoProjectPage;
 import org.simantics.project.IProject;
 import org.simantics.project.ProjectKeys;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.utils.ResourceAdaptionUtils;
 import org.simantics.utils.ui.ErrorLogger;
 import org.simantics.utils.ui.ExceptionUtils;
@@ -53,7 +53,7 @@ public class DrawingTemplateImportWizard extends Wizard implements IImportWizard
         String recentPathsPref = store.getString(Preferences.RECENT_DRAWING_TEMPLATE_IMPORT_LOCATIONS);
         Deque<String> recentImportPaths = Preferences.decodePaths(recentPathsPref);
 
-        ISessionContext ctx = SimanticsUI.getSessionContext();
+        ISessionContext ctx = Simantics.getSessionContext();
         if (ctx == null)
             return false;
         IProject project = ctx.getHint(ProjectKeys.KEY_PROJECT);
index 75c702bedd3d7eba673bf663a5bfa2d4efcaa953..b7803a77b387ece14eab3b813d20e0f6753b6d34 100644 (file)
@@ -9,6 +9,7 @@ import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.part.MultiPageEditorPart;
+import org.simantics.Simantics;
 import org.simantics.databoard.Bindings;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
@@ -28,7 +29,6 @@ import org.simantics.layer0.Layer0;
 import org.simantics.layer0.utils.direct.GraphUtils;
 import org.simantics.modeling.ModelingResources;
 import org.simantics.structural.stubs.StructuralResource2;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.IResourceEditorInput;
 import org.simantics.ui.workbench.ResourceEditorInput;
 
@@ -43,7 +43,7 @@ public abstract class CreateShapeHandler extends AbstractHandler {
 
     public Object addElement(final double mposX, final double mposY, final Resource composite) {
         final String data = getDefaultElementData();
-        SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+        Simantics.getSession().asyncRequest(new WriteRequest() {
             @Override
             public void perform(WriteGraph g) throws DatabaseException {
                 Layer0 L0 = Layer0.getInstance(g);
@@ -75,7 +75,7 @@ public abstract class CreateShapeHandler extends AbstractHandler {
             final ResourceArray ra = in.getResourceArray();
             ResourceArray symbolEditorInput;
             try {
-                symbolEditorInput = SimanticsUI.getSession().syncRequest(new Read<ResourceArray>() {
+                symbolEditorInput = Simantics.getSession().syncRequest(new Read<ResourceArray>() {
                     @Override
                     public ResourceArray perform(ReadGraph graph) throws DatabaseException {
                         StructuralResource2 sr = StructuralResource2.getInstance(graph);
index f3a1b44031c536a976cd1b9329b569bf29bbd072..ed41bc13277b61f69c7a4b2af81a815f38888aa3 100644 (file)
@@ -26,6 +26,7 @@ import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.part.MultiPageEditorPart;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
@@ -40,7 +41,6 @@ import org.simantics.g2d.participant.MouseUtil.MouseInfo;
 import org.simantics.modeling.ModelingResources;
 import org.simantics.scl.commands.Commands;
 import org.simantics.structural.stubs.StructuralResource2;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.IResourceEditorInput;
 import org.simantics.ui.workbench.ResourceEditorInput;
 import org.simantics.utils.FileUtils;
@@ -58,7 +58,7 @@ public class ImportSVG extends AbstractHandler {
             final ResourceArray ra = in.getResourceArray();
             ResourceArray symbolEditorInput;
             try {
-                symbolEditorInput = SimanticsUI.getSession().syncRequest(new Read<ResourceArray>() {
+                symbolEditorInput = Simantics.getSession().syncRequest(new Read<ResourceArray>() {
                     @Override
                     public ResourceArray perform(ReadGraph graph) throws DatabaseException {
                         StructuralResource2 sr = StructuralResource2.getInstance(graph);
@@ -116,7 +116,7 @@ public class ImportSVG extends AbstractHandler {
         try {
             final byte[] data = FileUtils.readFile(file);
 
-            SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+            Simantics.getSession().asyncRequest(new WriteRequest() {
 
                 @Override
                 public void perform(WriteGraph g) throws DatabaseException {
index 2c52834d5c75d4c4fdada9f31cef3a447473b88a..eca9620d5ac410b1c0cd9b6eb82878db70a31dda 100644 (file)
  *******************************************************************************/
 package org.simantics.modeling.ui.actions;
 
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.modeling.ModelingResources;
 import org.simantics.project.IProject;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.contribution.OperationsMenuContribution;
 
 /**
@@ -26,7 +26,7 @@ public class ModelingProjectOperationsContribution extends OperationsMenuContrib
     @Override
     protected Object[] getSelectedObjects() {
         // Force the evaluated selection to be the currently active project.
-        IProject project = SimanticsUI.peekProject();
+        IProject project = Simantics.peekProject();
         if (project == null)
             return Resource.NONE;
         return new Resource[] { project.get() };
index 1acbf5391455a714cdf996771b7a0d8b0136d8c3..fafaa7e51a09c4cad73590aa925fc3dc2c4c1671 100644 (file)
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.simantics.DatabaseJob;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
 import org.simantics.db.common.request.WriteRequest;
@@ -23,7 +24,6 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.adapter.ActionFactory;
 import org.simantics.modeling.NewComponentType;
 import org.simantics.modeling.ui.Activator;
-import org.simantics.ui.SimanticsUI;
 
 public class NewComponentTypeAction implements ActionFactory {
 
@@ -39,7 +39,7 @@ public class NewComponentTypeAction implements ActionFactory {
                     @Override
                     protected IStatus run(IProgressMonitor monitor) {
                         try {
-                            SimanticsUI.getSession().syncRequest(new WriteRequest() {
+                            Simantics.getSession().syncRequest(new WriteRequest() {
                                 @Override
                                 public void perform(WriteGraph graph) throws DatabaseException {
                                     graph.markUndoPoint();
index 7953818baf6ffc859e52ab04874d9f5e14c173dd..0efcc5b8c4cf695fb8f33e3400e9d72c8ccb3783 100644 (file)
@@ -1,5 +1,6 @@
 package org.simantics.modeling.ui.actions;
 
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
 import org.simantics.db.common.request.WriteRequest;
@@ -8,7 +9,6 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.adapter.ActionFactory;
 import org.simantics.document.DocumentResource;
 import org.simantics.layer0.Layer0;
-import org.simantics.ui.SimanticsUI;
 
 public class NewDocument implements ActionFactory {
 
@@ -21,7 +21,7 @@ public class NewDocument implements ActionFactory {
 
             @Override
             public void run() {
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph graph) throws DatabaseException {
                         graph.markUndoPoint();
index a187fa62578b6642072cc0b0a6c7835cb26287b4..d6205ea5f5696bcac491d44778ffdf0597506d06 100644 (file)
@@ -23,7 +23,7 @@ public class NewLibrary implements ActionFactory {
         return new Runnable() {
             @Override
             public void run() {
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph graph) throws DatabaseException {
                         graph.markUndoPoint();
index d187053df62a4e08ccc0b25c7b8c7c871503b2bc..2e8a8fcb81c8388f79804e15198b511c3f357a6f 100644 (file)
@@ -2,6 +2,7 @@ package org.simantics.modeling.ui.actions;
 
 import java.util.UUID;
 
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
 import org.simantics.db.common.CommentMetadata;
@@ -12,7 +13,6 @@ import org.simantics.db.layer0.adapter.ActionFactory;
 import org.simantics.layer0.Layer0;
 import org.simantics.layer0.utils.direct.GraphUtils;
 import org.simantics.modeling.ModelingResources;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * @author Tuukka Lehtonen
@@ -28,7 +28,7 @@ public class NewSubscription implements ActionFactory {
         return new Runnable() {
             @Override
             public void run() {
-                SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                Simantics.getSession().asyncRequest(new WriteRequest() {
                     @Override
                     public void perform(WriteGraph g) throws DatabaseException {
                         g.markUndoPoint();
index b864c4bcf56b3eff3b9d5a30e7338d5d60645018..84eab0eb7629f01eee5a106db64eac9647b8cc34 100644 (file)
@@ -28,6 +28,7 @@ import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor;
 import org.eclipse.ui.part.MultiPageEditorPart;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
@@ -47,7 +48,6 @@ import org.simantics.g2d.participant.MouseUtil.MouseInfo;
 import org.simantics.modeling.ModelingResources;
 import org.simantics.scl.commands.Commands;
 import org.simantics.structural.stubs.StructuralResource2;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.IResourceEditorInput;
 import org.simantics.ui.workbench.ResourceEditorInput;
 import org.simantics.utils.FileUtils;
@@ -78,7 +78,7 @@ public class ImportSVGPNG {
             final ResourceArray ra = in.getResourceArray();
             ResourceArray symbolEditorInput;
             try {
-                symbolEditorInput = SimanticsUI.getSession().syncRequest(new Read<ResourceArray>() {
+                symbolEditorInput = Simantics.getSession().syncRequest(new Read<ResourceArray>() {
                     @Override
                     public ResourceArray perform(ReadGraph graph) throws DatabaseException {
                         StructuralResource2 sr = StructuralResource2.getInstance(graph);
@@ -138,7 +138,7 @@ public class ImportSVGPNG {
         try {
             final byte[] data = FileUtils.readFile(file);
 
-            SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+            Simantics.getSession().asyncRequest(new WriteRequest() {
 
                 @Override
                 public void perform(WriteGraph g) throws DatabaseException {
index 62a0c470ed24e4077e942a50b1d01c51e93ddb28..9db3a2401d7a449fe711bef4ce492edf6520c7ee 100644 (file)
@@ -62,7 +62,7 @@ public class EditStyle {
         if (resources.length == 0)
             return;
 
-        SimanticsUI.getSession().asyncRequest(new ReadRequest() {
+        Simantics.getSession().asyncRequest(new ReadRequest() {
 
             @Override
             public void run(ReadGraph graph) throws DatabaseException {
index 0509329f32db517e75f6161444a6b53dcd15e967..94c03494b259a4da37dc51bd25ff948d4084f3b2 100644 (file)
@@ -27,6 +27,7 @@ import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
@@ -38,7 +39,6 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.diagram.synchronization.graph.DiagramGraphUtil;
 import org.simantics.modeling.ui.preferences.DiagramPreferences;
 import org.simantics.scl.commands.Commands;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.page.PageDesc;
 
 /**
@@ -65,7 +65,7 @@ public class PageSettingsDialog extends Dialog {
 
     public PageSettingsDialog(Resource diagramResource, Shell parentShell) {
         super(parentShell);
-        this.session = SimanticsUI.getSession();
+        this.session = Simantics.getSession();
         this.diagramResource = diagramResource;
     }
 
index 1762dea7f6108d34b0a265731387adc9325cb002..92d46e160e8f91347dee82da58c2698e5a7ba198 100644 (file)
@@ -346,7 +346,7 @@ public class DiagramViewer
 
     protected Set<String> getPropertyPageContexts() {
         try {
-            return BrowseContext.getBrowseContextClosure(SimanticsUI.getSession(), defaultPropertyBrowseContexts);
+            return BrowseContext.getBrowseContextClosure(Simantics.getSession(), defaultPropertyBrowseContexts);
         } catch (DatabaseException e) {
             ExceptionUtils.logAndShowError("Failed to load modeled browse contexts for property page, see exception for details.", e);
             return defaultPropertyBrowseContexts;
@@ -366,7 +366,7 @@ public class DiagramViewer
     }
 
     protected void initSession() {
-        sessionContextProvider = SimanticsUI.getSessionContextProvider();
+        sessionContextProvider = Simantics.getSessionContextProvider();
         sessionContext = sessionContextProvider.getSessionContext();
     }
 
@@ -960,7 +960,7 @@ public class DiagramViewer
         // Set initial part name according to the name given by IEditorInput
         host.doSetPartName(getEditorInput().getName());
 
-        Session session = SimanticsUI.peekSession();
+        Session session = Simantics.peekSession();
         if (session != null) {
             Supplier<Boolean> disposedCallback = () -> disposed;
             session.asyncRequest(
index fd1e6360547a13fce458d4ba781d83affe5444cd..fb3716f98e9c441d6dd48a578db625df3ba5dd31 100644 (file)
@@ -13,6 +13,7 @@ package org.simantics.modeling.ui.diagramEditor;
 
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.common.request.ReadRequest;
@@ -21,7 +22,6 @@ import org.simantics.db.layer0.request.PossibleModel;
 import org.simantics.db.layer0.variable.RVI;
 import org.simantics.diagram.stubs.DiagramResource;
 import org.simantics.modeling.ui.Activator;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.ResourceEditorInput2;
 import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter;
 import org.simantics.utils.ui.ErrorLogger;
@@ -50,7 +50,7 @@ public class OpenDiagramAdapter extends AbstractResourceEditorAdapter {
     @Override
     public void openEditor(final Resource r) throws Exception {
        
-        SimanticsUI.getSession().asyncRequest(new ReadRequest() {
+        Simantics.getSession().asyncRequest(new ReadRequest() {
                
             @Override
             public void run(ReadGraph g) throws DatabaseException {
index 2394c490b5a02d117269edc75184e0ee4ab7fbee..978d1f89595989dc811de829f1051941edec5190 100644 (file)
@@ -15,6 +15,7 @@ import java.util.Collection;
 import java.util.Collections;
 
 import org.eclipse.ui.PlatformUI;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.common.request.PossibleIndexRoot;
@@ -32,7 +33,6 @@ import org.simantics.modeling.ComponentUtils;
 import org.simantics.modeling.actions.NavigateToTarget;
 import org.simantics.modeling.ui.Activator;
 import org.simantics.structural.stubs.StructuralResource2;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter;
 import org.simantics.utils.datastructures.Pair;
 import org.simantics.utils.threads.ThreadUtils;
@@ -75,7 +75,7 @@ public class OpenDiagramFromConfigurationAdapter extends AbstractResourceEditorA
 
     @Override
     public void openEditor(final Resource r) throws Exception {
-        SimanticsUI.getSession().asyncRequest(new ReadRequest() {
+        Simantics.getSession().asyncRequest(new ReadRequest() {
             @Override
             public void run(ReadGraph g) throws DatabaseException {
                 openEditor(g, r, getEditorId());
index bfe0b7a7495d56b4ad89e7b31dd14628c7a84a9b..8739f904f1440292433e910ccc2a233a8d59a68a 100644 (file)
@@ -15,6 +15,7 @@ import java.util.Collection;
 
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.common.request.PossibleIndexRoot;
@@ -25,7 +26,6 @@ import org.simantics.diagram.stubs.DiagramResource;
 import org.simantics.modeling.ModelingResources;
 import org.simantics.modeling.ui.Activator;
 import org.simantics.structural.stubs.StructuralResource2;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.ResourceEditorInput2;
 import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter;
 import org.simantics.utils.ui.ErrorLogger;
@@ -58,7 +58,7 @@ public class OpenDiagramFromSymbolAdapter extends AbstractResourceEditorAdapter
 
     @Override
     public void openEditor(final Resource r) throws Exception {
-        SimanticsUI.getSession().asyncRequest(new ReadRequest() {
+        Simantics.getSession().asyncRequest(new ReadRequest() {
             @Override
             public void run(ReadGraph g) throws DatabaseException {
                 StructuralResource2 sr = StructuralResource2.getInstance(g);
index 0152a1c19fb72ea521febfe1c8b5c69048e8159c..ae88498dc948dc572b800d44a385c0f01e40a83d 100644 (file)
@@ -13,6 +13,7 @@ package org.simantics.modeling.ui.diagramEditor;
 
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.common.request.PossibleIndexRoot;
@@ -23,7 +24,6 @@ import org.simantics.db.layer0.variable.Variable;
 import org.simantics.db.layer0.variable.Variables;
 import org.simantics.modeling.ui.Activator;
 import org.simantics.spreadsheet.resource.SpreadsheetResource;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.ResourceEditorInput2;
 import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter;
 import org.simantics.utils.ui.workbench.WorkbenchUtils;
@@ -50,7 +50,7 @@ public class OpenSheetAdapter extends AbstractResourceEditorAdapter {
 
     @Override
     public void openEditor(final Resource r) throws Exception {
-        SimanticsUI.getSession().asyncRequest(new ReadRequest() {
+        Simantics.getSession().asyncRequest(new ReadRequest() {
             @Override
             public void run(ReadGraph g) throws DatabaseException {
 
index fbe48fbe2ec4aebcde60801b4be7acd5a867f05f..2838892c402e2831f8df68f924b374819eaddcf7 100644 (file)
@@ -30,6 +30,7 @@ import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.contexts.IContextService;
 import org.eclipse.ui.part.EditorPart;
 import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
@@ -202,7 +203,7 @@ public class SheetViewer extends EditorPart implements IResourceEditorPart2 {
     }
 
     protected void initSession() {
-        sessionContextProvider = SimanticsUI.getSessionContextProvider();
+        sessionContextProvider = Simantics.getSessionContextProvider();
         sessionContext = sessionContextProvider.getSessionContext();
     }
 
@@ -626,7 +627,7 @@ public class SheetViewer extends EditorPart implements IResourceEditorPart2 {
         // Set initial part name according to the name given by IEditorInput
         setPartName(getEditorInput().getName());
 
-        Session session = SimanticsUI.peekSession();
+        Session session = Simantics.peekSession();
         if (session != null) {
             Supplier<Boolean> disposedCallback = () -> disposed;
             session.asyncRequest(
index 8a4944200dcf5bfa244749496bc0f513fd4dc783..c646d769256f661e7babfeb38a8b4aac08538b67 100644 (file)
@@ -23,6 +23,7 @@ import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IWorkbenchPart;
+import org.simantics.Simantics;
 import org.simantics.databoard.util.ObjectUtils;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.common.procedure.adapter.ProcedureAdapter;
@@ -40,7 +41,6 @@ import org.simantics.scenegraph.g2d.events.KeyEvent;
 import org.simantics.scenegraph.g2d.events.KeyEvent.KeyPressedEvent;
 import org.simantics.scenegraph.g2d.events.MouseEvent;
 import org.simantics.scenegraph.g2d.events.MouseEvent.MouseMovedEvent;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.datastructures.hints.IHintContext.Key;
 import org.simantics.utils.datastructures.hints.IHintContext.KeyOf;
 import org.simantics.utils.ui.ErrorLogger;
@@ -159,7 +159,7 @@ public class TerminalInformer extends AbstractDiagramParticipant {
     }
 
     private void createMessage(TerminalInfo terminal, final Consumer<String> callback) {
-        SimanticsUI.getSession().asyncRequest(new TerminalInfoMessage(terminal, terminalNamingStrategy), new ProcedureAdapter<String>() {
+        Simantics.getSession().asyncRequest(new TerminalInfoMessage(terminal, terminalNamingStrategy), new ProcedureAdapter<String>() {
             @Override
             public void exception(Throwable t) {
                 ErrorLogger.defaultLogError(t);
index d6c4f69328bbd6e32afbae2efd444e33b0a435c4..d067ba344035fb7e0a300848d2c76441de742ba0 100644 (file)
@@ -26,6 +26,7 @@ import org.eclipse.ui.contexts.IContextActivation;
 import org.eclipse.ui.contexts.IContextService;
 import org.eclipse.ui.part.EditorPart;
 import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Session;
 import org.simantics.db.common.ResourceArray;
@@ -83,7 +84,6 @@ import org.simantics.modeling.mapping.ModelingSynchronizationHints;
 import org.simantics.scenegraph.g2d.events.command.CommandKeyBinding;
 import org.simantics.scenegraph.g2d.events.command.Commands;
 import org.simantics.simulation.experiment.IExperiment;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.dnd.ResourceTransferData;
 import org.simantics.ui.dnd.ResourceTransferUtils;
 import org.simantics.ui.workbench.IResourceEditorInput;
@@ -138,7 +138,7 @@ public class WikiDiagramViewer extends EditorPart implements IResourceEditorPart
         this.layer = layer;
         this.structuralPath = structuralPath;
 
-        sessionContextProvider = SimanticsUI.getSessionContextProvider();
+        sessionContextProvider = Simantics.getSessionContextProvider();
         sessionContext = sessionContextProvider.getSessionContext();
 
         canvasContext = createViewerCanvas();
index 0b3afd8a517ac1d63d41794418b61aec32e1d3cc..d0bf18b836a3521621fde2d93d04c735fcc05a23 100644 (file)
@@ -339,7 +339,7 @@ public class DiagramViewer
 
     protected Set<String> getPropertyPageContexts() {
         try {
-            return BrowseContext.getBrowseContextClosure(SimanticsUI.getSession(), defaultPropertyBrowseContexts);
+            return BrowseContext.getBrowseContextClosure(Simantics.getSession(), defaultPropertyBrowseContexts);
         } catch (DatabaseException e) {
             ExceptionUtils.logAndShowError("Failed to load modeled browse contexts for property page, see exception for details.", e);
             return defaultPropertyBrowseContexts;
@@ -361,7 +361,7 @@ public class DiagramViewer
     }
 
     protected void initSession() {
-        sessionContextProvider = SimanticsUI.getSessionContextProvider();
+        sessionContextProvider = Simantics.getSessionContextProvider();
         sessionContext = sessionContextProvider.getSessionContext();
     }
 
@@ -957,7 +957,7 @@ public class DiagramViewer
         // Set initial part name according to the name given by IEditorInput
         host.doSetPartName(getResourceEditorInput().getName());
 
-        Session session = SimanticsUI.peekSession();
+        Session session = Simantics.peekSession();
         if (session != null) {
             Supplier<Boolean> disposedCallback = () -> disposed;
             Display display = part.getContext().get(Shell.class).getDisplay();
index 94877d0b98da3462deebb8c468355be35c2cf67c..d8eaf0357472ba2831a0f58c800fd21ec4723d9d 100644 (file)
@@ -19,12 +19,12 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
 import org.simantics.db.common.request.WriteRequest;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.diagram.stubs.DiagramResource;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.utils.ResourceAdaptionUtils;
 
 /**
@@ -43,7 +43,7 @@ public class AlignHorizontalHandler extends AbstractHandler {
                if (resources.length < 2)
                        return null;
                
-               SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+               Simantics.getSession().asyncRequest(new WriteRequest() {
                        
                        @Override
                        public void perform(WriteGraph graph) throws DatabaseException {
index 87da411da9362942fe9dc76481078a0873741bd0..93359dd7358a1e3f3c2d67590af7f1608225ebe3 100644 (file)
@@ -19,12 +19,12 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
 import org.simantics.db.common.request.WriteRequest;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.diagram.stubs.DiagramResource;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.utils.ResourceAdaptionUtils;
 
 /**
@@ -43,7 +43,7 @@ public class AlignVerticalHandler extends AbstractHandler {
                if (resources.length < 2)
                        return null;
                
-               SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+               Simantics.getSession().asyncRequest(new WriteRequest() {
                        
                        @Override
                        public void perform(WriteGraph graph) throws DatabaseException {
index 04d1bf2ba4fa3a855f6419491526204e1094167a..261c2232f1c756b15c690cd9f391e5d74082e614 100644 (file)
@@ -24,13 +24,13 @@ import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.simantics.DatabaseJob;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
 import org.simantics.db.common.request.WriteRequest;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.modeling.actions.DisconnectFlag;
 import org.simantics.modeling.ui.Activator;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ISelectionUtils;
 
 /**
@@ -49,7 +49,7 @@ public class DisconnectFlagHandler extends AbstractHandler {
             @Override
             protected IStatus run(IProgressMonitor monitor) {
                 try {
-                    SimanticsUI.getSession().syncRequest(new WriteRequest() {
+                    Simantics.getSession().syncRequest(new WriteRequest() {
                         @Override
                         public void perform(WriteGraph graph) throws DatabaseException {
                             graph.markUndoPoint();
index 61eb73c17f02fa4118aab0a406882864999c6d8d..9167942b68f505242de381b163427d3f997e2b11 100644 (file)
@@ -25,6 +25,7 @@ import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.common.request.ReadRequest;
@@ -33,7 +34,6 @@ import org.simantics.diagram.elements.ElementTransforms;
 import org.simantics.diagram.elements.ElementTransforms.SIDE;
 import org.simantics.diagram.stubs.DiagramResource;
 import org.simantics.modeling.ui.Activator;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.utils.ResourceAdaptionUtils;
 
 /**
@@ -332,7 +332,7 @@ public class AlignTools implements DiagramTools {
     public void setSelection(ISelection s) {
         this.selection = ResourceAdaptionUtils.toResources(s);
         try {
-            SimanticsUI.getSession().syncRequest(new ReadRequest() {
+            Simantics.getSession().syncRequest(new ReadRequest() {
 
                 @Override
                 public void run(ReadGraph graph) throws DatabaseException {
index 6adb8d140cb22ee78c9cb96040108c0e0351c869..d8a80f2e9199e36dab76dc9d06942f12e38f843e 100644 (file)
@@ -12,6 +12,7 @@ import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.editors.text.EditorsUI;
 import org.eclipse.ui.ide.IDE;
+import org.simantics.Simantics;
 import org.simantics.databoard.Bindings;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
@@ -22,7 +23,6 @@ import org.simantics.document.DocumentResource;
 import org.simantics.layer0.Layer0;
 import org.simantics.modeling.ui.Activator;
 import org.simantics.simulation.ontology.SimulationResource;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter;
 import org.simantics.utils.FileUtils;
 import org.simantics.utils.ui.ErrorLogger;
@@ -44,7 +44,7 @@ public class OpenPlainTextDocumentAdapter extends AbstractResourceEditorAdapter
 
     @Override
     public void openEditor(final Resource r) throws Exception {
-        SimanticsUI.getSession().asyncRequest(new ReadRequest() {
+        Simantics.getSession().asyncRequest(new ReadRequest() {
             @Override
             public void run(ReadGraph g) throws DatabaseException {
                 Layer0 L0 = Layer0.getInstance(g);
index 25e57286fd10c79efe9ff1575fb0a0f57ec325b8..b1872c92badc005b9266ab06490201d2d7f5194f 100644 (file)
@@ -20,6 +20,7 @@ import java.util.Set;
 import java.util.function.Supplier;
 
 import org.eclipse.jface.resource.ImageDescriptor;
+import org.simantics.Simantics;
 import org.simantics.browsing.ui.BuiltinKeys;
 import org.simantics.browsing.ui.BuiltinKeys.ImagerKey;
 import org.simantics.browsing.ui.BuiltinKeys.LabelerKey;
@@ -56,7 +57,6 @@ import org.simantics.modeling.ui.modelBrowser.model.IDisposable;
 import org.simantics.modeling.ui.modelBrowser.model.INode;
 import org.simantics.modeling.ui.modelBrowser.model.INode2;
 import org.simantics.modeling.ui.modelBrowser.model.IUpdateable;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.datastructures.UnaryFunction;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -425,7 +425,7 @@ class NodeLabelerFactory implements LabelerFactory {
 
             @Override
             public Modifier getModifier(ModificationContext sourcePart, String key) {
-                return ((INode) context.getConstant(BuiltinKeys.INPUT)).getModifier(SimanticsUI.getSession(), key);
+                return ((INode) context.getConstant(BuiltinKeys.INPUT)).getModifier(Simantics.getSession(), key);
             }
 
             @Override
index 43f854fd4b669f91ea83b23816dba6df2e0afc35..4cc595310f5f5a9e82481be3092308b093ce6b9a 100644 (file)
@@ -20,13 +20,13 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
 import org.simantics.db.common.request.WriteRequest;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.SelectionHints;
 import org.simantics.modeling.flags.LiftFlag;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ISelectionUtils;
 
 /**
@@ -48,7 +48,7 @@ public class CreateConnectionPoint extends AbstractHandler {
             return null;
         final Set<Resource> flagSet = new HashSet<Resource>(flags);
 
-        SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+        Simantics.getSession().asyncRequest(new WriteRequest() {
             @Override
             public void perform(WriteGraph g) throws DatabaseException {
                 for (Resource flag : flagSet)
index 76ea9607b72857f52493b8a9c1c84b5aab6fcb53..d9634dc9d0ec3952badf84badbb5d722f25c7e02 100644 (file)
@@ -18,6 +18,7 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
 import org.simantics.db.common.request.WriteRequest;
@@ -25,7 +26,6 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.issues.common.IssueUtils;
 import org.simantics.issues.ontology.IssueResource;
 import org.simantics.modeling.ModelingResources;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.AdaptionUtils;
 public class CreateIssue extends AbstractHandler {
 
@@ -42,7 +42,7 @@ public class CreateIssue extends AbstractHandler {
         if (element == null)
             return null;
 
-        SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+        Simantics.getSession().asyncRequest(new WriteRequest() {
             @Override
             public void perform(WriteGraph graph) throws DatabaseException {
                
index 3067cf01f79c5243a6292d016dad575c924cf057..9e690f064fd87fae7857c3265c1d2b15a9dada68 100644 (file)
@@ -25,6 +25,7 @@ import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.Simantics;
 import org.simantics.browsing.ui.NodeContext;
 import org.simantics.browsing.ui.common.node.DeleteException;
 import org.simantics.browsing.ui.common.node.IDeletable;
@@ -38,7 +39,6 @@ import org.simantics.db.layer0.util.RemoverUtil;
 import org.simantics.modeling.ui.Activator;
 import org.simantics.modeling.ui.modelBrowser.model.INode;
 import org.simantics.modeling.ui.modelBrowser.model.INode2;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.logging.TimeLogger;
 import org.simantics.utils.ui.ErrorLogger;
 import org.simantics.utils.ui.ISelectionUtils;
@@ -147,7 +147,7 @@ public class DeleteNodeHandler extends AbstractHandler {
 
         final INode node = (INode) ctx.getAdapter(INode.class);
         if (node != null) {
-            SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+            Simantics.getSession().asyncRequest(new WriteRequest() {
                 @Override
                 public void perform(WriteGraph graph) throws DatabaseException {
                     node.handleDelete(graph);
index ab695a726a943b99b1b18706f871b03a485835cd..03cfa31f71563752b991c3fa07321cf7975cf254 100644 (file)
@@ -16,6 +16,7 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
 import org.simantics.db.common.request.WriteRequest;
@@ -24,7 +25,6 @@ import org.simantics.db.layer0.SelectionHints;
 import org.simantics.db.layer0.adapter.InstanceFactory;
 import org.simantics.simulation.ontology.SimulationResource;
 import org.simantics.spreadsheet.resource.SpreadsheetResource;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.datastructures.ArrayMap;
 import org.simantics.utils.ui.ISelectionUtils;
 
@@ -37,7 +37,7 @@ public class NewSpreadsheetHandler extends AbstractHandler {
         if (container == null)
             return null;
 
-        SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+        Simantics.getSession().asyncRequest(new WriteRequest() {
             @Override
             public void perform(WriteGraph graph) throws DatabaseException {
                 SimulationResource SIMU = SimulationResource.getInstance(graph);
index d03199d9c72f549f161d729fc82503fa749adfdd..11c6af8bc6ece2fd078911e67db04b7e2d24ed1b 100644 (file)
@@ -26,6 +26,7 @@ import org.eclipse.ui.commands.ICommandService;
 import org.eclipse.ui.commands.IElementUpdater;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.menus.UIElement;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
@@ -53,7 +54,7 @@ public class ToggleExternalFlag extends AbstractHandler implements IElementUpdat
         if (resource == null)
             return null;
 
-        SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+        Simantics.getSession().asyncRequest(new WriteRequest() {
             @Override
             public void perform(WriteGraph g) throws DatabaseException {
                 DiagramResource dr = DiagramResource.getInstance(g);
@@ -82,7 +83,7 @@ public class ToggleExternalFlag extends AbstractHandler implements IElementUpdat
         }
 
         // Get the current value for the State object
-        Session s = SimanticsUI.peekSession();
+        Session s = Simantics.peekSession();
         if (s != null) {
             Boolean value = Boolean.TRUE;
             IWorkbenchSite site = (IWorkbenchSite) parameters.get("org.eclipse.ui.part.IWorkbenchPartSite");
index 10eb340f7ceb6f4ef5af28c0412f12c206616d54..bd218ba69e5f719979f59fed127d4108a5e2d96f 100644 (file)
@@ -16,6 +16,7 @@ import java.util.Collections;
 
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.ISelection;
+import org.simantics.Simantics;
 import org.simantics.browsing.ui.common.node.IDropTargetNode;
 import org.simantics.browsing.ui.content.Labeler.Modifier;
 import org.simantics.browsing.ui.graph.impl.LabelerUtil;
@@ -26,7 +27,6 @@ import org.simantics.db.WriteGraph;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.util.RemoverUtil;
 import org.simantics.layer0.Layer0;
-import org.simantics.ui.SimanticsUI;
 
 @Deprecated
 public class Node implements INode, IDropTargetNode {
@@ -103,7 +103,7 @@ public class Node implements INode, IDropTargetNode {
     @Override
     public void drop(Object data) {
         if (data instanceof ISelection) {
-            handleDrop(SimanticsUI.getSession(), (ISelection) data);
+            handleDrop(Simantics.getSession(), (ISelection) data);
         }
     }
 
index 4943ce35268fe4122769bf946a734d73b9f941b9..c28035516fd96309304c9b70c038045be6421157 100644 (file)
@@ -13,6 +13,7 @@ import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.ActionContributionItem;
 import org.eclipse.jface.action.IContributionItem;
 import org.eclipse.jface.resource.ImageDescriptor;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
@@ -94,11 +95,11 @@ public class SetSubscriptionEnabledContribution extends DynamicMenuContribution
                 new ActionContributionItem(new Action(name, image) {
                     @Override
                     public void run() {
-                        Session session = SimanticsUI.peekSession();
+                        Session session = Simantics.peekSession();
                         if (session == null)
                             return;
 
-                        SimanticsUI.getSession().asyncRequest(new WriteRequest() {
+                        Simantics.getSession().asyncRequest(new WriteRequest() {
                             @Override
                             public void perform(WriteGraph graph) throws DatabaseException {
                                 new SetSubscriptionEnabled(subscriptions, include).perform(graph);
index 99020c4b78f99d54f68ef84f5950da70462fdb42..afdea65c01e40b20aa140436c29741f5fc39a7af 100644 (file)
@@ -14,6 +14,7 @@ package org.simantics.modeling.ui.modelBrowser2.model;
 import java.util.List;
 
 import org.eclipse.jface.viewers.ISelection;
+import org.simantics.Simantics;
 import org.simantics.browsing.ui.common.node.IDeletable;
 import org.simantics.browsing.ui.common.node.IDropTargetNode;
 import org.simantics.browsing.ui.common.node.IModifiableNode;
@@ -23,7 +24,6 @@ import org.simantics.db.Resource;
 import org.simantics.db.Session;
 import org.simantics.modeling.PropertyVariables;
 import org.simantics.structural.ui.modelBrowser.nodes.AbstractNode;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ISelectionUtils;
 
 /**
@@ -43,7 +43,7 @@ public class ChartNode extends AbstractNode implements IDeletable, IDropTargetNo
         final List<PropertyVariables> vars = ISelectionUtils.filterSelection((ISelection) data, PropertyVariables.class);
         if (!vars.isEmpty()) {
 //            try {
-//                List<VariableReference> references = SimanticsUI.getSession().syncRequest(VariableReferences.toReferences(vars));
+//                List<VariableReference> references = Simantics.getSession().syncRequest(VariableReferences.toReferences(vars));
 //                addPlots(references);
 //            } catch (DatabaseException e) {
 //                ErrorLogger.defaultLogError(e);
@@ -59,7 +59,7 @@ public class ChartNode extends AbstractNode implements IDeletable, IDropTargetNo
     }
 
 //    private void addPlots(List<VariableReference> references) {
-//        SimanticsUI.getSession().asyncRequest(new AddChartItem(resource, references), new Callback<DatabaseException>() {
+//        Simantics.getSession().asyncRequest(new AddChartItem(resource, references), new Callback<DatabaseException>() {
 //            @Override
 //            public void run(DatabaseException e) {
 //                if (e != null)
@@ -70,7 +70,7 @@ public class ChartNode extends AbstractNode implements IDeletable, IDropTargetNo
 
     @Override
     public Modifier getModifier(String columnId) {
-        Session s = SimanticsUI.getSession();
+        Session s = Simantics.getSession();
         return new LabelModifier(s, resource);
     }
 
index 0201aea84a836331777a0deafb0ad8cf5026cedb..abedde4afe8666fbc877002996a7a5894ba64087 100644 (file)
  *******************************************************************************/
 package org.simantics.modeling.ui.modelBrowser2.model;
 
+import org.simantics.Simantics;
 import org.simantics.browsing.ui.common.node.IDeletable;
 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.Resource;
 import org.simantics.structural.ui.modelBrowser.nodes.AbstractNode;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * @author Tuukka Lehtonen
@@ -31,7 +31,7 @@ public class StateNode extends AbstractNode implements IDeletable, IModifiableNo
     @Override
     public Modifier getModifier(String columnId) {
         // FIXME: the labeler contribution responsible for handling this node does not handle modifiers.
-        return new LabelModifier(SimanticsUI.getSession(), resource);
+        return new LabelModifier(Simantics.getSession(), resource);
     }
 
 }
index 5a1bef1d8b7e8ccce8abf008160c89ad1266e3cb..0031252ef27c9e27fcf47775321fa6ec587ae0bf 100644 (file)
@@ -29,7 +29,7 @@ public class SubscriptionItemNode extends AbstractNode implements IDeletable {
     public Object getAdapter(Class adapter) {
 //        if (adapter == NodeReference.class) {
 //            try {
-//                Variant nodeId = (Variant) SimanticsUI.getSession().syncRequest(
+//                Variant nodeId = (Variant) Simantics.getSession().syncRequest(
 //                        Queries.getRelatedValue(resource, ModelingResources.URIs.HasNodeId, Bindings.VARIANT));
 //                return new NodeReference(null, nodeId);
 //            } catch (DatabaseException e) {
index 1729db5409fbc8d7b23e7c3d46c6d5b8f83f4b3e..faf51168aae16ff39f896457c20a7bd511c18ee9 100644 (file)
@@ -14,6 +14,7 @@ package org.simantics.modeling.ui.modelBrowser2.model;
 import java.util.List;
 
 import org.eclipse.jface.viewers.ISelection;
+import org.simantics.Simantics;
 import org.simantics.browsing.ui.common.node.IDeletable;
 import org.simantics.browsing.ui.common.node.IDropTargetNode;
 import org.simantics.db.Resource;
@@ -23,7 +24,6 @@ import org.simantics.modeling.PropertyVariables;
 import org.simantics.modeling.subscription.AddSubscriptionItems;
 import org.simantics.modeling.utils.VariableReferences;
 import org.simantics.structural.ui.modelBrowser.nodes.AbstractNode;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ErrorLogger;
 import org.simantics.utils.ui.ISelectionUtils;
 
@@ -44,7 +44,7 @@ public class SubscriptionNode extends AbstractNode implements IDeletable, IDropT
         if (!vars.isEmpty()) {
             List<VariableReference> references;
             try {
-                references = SimanticsUI.getSession().syncRequest(VariableReferences.toReferences(vars));
+                references = Simantics.getSession().syncRequest(VariableReferences.toReferences(vars));
                 addSubscriptions(references);
             } catch (DatabaseException e) {
                 ErrorLogger.defaultLogError(e);
@@ -58,7 +58,7 @@ public class SubscriptionNode extends AbstractNode implements IDeletable, IDropT
     }
 
     private void addSubscriptions(List<VariableReference> references) {
-        SimanticsUI.getSession().asyncRequest(new AddSubscriptionItems(resource, references), e -> {
+        Simantics.getSession().asyncRequest(new AddSubscriptionItems(resource, references), e -> {
             if (e != null)
                 ErrorLogger.defaultLogError(e);
         });
index 689d543280459858f08be49c9534dd2c95e17c23..0952ca5b131ce2d7a077290dc266ed63379397f0 100644 (file)
@@ -29,7 +29,7 @@ public class TrendItemNode extends AbstractNode implements IDeletable {
     public Object getAdapter(Class adapter) {
 //        if (adapter==NodeReference.class) {
 //            try {
-//                Variant nodeId = (Variant) SimanticsUI.getSession().syncRequest(
+//                Variant nodeId = (Variant) Simantics.getSession().syncRequest(
 //                        Queries.getRelatedValue(resource, ModelingResources.URIs.HasNodeId, Bindings.VARIANT));
 //                return new NodeReference(null, nodeId);
 //            } catch (DatabaseException e) {
index 461e98c10b1d10d4895230ec1b9e9fe7df85e9b7..9cb32a2a7bbb2f4ee27cbb2dd1b57ec6c6540228 100644 (file)
@@ -153,7 +153,7 @@ public class PDFDiagramExportWizard extends Wizard implements IExportWizard {
     public void init(IWorkbench workbench, IStructuredSelection selection) {
         readPreferences();
 
-        ISessionContext ctx = SimanticsUI.getSessionContext();
+        ISessionContext ctx = Simantics.getSessionContext();
         if (ctx == null)
             return;
         IProject project = ctx.getHint(ProjectKeys.KEY_PROJECT);
index 8185d7f6d7659caccbf8055a4476e2c3d820345d..bbb3ca369753ad995b6db35d0ec229a2f1be0c9a 100644 (file)
@@ -13,6 +13,7 @@ package org.simantics.modeling.ui.property;
 
 import org.eclipse.core.expressions.PropertyTester;
 import org.simantics.DatabaseJob;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
@@ -54,7 +55,7 @@ public class ComponentTypePropertyTester extends PropertyTester {
         if (resource == null)
             return false;
 
-        Session session = SimanticsUI.peekSession();
+        Session session = Simantics.peekSession();
         if (session == null)
             return false;
 
index d19e6dbfbc1415c8afe9142e6384938937dee65a..179173ede933e5b35b89090fc1e999437c42831c 100644 (file)
@@ -21,6 +21,7 @@ import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.part.IPage;
 import org.eclipse.ui.part.PageBookView;
+import org.simantics.Simantics;
 import org.simantics.browsing.ui.common.ErrorLogger;
 import org.simantics.browsing.ui.common.property.IProperty;
 import org.simantics.db.Resource;
@@ -31,7 +32,6 @@ import org.simantics.db.common.utils.NameUtils;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.variable.Variable;
 import org.simantics.db.management.ISessionContext;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.IPropertyPage;
 import org.simantics.utils.ui.ISelectionUtils;
 
@@ -54,7 +54,7 @@ public class RestoreDefaultValueHandler extends AbstractHandler {
         // Cannot use this, since the property view does not contribute a selection back to the workbench.
         //HandlerUtil.getCurrentSelection(event);
 
-        ISessionContext sc = SimanticsUI.getSessionContext();
+        ISessionContext sc = Simantics.getSessionContext();
         if (sc == null)
             return null;
 
index 97d23f05f271f14214a6ec38e5382d407c5476aa..6574b31b628bfbc735ba884415199c266b036a09 100644 (file)
@@ -431,7 +431,7 @@ public class DiagramSceneGraphProvider implements ICanvasSceneGraphProvider, IDi
 
         try {
             // FIXME: I have no idea if this works or not..
-            diagram = SimanticsUI.getSession().syncRequest(new Read<IDiagram>() {
+            diagram = Simantics.getSession().syncRequest(new Read<IDiagram>() {
                 @Override
                 public IDiagram perform(ReadGraph graph) throws DatabaseException {
                     IDiagram d = synchronizer.loadDiagram(new NullProgressMonitor(), graph, null, structuralPath.resources[0], null, structuralPath.removeFromBeginning(0), hints);
index 182c0f6fcb59a2835666687777c6fea5278d8210..8a3bd6999f5a877bd8becfd29dae6f4a6d0b641a 100644 (file)
@@ -26,12 +26,12 @@ import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.ui.IExportWizard;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.simantics.Simantics;
 import org.simantics.db.management.ISessionContext;
 import org.simantics.modeling.ui.Activator;
 import org.simantics.modeling.ui.utils.NoProjectPage;
 import org.simantics.project.IProject;
 import org.simantics.project.ProjectKeys;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ErrorLogger;
 import org.simantics.utils.ui.ExceptionUtils;
 
@@ -81,7 +81,7 @@ public class ModelExportWizard extends Wizard implements IExportWizard {
     public void init(IWorkbench workbench, IStructuredSelection selection) {
         readPreferences();
 
-        ISessionContext ctx = SimanticsUI.getSessionContext();
+        ISessionContext ctx = Simantics.getSessionContext();
         if (ctx == null)
             return;
         IProject project = ctx.getHint(ProjectKeys.KEY_PROJECT);
index 011ce12ff538f1764d194ba5c2ef74c644382bc5..23d3419845993d6c9e1e16109c7444b4926cea88 100644 (file)
@@ -56,7 +56,7 @@ public class ModelImportWizard extends Wizard implements IImportWizard {
         String recentPathsPref = store.getString(Preferences.RECENT_SHARED_LIBRARY_IMPORT_LOCATIONS);
         Deque<String> recentImportPaths = Preferences.decodePaths(recentPathsPref);
 
-        ISessionContext ctx = SimanticsUI.getSessionContext();
+        ISessionContext ctx = Simantics.getSessionContext();
         if (ctx == null)
             return false;
         IProject project = ctx.getHint(ProjectKeys.KEY_PROJECT);
index 06773131224f5a845bec339455535a134af8bffa..e4accc8ceec328935f31584ba8111509dbe32c8b 100644 (file)
@@ -26,12 +26,12 @@ import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.ui.IExportWizard;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.simantics.Simantics;
 import org.simantics.db.management.ISessionContext;
 import org.simantics.modeling.ui.Activator;
 import org.simantics.modeling.ui.utils.NoProjectPage;
 import org.simantics.project.IProject;
 import org.simantics.project.ProjectKeys;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ErrorLogger;
 import org.simantics.utils.ui.ExceptionUtils;
 
@@ -78,7 +78,7 @@ public class SharedOntologyExportWizard extends Wizard implements IExportWizard
     public void init(IWorkbench workbench, IStructuredSelection selection) {
         readPreferences();
 
-        ISessionContext ctx = SimanticsUI.getSessionContext();
+        ISessionContext ctx = Simantics.getSessionContext();
         if (ctx == null)
             return;
         IProject project = ctx.getHint(ProjectKeys.KEY_PROJECT);
index 8345c229eb8d5d6d4dca452a270e0d152fef43e9..d2b296f91d5aacbd8a3c4b6ee00598189bb6d56e 100644 (file)
@@ -31,6 +31,7 @@ import org.eclipse.swt.SWT;
 import org.eclipse.ui.IImportWizard;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.simantics.Simantics;
 import org.simantics.databoard.binding.Binding;
 import org.simantics.databoard.binding.mutable.Variant;
 import org.simantics.databoard.container.DataContainer;
@@ -49,7 +50,6 @@ import org.simantics.modeling.ui.Activator;
 import org.simantics.modeling.ui.utils.NoProjectPage;
 import org.simantics.project.IProject;
 import org.simantics.project.ProjectKeys;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.utils.ResourceAdaptionUtils;
 import org.simantics.utils.strings.EString;
 import org.simantics.utils.ui.ErrorLogger;
@@ -71,7 +71,7 @@ public class SharedOntologyImportWizard extends Wizard implements IImportWizard
         String recentPathsPref = store.getString(Preferences.RECENT_SHARED_LIBRARY_IMPORT_LOCATIONS);
         Deque<String> recentImportPaths = Preferences.decodePaths(recentPathsPref);
 
-        ISessionContext ctx = SimanticsUI.getSessionContext();
+        ISessionContext ctx = Simantics.getSessionContext();
         if (ctx == null)
             return false;
         IProject project = ctx.getHint(ProjectKeys.KEY_PROJECT);
index 3016311ff9c0411be3eb22cb8b11ab6a440ad960..a92d7b62643d713ac3095f1d7df58966e8cb80f2 100644 (file)
@@ -260,7 +260,7 @@ public class TypicalUtil {
             if (excludedComponents != null && excludedComponents.contains(component))
                 continue;
             try {
-                String renamed = ComponentNamingUtil.findFreshInstanceName(graph, SimanticsUI.getProject(), configurationRoot, typicalCompositeInstance, component);
+                String renamed = ComponentNamingUtil.findFreshInstanceName(graph, Simantics.getProject(), configurationRoot, typicalCompositeInstance, component);
                 if (DEBUG)
                     System.out.println("Typicals: renamed " + entry.getKey() + " -> " + renamed);
                 graph.claimLiteral(entry.getValue(), L0.HasName, L0.NameOf, renamed, Bindings.STRING);
index d6fae16ccf7e780b42a5bd5db2a8c3d3f7980695..eb942ffb037112790520864a9e719fbe9904ab93 100644 (file)
@@ -11,6 +11,7 @@
  *******************************************************************************/
 package org.simantics.simulation.ui.handlers;
 
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.exception.DatabaseException;
@@ -19,7 +20,6 @@ import org.simantics.simulation.ontology.SimulationResource;
 import org.simantics.simulation.project.IExperimentManager;
 import org.simantics.ui.DoubleClickEvent;
 import org.simantics.ui.IDoubleClickAction;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.utils.ResourceAdaptionUtils;
 import org.simantics.utils.ui.action.PriorityAction;
 
@@ -42,7 +42,7 @@ public class ActivateExperimentAction implements IDoubleClickAction {
             return;
 
         if (g.isInstanceOf(experiment, SimulationResource.getInstance(g).Experiment)) {
-            final IProject project = SimanticsUI.getProject();
+            final IProject project = Simantics.getProject();
             if (project == null)
                 return;
 
index 19da34f3b8a003a047d0aa45bd907a871255f8e5..82fe56550bcc811910e818b2fa794f196972980e 100644 (file)
@@ -16,6 +16,7 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.common.request.ReadRequest;
@@ -23,7 +24,6 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.project.IProject;
 import org.simantics.simulation.ontology.SimulationResource;
 import org.simantics.simulation.project.IExperimentManager;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.utils.ResourceAdaptionUtils;
 import org.simantics.utils.ui.ErrorLogger;
 
@@ -45,7 +45,7 @@ public class ActivateExperimentHandler extends AbstractHandler {
         if (experiment == null)
             return null;
 
-        final IProject project = SimanticsUI.peekProject();
+        final IProject project = Simantics.peekProject();
         if (project == null)
             return null;
 
index cd376cf540eb190380ea59755a4008c51a84bce0..872bf969d57d5202f74cb0c09eb569d5c809769d 100644 (file)
@@ -21,17 +21,17 @@ import org.eclipse.core.runtime.SubMonitor;
 import org.eclipse.jface.dialogs.ProgressMonitorDialog;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.Simantics;
 import org.simantics.project.IProject;
 import org.simantics.simulation.experiment.IExperiment;
 import org.simantics.simulation.project.IExperimentManager;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ExceptionUtils;
 
 public class Dispose extends AbstractHandler {
 
     @Override
     public Object execute(ExecutionEvent event) throws ExecutionException {
-        IProject project = SimanticsUI.getProject();
+        IProject project = Simantics.getProject();
         IExperimentManager manager = project.getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);
         final IExperiment experiment = manager.getActiveExperiment();
         if (experiment == null)
index 5cd524665eb8fff1ba523cb1e7dd156462da2fbb..b3324db8b2af051fd75f1f621aa88e9994e83640 100644 (file)
@@ -14,17 +14,17 @@ package org.simantics.simulation.ui.handlers;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.simantics.Simantics;
 import org.simantics.simulation.experiment.IDynamicExperiment;
 import org.simantics.simulation.experiment.IExperiment;
 import org.simantics.simulation.project.IExperimentManager;
-import org.simantics.ui.SimanticsUI;
 
 public class Pause extends AbstractHandler {
 
     @Override
     public Object execute(ExecutionEvent event) throws ExecutionException {
         IExperimentManager manager = 
-            SimanticsUI.getProject().getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);
+            Simantics.getProject().getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);
         IExperiment experiment = manager.getActiveExperiment();
         if(experiment instanceof IDynamicExperiment)
             ((IDynamicExperiment)experiment).simulate(false);
index b49d0c0479f47fc034cc9187071bf35aec0b86af..335023b8f27c792e18f995c041d096c34dcb60c7 100644 (file)
@@ -19,6 +19,7 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.simantics.ObjectIdentitySchedulingRule;
+import org.simantics.Simantics;
 import org.simantics.simulation.experiment.IExperiment;
 import org.simantics.simulation.project.IExperimentManager;
 import org.simantics.simulation.ui.Activator;
@@ -29,7 +30,7 @@ public class Reload extends AbstractHandler {
     @Override
     public Object execute(ExecutionEvent event) throws ExecutionException {
         IExperimentManager manager =
-            SimanticsUI.getProject().getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);
+            Simantics.getProject().getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);
         IExperiment experiment = manager.getActiveExperiment();
         if (experiment != null) {
             Job j = new RefreshJob(experiment);
@@ -51,7 +52,7 @@ public class Reload extends AbstractHandler {
         protected IStatus run(IProgressMonitor monitor) {
             try {
                 monitor.beginTask("", IProgressMonitor.UNKNOWN);
-                experiment.refresh(SimanticsUI.getSession());
+                experiment.refresh(Simantics.getSession());
                 if (monitor.isCanceled())
                     return Status.CANCEL_STATUS;
                 return Status.OK_STATUS;
index 343858a0624dd951c6628a51446d1bdde005f92a..1f1c384c8f35e98b33bbd5b3ecf2e44d607ecc3a 100644 (file)
@@ -19,11 +19,11 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.simantics.ObjectIdentitySchedulingRule;
+import org.simantics.Simantics;
 import org.simantics.simulation.experiment.IDynamicExperiment;
 import org.simantics.simulation.experiment.IExperiment;
 import org.simantics.simulation.project.IExperimentManager;
 import org.simantics.simulation.ui.Activator;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * @author Tuukka Lehtonen
@@ -32,7 +32,7 @@ public class SaveState extends AbstractHandler {
 
     @Override
     public Object execute(ExecutionEvent event) throws ExecutionException {
-        IExperimentManager manager = SimanticsUI.getProject().getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);
+        IExperimentManager manager = Simantics.getProject().getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);
         IExperiment experiment = manager.getActiveExperiment();
         if (experiment instanceof IDynamicExperiment) {
             Job j = new SaveStateJob((IDynamicExperiment) experiment);
index e3734876297cfc2eec19d4f81f2b602df79435d4..91d97b88d28e54b627a6cc86d4ba78884d5cfbd5 100644 (file)
@@ -30,6 +30,7 @@ import org.eclipse.swt.widgets.ToolBar;
 import org.eclipse.swt.widgets.ToolItem;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.actions.CompoundContributionItem;
+import org.simantics.Simantics;
 import org.simantics.project.IProject;
 import org.simantics.simulation.experiment.ExperimentState;
 import org.simantics.simulation.experiment.IDynamicExperiment;
@@ -39,7 +40,6 @@ import org.simantics.simulation.experiment.IExperimentListener;
 import org.simantics.simulation.experiment.SimulationTimeUtil;
 import org.simantics.simulation.project.IExperimentManager;
 import org.simantics.simulation.project.IExperimentManagerListener;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.threads.ThreadUtils;
 
 
@@ -93,7 +93,7 @@ public class TimerContribution extends CompoundContributionItem {
     public void fill(final ToolBar parent, final int index) {
         //System.out.println(this + "(" + System.identityHashCode(this) + ") FILL");
 
-        IProject project = SimanticsUI.peekProject();
+        IProject project = Simantics.peekProject();
         if (project == null)
             return;
 
index e884a773d24c26c134feb3f9cf02fc274b693d95..db2064c131bd9320b1f9d34e666515d752fcd484 100644 (file)
@@ -17,6 +17,7 @@ import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.e4.core.di.annotations.Execute;
 import org.simantics.ObjectIdentitySchedulingRule;
+import org.simantics.Simantics;
 import org.simantics.simulation.experiment.IExperiment;
 import org.simantics.simulation.project.IExperimentManager;
 import org.simantics.simulation.ui.Activator;
@@ -27,7 +28,7 @@ public class Reload {
     @Execute
     public void execute() {
         IExperimentManager manager =
-            SimanticsUI.getProject().getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);
+            Simantics.getProject().getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);
         IExperiment experiment = manager.getActiveExperiment();
         if (experiment != null) {
             Job j = new RefreshJob(experiment);
@@ -49,7 +50,7 @@ public class Reload {
         protected IStatus run(IProgressMonitor monitor) {
             try {
                 monitor.beginTask("", IProgressMonitor.UNKNOWN);
-                experiment.refresh(SimanticsUI.getSession());
+                experiment.refresh(Simantics.getSession());
                 if (monitor.isCanceled())
                     return Status.CANCEL_STATUS;
                 return Status.OK_STATUS;
index a5f3fa951198c2720dc7ed53450504d3a2a991cc..a7756282fdde604df0052d4e870061d7f208300d 100644 (file)
@@ -36,6 +36,7 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Text;
+import org.simantics.Simantics;
 import org.simantics.databoard.util.ObjectUtils;
 import org.simantics.project.IProject;
 import org.simantics.simulation.experiment.ExperimentState;
@@ -46,7 +47,6 @@ import org.simantics.simulation.experiment.IExperimentListener;
 import org.simantics.simulation.experiment.SimulationTimeUtil;
 import org.simantics.simulation.project.IExperimentManager;
 import org.simantics.simulation.project.IExperimentManagerListener;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.threads.ThreadUtils;
 
 /**
@@ -144,7 +144,7 @@ public class TimerContribution {
 
     @PostConstruct
     public void createControls(Composite parent, MToolControl toolControl) {
-        IProject project = SimanticsUI.peekProject();
+        IProject project = Simantics.peekProject();
         if (project == null)
             return;
 
index d817ca1fa005a6ac460fd189214ab422438041b0..f57142b843a097de570fcd634b237069b7cea2eb 100644 (file)
@@ -11,6 +11,7 @@
  *******************************************************************************/
 package org.simantics.spreadsheet.graph;
 
+import org.simantics.Simantics;
 import org.simantics.db.AsyncReadGraph;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.RequestProcessor;
@@ -25,7 +26,6 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.variable.Variable;
 import org.simantics.spreadsheet.Adaptable;
 import org.simantics.spreadsheet.CellEditor;
-import org.simantics.ui.SimanticsUI;
 
 public class GraphBackend implements Adaptable, ListenerSupport, AsyncListenerSupport, SyncListenerSupport {
 
@@ -46,8 +46,8 @@ public class GraphBackend implements Adaptable, ListenerSupport, AsyncListenerSu
        public GraphBackend(RequestProcessor processor, VirtualGraph virtualGraph) {
                this.processor = processor;
                this.virtualGraph = virtualGraph;
-               delayedMerger = new MergingDelayedWriteProcessor(SimanticsUI.getSessionContext().getSession(), 5);
-               writeOnlyMerger = new MergingWriteOnlyProcessor(SimanticsUI.getSessionContext().getSession(), virtualGraph, 5);
+               delayedMerger = new MergingDelayedWriteProcessor(Simantics.getSessionContext().getSession(), 5);
+               writeOnlyMerger = new MergingWriteOnlyProcessor(Simantics.getSessionContext().getSession(), virtualGraph, 5);
        }
        
        public RequestProcessor getModifier() {
index ef5d78481c4fad87fcd84dc7ee0110c3fcb45568..17ed94c772c273121c05de3118897b2ede9b8d6d 100644 (file)
@@ -16,10 +16,10 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.swt.widgets.Composite;
+import org.simantics.Simantics;
 import org.simantics.db.procedure.Listener;
 import org.simantics.graphviz.Graph;
 import org.simantics.graphviz.ui.GraphvizComponent;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.ResourceEditorPart;
 
 public class CompositeViewer extends ResourceEditorPart {
@@ -35,7 +35,7 @@ public class CompositeViewer extends ResourceEditorPart {
     }
 
     private void readGraph() {
-        SimanticsUI.getSession().asyncRequest(new CreateCompositeGraph(
+        Simantics.getSession().asyncRequest(new CreateCompositeGraph(
                 getResourceInput().getResource()),
                 new Listener<Graph>() {
 
index d1649ad504116be1678355c03a6f10d998fd7cae..7ccfd7099b488c2c8f0df4cabac3838f4520c35b 100644 (file)
@@ -21,6 +21,7 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.ISharedImages;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
+import org.simantics.Simantics;
 import org.simantics.browsing.ui.model.browsecontexts.BrowseContext;
 import org.simantics.browsing.ui.platform.GraphExplorerView;
 import org.simantics.browsing.ui.swt.ViewArgumentUtils;
@@ -28,7 +29,6 @@ import org.simantics.db.UndoContext;
 import org.simantics.db.common.UndoContextEx;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.structural.ui.Activator;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ExceptionUtils;
 import org.simantics.utils.ui.workbench.WorkbenchUtils;
 
@@ -95,7 +95,7 @@ public class ModelBrowser extends GraphExplorerView {
 
     protected static Set<String> loadBrowseContexts(final Set<String> browseContexts) {
         try {
-            return BrowseContext.getBrowseContextClosure(SimanticsUI.getSession(), browseContexts);
+            return BrowseContext.getBrowseContextClosure(Simantics.getSession(), browseContexts);
         } catch (DatabaseException e) {
             ExceptionUtils.logAndShowError("Failed to load modeled browse contexts for property page, see exception for details.", e);
             return browseContexts;
index 09cb31c86965d5ee6622e40ed45094fb62195ee7..ef194024fa60dbc0f02994cb34b7065ce4a1453e 100644 (file)
@@ -16,6 +16,7 @@ import java.util.Collections;
 import java.util.Set;
 
 import org.eclipse.swt.widgets.Composite;
+import org.simantics.Simantics;
 import org.simantics.browsing.ui.NodeContext;
 import org.simantics.browsing.ui.common.ErrorLogger;
 import org.simantics.browsing.ui.model.InvalidContribution;
@@ -27,7 +28,6 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.procedure.Procedure;
 import org.simantics.db.request.Read;
 import org.simantics.project.ontology.ProjectResource;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * @author Hannu Niemist&ouml;
@@ -42,7 +42,7 @@ public class ModelBrowser2 extends ModelBrowser {
         this.hideComparatorSelector = true;
         this.hideViewpointSelector = true;
 
-        SimanticsUI.getSession().asyncRequest(new ReadRequest() {
+        Simantics.getSession().asyncRequest(new ReadRequest() {
             @Override
             public void run(ReadGraph graph) throws DatabaseException { 
                 ArrayList<Resource> browseContexts = new ArrayList<Resource>();
@@ -76,7 +76,7 @@ public class ModelBrowser2 extends ModelBrowser {
         if (target == null)
             return;
 
-        SimanticsUI.getSession().asyncRequest(new Read<Runnable>() {
+        Simantics.getSession().asyncRequest(new Read<Runnable>() {
             @Override
             public Runnable perform(ReadGraph graph) throws DatabaseException {
                 if (dndBrowseContext == null)
index 2feac0c5daea1a018cdfc045382dd5e4535f5512..2efb28bd0c68f9f222073bedeaaee6fd2e882309 100644 (file)
@@ -37,6 +37,7 @@ import org.eclipse.swt.widgets.TreeItem;
 import org.eclipse.ui.IWorkbenchActionConstants;
 import org.eclipse.ui.IWorkbenchPartSite;
 import org.eclipse.ui.PlatformUI;
+import org.simantics.Simantics;
 import org.simantics.db.ChangeSetIdentifier;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
@@ -50,7 +51,6 @@ import org.simantics.layer0.Layer0;
 import org.simantics.team.Activator;
 import org.simantics.team.internal.DebugPolicy;
 import org.simantics.team.internal.Images;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ExceptionUtils;
 import org.simantics.utils.ui.dialogs.ShowError;
 
@@ -109,7 +109,7 @@ public class HistoryView extends TreeView {
         commentColumn.getColumn().setWidth(20);
         ad.setColumnData(commentColumn.getColumn(), new ColumnWeightData(50, 50));
 
-        final HistoryContentProvider contentProvider = new HistoryContentProvider(SimanticsUI.getSession());
+        final HistoryContentProvider contentProvider = new HistoryContentProvider(Simantics.getSession());
           treeViewer.setContentProvider(contentProvider);
           //viewer.setSorter(new ViewerSorter());
           treeViewer.setInput(this);
@@ -136,7 +136,7 @@ public class HistoryView extends TreeView {
           getViewSite().getActionBars().getToolBarManager().add(new Action("Debug", Activator.DEBUG_ICON) {
               @Override
               public void run() {
-                  Session s = SimanticsUI.getSession();
+                  Session s = Simantics.getSession();
                   try {
                       s.sync(new WriteRequest() {
                           @Override
index dcbafcb3559ff5f25c6d92968c9b7edd28554101..2be1a2381f19957da4bff395da0db943c5a6118e 100644 (file)
@@ -20,8 +20,8 @@ import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.jface.viewers.TreeViewerColumn;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
+import org.simantics.Simantics;
 import org.simantics.team.Activator;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * @author Kalle Kondelin
@@ -57,7 +57,7 @@ public class RedoView extends TreeView {
         commentColumn.getColumn().setWidth(20);
         ad.setColumnData(commentColumn.getColumn(), new ColumnWeightData(50, 50));
 
-        final RedoContentProvider contentProvider = new RedoContentProvider(SimanticsUI.getSession());
+        final RedoContentProvider contentProvider = new RedoContentProvider(Simantics.getSession());
           treeViewer.setContentProvider(contentProvider);
           treeViewer.setInput(this);
           getViewSite().getActionBars().getToolBarManager().add(new Action("Remove All", Activator.REMOVE_ALL_ICON) {
index 6435d75578b843b2c4010baf0404b3ea712fbd4b..2283d97d591a1cc4def3cd244096dbe23f59173d 100644 (file)
@@ -43,6 +43,7 @@ import org.eclipse.ui.IMemento;
 import org.eclipse.ui.IViewSite;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.part.ViewPart;
+import org.simantics.Simantics;
 import org.simantics.browsing.ui.GraphExplorer;
 import org.simantics.browsing.ui.graph.impl.SessionContextInputSource;
 import org.simantics.browsing.ui.swt.DefaultSelectionDataResolver;
@@ -396,7 +397,7 @@ public class StagingView extends ViewPart {
     protected void createControls(final Composite parent) {
         parent.setLayout(LayoutUtils.createNoBorderGridLayout(1, false));
         GridDataFactory.fillDefaults().grab(true, true).applyTo(treeViewer.getTree());
-        treeViewer.setContentProvider(new CommentContentProvider(SimanticsUI.getSession()));
+        treeViewer.setContentProvider(new CommentContentProvider(Simantics.getSession()));
         treeViewer.setLabelProvider(new LabelProvider() {
             @Override
             public Image getImage(Object element) {
@@ -427,7 +428,7 @@ public class StagingView extends ViewPart {
 //        getViewSite().getActionBars().getToolBarManager().add(new Action("GetIncoming", Activator.DOOR_IN_ICON) {
 //            @Override
 //            public void run() {
-//                treeViewer.setContentProvider(new IncomingContentProvider(SimanticsUI.getSession(), parent.getShell()));
+//                treeViewer.setContentProvider(new IncomingContentProvider(Simantics.getSession(), parent.getShell()));
 //            }
 //        });
         new ItemDetailToolTip(treeViewer, treeViewer.getTree(), null);
index bae349680a4cb27c74481849d290b6fdcdab5747..9298b48c501d74976c081887676c95fe6ebd1b76 100644 (file)
@@ -47,6 +47,7 @@ import org.eclipse.ui.IWorkbenchSite;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.part.IPageSite;
 import org.eclipse.ui.part.ViewPart;
+import org.simantics.Simantics;
 import org.simantics.browsing.ui.GraphExplorer;
 import org.simantics.browsing.ui.graph.impl.SessionContextInputSource;
 import org.simantics.browsing.ui.swt.DefaultSelectionDataResolver;
@@ -429,7 +430,7 @@ public class SynchroniseView extends ViewPart {
     protected void createControls(final Composite parent) {
         parent.setLayout(LayoutUtils.createNoBorderGridLayout(1, false));
         GridDataFactory.fillDefaults().grab(true, true).applyTo(treeViewer.getTree());
-        treeViewer.setContentProvider(new UndoContentProvider(SimanticsUI.getSession()));
+        treeViewer.setContentProvider(new UndoContentProvider(Simantics.getSession()));
         treeViewer.setLabelProvider(new LabelProvider() {
             @Override
             public Image getImage(Object element) {
@@ -479,7 +480,7 @@ public class SynchroniseView extends ViewPart {
 //        getViewSite().getActionBars().getToolBarManager().add(new Action("GetUndoHistory", desc) {
 //            @Override
 //            public void run() {
-//                treeViewer.setContentProvider(new UndoContentProvider(SimanticsUI.getSession()));
+//                treeViewer.setContentProvider(new UndoContentProvider(Simantics.getSession()));
 //            }
 //        });
 //        getViewSite().getActionBars().getToolBarManager().add(new Action("DumpSelectedRevision", Activator.BIN_CLOSED_ICON) {
@@ -490,7 +491,7 @@ public class SynchroniseView extends ViewPart {
 //                if (o instanceof ChangeSetElement) {
 //                    ChangeSetElement ce = (ChangeSetElement)o;
 //                    long csid = ce.getChangeSetIdentifier().getId();
-//                    ManagementSupport ms = SimanticsUI.getSession().getService(ManagementSupport.class);
+//                    ManagementSupport ms = Simantics.getSession().getService(ManagementSupport.class);
 //                    try {
 //                        ms.dumpRevision(csid);
 //                        ShowMessage.showInformation("DumpSelectedRevision", "Operation was successful.");
index 28fadd0f89cd21099c20434555e2c078165f2868..751658a1cdcf057b22d198b51c707163c05e3450 100644 (file)
@@ -21,6 +21,7 @@ import org.eclipse.jface.viewers.TreeViewerColumn;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Composite;
+import org.simantics.Simantics;
 import org.simantics.db.Operation;
 import org.simantics.db.Session;
 import org.simantics.db.UndoContext;
@@ -30,7 +31,6 @@ import org.simantics.db.service.UndoRedoSupport;
 import org.simantics.db.service.UndoRedoSupport.ChangeListener;
 import org.simantics.team.Activator;
 import org.simantics.team.internal.Images;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.dialogs.ShowError;
 
 /**
@@ -68,7 +68,7 @@ public class UndoView extends TreeView {
         commentColumn.getColumn().setWidth(20);
         ad.setColumnData(commentColumn.getColumn(), new ColumnWeightData(50, 50));
 
-        final UndoContentProvider contentProvider = new UndoContentProvider(SimanticsUI.getSession());
+        final UndoContentProvider contentProvider = new UndoContentProvider(Simantics.getSession());
           treeViewer.setContentProvider(contentProvider);
           treeViewer.setInput(this);
           getViewSite().getActionBars().getToolBarManager().add(new Action("Remove All", Activator.REMOVE_ALL_ICON) {
index e047a3e565101de68797d9a3135459ac5d042bd9..83d136a8b2ac14e2a13f95be5a593f4dfac7dfdf 100644 (file)
@@ -15,13 +15,13 @@ import java.io.File;
 
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.simantics.Simantics;
 import org.simantics.db.Session;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.service.TeamSupport;
 import org.simantics.team.Activator;
 import org.simantics.team.Utils;
 import org.simantics.team.ui.CommentDialog;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.handler.AbstractPreferenceHandler;
 
 public class CommitAllHandler extends AbstractPreferenceHandler {
@@ -46,7 +46,7 @@ public class CommitAllHandler extends AbstractPreferenceHandler {
     }
     static CommentDialog.Data commitAll(File teamFolder, boolean init) 
     throws DatabaseException {
-        Session session = SimanticsUI.getSession();
+        Session session = Simantics.getSession();
         TeamSupport ts = session.getService(TeamSupport.class);
         final CommentDialog.Data data = new CommentDialog.Data("Commit Comment");
         if (CommentDialog.openCommentDialog(data))
index 5d8ec323f5659373b65d9247a91068118e50cdba..9fc1d4ee5162928ead00a18f4980ef9cbccaa54b 100644 (file)
@@ -13,6 +13,7 @@ package org.simantics.team.ui.handlers;
 
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
 import org.simantics.db.WriteGraph;
@@ -21,7 +22,6 @@ import org.simantics.db.common.request.WriteRequest;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.service.XSupport;
 import org.simantics.team.Activator;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.handler.AbstractPreferenceHandler;
 
 public class DebugHandler extends AbstractPreferenceHandler {
@@ -35,7 +35,7 @@ public class DebugHandler extends AbstractPreferenceHandler {
 //        if (sel instanceof IStructuredSelection)
 //            ss = (IStructuredSelection) sel;
         try {
-            Session s = SimanticsUI.getSession();
+            Session s = Simantics.getSession();
             s.sync(new WriteRequest() {
                 @Override
                 public void perform(WriteGraph graph) throws DatabaseException {
index 2b8c677bec1aba9dd823452605d6471a9eee168e..3b1b8e7f33808d741b7134726d916485a9d48b84 100644 (file)
@@ -20,13 +20,13 @@ import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.Simantics;
 import org.simantics.db.ChangeSetIdentifier;
 import org.simantics.db.Session;
 import org.simantics.db.common.utils.Logger;
 import org.simantics.db.service.ManagementSupport;
 import org.simantics.db.service.TeamSupport;
 import org.simantics.team.ui.Command;
-import org.simantics.ui.SimanticsUI;
 
 public class DumpToSelectedRevisionHandler extends AbstractHandler {
     public DumpToSelectedRevisionHandler() {
@@ -45,7 +45,7 @@ public class DumpToSelectedRevisionHandler extends AbstractHandler {
                 if (null == csi)
                     return null;
                 long csid = csi.getId();
-                Session session = SimanticsUI.getSession();
+                Session session = Simantics.getSession();
                 ManagementSupport ms = session.getService(ManagementSupport.class);
                 ms.dumpRevision(csid);
                 File wsFolder = new File(Platform.getInstanceLocation().getURL().getFile());
index 5f84c49aeab3d5fca6ff177864505e1847669d4c..c9afe4fc5f16bafdff309d9bea40a76e43c01275 100644 (file)
@@ -17,11 +17,11 @@ import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.Simantics;
 import org.simantics.db.Session;
 import org.simantics.db.service.LifecycleSupport;
 import org.simantics.db.service.TeamSupport;
 import org.simantics.team.Activator;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.handler.AbstractPreferenceHandler;
 
 public class GetOutgoingHandler extends AbstractPreferenceHandler {
@@ -39,7 +39,7 @@ public class GetOutgoingHandler extends AbstractPreferenceHandler {
                        ss = (IStructuredSelection) sel;
                
         try {
-               Session session = SimanticsUI.getSession();
+               Session session = Simantics.getSession();
                TeamSupport ps = session.getService(TeamSupport.class);
                LifecycleSupport support = session.getService(LifecycleSupport.class);
                System.out.println("koss");
index 8fcede7c4bc221117bf349374affd92dff6678f5..45ec796d9ce8dd8629968ae435a393ab51fbaea3 100644 (file)
@@ -20,12 +20,12 @@ import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.Simantics;
 import org.simantics.db.ChangeSetIdentifier;
 import org.simantics.db.Session;
 import org.simantics.db.common.utils.Logger;
 import org.simantics.db.service.TeamSupport;
 import org.simantics.team.ui.Command;
-import org.simantics.ui.SimanticsUI;
 
 public class RevertToSelectedRevisionHandler extends AbstractHandler {
     public RevertToSelectedRevisionHandler() {
@@ -44,7 +44,7 @@ public class RevertToSelectedRevisionHandler extends AbstractHandler {
                 if (null == csi)
                     return null;
                 long csid = csi.getId();
-                Session session = SimanticsUI.getSession();
+                Session session = Simantics.getSession();
                 File wsFolder = new File(Platform.getInstanceLocation().getURL().getFile());
                 File frFolder = new File(wsFolder, "db");
                 File toFolder = new File(wsFolder, "Revert-ws");
index 6405079c44d5288897c3681e628ddaf4b43c12a7..90ad6082daa276cf050524fc9ee51fbf49c7e306 100644 (file)
@@ -20,12 +20,12 @@ import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.Simantics;
 import org.simantics.db.ChangeSetIdentifier;
 import org.simantics.db.Session;
 import org.simantics.db.common.utils.Logger;
 import org.simantics.db.service.TeamSupport;
 import org.simantics.team.ui.Command;
-import org.simantics.ui.SimanticsUI;
 
 public class RevertToSelectedRevisionHandlerStopOnError extends AbstractHandler {
     public RevertToSelectedRevisionHandlerStopOnError() {
@@ -44,7 +44,7 @@ public class RevertToSelectedRevisionHandlerStopOnError extends AbstractHandler
                 if (null == csi)
                     return null;
                 long csid = csi.getId();
-                Session session = SimanticsUI.getSession();
+                Session session = Simantics.getSession();
                 File wsFolder = new File(Platform.getInstanceLocation().getURL().getFile());
                 File frFolder = new File(wsFolder, "db");
                 File toFolder = new File(wsFolder, "Revert-ws");
index 3a8f025737d6a17ccaa9045759655e22c7e22088..2d59e369d3b2baca4d98960f869a4e8b3d23cc89 100644 (file)
@@ -21,6 +21,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.ui.PlatformUI;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.ServerReference;
 import org.simantics.db.Session;
@@ -30,7 +31,6 @@ import org.simantics.team.Activator;
 import org.simantics.team.internal.StagingLauncher;
 import org.simantics.team.internal.StagingLauncher.Config;
 import org.simantics.team.internal.StagingLauncher.StagingResult;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.handler.AbstractPreferenceHandler;
 import org.simantics.utils.FileUtils;
 import org.simantics.utils.ui.ErrorLogger;
@@ -49,7 +49,7 @@ public class StageEditHandler extends AbstractPreferenceHandler {
     public Object execute(ExecutionEvent event) throws ExecutionException {
         System.out.println("DEBUG: EditStageHandler");
         try {
-            Session session = SimanticsUI.getSession();
+            Session session = Simantics.getSession();
             File wsFolder = new File(Platform.getInstanceLocation().getURL().getFile());
             File stFolder = new File(wsFolder, "staging");
             if (!stFolder.isDirectory())
index 09e8d6d2ddba473cf4b2a4ccd71b63628055e2f8..6afae9e3b141d8c4147b2c11590539950493fa96 100644 (file)
@@ -16,11 +16,11 @@ import java.io.File;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.runtime.Platform;
+import org.simantics.Simantics;
 import org.simantics.db.Session;
 import org.simantics.team.Activator;
 import org.simantics.team.ui.CommentDialog;
 import org.simantics.team.ui.StageInitWizard;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.handler.AbstractPreferenceHandler;
 import org.simantics.utils.ui.dialogs.ShowError;
 
@@ -37,7 +37,7 @@ public class StageInitHandler extends AbstractPreferenceHandler {
     public Object execute(ExecutionEvent event) throws ExecutionException {
         System.out.println("DEBUG: " + this.getClass().getName());
         try {
-            Session session = SimanticsUI.getSession();
+            Session session = Simantics.getSession();
             File wsFolder = new File(Platform.getInstanceLocation().getURL().getFile());
             File stFolder = new File(wsFolder, "staging");
             final StageInitWizard.Data data = new StageInitWizard.Data(stFolder, null);
index 16acca6ed8639f419488c65e1db6173fe6d9e1d0..97a0a8c0818142199778e246bc72cc01f6a413bd 100644 (file)
@@ -14,13 +14,13 @@ package org.simantics.team.ui.handlers;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.ui.PlatformUI;
+import org.simantics.Simantics;
 import org.simantics.db.Session;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.service.TeamSupport;
 import org.simantics.team.Activator;
 import org.simantics.team.Utils;
 import org.simantics.team.ui.CommentDialog;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.handler.AbstractPreferenceHandler;
 
 public class StagingOutHandler extends AbstractPreferenceHandler {
@@ -35,7 +35,7 @@ public class StagingOutHandler extends AbstractPreferenceHandler {
 //        if (sel instanceof IStructuredSelection)
 //            ss = (IStructuredSelection) sel;
         try {
-            Session session = SimanticsUI.getSession();
+            Session session = Simantics.getSession();
             TeamSupport ts = session.getService(TeamSupport.class);
             final CommentDialog.Data data = new CommentDialog.Data("Staging Comment");
             if (!CommentDialog.openCommentDialog(data))
index 6463ccbb2f58808c217643c342f6e7e3ecc2ffe8..d8be98c06980c4769b5e4398e440c9dbe095af4d 100644 (file)
@@ -22,6 +22,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.ui.PlatformUI;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.ServerReference;
 import org.simantics.db.Session;
@@ -34,7 +35,6 @@ import org.simantics.team.internal.StagingLauncher;
 import org.simantics.team.internal.StagingLauncher.Config;
 import org.simantics.team.internal.StagingLauncher.StagingResult;
 import org.simantics.team.ui.StageInitWizard;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.workbench.handler.AbstractPreferenceHandler;
 import org.simantics.utils.FileUtils;
 import org.simantics.utils.ui.ErrorLogger;
@@ -53,7 +53,7 @@ public class SynchroniseAllHandler extends AbstractPreferenceHandler {
 //        if (sel instanceof IStructuredSelection)
 //            ss = (IStructuredSelection) sel;
         try {
-            Session session = SimanticsUI.getSession();
+            Session session = Simantics.getSession();
             File wsFolder = new File(Platform.getInstanceLocation().getURL().getFile());
             File stFolder = new File(wsFolder, "staging");
             File teamFolder = pullAll(session, Utils.getTeamFolder(), stFolder);
index b90e480883702de02a6f77f571ff934440848559..18019c9fd4d0ad4eed71192fca063468a2edb619 100644 (file)
@@ -227,17 +227,6 @@ public class SimanticsUI {
 //        return null;
 //    }
 
-    /**
-     * Returns the session context provider of the curretly active workbench
-     * window. This method will always return a valid session context provider.
-     * 
-     * @return a valid ISessionContextProvider
-     */
-    @Deprecated
-    public static ISessionContextProvider getSessionContextProvider() {
-        return Simantics.getSessionContextProvider();
-    }
-
     /**
      * Returns the session context provider for the specified handle if one
      * exists. Workbench windows (IWorkbenchWindow) are currently used as
@@ -307,7 +296,7 @@ public class SimanticsUI {
      *         done.
      */
     public static synchronized ISessionContext setSessionContext(ISessionContext ctx) {
-        return getSessionContextProvider().setSessionContext(ctx);
+        return Simantics.getSessionContextProvider().setSessionContext(ctx);
     }
 
     /**
@@ -339,62 +328,6 @@ public class SimanticsUI {
         return null;
     }
 
-    /**
-     * Returns the database Session bound to the currently active workbench
-     * window.
-     * 
-     * <p>
-     * This method should only be invoked in cases where it is certain that the
-     * correct workbench window has focus or it is the latest of all workbench
-     * windows to have had focus. Basically any invocation from the SWT UI
-     * thread is safe, since because in those cases the currently active
-     * workbench window is generally known. Instead invocations from any other
-     * thread should be carefully considered. The rule of thumb is that if you
-     * cannot be sure that the correct workbench window has focus, you should
-     * always get a hold of the Session to be used in some other manner.
-     * </p>
-     * 
-     * <p>
-     * The method always returns a non-null Session or produces an
-     * IllegalStateException if a Session was not attainable.
-     * </p>
-     * 
-     * @return the Session bound to the currently active workbench window
-     * @throws IllegalStateException if no Session was available
-     */
-    @Deprecated
-    public static Session getSession() {
-        return Simantics.getSession();
-    }
-       
-    /**
-     * Returns the database Session bound to the currently active workbench
-     * window. Differently from {@link #getSession()}, this method returns
-     * <code>null</code> if there is no current Session available.
-     * 
-     * <p>
-     * This method should only be invoked from the SWT UI thread. Check the
-     * explanations given in {@link #getSession()}. The same applies to this
-     * method also.
-     * </p>
-     * 
-     * @return the Session bound to the currently active workbench window or
-     *         <code>null</code>
-     */
-    @Deprecated
-    public static Session peekSession() {
-        return Simantics.peekSession();
-    }
-
-    /**
-     * @return the currently open and active project as an IProject or
-     *         <code>null</code> if there is no active session or project
-     */
-    @Deprecated
-    public static IProject peekProject() {
-        return Simantics.peekProject();
-    }
-
     /**
      * @return the currently open and active project for the specified database
      *         session or <code>null</code> if there is no current project
@@ -406,17 +339,6 @@ public class SimanticsUI {
         return ctx.getHint(ProjectKeys.KEY_PROJECT);
     }
 
-    /**
-     * @return the currently open and active project as an IProject
-     * @throws IllegalStateException if there is no currently active database
-     *         session, which also means there is no active project at the
-     *         moment
-     */
-    @Deprecated
-    public static IProject getProject() {
-        return Simantics.getProject();
-    }
-
     /**
      * TODO: refactor this out of here
      * 
@@ -445,7 +367,7 @@ public class SimanticsUI {
        if(resource == null) return null;
        
         try {
-            return getSession().syncRequest(new Adapter<T>(resource, assignableFrom));
+            return Simantics.getSession().syncRequest(new Adapter<T>(resource, assignableFrom));
         } catch (DatabaseException e) {
             Logger.defaultLogError(e);
             return null;
index 4830f525bf5f9ad35f91345858617dfd3ed6a789..95bc5b423f756b0eb15809d0845a33009f1c8f91 100644 (file)
@@ -82,7 +82,7 @@ public abstract class DynamicMenuContribution extends CompoundContributionItem {
     protected final IContributionItem[] getContributionItems() {
         if (DatabaseJob.inProgress())
             return NONE;
-        ISessionContext ctx = SimanticsUI.getSessionContext();
+        ISessionContext ctx = Simantics.getSessionContext();
         if (ctx != null) {
             final Object[] selection = getSelectedObjects();
             //System.out.println(getClass().getSimpleName() + "@" + System.identityHashCode(this) + "( " + System.identityHashCode(selection) + ": " + Arrays.toString(selection) + " )");
index c4d8a72ce961a6b1c155b854cbfa68d1106f96a8..9f7990d848f0ad2954f6847bb2dcb13796e2e39b 100644 (file)
@@ -18,6 +18,7 @@ import java.util.Collection;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.resource.ImageDescriptor;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
@@ -26,7 +27,6 @@ import org.simantics.db.request.Read;
 import org.simantics.layer0.utils.collections.IContextualList;
 import org.simantics.layer0.utils.operations.IOperation;
 import org.simantics.project.IProject;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.icons.ImageUtil;
 import org.simantics.ui.selection.WorkbenchSelectionUtils;
 import org.simantics.ui.utils.ResourceAdaptionUtils;
@@ -68,7 +68,7 @@ public abstract class OperationsMenuContribution extends DynamicMenuContribution
                         }
                         final ContextMap parameters = new ContextMap();
                         parameters.put(IOperation.SUBJECT, r);
-                        IProject project = SimanticsUI.peekProject();
+                        IProject project = Simantics.peekProject();
                         if (project != null)
                             parameters.put(IOperation.PROJECT, project.get());
                         assignParameters(parameters);
index 98bca314dd6f7b0910db7704cc773421bfed307d..6e9987a135aa0309d1baa67c326ab859159f5e89 100644 (file)
@@ -15,12 +15,12 @@ import org.eclipse.swt.dnd.ByteArrayTransfer;
 import org.eclipse.swt.dnd.DND;
 import org.eclipse.swt.dnd.TextTransfer;
 import org.eclipse.swt.dnd.TransferData;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
 import org.simantics.db.common.ResourceArray;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.service.SerialisationSupport;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * @author Tuukka Lehtonen
@@ -57,7 +57,7 @@ public class ResourceReferenceTransfer extends ByteArrayTransfer {
 
     private Session getSession() {
         // NOTE return SimanticsUI is a big HAXXX
-        return session == null ? SimanticsUI.getSession() : session;
+        return session == null ? Simantics.getSession() : session;
     }
 
     public void javaToNative(Object object, TransferData transferData) {
index 86ef494522a6c8fc406cb7e1ccea344659cc3e14..07b086644dd15c308d90692846bd09ef14c1f8e1 100644 (file)
@@ -175,7 +175,7 @@ public final class SessionUtils {
 //    throws DatabaseException, IOException
 //    {
 //        if(!forceReload) {
-//            ISessionContext newCtx = SimanticsUI.getSessionContext();
+//            ISessionContext newCtx = Simantics.getSessionContext();
 //            if (newCtx != null && address.equals(newCtx.getAddress()))
 //                return newCtx;
 //
index 1977d08df90744a8b89331b885dbd048db0d55ad..3ea5293c39d548b08e681cce8ad64e09c6227974 100644 (file)
@@ -152,7 +152,7 @@ public class UndoPropertyTester extends PropertyTester implements UndoRedoSuppor
         int newUndo = oldUndo;
         int newRedo = oldRedo;
         try {
-            ISessionContext ctx = SimanticsUI.getSessionContext();
+            ISessionContext ctx = Simantics.getSessionContext();
             if (DEBUG)
                 System.out.println("UndoPropertyTester: handle change, ctx=" + ctx);
             if (ctx == null)
index 739796aae3554eca1575ff307bc16912da504e11..2c703c41bd35e34149e09cd13aa12a01cd68e133 100644 (file)
@@ -18,6 +18,7 @@ import org.eclipse.ui.IMemento;
 import org.eclipse.ui.IViewSite;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.part.ViewPart;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Session;
 import org.simantics.db.common.request.ReadRequest;
@@ -26,7 +27,6 @@ import org.simantics.db.event.ChangeListener;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.management.ISessionContext;
 import org.simantics.db.service.GraphChangeListenerSupport;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * This class acts as a base class for ViewParts that to access the semantic
@@ -170,7 +170,7 @@ public abstract class GraphAccessViewPart extends ViewPart {
     }
 
     protected void initializeSession() {
-        sessionContext = SimanticsUI.getSessionContext();
+        sessionContext = Simantics.getSessionContext();
         if (sessionContext == null)
             throw new IllegalStateException("no active session context");
         session = sessionContext.getSession();
index a81357532e4d4ae02c42f61bc9813efb1fe57270..1cd72de635c2349fa3fec31241b25c76a55be0c7 100644 (file)
@@ -22,11 +22,11 @@ import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.part.EditorPart;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
 import org.simantics.db.common.request.ParametrizedRead;
 import org.simantics.db.management.ISessionContext;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * ResourceEditorPart is a base implementation for editors that support
@@ -79,7 +79,7 @@ public abstract class ResourceEditorPart extends EditorPart implements IResource
         // Set initial part name according to the name given by IEditorInput
         setPartName(getEditorInput().getName());
 
-        Session session = SimanticsUI.peekSession();
+        Session session = Simantics.peekSession();
         if (session != null) {
             Supplier<Boolean> disposedCallback = () -> disposed;
             session.asyncRequest(
index 80e0393cf42e6da121ed96f0e016d5cbf4b836b7..3597804d8f83164637e8f0b5e60e44c9879d25c2 100644 (file)
@@ -17,6 +17,7 @@ import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Session;
 import org.simantics.db.common.procedure.adapter.ListenerAdapter;
@@ -28,7 +29,6 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.management.ISessionContext;
 import org.simantics.db.management.ISessionContextProvider;
 import org.simantics.db.service.GraphChangeListenerSupport;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.datastructures.map.Tuple;
 import org.simantics.utils.ui.ExceptionUtils;
 import org.simantics.utils.ui.SWTUtils;
@@ -91,7 +91,7 @@ public class ResourceEditorSupport implements IAdaptable, ChangeListener {
 
     private ISessionContext initSession() throws PartInitException {
         if (sessionContext == null) {
-            ISessionContextProvider provider = SimanticsUI.getSessionContextProvider();
+            ISessionContextProvider provider = Simantics.getSessionContextProvider();
             ISessionContext sc = provider.getSessionContext();
             if (sc == null)
                 throw new PartInitException("active database session context is null");
index fe2a40acfcb41e97c4557398d4ba288ce5020e4e..e018e98333a36dd1794c5e005ed4f19f943f7514 100644 (file)
@@ -16,9 +16,9 @@ import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.forms.editor.FormEditor;
+import org.simantics.Simantics;
 import org.simantics.db.Session;
 import org.simantics.db.management.ISessionContext;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * @author Tuukka Lehtonen
@@ -56,7 +56,7 @@ public abstract class ResourceFormEditor extends FormEditor implements IResource
         // Set initial part name according to the name given by IEditorInput
         setPartName(getEditorInput().getName());
 
-        Session session = SimanticsUI.peekSession();
+        Session session = Simantics.peekSession();
         if (session != null) {
             session.asyncRequest(
                     new TitleRequest(site.getId(), getResourceInput()),
index 4032ee37cdacc69bd811c24c54ae61291b265f70..4abb20787a8e31fdc3e1b6d711c9d242aa848e2b 100644 (file)
@@ -16,9 +16,9 @@ import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.forms.editor.SharedHeaderFormEditor;
+import org.simantics.Simantics;
 import org.simantics.db.Session;
 import org.simantics.db.common.request.ParametrizedRead;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * @author Tuukka Lehtonen
@@ -54,7 +54,7 @@ public abstract class SharedHeaderResourceFormEditor extends SharedHeaderFormEdi
         // Set initial part name according to the name given by IEditorInput
         setPartName(getEditorInput().getName());
 
-        Session session = SimanticsUI.peekSession();
+        Session session = Simantics.peekSession();
         if (session != null) {
             session.asyncRequest(
                     new TitleRequest(site.getId(), getResourceInput()),
index 2115b3c1d4e07b3d93bff779db3051e8dec64638..93ec7ec6a09127fbdd8778d62e559299287fee05 100644 (file)
  *******************************************************************************/
 package org.simantics.ui.workbench;
 
+import org.simantics.Simantics;
 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.project.IProject;
-import org.simantics.ui.SimanticsUI;
 
 /**
  * @author Tuukka Lehtonen
@@ -36,7 +36,7 @@ public class ToolTipRequest implements Read<String> {
     public String perform(ReadGraph graph) throws DatabaseException {
         Resource r = input.getResource();
 
-        IProject p = SimanticsUI.peekProject();
+        IProject p = Simantics.peekProject();
         if (p != null) {
             IEditorNamingService ems = EditorNaming.getNamingService(graph, r); 
             if (ems instanceof IEditorNamingService2)
index 30af51d9247e4414ebe5972d19ef571a6a60dfa8..46facb59ea4896dc5a2093959c2c5812000b8006 100644 (file)
@@ -19,8 +19,8 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PlatformUI;
+import org.simantics.Simantics;
 import org.simantics.db.common.procedure.adapter.ProcedureAdapter;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.ui.internal.Activator;
 import org.simantics.utils.ui.workbench.WorkbenchUtils;
 
@@ -50,7 +50,7 @@ public class PerformDefaultAction extends Action {
             if (window != null)
                 shell = window.getShell();
         }
-        SimanticsUI.getSession().asyncRequest(
+        Simantics.getSession().asyncRequest(
                 new ChooseActionRequest(shell, control, input, perspectiveId),
                 new ProcedureAdapter<Object>() {
                     @Override
index 5749ff5dad5a8b6822e6db2781870531b2067182..8633c8c9a67b0feeca302cb40b1a160dce3be3b9 100644 (file)
@@ -27,10 +27,10 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IMemento;
 import org.eclipse.ui.dialogs.FilteredItemsSelectionDialog;
 import org.eclipse.ui.dialogs.SearchPattern;
+import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.exception.InvalidResourceReferenceException;
 import org.simantics.db.service.SerialisationSupport;
-import org.simantics.ui.SimanticsUI;
 
 public abstract class ResourceSelectionDialog<T> extends FilteredItemsSelectionDialog {
 
@@ -42,7 +42,7 @@&