org.xwiki.gwt.wysiwyg.client.plugin.image.exec
Class InsertImageExecutable
java.lang.Object
org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractRichTextAreaExecutable
org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractSelectionExecutable
org.xwiki.gwt.user.client.ui.rta.cmd.internal.InsertHTMLExecutable
org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractInsertElementExecutable<ImageConfig,com.google.gwt.dom.client.ImageElement>
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.
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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 elementimage
- 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()