org.xwiki.gwt.wysiwyg.client.plugin.style.exec
Class BlockStyleNameExecutable
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.AbstractBlockExecutable
org.xwiki.gwt.user.client.ui.rta.cmd.internal.BlockStyleExecutable
org.xwiki.gwt.wysiwyg.client.plugin.style.exec.BlockStyleNameExecutable
- All Implemented Interfaces:
- Executable
public class BlockStyleNameExecutable
- extends org.xwiki.gwt.user.client.ui.rta.cmd.internal.BlockStyleExecutable
Applies a given style name to each of the block nodes touched by the current text selection.
- Version:
- $Id: e3abef0e9254361bc9a652bdbf410259b3550b5c $
| Methods inherited from class org.xwiki.gwt.user.client.ui.rta.cmd.internal.BlockStyleExecutable |
getParameter |
| Methods inherited from class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractBlockExecutable |
execute, execute, getParameter, wrap |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BlockStyleNameExecutable
public BlockStyleNameExecutable(RichTextArea rta)
- Creates a new instance.
- Parameters:
rta - the execution target
execute
public boolean execute(String parameter)
-
- Specified by:
execute in interface Executable- Overrides:
execute in class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractBlockExecutable
- See Also:
AbstractBlockExecutable.execute(String)
execute
protected void execute(com.google.gwt.dom.client.Node node,
int startOffset,
int endOffset,
String value)
-
- Overrides:
execute in class org.xwiki.gwt.user.client.ui.rta.cmd.internal.BlockStyleExecutable
- See Also:
BlockStyleExecutable.execute(Node, int, int, String)
addStyle
protected void addStyle(Element element,
String styleName)
-
- Overrides:
addStyle in class org.xwiki.gwt.user.client.ui.rta.cmd.internal.BlockStyleExecutable
- See Also:
BlockStyleExecutable.addStyle(Element, String)
removeStyleName
protected void removeStyleName(com.google.gwt.dom.client.Node node,
String styleName)
- Removes the specified style name from the block-level ancestors of the given DOM node.
- Parameters:
node - a DOM nodestyleName - the style name to be removed
matchesStyleName
protected boolean matchesStyleName(com.google.gwt.dom.client.Node node,
String styleName)
- Parameters:
node - a DOM nodestyleName - a style name
- Returns:
true if any of the block-level ancestors of the given node has the specified style name, false otherwise
getParameter
public String getParameter()
-
- Specified by:
getParameter in interface Executable- Overrides:
getParameter in class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractBlockExecutable
- See Also:
AbstractBlockExecutable.getParameter()
getStyleNames
protected Set<String> getStyleNames(Selection selection)
- Parameters:
selection - a text selection
- Returns:
- the set of style names that affect all the text nodes touched by the given text selection
getStyleNames
protected Set<String> getStyleNames(Range range)
- Parameters:
range - a text range
- Returns:
- the set of style names that affect all the leafs in the given DOM range
getStyleNames
protected Set<String> getStyleNames(com.google.gwt.dom.client.Node node)
- Parameters:
node - a DOM node
- Returns:
- the set of style names that affect the block-level ancestors of the given DOM node
isExecuted
public boolean isExecuted()
-
- Specified by:
isExecuted in interface Executable- Overrides:
isExecuted in class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractSelectionExecutable
- See Also:
AbstractSelectionExecutable.isExecuted()
Copyright © 2004-2013 XWiki. All Rights Reserved.