OracleJavaScript API Reference for Oracle ADF Faces

 

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

oracle.adfinternal.view.js.laf.dhtml.rich
Class AdfDhtmlRichTextEditorPeer

Warning:

org.ecmascript.object.Object
   |
   +--oracle.adf.view.js.base.AdfObject
         |
         +--oracle.adf.view.js.base.AdfUIPeer
               |
               +--oracle.adf.view.js.laf.rich.AdfRichUIPeer
                     |
                     +--oracle.adfinternal.view.js.laf.dhtml.rich.AdfDhtmlValuePeer
                           |
                           +--oracle.adfinternal.view.js.laf.dhtml.rich.AdfDhtmlEditableValuePeer
                                 |
                                 +--oracle.adfinternal.view.js.laf.dhtml.rich.AdfDhtmlRichTextEditorPeer

public class AdfDhtmlRichTextEditorPeer
extends AdfDhtmlEditableValuePeer
Peer for the richTextEditor component.



Field Summary

private Object
_ignoreEvents
protected static Object
InitConstants


Fields inherited from oracle.adfinternal.view.js.laf.dhtml.rich.AdfDhtmlEditableValuePeer

ComponentLabelChanged


Fields inherited from oracle.adf.view.js.laf.rich.AdfRichUIPeer

addComponentPropertyChanges, addComponentPropertyGetters, BUSY_STYLECLASS, DISABLED_STYLECLASS, DRAG_READY_STYLECLASS, DRAG_SOURCE_STYLECLASS, DROP_TARGET_STYLECLASS, FOCUS_TARGET_STYLECLASS, HOVER_TARGET_STYLECLASS, READONLY_STYLECLASS


Fields inherited from oracle.adf.view.js.base.AdfObject

constructor, superclass


Fields inherited from org.ecmascript.object.Object

prototype


Constructor Summary

public
AdfDhtmlRichTextEditorPeer()
Peer for the richTextEditor component.


Method Summary

