public class OutdentExecutable extends AbstractListExecutable
| Modifier and Type | Field and Description |
|---|---|
protected static String |
LINE_BREAK_TAG
Line break tag, to help manage empty list items after outdenting sublists.
|
LIST_ITEM_TAG, ORDERED_LIST_TAG, UNORDERED_LIST_TAGcache, domUtilsrta| Constructor and Description |
|---|
OutdentExecutable(RichTextArea rta)
Creates a new executable that can be used to decrease the identation of list items inside 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 void |
execute(Element listItem)
Actually executes the operation on a single list item.
|
protected boolean |
executeOnMultipleItems(Range range,
boolean perform)
Executes this list operation on all items in the non-collapsed selection.
|
protected void |
outdentFirstLevelItem(Element listItem,
Element parentList)
Outdents an element on the first level of the list, by splitting the list in two, and leaving the list item's
content as text between the lists.
|
void |
outdentItem(Element listItem,
Element parentList,
Element parentListItem)
Actually executes the outdent on
listItem, with respect to the list it takes part of. |
execute, getListItem, isEnabled, isListgetParameter, hasValidSelection, isExecutedisSupportedprotected static final String LINE_BREAK_TAG
public OutdentExecutable(RichTextArea rta)
rta - the execution targetprotected boolean canExecute(Element listItem)
canExecute in class AbstractListExecutablelistItem - the list item to check if the command can be executed ontrue if the command can be executed, false otherwiseprotected void execute(Element listItem)
AbstractListExecutable.canExecute(Element) on the same list item returns true. Moves the passed lust item one level up, as a next sibling of the list item it takes part of. If
it's a first level list item, it is pulled out of its list.execute in class AbstractListExecutablelistItem - the list item to execute the operation onprotected 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(RichTextArea, String) and #isEnabled(RichTextArea) functions).executeOnMultipleItems in class AbstractListExecutablerange - 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 void outdentItem(Element listItem, Element parentList, Element parentListItem)
listItem, with respect to the list it takes part of.listItem - the list item to outdentparentList - the list in which it is placedparentListItem - the list item in which this sublist is placedprotected void outdentFirstLevelItem(Element listItem, Element parentList)
listItem - the list item that needs to be unindentedparentList - the parent list of this itemCopyright © 2004–2014 XWiki. All rights reserved.