[Title] using java reflection in setTopMost()
authorgiwoong.kim <giwoong.kim@samsung.com>
Thu, 26 Jul 2012 09:11:09 +0000 (18:11 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Thu, 26 Jul 2012 09:11:09 +0000 (18:11 +0900)
[Type] feature
[Module] Emulator / skin
[Priority] major
[Jira#]
[Redmine#]
[Problem]
[Cause] support mac
[Solution]
[TestCase]

tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java

index 677a569..d60f1d5 100644 (file)
@@ -331,7 +331,7 @@ public class EmulatorSkin {
 
                        try {
                                Field field = lcdCanvas.getClass().getField("handle");
-                               windowHandleId = field.getLong( lcdCanvas );
+                               windowHandleId = field.getLong(lcdCanvas);
                                logger.info("lcdCanvas.handle:" + windowHandleId);
                        } catch (IllegalArgumentException e) {
                                logger.log(Level.SEVERE, e.getMessage(), e);
@@ -1294,7 +1294,27 @@ public class EmulatorSkin {
                        Method m = getOSMethod( "SetWindowPos", int.class, int.class, int.class, int.class, int.class,
                                        int.class, int.class );
 
-                       invokeOSMethod( m, shell.handle, hWndInsertAfter, location.x, location.y, 0, 0, noSize );
+                       /* org.eclipse.swt.widgets.Shell */
+                       int shellHandle = 0;
+                       try {
+                               Field field = shell.getClass().getField("handle");
+                               shellHandle = field.getInt(shell);
+                               logger.info("shell.handle:" + shellHandle);
+                       } catch (IllegalArgumentException e) {
+                               logger.log(Level.SEVERE, e.getMessage(), e);
+                               shutdown();
+                       } catch (IllegalAccessException e) {
+                               logger.log(Level.SEVERE, e.getMessage(), e);
+                               shutdown();
+                       } catch (SecurityException e) {
+                               logger.log(Level.SEVERE, e.getMessage(), e);
+                               shutdown();
+                       } catch (NoSuchFieldException e) {
+                               logger.log(Level.SEVERE, e.getMessage(), e);
+                               shutdown();
+                       }
+
+                       invokeOSMethod( m, shellHandle, hWndInsertAfter, location.x, location.y, 0, 0, noSize );
                } else if( SwtUtil.isMacPlatform() ) {
                        //TODO:
                }