[Title]fixed radio button focus bug
authorsungmin ha <sungmin82.ha@samsung.com>
Wed, 4 Jul 2012 12:58:00 +0000 (21:58 +0900)
committersungmin ha <sungmin82.ha@samsung.com>
Wed, 4 Jul 2012 12:58:00 +0000 (21:58 +0900)
[Type]Bugfix
[Module]eventinjector
[Priority]Major
[Jira#]Nabi_SE/N_SE-2536
[Redmine#]  // Redmine Isuue Number
[Problem]  // Problem Description
[Cause]  // Cause Description
[Solution] // Solution Description
[TestCase]  // Executed the test-target (How to)

org.tizen.device/src/org/tizen/device/battery/page/BatteryPage.java
org.tizen.device/src/org/tizen/device/earjack/page/EarjackPage.java
org.tizen.device/src/org/tizen/device/usb/page/UsbPage.java
package/pkginfo.manifest

index 220c98c..80315ca 100644 (file)
@@ -135,6 +135,30 @@ public class BatteryPage extends AbstractInjectorPage implements ISelectionListe
                });
                
                Composite secondComposite = formUtil.createComposite(parent, 5);
+               secondComposite.addMouseListener(new MouseListener() {
+                       @Override
+                       public void mouseDoubleClick(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void mouseDown(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                               for( int i = 0 ; i < radioButton.length ; i++ ) {
+                                       if(radioButton[i].getSelection()) {
+                                               if( i == 0 ) { // On
+                                                       radioButton[0].setFocus();
+                                               }
+                                               else {  // Off
+                                                       radioButton[1].setFocus();
+                                               }
+                                       }
+                               }
+                       }
+                       @Override
+                       public void mouseUp(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
                formUtil.createLabel(secondComposite, batteryCharger);
                radioButton = new Button[2];
                radioButton[0] = formUtil.createButton(secondComposite, BatteryConstants.Connect, SWT.RADIO);
index da400a8..77c73c0 100644 (file)
 
 package org.tizen.device.earjack.page;
 
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
 import org.eclipse.swt.events.KeyEvent;
 import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.Button;
@@ -60,11 +64,36 @@ public class EarjackPage extends AbstractInjectorPage implements ISelectionListe
                InjectorView.getDefault().addSelectionListener(this);
                currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
                
-               Composite mainComposite = formUtil.createComposite(parent, 6);
+               Composite mainComposite = formUtil.createComposite(parent, 1);  // for focus when mouse click
+               Composite subComposite = formUtil.createComposite(parent, 6);
+               subComposite.addMouseListener(new MouseListener(){
+                       @Override
+                       public void mouseDoubleClick(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void mouseDown(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                               for( int i = 0 ; i < radioButton.length ; i++ ) {
+                                       if(radioButton[i].getSelection()) {
+                                               if( i == 0 )    // 3wire
+                                                       radioButton[0].setFocus();
+                                               else if(i == 1)  // 4wire
+                                                       radioButton[1].setFocus();
+                                               else
+                                                       radioButton[2].setFocus();
+                                       }
+                               }
+                       }
+                       @Override
+                       public void mouseUp(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
                radioButton = new Button[3];
-               radioButton[0] = formUtil.createButton(mainComposite, EarjackConstants.wire3, SWT.RADIO);
-               radioButton[1] = formUtil.createButton(mainComposite, EarjackConstants.wire4, SWT.RADIO);
-               radioButton[2] = formUtil.createButton(mainComposite, EarjackConstants.disconnect, SWT.RADIO);
+               radioButton[0] = formUtil.createButton(subComposite, EarjackConstants.wire3, SWT.RADIO);
+               radioButton[1] = formUtil.createButton(subComposite, EarjackConstants.wire4, SWT.RADIO);
+               radioButton[2] = formUtil.createButton(subComposite, EarjackConstants.disconnect, SWT.RADIO);
                radioButton[2].setSelection(true);
                for( int i = 0 ; i < radioButton.length ; i++ ) {
                        if(radioButton[i].getSelection()) {
index 9dbe39a..b51dc82 100644 (file)
@@ -28,6 +28,8 @@ package org.tizen.device.usb.page;
 
 import org.eclipse.swt.events.KeyEvent;
 import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.Button;
@@ -61,10 +63,33 @@ public class UsbPage extends AbstractInjectorPage implements ISelectionListener
                InjectorView.getDefault().addSelectionListener(this);
                currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
 
-               Composite mainComposite = formUtil.createComposite(parent, 5);
+               Composite mainComposite = formUtil.createComposite(parent, 1);
+               Composite subComposite = formUtil.createComposite(parent, 5); // for focus when mouse click
+               subComposite.addMouseListener(new MouseListener() {
+                       @Override
+                       public void mouseDoubleClick(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void mouseDown(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                               for( int i = 0 ; i < radioButton.length ; i++ ) {
+                                       if(radioButton[i].getSelection()) {
+                                               if( i == 0 )  // On
+                                                       radioButton[0].setFocus();
+                                               else            // Off
+                                                       radioButton[1].setFocus();
+                                       }
+                               }
+                       }
+                       @Override
+                       public void mouseUp(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
                radioButton = new Button[2];
-               radioButton[0] = formUtil.createButton(mainComposite, UsbConstants.inject, SWT.RADIO);
-               radioButton[1] = formUtil.createButton(mainComposite, UsbConstants.remove, SWT.RADIO);
+               radioButton[0] = formUtil.createButton(subComposite, UsbConstants.inject, SWT.RADIO);
+               radioButton[1] = formUtil.createButton(subComposite, UsbConstants.remove, SWT.RADIO);
                radioButton[1].setSelection(true);
                sensorOn = false;
                /*
index b6a76c1..09c7d87 100644 (file)
@@ -1,5 +1,5 @@
 Package:eventinjector-eplugin
-Version:0.2.28
+Version:0.2.29
 OS:linux
 Build-host-os:linux
 Maintainer:yeongkyoon Lee <yeongkyoon.lee@samsung.com>, sungmin Ha <sungmin82.ha@samsung.com>
@@ -9,7 +9,7 @@ Install-dependency:common-eplugin[linux], base-ide-product[linux]
 Source:eventinjector-eplugin
 
 Package:eventinjector-eplugin
-Version:0.2.28
+Version:0.2.29
 OS:windows
 Build-host-os:linux
 Maintainer:yeongkyoon Lee <yeongkyoon.lee@samsung.com>, sungmin Ha <sungmin82.ha@samsung.com>