org.xwiki.gwt.wysiwyg.client.plugin.line
Class MozillaLinePlugin

java.lang.Object
  extended by org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugin
      extended by org.xwiki.gwt.wysiwyg.client.plugin.line.LinePlugin
          extended by org.xwiki.gwt.wysiwyg.client.plugin.line.MozillaLinePlugin
All Implemented Interfaces:
com.google.gwt.event.dom.client.KeyDownHandler, com.google.gwt.event.dom.client.KeyPressHandler, com.google.gwt.event.dom.client.KeyUpHandler, com.google.gwt.event.shared.EventHandler, CommandListener, Plugin

public class MozillaLinePlugin
extends LinePlugin

Mozilla specific implementation of the LinePlugin.

Version:
$Id: MozillaLinePlugin.java 28924 2010-05-17 09:12:19Z mflorea $

Field Summary
 
Fields inherited from class org.xwiki.gwt.wysiwyg.client.plugin.line.LinePlugin
BR, CLASS_NAME, domUtils, LI, LINE_BREAK, RESET, SPACER, SUBMIT, TD, TH
 
Constructor Summary
MozillaLinePlugin()
           
 
Method Summary
protected  void insertLineBreak(com.google.gwt.dom.client.Node container, Range caret)
          Inserts a line break at the specified position in the document.
We overwrite in order to fix a Mozilla bug which causes the caret to be rendered on the same line after you press Enter, if the new line doesn't have any visible contents.
protected  void splitLine(com.google.gwt.dom.client.Node container, Range caret)
          Splits a line after a line break.
 
Methods inherited from class org.xwiki.gwt.wysiwyg.client.plugin.line.LinePlugin
adjustLineBreak, copyLineStyle, destroy, handleRepeatableKey, init, insertEmptyLine, isAfterLineBreak, isAtStart, isEmptyLine, isLineBreak, markInitialLineBreaks, markSpacers, needsSpace, onBackspace, onBeforeCommand, onCommand, onEnter, onEnterParagraph, onKeyDown, onKeyPress, onKeyUp, onReset, replaceEmptyLinesWithParagraphs, 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
 

Constructor Detail

MozillaLinePlugin

public MozillaLinePlugin()
Method Detail

insertLineBreak

protected void insertLineBreak(com.google.gwt.dom.client.Node container,
                               Range caret)
Inserts a line break at the specified position in the document.
We overwrite in order to fix a Mozilla bug which causes the caret to be rendered on the same line after you press Enter, if the new line doesn't have any visible contents. Once you start typing the caret moves below, but it looks strange before you type. We fixed the bug by adding a BR at the end of the new line.

Overrides:
insertLineBreak in class LinePlugin
Parameters:
container - a block-level element containing the caret
caret - the place where to insert the line break
See Also:
LinePlugin.insertLineBreak(Node, Range)

splitLine

protected void splitLine(com.google.gwt.dom.client.Node container,
                         Range caret)
Splits a line after a line break.

We overwrite in order to fix a Firefox 3.6 bug which causes the caret to be rendered at the start of the document when we split a line at its end. It seems Firefox 3.6 doesn't like the fact that the caret ends up inside an empty text node when the line is split at the end. This wan't the case with older versions of Firefox.

Overrides:
splitLine in class LinePlugin
Parameters:
container - a block-level element containing the caret
caret - the position of the caret in the document
See Also:
LinePlugin.splitLine(Node, Range)


Copyright © 2004-2011 XWiki. All Rights Reserved.