X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.ui%2Fsrc%2Forg%2Fsimantics%2Fui%2FSimanticsUI.java;h=18019c9fd4d0ad4eed71192fca063468a2edb619;hp=b90e480883702de02a6f77f571ff934440848559;hb=e88be95edf1f80781646cfdf717ec1b663264179;hpb=a22c5a8681859b6518017f3ad2be7e9319a6695e diff --git a/bundles/org.simantics.ui/src/org/simantics/ui/SimanticsUI.java b/bundles/org.simantics.ui/src/org/simantics/ui/SimanticsUI.java index b90e48088..18019c9fd 100644 --- a/bundles/org.simantics.ui/src/org/simantics/ui/SimanticsUI.java +++ b/bundles/org.simantics.ui/src/org/simantics/ui/SimanticsUI.java @@ -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. - * - *

- * 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. - *

- * - *

- * The method always returns a non-null Session or produces an - * IllegalStateException if a Session was not attainable. - *

- * - * @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 - * null if there is no current Session available. - * - *

- * 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. - *

- * - * @return the Session bound to the currently active workbench window or - * null - */ - @Deprecated - public static Session peekSession() { - return Simantics.peekSession(); - } - - /** - * @return the currently open and active project as an IProject or - * null 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 null 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(resource, assignableFrom)); + return Simantics.getSession().syncRequest(new Adapter(resource, assignableFrom)); } catch (DatabaseException e) { Logger.defaultLogError(e); return null;