public abstract class AbstractListExecutable extends org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractSelectionExecutable
| Modifier and Type | Field and Description |
|---|---|
protected static String |
LIST_ITEM_TAG
List item element name.
|
protected static String |
ORDERED_LIST_TAG
Ordered list element name.
|
protected static String |
UNORDERED_LIST_TAG
Unordered list element name.
|
cache, domUtilsrta| Constructor and Description |
|---|
AbstractListExecutable(RichTextArea rta)
Creates a new executable to be executed on the specified rich text area.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canExecute(Element listItem)
Checks if this command can be executed on a single list item.
|
protected abstract void |
execute(Element listItem)
Actually executes the operation on a single list item.
|
boolean |
execute(String param) |
protected abstract boolean |
executeOnMultipleItems(Range range,
boolean perform)
Executes this list operation on all items in the non-collapsed selection.
|
protected Element |
getListItem(Range range) |
boolean |
isEnabled() |
protected boolean |
isList(com.google.gwt.dom.client.Node node)
Checks if the passed node is a list node: either an ordered list or an unordered one.
|
getParameter, hasValidSelection, isExecutedisSupportedprotected static final String LIST_ITEM_TAG
protected static final String UNORDERED_LIST_TAG
protected static final String ORDERED_LIST_TAG
public AbstractListExecutable(RichTextArea rta)
rta - the execution targetprotected Element getListItem(Range range)
range - a DOM rangenull if no such thing existsprotected boolean isList(com.google.gwt.dom.client.Node node)
node - the node to check if it's a list or notpublic boolean execute(String param)
protected abstract void execute(Element listItem)
canExecute(Element) on the same list item returns true.listItem - the list item to execute the operation onprotected boolean canExecute(Element listItem)
listItem - the list item to check if the command can be executed ontrue if the command can be executed, false otherwiseprotected abstract boolean executeOnMultipleItems(Range range, boolean perform)
perform parameter specifies
if the operation is actually performed or just checked to be possible (while this kind of parameters are not good
practice, it's the best way right now to make sure we use the same detection algorithm in the
execute(String) and isEnabled() functions).range - the current range to execute the operation onperform - true if the operation is to be actually executed, false if it's only to be checkedtrue if at least one of the items in the selection was affected, false otherwise.public boolean isEnabled()
isEnabled in interface ExecutableisEnabled in class org.xwiki.gwt.user.client.ui.rta.cmd.internal.AbstractSelectionExecutableCopyright © 2004–2016 XWiki. All rights reserved.