public Object
addBinding(String componentClientId, Object componentClient, String command, String commandParameter, String propertyName, String eventType)
Adds the binding for command.
private Object
_addCommandBinding(Object componentId, Object bindComponent, String command, String commandParameter)
Binds the the command to the component.
private Object
_addContextChangeListeners(HTMLDocument field)
Adds the listeners for context changes.
private Object
_addStyleBinding(String componentId, String propertyName, String styleKey, String eventType)
Binds the value of the style to the property of the component.
private Object
_cmdCreateLink()
Wrapper for the "createlink" command, useful for creating callbacks.
private Object
_commandBindingActionListener(AdfActionEvent event)
Handles the events fired by the components that are bound to this component, and translates these into commands.
protected Object
ComponentRemoved(AdfUIComponent component)
Handles the removal of a component.
private Object
_createIframe(Object component)
Creates an IFRAME by replacing a placeholder DIV with an IFRAME
private Object
_execCommand(String key, Object value)
Executes a command on the document, selection, or the given range.
public Object
executeCommand(Object cmd, Object value)
protected Object
Focus()
Programmatically focuses the document.
protected Object
GetComponentLabel(Object component, Object domElement)
The richTextEditor has label tags in it for the form controls in the toolbar, which we want to ignore when looking for the component label.
private HTMLElement
_getContentField(Object component)
Gets the contentField (the iframe).
private Boolean
_getIndeterminateStyling(String styleKey)
Queries whether the value for styleKey is currently indeterminate.
protected Object
GetInlineEditor(Event event)
Override to return an inline editor that edits the component's label property
private Object
_getOneThroughSevenFontSize(Object value)
public Object
getSelectionRange(Object component)
private Object
_getSelectionStyling(String styleKey)
Gets the value of the styleKey for the current context.
private Object
_getSourceCodeField(Object component)
protected Object
GetSubmittedValue(AdfUIComponent component, HTMLElement domElement)
Returns the submittedValue by getting the value of the input dom node.
private Object
_handleBlur(Object evt)
protected Object
HandleComponentAction(Object componentEvent)
Handles ActionEvents by children of this component.
protected Object
HandleComponentClick(Object componentEvent)
Handles a click on the component.
protected Object
HandleComponentFocus(Object componentEvent)
private Object
_handleContextChanged()
Handles the changing of context.
private Object
_handleContextChangedForCommands()
private Object
_handleContextChangedForStyles()
private Object
_handleFocus(Object evt)
This handles the first time we focused the component.
private Object
_handleKeyDown(Object evt)
private Object
_handleLoad(Object nativeEvent)
Called when the IFRAME has finished loading.
private Object
_handleMouseDown(Object evt)
protected static Object
HandleTimerUpdate(Object clientId)
Method use for handling the timer.
private Object
_ignoreNextEvent(String styleKey)
Ignores the next event for the styleKey.
protected Object
Init(Object component)
Initializes the instance.
protected static Object
InitConstants()
protected Object
InitDomElement(AdfUIComponent component, HTMLElement domElement)
Initialize the associated domElement when the peer is created.
protected static Object
InitSubclass()
public Object
isEmpty(Object value)
Check whether the input text is empty Return whether the input text is empty so the client side can do the validation for required field.
private Boolean
_isIgnoreNextEvent(String styleKey)
Checks if we need to ignore the next event.
private Object
_makeEditable(AdfUIComponent component)
Makes a component editable, i.e.
private Object
_queryCommandValue(Object key)
private Object
_removeCommandBindings(AdfUIComponent component)
Removes all the bindings of components to a command.
private Object
_removeContextChangeListeners(AdfUIComponent component)
Removes the listeners for context changes.
private Object
_removeSelection()
Removes the saved selection.
private Object
_removeStyleBindings(AdfUIComponent component)
Removes all the bindings of components to a style-command.
private Object
_restoreSelection()
Restores the previous selection, if necessary.
private Object
_saveSelection()
Saves of the current selection, if necessary.
protected Object
ScrollIntoView(Object component, Object focus, String subTargetId)
Overrriden to provide RTE specific implementation.
public Object
setCodeEditingMode(Boolean newCodeEditingMode)
Specifies the new source code editing mode.
protected Object
SetDisplayValue(AdfUIComponent component, HTMLElement domElement, String newValue)
Set the display string.
private Object
_setInlineFrameContent(HTMLElement inlineFrame, String content)
Sets content as the content of the inline frame.
private Object
_setInlineFrameStyle(Object inlineFrameDocument)
protected Object
ShowFormatHint()
Show converter hints in note window for this component.
private Object
_stopDialogsFromBeingInactivatedDueToIframes()
Since the richTextEditor uses an iframe, it is possible that dialogs containing this component will become inactivated when focus is moved into the iframe.
private Object
_styleBindingActionListener(AdfActionEvent event)
Handles the events fired by the components that are bound to this component.
private Boolean
_toggleSelectionStyling(String styleKey)
Toggles the styling with styleKey on the current selection.
private static Number
_toolboxVisitChildrenCallback(AdfUIComponent component)
Callback for the visitor of children components of the toolbox when switching editing modes.
private Object
_updateValue()
Updates the value of the component in the hidden form element.


Methods inherited from oracle.adfinternal.view.js.laf.dhtml.rich.AdfDhtmlEditableValuePeer

autoSubmit, BindToComponent, ComponentChanged, __componentLabelChanged, ComponentSubmittedValueChanged, disableBrowserAutoComplete, GetComponentSubmittedValue, GetComponentValue, GetContentNode, GetContentNodeId, GetDisplayValue, GetNoteWindowAlignmentHint, GetNoteWindowAlignmentNode, GetValidatorHints, HandleComponentKeyUp, HideNoteWindow, IsInitialized, IsNoteWindowVisible, LazyInitialize, MessageNotify, MessageShow, ShouldShowHint, ShowNoteWindow, ShowNoteWindowMouseOver, StashOldValue, Validate, ValidateAndStashNewValue, ValidateIfStashedOldValue, VetoShowNoteWindow, WasSubmitted


Methods inherited from oracle.adfinternal.view.js.laf.dhtml.rich.AdfDhtmlValuePeer

