[10] Review request for 8166772: Touch keyboard is not shown for text components on a screen touch

2017-08-17 Thread Anton Litvinov

Hello,

Could you please review the following fix for the bug.

Bug: https://bugs.openjdk.java.net/browse/JDK-8166772
Webrev: http://cr.openjdk.java.net/~alitvinov/8166772/jdk10/webrev.00

The bug is the fact that, when a user touches any Swing or AWT text 
component, for example "JTextField", "JTextArea", "TextField", 
"TextArea", by means of a touch screen on a host with MS Windows 
10/8.1/8 OS, the system touch keyboard is not shown automatically. 
Please find a detailed description of the bug, screenshots depicting the 
touch keyboard and a compilable test case with Swing/AWT text components 
in JBS bug record. Also a summary of the done research of the issue with 
a description of identified approaches for its resolution are reported 
in my last comment in the bug record.


THE FIX:
On a very abstract level the fix functioning can be presented by the 
next 3 stages:


Stage 1.
The fix adds support of "WM_TOUCH" system window messages to AWT native 
peer windows through C++ class "AwtComponent". It "processes" "WM_TOUCH" 
message and marks "java.awt.event.MouseEvent", which is created as a 
result of handling of the further coming "WM_LBUTTONDOWN", 
"WM_LBUTTONUP" messages sent by the system in substitution for this 
"WM_TOUCH" message, by the new private field flag 
"MouseEvent.causedByTouchEvent".


Stage 2.
Then on Java level the fix handles "MouseEvent", "FocusEvent" received 
only by the instances of "java.awt.TextComponent", 
"javax.swing.text.TextComponent" in "WToolkit.showOrHideTouchKeyboard()" 
called from "Component.dispatchEventImpl()" and shows or hides the touch 
keyboard on "MouseEvent.MOUSE_RELEASED" and "FocusEvent.FOCUS_LOST" 
events by calling corresponding native methods of "WToolkit" class.


Stage 3.
Showing of the touch keyboard is implemented in C++ class "AwtToolkit" 
and is done by launching the system application "TabTip.exe" which 
implements the system touch keyboard. This approach is described in the 
bug record.


FEATURES OF THE FIX:
1. By default all native and Java parts of the fix do not function at 
all - the fix is disabled. To enable the fix the application should be 
run with "-Dawt.touchKeyboardAutoShowIsEnabled=true" option. Handling of 
this new property is implemented in "sun.awt.SunToolkit" class.


2. Native parts of the fix functions only on MS Window 8 or later.

3. The fix implements automatic showing of the touch keyboard for the 
following 2 use cases:

a.  The user touches the text components using the touch screen.
b.  The user does mouse clicks on the text components, while no any 
keyboard is attached to the host.


FIX LOGICAL STRUCTURE BY SOURCE CODE:
1. Core of the fix:
Native code:  awt_Toolkit.[h/cpp], awt_Component.[h/cpp], 
awt_MouseEvent.[h/cpp], awt.h
Java:  SunToolkit.java, WToolkit.java, Component.java, 
MouseEvent.java, AWTAccessor.java


2. Changes in all remaining Java files are connected with retaining of 
the flag value "MouseEvent.causedByTouchEvent" during creation of the 
new instances of "MouseEvent" class based on the original "MouseEvent" 
instances.


Work of the fix was verified both in the environment with the real touch 
screen device and in the environment with the emulated touch screen.


Thank you,
Anton


Re: [10] JDK-8004029: [macosx] The long Tab titles are not clipped with dots at the end.

2017-08-17 Thread Prasanta Sadhukhan

Fix looks good.

But, can you update test/javax/swing/JTabbedPane/4310381/bug4310381.java 
to include the test for all installed l so that we can see if there 
is problem in any other l?


Regards
Prasanta
On 8/17/2017 2:08 PM, Shashidhara Veerabhadraiah wrote:


Hi All, Please review a fix for the JDK- 8004029 where the long tab 
titles were not clipped with the dots at the end to indicate a lengthy 
title. The aqua look and feel which is the default laf for mac does 
the title clipping only leading to an ambiguous UI where in the 
clipped title would look like the /_complete_/ title though it is not. 
Hence it is good to show dots at the end indicating a much bigger 
title exists though the tab does not have enough real estate to 
display the complete title.


_Solution and fix:_ I have updated the aqua laf module to clip the 
title text and put the dots at the end if the text size is larger than 
the tab size. Below is the picture /_after_/ the fix.


Bug: https://bugs.openjdk.java.net/browse/JDK-8004029

Webrev: http://cr.openjdk.java.net/~aghaisas/shashi/8004029/webrev.00/ 



Thanks and regards,

Shashi





[10] JDK-8004029: [macosx] The long Tab titles are not clipped with dots at the end.

2017-08-17 Thread Shashidhara Veerabhadraiah
Hi All, Please review a fix for the JDK- 8004029 where the long tab titles were 
not clipped with the dots at the end to indicate a lengthy title. The aqua look 
and feel which is the default laf for mac does the title clipping only leading 
to an ambiguous UI where in the clipped title would look like the complete 
title though it is not. Hence it is good to show dots at the end indicating a 
much bigger title exists though the tab does not have enough real estate to 
display the complete title.

 

Solution and fix: I have updated the aqua laf module to clip the title text and 
put the dots at the end if the text size is larger than the tab size. Below is 
the picture after the fix.

 



 

Bug: https://bugs.openjdk.java.net/browse/JDK-8004029

Webrev: http://cr.openjdk.java.net/~aghaisas/shashi/8004029/webrev.00/

 

Thanks and regards,

Shashi