org.xwiki.gwt.wysiwyg.client.plugin.style.exec
Class InlineStyleNameExecutable
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.InlineStyleExecutable
org.xwiki.gwt.wysiwyg.client.plugin.style.exec.InlineStyleNameExecutable
- All Implemented Interfaces:
- Executable
public class InlineStyleNameExecutable
- extends org.xwiki.gwt.user.client.ui.rta.cmd.internal.InlineStyleExecutable
Applies a given style name to each of the text nodes from the current text selection.
- Version:
- $Id: f35df9a9fa7ed4809c858f364c483dd6a5d9aa90 $
| Methods inherited from class org.xwiki.gwt.user.client.ui.rta.cmd.internal.InlineStyleExecutable |
execute, getNonEmptyTextNodes, getParameter, getParameter, getParameter, getProperty |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InlineStyleNameExecutable
public InlineStyleNameExecutable(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.InlineStyleExecutable
- See Also:
InlineStyleExecutable.execute(String)
execute
protected TextFragment execute(Text text,
int startIndex,
int endIndex,
String parameter)
-
- Overrides:
execute in class org.xwiki.gwt.user.client.ui.rta.cmd.internal.InlineStyleExecutable
- See Also:
InlineStyleExecutable.execute(Text, int, int, String)
addStyle
protected void addStyle(Element element,
String parameter)
-
- Overrides:
addStyle in class org.xwiki.gwt.user.client.ui.rta.cmd.internal.InlineStyleExecutable
- See Also:
InlineStyleExecutable.addStyle(Element, String)
matchesStyleName
protected boolean matchesStyleName(Text text,
String parameter)
- Parameters:
text - a text nodeparameter - a style name
- Returns:
true if any of the in-line ancestors of the given text node has the specified style name, false otherwise
removeStyleName
protected TextFragment removeStyleName(Text text,
int startIndex,
int endIndex,
String styleName)
- Removes the give style name from all the in-line element ancestors of the given text node, making sure no other
nodes are affected by this change (by isolating the nodes while iterating the ancestors).
- Parameters:
text - the target text nodestartIndex - the first character on which we remove the style nameendIndex - the last character on which we remove the style namestyleName - the style name to be removed
- Returns:
- the text fragment where the given style name doesn't apply anymore
getParameter
public String getParameter()
-
- Specified by:
getParameter in interface Executable- Overrides:
getParameter in class org.xwiki.gwt.user.client.ui.rta.cmd.internal.InlineStyleExecutable
- See Also:
InlineStyleExecutable.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 text nodes touched by the given text 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 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-2012 XWiki. All Rights Reserved.