|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.gwt.user.client.KeyboardAdaptor
org.xwiki.gwt.wysiwyg.client.plugin.readonly.ReadOnlyKeyboardHandler
org.xwiki.gwt.wysiwyg.client.plugin.readonly.SafariReadOnlyKeyboardHandler
public class SafariReadOnlyKeyboardHandler
Custom implementation of ReadOnlyKeyboardHandler for WebKit-based browsers.
| Constructor Summary | |
|---|---|
SafariReadOnlyKeyboardHandler()
|
|
| Method Summary | |
|---|---|
protected void |
moveCaretOutside(com.google.gwt.dom.client.Node node,
boolean before)
Places the caret outside of the specified node, either before or after. |
protected void |
onDelete(Event event,
Element element)
Deletes a read-only element when it is the only target of the given event. |
protected void |
onDelete(Event event,
Element element,
Range range,
boolean start)
Deletes a read-only element when it is not the only target of the given event. |
| Methods inherited from class org.xwiki.gwt.wysiwyg.client.plugin.readonly.ReadOnlyKeyboardHandler |
|---|
handleRepeatableKey |
| Methods inherited from class org.xwiki.gwt.user.client.KeyboardAdaptor |
|---|
handleKeyRelease, onKeyDown, onKeyPress, onKeyUp |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SafariReadOnlyKeyboardHandler()
| Method Detail |
|---|
protected void onDelete(Event event,
Element element)
WebKit browsers don't restore the selection after an element that contained or was touched by the selection is removed. Instead of manually removing the read-only element we select it and let the browser remove it.
onDelete in class ReadOnlyKeyboardHandlerevent - the native event that was firedelement - the read-only element to be deletedReadOnlyKeyboardHandler.onDelete(Event, Element)
protected void onDelete(Event event,
Element element,
Range range,
boolean start)
WebKit browsers don't restore the selection after an element that contained or was touched by the selection is removed. Instead of manually removing the read-only element we extend the given range to include the element and let the browser remove it.
onDelete in class ReadOnlyKeyboardHandlerevent - the native event that was firedelement - the read-only element to be deletedrange - the range that touches the read-only elementstart - true if the start point of the given range is inside the read-only element, false if
the end point is inside the read-only elementReadOnlyKeyboardHandler.onDelete(Event, Element, Range, boolean)
protected void moveCaretOutside(com.google.gwt.dom.client.Node node,
boolean before)
WebKit browsers don't keep the caret where we put it (before/after the macro container) so we have to add a text node and select it to be sure the caret remains outside of the macro.
moveCaretOutside in class ReadOnlyKeyboardHandlernode - a DOM nodebefore - true to place the caret before the given node, false to place it after
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||