View Javadoc

1   /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.student.common.ui.client.widgets.impl;
17  
18  
19  
20  import org.kuali.student.common.ui.client.widgets.KSRichEditorAbstract;
21  
22  import com.google.gwt.event.dom.client.BlurHandler;
23  import com.google.gwt.event.dom.client.FocusHandler;
24  import com.google.gwt.event.shared.HandlerRegistration;
25  import com.google.gwt.user.client.ui.RichTextArea;
26  
27  /** 
28   * Placeholder widget for future real rich text editor implementation
29   * 
30   */
31  public class KSRichEditorImpl extends KSRichEditorAbstract {
32  	private final RichTextArea textArea = new RichTextArea();
33  	
34  	public KSRichEditorImpl(){
35  		init();
36  	}
37  
38  	@Override
39  	public String getHTML() {
40  		return textArea.getHTML();
41  	}
42  
43  	@Override
44  	public RichTextArea getRichTextArea() {
45  		return textArea;
46  	}
47  
48  	@Override
49  	public String getText() {
50  		return textArea.getText();
51  	}
52  
53  	@Override
54  	protected void init() {
55  		this.initWidget(textArea);
56  	}
57  
58  	@Override
59  	public void setHTML(String html) {
60  		textArea.setHTML(html);
61  	}
62  
63  	@Override
64  	public void setStyleName(String style) {
65  		textArea.setStyleName(style);
66  		
67  	}
68  
69  	@Override
70  	public void setText(String text) {
71  		textArea.setText(text);
72  	}
73  
74  	@Override
75  	public HandlerRegistration addBlurHandler(BlurHandler handler) {
76  		return textArea.addBlurHandler(handler);
77  	}
78  
79  	@Override
80  	public HandlerRegistration addFocusHandler(FocusHandler handler) {
81  		return textArea.addFocusHandler(handler);
82  	}
83  
84  	
85  	
86  }