org.xwiki.gwt.wysiwyg.client.plugin.format.exec
Class FormatBlockExecutable

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.AbstractBlockExecutable
              extended by org.xwiki.gwt.wysiwyg.client.plugin.format.exec.FormatBlockExecutable
All Implemented Interfaces:
Executable

public class FormatBlockExecutable
extends org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractBlockExecutable

Wraps the HTML fragment including the current selection in a specified block level element.

Version:
$Id: 668a8aa2cc50097f4136cd0bbc38e66e9aa5b2a0 $

Field Summary
 
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
FormatBlockExecutable(RichTextArea rta)
          Create a new executable to be executed on the specified rich text area.
 
Method Summary
protected  void execute(com.google.gwt.dom.client.Node node, int startOffset, int endOffset, String tagName)
          
protected  String getParameter(com.google.gwt.dom.client.Node node)
          
static void replace(Element element, String tagName)
          Replaces the given element with an element with the specified tag name, moving all the child nodes to the new element.
 
Methods inherited from class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractBlockExecutable
execute, execute, execute, getParameter, getParameter, wrap
 
Methods inherited from class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractSelectionExecutable
hasValidSelection, isEnabled, isExecuted
 
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

FormatBlockExecutable

public FormatBlockExecutable(RichTextArea rta)
Create a new executable to be executed on the specified rich text area.

Parameters:
rta - the execution target
Method Detail

execute

protected void execute(com.google.gwt.dom.client.Node node,
                       int startOffset,
                       int endOffset,
                       String tagName)

Formats as block the in-line neighborhood of the given node, using the specified block tag. If the specified tag name is empty then the block format is removed (in-line formatting will be used instead).

Specified by:
execute in class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractBlockExecutable
See Also:
AbstractBlockExecutable.execute(Node, int, int, String)

getParameter

protected String getParameter(com.google.gwt.dom.client.Node node)

Returns the tag used for block formatting. If the returned string is empty it means there's no block formatting (in other words, in-line formatting). If the returned string is null it means the given node doesn't support block formatting.

Specified by:
getParameter in class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractBlockExecutable
See Also:
AbstractBlockExecutable.getParameter(Node)

replace

public static void replace(Element element,
                           String tagName)
Replaces the given element with an element with the specified tag name, moving all the child nodes to the new element.

Parameters:
element - the element to be replaced
tagName - the tag name of the replacing element


Copyright © 2004-2013 XWiki. All Rights Reserved.