[ https://issues.apache.org/jira/browse/PIVOT-850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16048364#comment-16048364 ]
Roger Whitcomb commented on PIVOT-850: -------------------------------------- First cut of IME support in TextPane (complicated): Revision 1798635: PIVOT-850: First round of changes to allow Input Method Editors to work with TextPane. This involves several things: 1. Change AttributedStringCharacterIterator to add new methods to attach underline and strikethrough attributes to a complete string. Make a new private method to attach attributes, and use that for existing code (such as for Font) as well. 2. Add the required method call to return the TextInputMethodListener interface for the component. 3. Implement that interface, similarly to TerraTextInputSkin. 4. Make necessary changes in TextPaneSkinTextNodeView.java to paint text using TextLayout instead of GlyphVector; do layout using the composed text as well as the committed text (again resulting in TextLayout objects). 4a. Using LineBreakMeasurer now to do line wrapping, which results in a TextLayout as is needed. 4b. Using the underline and strikethrough attributes available through TextLayout instead of drawing them ourselves. 4c. Using the TextLayout and TextHitInfo classes to compute caret position and insertion points. 5. Store and retrieve the composed text inside TextPane itself. 6. Allow for any composed text length in "setSelection" logic. 7.. Update the TextPaneDemo program to work a little better (pressing the style buttons puts focus back on the TextPane; correct some of the Span construction so the correct amount of text is affected). Along the way did some other things: A. Use Utils.checkXXX methods where applicable to validate parameters. B. Simplify the code in some of the methods that look up the tree for attributes in their parents. C. (Hopefully) speed up the process of creating the NodeView objects in TextPaneSkinNodeView by not using reflection to find and call the object constructors, but a simple interface/callback to do so. D. Add some Javadoc. E. Use the new ApplicationContext.runAndScheduleRecurringCallback for scrolling and caret blink. F. Add a new "setSize(Dimensions)" method to TextPaneSkinNodeView for use by subclasses. G. Changed some "toString()" methods to be similar to changes made earlier to "Bounds", "Point", etc. Note: There are still issues in this code to be worked out (and so some debugging code has been left in for now): a. Caret positioning for composed text at the end of lines is incorrect. b. Sometimes duplicated or missing composed text is displayed. c. There may be other times when selection outside of composed text messes things up. Modified: pivot/trunk/core/src/org/apache/pivot/text/AttributedStringCharacterIterator.java pivot/trunk/demos/src/org/apache/pivot/demos/text/TextPaneDemo.java pivot/trunk/wtk/src/org/apache/pivot/wtk/TextPane.java pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkin.java pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinElementView.java pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinNodeView.java pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinTextNodeView.java pivot/trunk/wtk/src/org/apache/pivot/wtk/text/TextNode.java > Fail to take input characters other than English in Mac Lion > ------------------------------------------------------------ > > Key: PIVOT-850 > URL: https://issues.apache.org/jira/browse/PIVOT-850 > Project: Pivot > Issue Type: Bug > Components: wtk, wtk-terra > Affects Versions: 2.0.1, 2.0.2, 2.0.3 > Environment: Mac Lion > Reporter: Brendan > Assignee: Roger Whitcomb > Labels: jre, mac > Fix For: 2.5 > > Attachments: ASF.LICENSE.NOT.GRANTED--Input to Mac Lion of Chinese > Character show nothing.jpg, ASF.LICENSE.NOT.GRANTED--Window 7 and Text Area > to show Chinese Input as Box.jpg, inputProblem.png, Screen Shot 2013-03-11 at > 10.56.51 AM.png, Screen Shot 2013-03-11 at 10.59.23 AM.png, Screen Shot > 2013-03-11 at 11.00.14 AM.png, WebStartInput.png > > > In Mac Lion, no Chinese and Korean character can appear in TextInput and > TextArea thru the input method. > However, these components can take the character thru copy and paste. > -- This message was sent by Atlassian JIRA (v6.4.14#64029)