ComponentValueChanged, getConvertedObject, getConvertedValue, getFormatHint, GetNullDefault


Methods inherited from oracle.adf.view.js.laf.rich.AdfRichUIPeer

addComponentEventHandlers, addComponentPropertyChanges, addComponentPropertyGetters, addDomEventHandlers, addEventHandlerToDomInstance, addSuppressedPPRAttributes, applyDragReadyState, ApplyDragReadyState, applyDragSourceState, ApplyDragSourceState, bind, cancelAllPopups, cancelPopup, ChildVisibilityChanged, clearDragReadyState, ClearDragReadyState, clearDragSourceState, ClearDragSourceState, ComponentInlineStyleChanged, ComponentPropertyChanged, componentRemoved, ComponentStyleClassChanged, ComponentVisibleChanged, ConvertClientIdToLocator, convertLocatorToClientId, CreateDraggableNode, createPeerClass, createSubId, CreateSubId, DefaultInitClass, descendantMessageChanged, DescendantMessageChanged, DispatchComponentEvent, domReplaceNotify, DomReplaceNotify, focus, getAbsoluteId, getAbsoluteLocator, getAccessibleName, GetAccessibleName, getAllPopups, getComponent, GetComponent, GetComponentId, getComponentParent, getComponentProperty, GetComponentVisible, getDescendantComponents, getDomContentElement, getDomContentElementForComponent, GetDomContentElementForNode, getDomDocument, getDomElement, getDomElementForComponent, getDomNode, GetDomNodeForCommentComponent, getDomNodeForComponent, getDragOverFeedback, GetDragOverFeedback, getDragTransferable, GetDragTransferable, getFirstAncestorComponent, getInlineEditor, getInlineStyleProperty, getLocatorByDomElement, getPagePosition, getPopupWindow, getReadyState, GetReadyState, GetRichResourceURL, getSubIdDomElement, GetSubIdDomElement, hideAllPopups, hidePopup, InitClass, initialize, isActive, isInActiveHeirarchy, isPopupVisible, messageNotify, messageShow, needsChildVisibilityChanges, needsFocusTargetStyleClass, PopupClosed, processPushData, ProcessPushData, registerKeyStroke, replaceDomElement, ReplaceDomElement, resizeNotify, ResizeNotify, scrollIntoView, setBusy, SetBusy, setInlineStyleProperty, showContextMenu, showPopup, TruncateClientId, TruncateClientIdOnceImpl, UnbindFromComponent, unregisterKeyStroke, visitChildren


Methods inherited from oracle.adf.view.js.base.AdfUIPeer

getDefaultDragRecognizer, getParentPeer, initiateDrag, isVisible, needsResizeNotify


Methods inherited from oracle.adf.view.js.base.AdfObject

adopt, clone, createCallback, createInitializedObject, createSubclass, ensureClassInitialization, equals, getClass, GetLazyArrayProperty, GetLazyMapProperty, getTypeName, toDebugString, toString


Field Detail


_ignoreEvents

private Object _ignoreEvents

InitConstants

protected static Object InitConstants

Constructor Detail


AdfDhtmlRichTextEditorPeer

public AdfDhtmlRichTextEditorPeer()

Peer for the richTextEditor component.

Method Detail


addBinding

public Object addBinding(String componentClientId,
                         Object componentClient,
                         String command,
                         String commandParameter,
                         String propertyName,
                         String eventType)

Adds the binding for command.

Parameters:
componentClientId  -  The component to bind to the richTextEditor
componentClient    
command  -  The command to use for the binding.
commandParameter  -  Null or the optional parameter for the command.
Default value = null
propertyName  -  The propertyName to bind to (only needed for STYLE_ commands).
Default value = null
eventType  -  The type of event to bind to. This only works for STYLE_ commands.
Return:
Object
See also:
_addStyleBinding(String, String, String, String)
_addCommandBinding(Object, Object, String, String)

_addCommandBinding

private Object _addCommandBinding(Object componentId,
                                  Object bindComponent,
                                  String command,
                                  String commandParameter)

Binds the the command to the component. If the command is not applicable on the current selection, the component will be disabled. This also adds a clientListener to thecomponent that applies the command to the current selection.

