net.sourceforge.gwtaddons.client.richtext
Class Editor

java.lang.Object
  extended bycom.google.gwt.user.client.ui.UIObject
      extended bycom.google.gwt.user.client.ui.Widget
          extended bycom.google.gwt.user.client.ui.Composite
              extended bynet.sourceforge.gwtaddons.client.richtext.Editor
All Implemented Interfaces:
com.google.gwt.user.client.EventListener

public class Editor
extends com.google.gwt.user.client.ui.Composite

This is the main class of the rich text editor. A typical use is:

      Editor editor = new Editor();
      editor.setTextPixelSize(400, 300);
      RootPanel.get().add(editor);
      editor.setHTML("My editor text.");
 
The editor is using the follow stylenames:

Author:
Volker Berlin

Constructor Summary
Editor()
          Constructor of a Rich Text Editor
 
Method Summary
 java.lang.String getHTML()
          Get the current HTML text of the editor.
protected  void onLoad()
          This method is called when the editor becomes attached to the browser's document.
 void setEditable(boolean editable)
          Enable or disable the edit mode.
 void setHTML(java.lang.String html)
          Sets this editor's contents via HTML.
 void setTextSize(java.lang.String width, java.lang.String height)
          Sets the text's size, in pixels, not including decorations such as border, margin, padding and the toolbar.
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getElement, onAttach, onDetach, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached, onBrowserEvent
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleName, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Editor

public Editor()
Constructor of a Rich Text Editor

Method Detail

onLoad

protected void onLoad()
This method is called when the editor becomes attached to the browser's document. In this method all elements are created with the current skin.


setTextSize

public void setTextSize(java.lang.String width,
                        java.lang.String height)
Sets the text's size, in pixels, not including decorations such as border, margin, padding and the toolbar.

Parameters:
width - the text's new width, in pixels
height - the text's new height, in pixels

getHTML

public java.lang.String getHTML()
Get the current HTML text of the editor.

See Also:
setHTML(String)

setHTML

public void setHTML(java.lang.String html)
Sets this editor's contents via HTML. This method can be call first after it was add to the parent.

Parameters:
html - the editor's new HTML

setEditable

public void setEditable(boolean editable)
Enable or disable the edit mode. Depending on the mode the toolbar is visible or not.

Parameters:
editable - true means that is can be edit.