org.xwiki.gwt.user.client.ui.rta
Class Reloader

java.lang.Object
  extended by org.xwiki.gwt.user.client.ui.rta.Reloader
All Implemented Interfaces:
com.google.gwt.event.dom.client.LoadHandler, com.google.gwt.event.shared.EventHandler, com.google.gwt.http.client.RequestCallback

public class Reloader
extends Object
implements com.google.gwt.http.client.RequestCallback, com.google.gwt.event.dom.client.LoadHandler

Reloads a rich text area.

Version:
$Id: 71a55f439854c2411a2f967667ef1f4897fd5c49 $

Constructor Summary
Reloader(RichTextArea rta)
          Creates a new reloader for the specified rich text area.
Reloader(RichTextArea rta, String url)
          Creates a new reloader that makes requests to the specified URL and uses the response to reset the content of the given rich text area.
 
Method Summary
 void onError(com.google.gwt.http.client.Request request, Throwable exception)
           
 void onLoad(com.google.gwt.event.dom.client.LoadEvent event)
           
 void onResponseReceived(com.google.gwt.http.client.Request request, com.google.gwt.http.client.Response response)
           
 void reload(Map<String,String> params, com.google.gwt.user.client.rpc.AsyncCallback<?> callback)
          Reloads the underlying rich text area.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reloader

public Reloader(RichTextArea rta)
Creates a new reloader for the specified rich text area.

Parameters:
rta - the rich text that needs to be reloaded

Reloader

public Reloader(RichTextArea rta,
                String url)
Creates a new reloader that makes requests to the specified URL and uses the response to reset the content of the given rich text area.

Parameters:
rta - the rich text area that needs to be reloaded
url - the URL to get the content from; note that this URL must obey the same-origin policy
Method Detail

reload

public void reload(Map<String,String> params,
                   com.google.gwt.user.client.rpc.AsyncCallback<?> callback)
Reloads the underlying rich text area.

Parameters:
params - optional reload parameters
callback - the object notified when the rich text area is reloaded

onError

public void onError(com.google.gwt.http.client.Request request,
                    Throwable exception)
Specified by:
onError in interface com.google.gwt.http.client.RequestCallback

onResponseReceived

public void onResponseReceived(com.google.gwt.http.client.Request request,
                               com.google.gwt.http.client.Response response)
Specified by:
onResponseReceived in interface com.google.gwt.http.client.RequestCallback

onLoad

public void onLoad(com.google.gwt.event.dom.client.LoadEvent event)
Specified by:
onLoad in interface com.google.gwt.event.dom.client.LoadHandler


Copyright © 2004-2013 XWiki. All Rights Reserved.