1 16 package com.google.gwt.user.client.ui.impl; 17 18 import com.google.gwt.user.client.Element; 19 import com.google.gwt.user.client.ui.RichTextArea; 20 21 24 public class RichTextAreaImplOpera extends RichTextAreaImplStandard { 25 26 private static RichTextAreaImpl old; 27 private static boolean richTextSupported = detectEditingSupport(); 28 29 static { 30 if (!richTextSupported) { 33 old = new RichTextAreaImpl(); 34 } 35 } 36 37 private static native boolean detectEditingSupport() ; 40 41 public Element createElement() { 42 if (old != null) { 43 return old.createElement(); 44 } 45 return super.createElement(); 46 } 47 48 public Element getElement() { 49 if (old != null) { 50 return old.getElement(); 51 } 52 return super.getElement(); 53 } 54 55 public void hookEvents(RichTextArea owner) { 56 if (old != null) { 57 old.hookEvents(owner); 58 return; 59 } 60 super.hookEvents(owner); 61 } 62 63 public void initElement() { 64 if (old != null) { 65 old.initElement(); 66 return; 67 } 68 super.initElement(); 69 } 70 71 public boolean isBasicEditingSupported() { 72 return richTextSupported; 73 } 74 75 public boolean isExtendedEditingSupported() { 76 return richTextSupported; 77 } 78 79 public void setBackColor(String color) { 80 execCommand("HiliteColor", color); 83 } 84 85 public native void setFocus(boolean focused) ; 93 94 public void unhookEvents() { 95 if (old != null) { 96 old.unhookEvents(); 97 } 98 super.unhookEvents(); 99 } 100 101 protected String getHTMLImpl() { 102 if (old != null) { 103 return old.getHTML(); 104 } 105 return super.getHTMLImpl(); 106 } 107 108 protected String getTextImpl() { 109 if (old != null) { 110 return old.getText(); 111 } 112 return super.getTextImpl(); 113 } 114 115 protected void setHTMLImpl(String html) { 116 if (old != null) { 117 old.setHTML(html); 118 return; 119 } 120 super.setHTMLImpl(html); 121 } 122 123 protected void setTextImpl(String text) { 124 if (old != null) { 125 old.setText(text); 126 return; 127 } 128 super.setTextImpl(text); 129 } 130 } 131 | Popular Tags |