BUTTON: Add part of lack of selection events
authorHyunJong Park <paulhj.park@samsung.com>
Thu, 2 Jun 2016 09:08:40 +0000 (18:08 +0900)
committerSangho Park <sangho.p@samsung.com>
Fri, 10 Jun 2016 01:38:10 +0000 (10:38 +0900)
- Add part of lack of selection events.
- To block unnecessary event that are delivered to the button.

Change-Id: Id875459e0f31d80de6f920f22be9897a4fac1ff2
Signed-off-by: HyunJong Park <paulhj.park@samsung.com>
(cherry picked from commit 9882a9074faca1a7acb78ea1dfb4eb1408679bc2)

bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TizenButton.java
bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TizenPushButtonRenderer.java

index 865a08f..fcc9d7f 100644 (file)
@@ -153,10 +153,12 @@ public class TizenButton extends Canvas {
      */
     public void addSelectionListener(SelectionListener listener) {
         addListener(SWT.Selection, new TypedListener(listener));
+        addListener(SWT.DefaultSelection, new TypedListener(listener));
     }
 
     public void removeSelectionListener(SelectionListener listener) {
         removeListener(SWT.Selection, listener);
+        removeListener(SWT.DefaultSelection, listener);
     }
 
     @Override
index 1ef31d4..aca1d60 100644 (file)
@@ -243,6 +243,9 @@ public class TizenPushButtonRenderer extends TizenAbstractButtonRenderer {
                 } else {
                     eventEnterKeyTime = event.time;
                 }
+                if (event.widget instanceof StyledText) {
+                    return;
+                }
                 event.doit = false;
                 parent.fireSelectionEvent();
             }