List of usage examples for com.google.gwt.user.client.ui RichTextArea addInitializeHandler
public HandlerRegistration addInitializeHandler(InitializeHandler handler)
From source file:cz.filmtit.client.subgestbox.PosteditBox.java
License:Open Source License
public PosteditBox(TimedChunk chunk, TranslationWorkspace workspace, int tabIndex) { this.chunk = chunk; this.workspace = workspace; if (this.workspace == null) { Gui.log("workspace for subgestbox is null!!!"); }// w ww.java 2 s . c o m this.subgestBox = null; this.setHeight("36px"); this.setHTML(posteditBoxHTML("")); this.addFocusHandler(this.workspace.posteditHandler); this.addKeyDownHandler(this.workspace.posteditHandler); this.addKeyUpHandler(this.workspace.posteditHandler); this.setTabIndex(tabIndex); this.addStyleName("posteditwidth"); final RichTextArea richtext = this; richtext.addInitializeHandler(new InitializeHandler() { public void onInitialize(InitializeEvent ie) { IFrameElement fe = (IFrameElement) richtext.getElement().cast(); Style s = fe.getContentDocument().getBody().getStyle(); s.setProperty("fontFamily", "Arial Unicode MS,Arial,sans-serif"); s.setProperty("fontSize", "small"); s.setColor("#333"); } }); }
From source file:cz.filmtit.client.subgestbox.SubgestBox.java
License:Open Source License
/** * Primary constructor for the SubgestBox. * * @param chunk - the source chunk of the underlying TranslationResult * @param workspace - the TranslationWorkspace in which this SubgestBox * operates/* w w w .j a v a2 s . c o m*/ * @param tabIndex - intended tabIndex within the workspace */ public SubgestBox(TimedChunk chunk, TranslationWorkspace workspace, int tabIndex) { this.chunk = chunk; this.translationResult = new TranslationResult(chunk); this.workspace = workspace; if (this.workspace == null) { Gui.log("workspace for subgestbox is null!!!"); } this.posteditBox = null; this.setHeight("36px"); this.setHTML(subgestBoxHTML("")); this.addFocusHandler(this.workspace.subgestHandler); this.addKeyDownHandler(this.workspace.subgestHandler); this.addKeyUpHandler(this.workspace.subgestHandler); this.setTabIndex(tabIndex); if (workspace.isPosteditOn()) { this.addStyleName("posteditwidth"); } else { this.addStyleName("subgest_fullwidth"); } final RichTextArea richtext = this; richtext.addInitializeHandler(new InitializeHandler() { public void onInitialize(InitializeEvent ie) { IFrameElement fe = (IFrameElement) richtext.getElement().cast(); Style s = fe.getContentDocument().getBody().getStyle(); s.setProperty("fontFamily", "Arial Unicode MS,Arial,sans-serif"); s.setProperty("fontSize", "small"); s.setColor("#333"); } }); }