public class InlineStyleNameExecutable extends org.xwiki.gwt.user.client.ui.rta.cmd.internal.InlineStyleExecutable
cache, domUtilsrta| Constructor and Description |
|---|
InlineStyleNameExecutable(RichTextArea rta)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addStyle(Element element,
String parameter) |
boolean |
execute(String parameter) |
protected TextFragment |
execute(Text text,
int startIndex,
int endIndex,
String parameter) |
String |
getParameter() |
protected Set<String> |
getStyleNames(com.google.gwt.dom.client.Node node) |
protected Set<String> |
getStyleNames(Range range) |
protected Set<String> |
getStyleNames(Selection selection) |
boolean |
isExecuted() |
protected boolean |
matchesStyleName(Text text,
String parameter) |
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).
|
execute, getNonEmptyTextNodes, getParameter, getParameter, getParameter, getPropertyhasValidSelection, isEnabledisSupportedpublic InlineStyleNameExecutable(RichTextArea rta)
rta - the execution targetpublic boolean execute(String parameter)
execute in interface Executableexecute in class org.xwiki.gwt.user.client.ui.rta.cmd.internal.InlineStyleExecutableInlineStyleExecutable.execute(String)protected TextFragment execute(Text text, int startIndex, int endIndex, String parameter)
execute in class org.xwiki.gwt.user.client.ui.rta.cmd.internal.InlineStyleExecutableInlineStyleExecutable.execute(Text, int, int, String)protected void addStyle(Element element, String parameter)
addStyle in class org.xwiki.gwt.user.client.ui.rta.cmd.internal.InlineStyleExecutableInlineStyleExecutable.addStyle(Element, String)protected boolean matchesStyleName(Text text, String parameter)
text - a text nodeparameter - a style nametrue if any of the in-line ancestors of the given text node has the specified style name, false otherwiseprotected TextFragment removeStyleName(Text text, int startIndex, int endIndex, String styleName)
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 removedpublic String getParameter()
getParameter in interface ExecutablegetParameter in class org.xwiki.gwt.user.client.ui.rta.cmd.internal.InlineStyleExecutableInlineStyleExecutable.getParameter()protected Set<String> getStyleNames(Selection selection)
selection - a text selectionprotected Set<String> getStyleNames(Range range)
range - a text rangeprotected Set<String> getStyleNames(com.google.gwt.dom.client.Node node)
node - a DOM nodepublic boolean isExecuted()
isExecuted in interface ExecutableisExecuted in class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractSelectionExecutableAbstractSelectionExecutable.isExecuted()Copyright © 2004–2014 XWiki. All rights reserved.