Parameters:
componentId    
bindComponent    
command  -  The command to bind to.
commandParameter  -  Null or the optional parameter for the command.
Default value = null
Return:
Object

_addContextChangeListeners

private Object _addContextChangeListeners(HTMLDocument field)

Adds the listeners for context changes.

Parameters:
field  -  The document
Return:
Object

_addStyleBinding

private Object _addStyleBinding(String componentId,
                                String propertyName,
                                String styleKey,
                                String eventType)

Binds the value of the style to the property of the component. If the property specified by styleKey gets updated, the component-property will change too. This also adds a clientListener to the component that applies the command to the current selection.

Parameters:
componentId  -  The id of the component
propertyName  -  The name of the property to bind to.
styleKey  -  The styleKey to bind to.
eventType  -  The type of the event that we listen to.
Return:
Object

_cmdCreateLink

private Object _cmdCreateLink()

Wrapper for the "createlink" command, useful for creating callbacks.

Return:
Object

_commandBindingActionListener

private Object _commandBindingActionListener(AdfActionEvent event)

Handles the events fired by the components that are bound to this component, and translates these into commands.

Parameters:
event  -  The ActionEvent.
Return:
Object

ComponentRemoved

protected Object ComponentRemoved(AdfUIComponent component)

Handles the removal of a component.

Parameters:
component  -  The component
Return:
Object
Overrides:
AdfUIPeer.componentRemoved(AdfUIComponent)

_createIframe

private Object _createIframe(Object component)

Creates an IFRAME by replacing a placeholder DIV with an IFRAME

Parameters:
component    
Return:
Object

_execCommand

private Object _execCommand(String key,
                            Object value)

Executes a command on the document, selection, or the given range.

Parameters:
key  -  The command to execute
value  -  The value of the command
Return:
Object

executeCommand

public Object executeCommand(Object cmd,
                             Object value)

Parameters:
cmd    
value    
Return:
Object

Focus

protected Object Focus()

Programmatically focuses the document. This will only work if the component had a focus before.

Return:
Object
Overrides:
AdfUIPeer.focus(Object)

GetComponentLabel

protected Object GetComponentLabel(Object component,
                                   Object domElement)

The richTextEditor has label tags in it for the form controls in the toolbar, which we want to ignore when looking for the component label. Therefore we only want to look for ones that use the subid "content" or "src".

Parameters:
component    
domElement    
Return:
Object
Overrides:
AdfDhtmlEditableValuePeer.GetComponentLabel(Object, Object)

_getContentField

private HTMLElement _getContentField(Object component)

Gets the contentField (the iframe).

Parameters:
component    
Return:
HTMLElement - the contentField

_getIndeterminateStyling

private Boolean _getIndeterminateStyling(String styleKey)

Queries whether the value for styleKey is currently indeterminate.

Parameters:
styleKey  -  The styleKey to use, e.g. AdfDhtmlRichTextEditorPeer.STYLE_BOLD.
Return:
Boolean - null true if the command is indeterminate.

GetInlineEditor

protected Object GetInlineEditor(Event event)

Override to return an inline editor that edits the component's label property

Parameters:
event  -  DOM Event that triggered the inline edit
Return:
Object
Overrides:
AdfRichUIPeer.getInlineEditor(AdfUIComponent, Object)

_getOneThroughSevenFontSize

private Object _getOneThroughSevenFontSize(Object value)

Parameters:
value    
Return:
Object

getSelectionRange

public Object getSelectionRange(Object component)

Parameters:
component    
Return:
Object

_getSelectionStyling

private Object _getSelectionStyling(String styleKey)

Gets the value of the styleKey for the current context.

Parameters:
styleKey  -  The styleKey to use, e.g. AdfDhtmlRichTextEditorPeer.STYLE_BOLD.
Return:
Object - The value of the selection for this styleKey.

_getSourceCodeField

private Object _getSourceCodeField(Object component)

Parameters:
component    
Return:
Object

GetSubmittedValue

protected Object GetSubmittedValue(AdfUIComponent component,
                                   HTMLElement domElement)

