From: Tuukka Lehtonen Date: Thu, 30 Aug 2018 12:05:41 +0000 (+0300) Subject: Remove usage of deprecated SimanticsUI-methods X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F58%2F2058%2F1;p=simantics%2Finterop.git Remove usage of deprecated SimanticsUI-methods gitlab #4 gitlab simantics/platform#95 Change-Id: I71a99f04b3db073268ad508c46841350574e077a --- diff --git a/org.simantics.interop.update/src/org/simantics/interop/update/editor/ModelUpdateEditor.java b/org.simantics.interop.update/src/org/simantics/interop/update/editor/ModelUpdateEditor.java index 919fe4b..f79b1c1 100644 --- a/org.simantics.interop.update/src/org/simantics/interop/update/editor/ModelUpdateEditor.java +++ b/org.simantics.interop.update/src/org/simantics/interop/update/editor/ModelUpdateEditor.java @@ -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) { diff --git a/org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateList.java b/org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateList.java index beb0e43..6f66ba3 100644 --- a/org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateList.java +++ b/org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateList.java @@ -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 { diff --git a/org.simantics.interop/src/org/simantics/interop/browsing/ImportNode2.java b/org.simantics.interop/src/org/simantics/interop/browsing/ImportNode2.java index 7d8655a..804882d 100644 --- a/org.simantics.interop/src/org/simantics/interop/browsing/ImportNode2.java +++ b/org.simantics.interop/src/org/simantics/interop/browsing/ImportNode2.java @@ -19,9 +19,8 @@ public class ImportNode2 implements INode { this.project = project; } - @SuppressWarnings("rawtypes") @Override - public Object getAdapter(Class adapter) { + public T getAdapter(Class adapter) { return null; } diff --git a/org.simantics.interop/src/org/simantics/interop/test/GraphComparatorViewer.java b/org.simantics.interop/src/org/simantics/interop/test/GraphComparatorViewer.java index d9c8ff6..24e24ad 100644 --- a/org.simantics.interop/src/org/simantics/interop/test/GraphComparatorViewer.java +++ b/org.simantics.interop/src/org/simantics/interop/test/GraphComparatorViewer.java @@ -63,6 +63,7 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.part.ViewPart; +import org.simantics.Simantics; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.Session; @@ -71,13 +72,11 @@ import org.simantics.db.common.ResourceArray; import org.simantics.db.common.request.ReadRequest; import org.simantics.db.common.utils.NameUtils; import org.simantics.db.exception.DatabaseException; -import org.simantics.db.exception.InvalidResourceReferenceException; import org.simantics.db.exception.ServiceException; import org.simantics.db.exception.ValidationException; import org.simantics.db.request.Read; import org.simantics.db.service.SerialisationSupport; import org.simantics.layer0.Layer0; -import org.simantics.ui.SimanticsUI; import org.simantics.ui.dnd.LocalObjectTransfer; import org.simantics.ui.dnd.ResourceReferenceTransfer; import org.simantics.ui.dnd.ResourceTransferUtils; @@ -122,7 +121,7 @@ public class GraphComparatorViewer extends ViewPart{ composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(2, false)); - session = SimanticsUI.getSession(); + session = Simantics.getSession(); Composite topComposite = new Composite(composite, SWT.BORDER); topComposite.setLayout(new GridLayout(3, false)); diff --git a/org.simantics.interop/src/org/simantics/interop/test/TypeComparator.java b/org.simantics.interop/src/org/simantics/interop/test/TypeComparator.java index 61e8a0f..81d4656 100644 --- a/org.simantics.interop/src/org/simantics/interop/test/TypeComparator.java +++ b/org.simantics.interop/src/org/simantics/interop/test/TypeComparator.java @@ -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; /** diff --git a/org.simantics.interop/src/org/simantics/interop/utils/StringColumnComparator.java b/org.simantics.interop/src/org/simantics/interop/utils/StringColumnComparator.java index 076559c..b79e4a7 100644 --- a/org.simantics.interop/src/org/simantics/interop/utils/StringColumnComparator.java +++ b/org.simantics.interop/src/org/simantics/interop/utils/StringColumnComparator.java @@ -28,7 +28,6 @@ public class StringColumnComparator extends ViewerComparator { } } - @SuppressWarnings("unchecked") @Override public int compare(Viewer viewer, Object e1, Object e2) {