From 88318078b5ca53da5f23d800b3a84760481b2a7b Mon Sep 17 00:00:00 2001 From: Markus Keller Date: Thu, 22 Sep 2011 16:06:01 +0200 Subject: Bug 293932: *Event#toString() methods should write hex strings for masks --- .../common/org/eclipse/swt/events/GestureEvent.java | 2 +- .../Eclipse SWT/common/org/eclipse/swt/events/KeyEvent.java | 10 +++++----- .../Eclipse SWT/common/org/eclipse/swt/events/MouseEvent.java | 4 ++-- .../common/org/eclipse/swt/events/SelectionEvent.java | 4 ++-- .../Eclipse SWT/common/org/eclipse/swt/events/TouchEvent.java | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/GestureEvent.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/GestureEvent.java index f6667fdbea..f197f0e32d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/GestureEvent.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/GestureEvent.java @@ -145,7 +145,7 @@ public GestureEvent(Event e) { public String toString() { String string = super.toString (); return string.substring (0, string.length() - 1) // remove trailing '}' - + " stateMask=" + stateMask + + " stateMask=0x" + Integer.toHexString(stateMask) + " detail=" + detail + " x=" + x + " y=" + y diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/KeyEvent.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/KeyEvent.java index 03ecb92cb3..56b511a9e2 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/KeyEvent.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/KeyEvent.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -124,10 +124,10 @@ public KeyEvent(Event e) { public String toString() { String string = super.toString (); return string.substring (0, string.length() - 1) // remove trailing '}' - + " character='" + ((character == 0) ? "\\0" : "" + character) + "'" - + " keyCode=" + keyCode - + " keyLocation=" + keyLocation - + " stateMask=" + stateMask + + " character='" + ((character == 0) ? "\\0" : String.valueOf(character)) + "'=0x" + Integer.toHexString(character) + + " keyCode=0x" + Integer.toHexString(keyCode) + + " keyLocation=0x" + Integer.toHexString(keyLocation) + + " stateMask=0x" + Integer.toHexString(stateMask) + " doit=" + doit + "}"; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MouseEvent.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MouseEvent.java index 2730002234..d9f746fb26 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MouseEvent.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MouseEvent.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -96,7 +96,7 @@ public String toString() { String string = super.toString (); return string.substring (0, string.length() - 1) // remove trailing '}' + " button=" + button - + " stateMask=" + stateMask + + " stateMask=0x" + Integer.toHexString(stateMask) + " x=" + x + " y=" + y + " count=" + count diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/SelectionEvent.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/SelectionEvent.java index 7f6a77eb2d..d0034594cd 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/SelectionEvent.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/SelectionEvent.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -133,7 +133,7 @@ public String toString() { + " y=" + y + " width=" + width + " height=" + height - + " stateMask=" + stateMask + + " stateMask=0x" + Integer.toHexString(stateMask) + " text=" + text + " doit=" + doit + "}"; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/TouchEvent.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/TouchEvent.java index ae467a9720..9ad6c401be 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/TouchEvent.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/TouchEvent.java @@ -78,7 +78,7 @@ public TouchEvent(Event e) { public String toString() { String string = super.toString(); string = string.substring (0, string.length() - 1); // remove trailing '}' - string += " stateMask=" + stateMask + string += " stateMask=0x" + Integer.toHexString(stateMask) + " x=" + x + " y=" + y; if (touches != null) { -- cgit v1.2.3