javauis/coreui_qt/javasrc/com/nokia/mj/impl/coreuiqt/CoreUiImpl.java
changeset 80 d6dafc5d983f
parent 72 1f0034e370aa
equal deleted inserted replaced
78:71ad690e91f5 80:d6dafc5d983f
    19 import com.nokia.mj.impl.utils.Uid;
    19 import com.nokia.mj.impl.utils.Uid;
    20 import com.nokia.mj.impl.rt.support.Jvm;
    20 import com.nokia.mj.impl.rt.support.Jvm;
    21 import com.nokia.mj.impl.rt.support.ApplicationUtils;
    21 import com.nokia.mj.impl.rt.support.ApplicationUtils;
    22 import com.nokia.mj.impl.rt.support.ApplicationInfo;
    22 import com.nokia.mj.impl.rt.support.ApplicationInfo;
    23 import com.nokia.mj.impl.coreui.CoreUi;
    23 import com.nokia.mj.impl.coreui.CoreUi;
       
    24 
       
    25 import org.eclipse.swt.internal.extension.Toolkit;
    24 
    26 
    25 
    27 
    26 /**
    28 /**
    27  * A gate to CoreUi Qt implementation.
    29  * A gate to CoreUi Qt implementation.
    28  */
    30  */
    90         // Native logic is reversed between Symbian^3 and Symbian^4.
    92         // Native logic is reversed between Symbian^3 and Symbian^4.
    91         // platform specific part.
    93         // platform specific part.
    92         _hideApplication(!hide);
    94         _hideApplication(!hide);
    93     }
    95     }
    94 
    96 
       
    97     /**
       
    98      * Executes given Runnable synchronously in UI thread.
       
    99      * <br>
       
   100      * This method should only be used in cases where it
       
   101      * is absolutely needed. Before using this method,
       
   102      * consider carefully if the use case really requires
       
   103      * code to be executed in UI thread.
       
   104      * <br>
       
   105      * This method is only supported in Qt based runtimes.
       
   106      * <br>
       
   107      * @param runnable Runnable to be executed
       
   108      * @throws RuntimeException if execution in UI thread
       
   109      * is not supported
       
   110      */
       
   111     protected void runInSyncUiThreadImpl(Runnable runnable)
       
   112     {
       
   113         Toolkit.getInternalDisplay().syncExec(runnable);
       
   114     }
       
   115 
       
   116     /**
       
   117      * Executes given Runnable asynchronously in UI thread.
       
   118      * <br>
       
   119      * This method should only be used in cases where it
       
   120      * is absolutely needed. Before using this method,
       
   121      * consider carefully if the use case really requires
       
   122      * code to be executed in UI thread.
       
   123      * <br>
       
   124      * This method is only supported in Qt based runtimes.
       
   125      * <br>
       
   126      * @param runnable Runnable to be executed
       
   127      * @throws RuntimeException if execution in UI thread
       
   128      * is not supported
       
   129      */
       
   130     protected void runInAsyncUiThreadImpl(Runnable runnable)
       
   131     {
       
   132         Toolkit.getInternalDisplay().asyncExec(runnable);
       
   133     }
       
   134 
    95     private native void _hideApplication(boolean hide);
   135     private native void _hideApplication(boolean hide);
    96 }
   136 }