|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugin
org.xwiki.gwt.wysiwyg.client.plugin.line.LinePlugin
public class LinePlugin
Overwrites the behavior of creating new lines of text and merging existing ones.
| Field Summary | |
|---|---|
static java.lang.String |
BR
The name of the <br/> tag. |
static java.lang.String |
CLASS_NAME
The class name attribute. |
protected DOMUtils |
domUtils
Collection of DOM utility methods. |
static java.lang.String |
LI
The name of the <li> tag. |
static java.lang.String |
LINE_BREAK
The CSS class name associated with BRs that are present in the rich text area's HTML input and which have to be kept even when they are placed at the end of a block-level element. |
static Command |
RESET
The command that notifies us when the content of the rich text area has been reset. |
static java.lang.String |
SPACER
The CSS class name associated with BRs added at edit time to make items like empty block-level elements editable. |
static Command |
SUBMIT
The command that stores the value of the rich text area in an HTML form field. |
static java.lang.String |
TD
The name of the <td> tag. |
static java.lang.String |
TH
The name of the <th> tag. |
| Constructor Summary | |
|---|---|
LinePlugin()
|
|
| Method Summary | |
|---|---|
protected void |
adjustLineBreak(com.google.gwt.dom.client.Node container,
com.google.gwt.dom.client.Node br)
Adjusts the line break position so that: Anchors don't start or end with a line break. |
protected void |
copyLineStyle(Element sourceLine,
Element destinationLine)
Copy some of the CSS styles from the source line to the destination line. |
void |
destroy()
Notifies the plug-in to release its resources before being unloaded from the WYSIWYG editor. |
protected void |
handleRepeatableKey(Event event)
Handles a repeatable key press. |
void |
init(RichTextArea textArea,
Config config)
Initialize the plug-in. |
protected void |
insertEmptyLine(com.google.gwt.dom.client.Node container,
Range caret)
Inserts an empty line before the block containing the caret. |
protected void |
insertLineBreak(com.google.gwt.dom.client.Node container,
Range caret)
Inserts a line break at the specified position in the document. |
protected boolean |
isAfterLineBreak(com.google.gwt.dom.client.Node container,
Range caret)
|
protected boolean |
isAtStart(com.google.gwt.dom.client.Node container,
Range caret)
|
protected boolean |
isEmptyLine(com.google.gwt.dom.client.Node node)
|
protected boolean |
isLineBreak(com.google.gwt.dom.client.Node node)
|
protected void |
markInitialLineBreaks()
Marks the initial line breaks so they are not mistaken as SPACER. |
protected void |
markSpacers()
Marks the BRs that have been added as spacers during the editing. |
protected boolean |
needsSpace(com.google.gwt.dom.client.Node leaf)
|
protected void |
onBackspace(Event event)
Overwrites the default rich text area behavior when the Backspace key is being pressed. |
boolean |
onBeforeCommand(CommandManager sender,
Command command,
java.lang.String param)
|
void |
onCommand(CommandManager sender,
Command command,
java.lang.String param)
|
protected void |
onEnter(Event event)
Overwrites the default rich text area behavior when the Enter key is being pressed. |
protected void |
onEnterParagraph(com.google.gwt.dom.client.Node container,
Range caret,
Event event)
Behaves as if the caret is inside a paragraph. |
void |
onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event)
|
void |
onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event)
|
void |
onKeyUp(com.google.gwt.event.dom.client.KeyUpEvent event)
|
protected void |
onReset()
Called after the content of the rich text area has been reset. |
protected void |
replaceEmptyLinesWithParagraphs()
Replaces <div class="wikimodel-emptyline"/> with <p/>. |
protected void |
splitLine(com.google.gwt.dom.client.Node container,
Range caret)
Splits a line after a line break. |
protected void |
unMarkSpacers()
|
| Methods inherited from class org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugin |
|---|
getConfig, getTextArea, getUIExtensionList, getUIExtensions, saveRegistration, saveRegistrations |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Command SUBMIT
public static final Command RESET
public static final java.lang.String SPACER
public static final java.lang.String LINE_BREAK
SPACER BRs we add during the editing.
public static final java.lang.String CLASS_NAME
public static final java.lang.String BR
<br/> tag.
public static final java.lang.String LI
<li> tag.
public static final java.lang.String TD
<td> tag.
public static final java.lang.String TH
<th> tag.
protected final DOMUtils domUtils
| Constructor Detail |
|---|
public LinePlugin()
| Method Detail |
|---|
public void init(RichTextArea textArea,
Config config)
init in interface Plugininit in class org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugintextArea - the text area of the editorconfig - the configuration objectAbstractPlugin.init(RichTextArea, Config)public void destroy()
destroy in interface Plugindestroy in class org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPluginAbstractPlugin.destroy()public void onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event)
onKeyDown in interface com.google.gwt.event.dom.client.KeyDownHandlerKeyDownHandler.onKeyDown(KeyDownEvent)public void onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event)
onKeyPress in interface com.google.gwt.event.dom.client.KeyPressHandlerKeyPressHandler.onKeyPress(KeyPressEvent)public void onKeyUp(com.google.gwt.event.dom.client.KeyUpEvent event)
onKeyUp in interface com.google.gwt.event.dom.client.KeyUpHandlerKeyUpHandler.onKeyUp(KeyUpEvent)protected void handleRepeatableKey(Event event)
event - the native event that was fired
public boolean onBeforeCommand(CommandManager sender,
Command command,
java.lang.String param)
onBeforeCommand in interface CommandListenerCommandListener.onBeforeCommand(CommandManager, Command, String)
public void onCommand(CommandManager sender,
Command command,
java.lang.String param)
onCommand in interface CommandListenerCommandListener.onCommand(CommandManager, Command, String)protected void markSpacers()
protected void unMarkSpacers()
markSpacers()protected boolean needsSpace(com.google.gwt.dom.client.Node leaf)
leaf - a DOM node which has not children
true if the given leaf needs space on the screen in order to be rendered, false otherwiseprotected void markInitialLineBreaks()
SPACER.
protected void replaceEmptyLinesWithParagraphs()
<div class="wikimodel-emptyline"/> with <p/>. Empty lines are used by WikiModel to
separate block level elements, but since the user should be able to write on these empty lines we convert them to
paragraphs.
protected void onEnter(Event event)
event - the native event that was fired
protected void onEnterParagraph(com.google.gwt.dom.client.Node container,
Range caret,
Event event)
container - a block-level element containing the caretcaret - the position of the caret inside the documentevent - the native event that was fired
protected boolean isAtStart(com.google.gwt.dom.client.Node container,
Range caret)
container - a block level element containing the caretcaret - the position of the caret inside the document
true if the caret is at the beginning of its block level container, false otherwise
protected boolean isAfterLineBreak(com.google.gwt.dom.client.Node container,
Range caret)
container - a block level element containing the caretcaret - the position of the caret in the document
true if the caret is immediately after a line break inside the given container, false
otherwiseprotected boolean isLineBreak(com.google.gwt.dom.client.Node node)
node - a DOM node
true if the given node marks a line break, false otherwise
protected void adjustLineBreak(com.google.gwt.dom.client.Node container,
com.google.gwt.dom.client.Node br)
container - the block-level element containing the line breakbr - the line breakWhen hitting Return at the end of the link the new line should not be a link
protected void insertLineBreak(com.google.gwt.dom.client.Node container,
Range caret)
container - a block-level element containing the caretcaret - the place where to insert the line break
protected void splitLine(com.google.gwt.dom.client.Node container,
Range caret)
container - a block-level element containing the caretcaret - the position of the caret in the document
protected void insertEmptyLine(com.google.gwt.dom.client.Node container,
Range caret)
container - a block-level element containing the caretcaret - the place where to insert the empty lineprotected void onBackspace(Event event)
event - the native event that was firedprotected boolean isEmptyLine(com.google.gwt.dom.client.Node node)
node - a DOM node
true if the given node represents an empty lineprotected void onReset()
protected void copyLineStyle(Element sourceLine,
Element destinationLine)
sourceLine - the line from where to copy the stylesdestinationLine - the line whose style will be changedsplitLine(Node, Range)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||