|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ephox.editlive.java2.editor.DocumentModifier
| Method Summary | |
void |
adjustCharacterAttributes(int startOffset,
int endOffset,
AttributeSet add,
Collection remove)
Changes the attributes of all content level elements within the specified range. |
void |
adjustCharacterAttributesForElementSelection(Collection selectedElements,
AttributeSet add,
Collection remove)
Changes the attributes of all content level elements that are children of the elements in selectedElements. |
void |
changeListItemIndent(int startOffset,
int endOffset,
int depthFromContent,
int indentAmount,
HTML.Tag targetListTag)
Changes the indent level of list items in the specified range. |
void |
endElementPropertiesTransaction()
End a properties transaction and add the operation to the manager. |
OperationManager |
getOperationManager()
Returns the operation manager that this modifier's operations are tracked in. |
void |
insertHtml(int offset,
String html)
Inserts a HTML fragment into the document. |
void |
insertHtml(int offset,
String html,
HTML.Tag firstTagToInsert,
Element insertIntoElement)
Insert a HTML fragment into the document. |
void |
insertString(int offset,
AttributeSet attributes,
String insert)
Inserts a plain text string into the document with the specified formatting applied. |
void |
pauseTracking()
Pause tracking operations. |
void |
remove(Element element)
Remove the specified element and all its content from the document. |
boolean |
remove(int startOffset,
int endOffset)
Remove the specified range from the document. |
void |
resumeTracking()
Unpause tracking operations. |
void |
setElementAttributes(Element element,
AttributeSet add,
Collection remove)
Modify an elements attributes. |
void |
setListType(int startOffset,
int endOffset,
int depthFromContent,
HTML.Tag targetListTag,
String targetListType,
String targetListStart)
Changes the list type in a given range. |
void |
setOverrideContentEditable(boolean override)
Allows developers to override the content editable attribute and modify uneditable sections. |
void |
startElementPropertiesTransaction()
Begin a new element properties transaction. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public void insertHtml(int offset,
String html)
throws BadLocationException
offset - the offset in the document to perform at.html - the HTML to insert.
BadLocationException - if offset is invalid.
public void insertHtml(int offset,
String html,
HTML.Tag firstTagToInsert,
Element insertIntoElement)
throws BadLocationException
offset - the offset to insert at.html - the HTML fragment to insert.firstTagToInsert - the tag which indicates the start of the content to actually insert.insertIntoElement - the element that the fragment should be inserted into.
BadLocationException - if offset or insertIntoElement is invalid.
public void insertString(int offset,
AttributeSet attributes,
String insert)
throws BadLocationException
offset - the offset to insert the string at.attributes - the attributes to apply to the content. This must include at a minimum a HTML.Tag instance
specified as the value for AttributeSet.NameAttribute.
For normal text content, use HTML.Tag#CONTENT as the tag.insert - the content to insert.
BadLocationException - if the specified offset is invalid.
public boolean remove(int startOffset,
int endOffset)
throws BadLocationException
startOffset - the start of the range to remove.endOffset - the end of the range to remove.
true if the changes were applied to the document, false if they were deferred until the
operation is accepted.
BadLocationException - if the specified range is invalid.
public void remove(Element element)
throws BadLocationException
element - the element to remove.
BadLocationException - if the element is not from this document or is no longer valid for this document.public void startElementPropertiesTransaction()
public void endElementPropertiesTransaction()
public void setElementAttributes(Element element,
AttributeSet add,
Collection remove)
element - the element to change the attributes of.add - the attributes to add.remove - the attributes to remove.
public void adjustCharacterAttributes(int startOffset,
int endOffset,
AttributeSet add,
Collection remove)
throws BadLocationException
setElementAttributes(Element, AttributeSet, Collection).
startOffset - the start of the range to change character attributes within.endOffset - the end of the range to change character attributes within.add - the attributes to add.remove - the attributes to remove.
BadLocationExceptionsetElementAttributes(Element, AttributeSet, Collection)
public void adjustCharacterAttributesForElementSelection(Collection selectedElements,
AttributeSet add,
Collection remove)
throws BadLocationException
setElementAttributes(Element, AttributeSet, Collection).
selectedElements - a collection of Element instances to change the character attributes within.add - the attributes to add.remove - the attributes to remove.
BadLocationExceptionsetElementAttributes(Element, AttributeSet, Collection)
public void setListType(int startOffset,
int endOffset,
int depthFromContent,
HTML.Tag targetListTag,
String targetListType,
String targetListStart)
throws BadLocationException
startOffset - the start of the range to modify.endOffset - the end of the range to modify.depthFromContent - how many elements down from the content is the list tag to modify.
This allows nested lists to be handled correctly.targetListTag - the list tag to change to. Either HTML.Tag#OL or HTML.Tag#UL.targetListType - the list type to change to.targetListStart - the list number to start at.
BadLocationException - if the offsets are invalid.
public void changeListItemIndent(int startOffset,
int endOffset,
int depthFromContent,
int indentAmount,
HTML.Tag targetListTag)
throws BadLocationException
startOffset - the start of the range to modify.endOffset - the end of the range to modify.depthFromContent - how many elements down from the content is the list tag to modify.
This allows nested lists to be handled correctly.indentAmount - how much to increase the indent level by. Negative numbers reduce the indent level.targetListTag - the list tag to apply to the modified list items. Either HTML.Tag#OL or HTML.Tag.#UL.
BadLocationException - of the specified offsets are invalid.public void pauseTracking()
public void resumeTracking()
public OperationManager getOperationManager()
public void setOverrideContentEditable(boolean override)
override - whether or not content editable attributes should be ignored.
|
Copyright (c) 2005-2007 Ephox Pty Ltd. All rights reserved. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||