org.xwiki.gwt.wysiwyg.client.plugin.image.exec
Class InsertImageExecutable

java.lang.Object
  extended by org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractRichTextAreaExecutable
      extended by org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractSelectionExecutable
          extended by org.xwiki.gwt.user.client.ui.rta.cmd.internal.InsertHTMLExecutable
              extended by org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractInsertElementExecutable<ImageConfig,com.google.gwt.dom.client.ImageElement>
                  extended by org.xwiki.gwt.wysiwyg.client.plugin.image.exec.InsertImageExecutable
All Implemented Interfaces:
Executable

public class InsertImageExecutable
extends AbstractInsertElementExecutable<ImageConfig,com.google.gwt.dom.client.ImageElement>

Handles the insertion of an image, passed through its corresponding HTML block.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractInsertElementExecutable
AbstractInsertElementExecutable.AbstractConfigJSONSerializer<C>, AbstractInsertElementExecutable.ConfigDOMReader<C,E extends com.google.gwt.dom.client.Element>, AbstractInsertElementExecutable.ConfigDOMWriter<C,E extends com.google.gwt.dom.client.Element>, AbstractInsertElementExecutable.ConfigJSONParser<C>, AbstractInsertElementExecutable.ConfigJSONSerializer<C>
 
Field Summary
 
Fields inherited from class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractInsertElementExecutable
configDOMReader, configDOMWriter, configJSONParser, configJSONSerializer
 
Fields inherited from class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractSelectionExecutable
cache, domUtils
 
Fields inherited from class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractRichTextAreaExecutable
rta
 
Constructor Summary
InsertImageExecutable(RichTextArea rta)
          Creates a new executable that can be used to insert images in the specified rich text area.
 
Method Summary
protected  String getCacheKeyPrefix()
          
protected  com.google.gwt.dom.client.ImageElement getSelectedElement()
          
protected  com.google.gwt.dom.client.ImageElement newElement()
          
protected  void write(ImageConfig config, com.google.gwt.dom.client.ImageElement image)
          Updates the attributes of the given element based on the given configuration object.
 
Methods inherited from class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractInsertElementExecutable
execute, getParameter, isExecuted
 
Methods inherited from class org.xwiki.gwt.user.client.ui.rta.cmd.internal.InsertHTMLExecutable
execute, insertNode
 
Methods inherited from class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractSelectionExecutable
hasValidSelection, isEnabled
 
Methods inherited from class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractRichTextAreaExecutable
isSupported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InsertImageExecutable

public InsertImageExecutable(RichTextArea rta)
Creates a new executable that can be used to insert images in the specified rich text area.

Parameters:
rta - the execution target
Method Detail

write

protected void write(ImageConfig config,
                     com.google.gwt.dom.client.ImageElement image)
Updates the attributes of the given element based on the given configuration object.

Note: This method was added mainly to allow derived classes to adjust the configuration object before the element is updated.

Overrides:
write in class AbstractInsertElementExecutable<ImageConfig,com.google.gwt.dom.client.ImageElement>
Parameters:
config - the object used to update the attributes of the given element
image - the element whose attributes are being updated
See Also:
AbstractInsertElementExecutable.write(Object, com.google.gwt.dom.client.Element)

getCacheKeyPrefix

protected String getCacheKeyPrefix()

Specified by:
getCacheKeyPrefix in class AbstractInsertElementExecutable<ImageConfig,com.google.gwt.dom.client.ImageElement>
Returns:
the text to prefix all cache keys used by this class
See Also:
AbstractInsertElementExecutable.getCacheKeyPrefix()

getSelectedElement

protected com.google.gwt.dom.client.ImageElement getSelectedElement()

Gets the image element in the current selection.

Specified by:
getSelectedElement in class AbstractInsertElementExecutable<ImageConfig,com.google.gwt.dom.client.ImageElement>
Returns:
the selected element, null if no element is selected
See Also:
AbstractInsertElementExecutable.getSelectedElement()

newElement

protected com.google.gwt.dom.client.ImageElement newElement()

Specified by:
newElement in class AbstractInsertElementExecutable<ImageConfig,com.google.gwt.dom.client.ImageElement>
Returns:
a new element to be inserted
See Also:
AbstractInsertElementExecutable.newElement()