Returns the submittedValue by getting the value of the input dom node.

Parameters:
component  -  Component that this peer will be associated with
domElement  -  Root DOM element of this peer
Return:
Object - submittedValue
Overrides:
AdfDhtmlEditableValuePeer.GetSubmittedValue(Object, Object)

_handleBlur

private Object _handleBlur(Object evt)

Parameters:
evt    
Return:
Object

HandleComponentAction

protected Object HandleComponentAction(Object componentEvent)

Handles ActionEvents by children of this component.

Parameters:
componentEvent    
Return:
Object

HandleComponentClick

protected Object HandleComponentClick(Object componentEvent)

Handles a click on the component.

Parameters:
componentEvent    
Return:
Object
Overrides:
AdfDhtmlEditableValuePeer.HandleComponentClick(Object)

HandleComponentFocus

protected Object HandleComponentFocus(Object componentEvent)

Parameters:
componentEvent    
Return:
Object
Overrides:
AdfDhtmlEditableValuePeer.HandleComponentFocus(Object)

_handleContextChanged

private Object _handleContextChanged()

Handles the changing of context. All listeners will be updated.

Return:
Object

_handleContextChangedForCommands

private Object _handleContextChangedForCommands()

Return:
Object

_handleContextChangedForStyles

private Object _handleContextChangedForStyles()

Return:
Object

_handleFocus

private Object _handleFocus(Object evt)

This handles the first time we focused the component.

Parameters:
evt    
Return:
Object

_handleKeyDown

private Object _handleKeyDown(Object evt)

Parameters:
evt    
Return:
Object

_handleLoad

private Object _handleLoad(Object nativeEvent)

Called when the IFRAME has finished loading.

Parameters:
nativeEvent    
Return:
Object

_handleMouseDown

private Object _handleMouseDown(Object evt)

Parameters:
evt    
Return:
Object

HandleTimerUpdate

protected static Object HandleTimerUpdate(Object clientId)

Method use for handling the timer. This is used in order to do special handling of the "undo" button in ie.

Parameters:
clientId    
Return:
Object

_ignoreNextEvent

private Object _ignoreNextEvent(String styleKey)

Ignores the next event for the styleKey.

Parameters:
styleKey  -  the styleKey
Return:
Object

Init

protected Object Init(Object component)

Initializes the instance. Subclasses of AdfObject must call their superclass' Init

Parameters:
component    
Return:
Object
Overrides:
AdfObject.Init()

InitConstants

protected static Object InitConstants()

Return:
Object

InitDomElement

protected Object InitDomElement(AdfUIComponent component,
                                HTMLElement domElement)

Initialize the associated domElement when the peer is created. Stateless peers are not bound at the time that this method is called.

Parameters:
component  -  Component that this peer will be associated with
domElement  -  Root DOM element of this peer
Return:
Object
Overrides:
AdfRichUIPeer.InitDomElement(AdfUIComponent, Object)

InitSubclass

protected static Object InitSubclass()

Return:
Object
Overrides:
AdfDhtmlValuePeer.InitSubclass()

isEmpty

public Object isEmpty(Object value)

Check whether the input text is empty Return whether the input text is empty so the client side can do the validation for required field.

Parameters:
value    
Return:
Object
Overrides:
AdfDhtmlValuePeer.isEmpty(Object)

_isIgnoreNextEvent

private Boolean _isIgnoreNextEvent(String styleKey)

Checks if we need to ignore the next event. Lowers the count of events to ignore by 1 if the result is true.

Parameters:
styleKey  -  the styleKey
Return:
Boolean - null true if we should ignore the next event.

_makeEditable

private Object _makeEditable(AdfUIComponent component)

Makes a component editable, i.e. turn on the iframe and replace the contents of the iframe.

Parameters:
component  -  The component
Return:
Object

_queryCommandValue

private Object _queryCommandValue(Object key)

Parameters:
key    
Return:
Object

_removeCommandBindings

private Object _removeCommandBindings(AdfUIComponent component)

Removes all the bindings of components to a command.

Parameters:
component  -  The component
Return:
Object
See also:
_addCommandBinding(Object, Object, String, String)

