Enable IME for text tool's basic TextField - fixes #2678

This commit is contained in:
Chad Pilkey 2017-06-05 18:22:40 -04:00
parent 16f67377e5
commit 5f34a359c5
2 changed files with 45 additions and 1 deletions

View File

@ -0,0 +1,43 @@
package org.bigbluebutton.common {
import flash.events.FocusEvent;
import flash.system.Capabilities;
import flash.system.IME;
import flash.text.TextField;
import mx.core.IIMESupport;
public class IMETextField extends TextField implements IIMESupport {
private var _imeMode:String = null;
public function IMETextField() {
super();
// Only bind to FOCUS_IN. The FOCUS_OUT doesn't matter
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
}
public function get enableIME():Boolean {
return true;
}
// This getter/setter pair is never used, but it's required for the interface
public function get imeMode():String {
return _imeMode;
}
public function set imeMode(value:String):void {
_imeMode = value;
}
protected function focusInHandler(e:FocusEvent):void {
/* The Adobe documentation on IME is out of date and should be ignored.
* See SDK FocusManager focusInHandler() function for current method of
* handling. Unfortunately the TextField "focus in" is ignored by the
* FocusManager so we need to handle it ourselves.
*/
if (Capabilities.hasIME) {
IME.enabled = enableIME;
}
}
}
}

View File

@ -26,11 +26,12 @@ package org.bigbluebutton.modules.whiteboard.business.shapes {
import flash.text.TextFieldType;
import flash.text.TextFormat;
import org.bigbluebutton.common.IMETextField;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.modules.whiteboard.models.Annotation;
import org.bigbluebutton.modules.whiteboard.models.AnnotationStatus;
public class TextObject extends TextField implements GraphicObject {
public class TextObject extends IMETextField implements GraphicObject {
private var _id:String;
private var _type:String;
private var _status:String;