]> gerrit.simantics Code Review - simantics/interop.git/commitdiff
Remove usage of deprecated SimanticsUI-methods 58/2058/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 30 Aug 2018 12:05:41 +0000 (15:05 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 30 Aug 2018 12:05:41 +0000 (15:05 +0300)
gitlab #4
gitlab simantics/platform#95

Change-Id: I71a99f04b3db073268ad508c46841350574e077a

org.simantics.interop.update/src/org/simantics/interop/update/editor/ModelUpdateEditor.java
org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateList.java
org.simantics.interop/src/org/simantics/interop/browsing/ImportNode2.java
org.simantics.interop/src/org/simantics/interop/test/GraphComparatorViewer.java
org.simantics.interop/src/org/simantics/interop/test/TypeComparator.java
org.simantics.interop/src/org/simantics/interop/utils/StringColumnComparator.java

index 919fe4b68238d05311533d363553bdad6de0bc17..f79b1c19dac103684dd78e01dc1a1163327159a4 100644 (file)
@@ -40,6 +40,7 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 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.Session;
@@ -59,7 +60,6 @@ import org.simantics.interop.update.model.UpdateOp;
 import org.simantics.interop.update.model.UpdateStatus;
 import org.simantics.interop.update.model.UpdateTree;
 import org.simantics.interop.utils.TableUtils;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.datastructures.Pair;
 import org.simantics.utils.ui.ExceptionUtils;
 
@@ -265,7 +265,7 @@ public abstract class ModelUpdateEditor extends Composite implements WarningList
        }
        
        protected Session getSession() {
-               return SimanticsUI.getSession();
+               return Simantics.getSession();
        }
        
        protected String getColumntTitle(int i) {
index beb0e431e9216eae79eabd864436cc7ba1c610da..6f66ba399326f0eb4ffa480d3b9d3874c54841f4 100644 (file)
@@ -10,7 +10,6 @@ import org.simantics.db.Resource;
 import org.simantics.db.Statement;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.interop.test.GraphChanges;
-import org.simantics.interop.update.model.ModelUpdate.ChangeFilter;
 import org.simantics.utils.datastructures.Pair;
 
 public class UpdateList {
index 7d8655a325bf66563af15b6f0035e00b4e783930..804882d9afa107003d6f4de18f0504c79ef42003 100644 (file)
@@ -19,9 +19,8 @@ public class ImportNode2 implements INode {
                this.project = project;\r
        }\r
        \r
-       @SuppressWarnings("rawtypes")\r
        @Override\r
-       public Object getAdapter(Class adapter) {\r
+       public <T> T getAdapter(Class<T> adapter) {\r
                return null;\r
        }\r
 \r
index d9c8ff69d0951ceb36202bf96f0f551f1c74820b..24e24ad0159c9bbde0461c382e807f43eafcc3b7 100644 (file)
@@ -63,6 +63,7 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;\r
 import org.eclipse.swt.widgets.Text;\r
 import org.eclipse.ui.part.ViewPart;\r
+import org.simantics.Simantics;\r
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
 import org.simantics.db.Session;\r
@@ -71,13 +72,11 @@ import org.simantics.db.common.ResourceArray;
 import org.simantics.db.common.request.ReadRequest;\r
 import org.simantics.db.common.utils.NameUtils;\r
 import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.exception.InvalidResourceReferenceException;\r
 import org.simantics.db.exception.ServiceException;\r
 import org.simantics.db.exception.ValidationException;\r
 import org.simantics.db.request.Read;\r
 import org.simantics.db.service.SerialisationSupport;\r
 import org.simantics.layer0.Layer0;\r
-import org.simantics.ui.SimanticsUI;\r
 import org.simantics.ui.dnd.LocalObjectTransfer;\r
 import org.simantics.ui.dnd.ResourceReferenceTransfer;\r
 import org.simantics.ui.dnd.ResourceTransferUtils;\r
@@ -122,7 +121,7 @@ public class GraphComparatorViewer extends ViewPart{
                composite = new Composite(parent, SWT.NONE);\r
                composite.setLayout(new GridLayout(2, false));\r
                \r
-               session = SimanticsUI.getSession();\r
+               session = Simantics.getSession();\r
                \r
                Composite topComposite = new Composite(composite, SWT.BORDER);\r
                topComposite.setLayout(new GridLayout(3, false));\r
index 61e8a0fbc193fa50cbc08e9a44f66207b241230d..81d465609e024b8171503ce88345ff09db312772 100644 (file)
@@ -7,10 +7,6 @@ import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.Statement;
 import org.simantics.db.exception.DatabaseException;
-import org.simantics.db.exception.DoesNotContainValueException;
-import org.simantics.db.exception.ManyObjectsForFunctionalRelationException;
-import org.simantics.db.exception.ServiceException;
-import org.simantics.db.exception.ValidationException;
 import org.simantics.layer0.Layer0;
 
 /**
index 076559c49661682010d138fa32415d065f29f3c7..b79e4a7e473175ab3afc43020da577b6440ebab7 100644 (file)
@@ -28,7 +28,6 @@ public class StringColumnComparator extends ViewerComparator {
                }\r
        }\r
        \r
-       @SuppressWarnings("unchecked")\r
        @Override\r
        public int compare(Viewer viewer, Object e1, Object e2) {\r
                \r