_removeContextChangeListeners

private Object _removeContextChangeListeners(AdfUIComponent component)

Removes the listeners for context changes.

Parameters:
component  -  The component
Return:
Object
See also:
_addContextChangeListeners(HTMLDocument)

_removeSelection

private Object _removeSelection()

Removes the saved selection.

Return:
Object

_removeStyleBindings

private Object _removeStyleBindings(AdfUIComponent component)

Removes all the bindings of components to a style-command.

Parameters:
component  -  The component
Return:
Object
See also:
_addStyleBinding(String, String, String, String)

_restoreSelection

private Object _restoreSelection()

Restores the previous selection, if necessary.

Return:
Object

_saveSelection

private Object _saveSelection()

Saves of the current selection, if necessary.

Return:
Object

ScrollIntoView

protected Object ScrollIntoView(Object component,
                                Object focus,
                                String subTargetId)

Overrriden to provide RTE specific implementation.

Parameters:
component    
focus    
subTargetId  -  optional component dependent DOM sub-id that needs to be scrolled/focused into view
Default value = null
Return:
Object
Overrides:
AdfRichUIPeer.scrollIntoView(Object, Object, String)

setCodeEditingMode

public Object setCodeEditingMode(Boolean newCodeEditingMode)

Specifies the new source code editing mode.

Parameters:
newCodeEditingMode  -  true for code mode, and false for rich text
Return:
Object

SetDisplayValue

protected Object SetDisplayValue(AdfUIComponent component,
                                 HTMLElement domElement,
                                 String newValue)

Set the display string.

Parameters:
component  -  The component
domElement  -  The domElement
newValue  -  The new value
Return:
Object
Overrides:
AdfDhtmlValuePeer.SetDisplayValue(Object, Object, Object)

_setInlineFrameContent

private Object _setInlineFrameContent(HTMLElement inlineFrame,
                                      String content)

Sets content as the content of the inline frame.

Parameters:
inlineFrame  -  The inline frame
content  -  The content
Return:
Object

_setInlineFrameStyle

private Object _setInlineFrameStyle(Object inlineFrameDocument)

Parameters:
inlineFrameDocument    
Return:
Object

ShowFormatHint

protected Object ShowFormatHint()

Show converter hints in note window for this component.

Return:
Object

_stopDialogsFromBeingInactivatedDueToIframes

private Object _stopDialogsFromBeingInactivatedDueToIframes()

Since the richTextEditor uses an iframe, it is possible that dialogs containing this component will become inactivated when focus is moved into the iframe. In Firefox 2, we can prevent the inactivation of the dialog by cancelling the blur timeout. In Firefox 3, there is a new activeElement on the document that can be used to avoid this issue. If the dialog is already dismissed and the user clicks inside of the dialog, we really want to make it active. The only way to do that is to abstain from cancelling the timeout since the auto-dismissal manager will then be able to look at the active element and make changes as necessary.

Return:
Object

_styleBindingActionListener

private Object _styleBindingActionListener(AdfActionEvent event)

Handles the events fired by the components that are bound to this component.

Parameters:
event  -  The ActionEvent.
Return:
Object

_toggleSelectionStyling

private Boolean _toggleSelectionStyling(String styleKey)

Toggles the styling with styleKey on the current selection.

Parameters:
styleKey  -  The styleKey
Return:
Boolean - The new value for styleKey

_toolboxVisitChildrenCallback

private static Number _toolboxVisitChildrenCallback(AdfUIComponent component)

Callback for the visitor of children components of the toolbox when switching editing modes. If it returns the number zero (or false), iteration will continue. If it returns the number one (or true), iteration will not continue into the children. If it returns the number two, iteration will entirely halt. Iteration proceeds depth first, but calling the parents before the children.

Parameters:
component  -  the visited component
Return:
Number - 0 if iteration continues, 1 if iteration continues though not into children, 2 if iteration is to entirely halt

_updateValue

private Object _updateValue()

Updates the value of the component in the hidden form element.

Return:
Object

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

 

Generated on 2012.08.25 02:16 UTC
Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.