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
private static Object
_SUB_ID_MAP
richTextEditor component publishes the following sub ids [External Subid --> Internal Client SubId]:- 1.


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_SOURCE_STYLECLASS, DROP_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
focus(AdfUIComponent component)
Programmatically focuses the document.
private HTMLElement
_getContentField(Object component)
Gets the contentField (the iframe).
private Boolean
_getIndeterminateStyling(String styleKey)
Queries whether the value for styleKey is currently indeterminate.
private Object
_getOneThroughSevenFontSize(Object value)
private Object
_getSelectionStyling(String styleKey)
Gets the value of the styleKey for the current context.
private Object
_getSourceCodeField(Object component)
protected Object
GetSubIdDomElement(Object subElementId)
Returns the DOM element identified by the passed in subId.
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()
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, __componentLabelChanged, ComponentSubmittedValueChanged, ComponentTextChanged, Focus, GetComponentLabel, 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, isEmpty


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

addComponentEventHandlers, addComponentPropertyChanges, addComponentPropertyGetters, addDomEventHandlers, addEventHandlerToDomInstance, addSuppressedPPRAttributes, bind, cancelAllPopups, cancelPopup, ChildVisibilityChanged, ComponentInlineStyleChanged, ComponentPropertyChanged, componentRemoved, ComponentStyleClassChanged, ComponentVisibleChanged, ConvertClientIdToLocator, convertLocatorToClientId, CreateDraggableNode, createPeerClass, createSubId, CreateSubId, DefaultInitClass, DispatchComponentEvent, domReplaceNotify, DomReplaceNotify, getAbsoluteId, getAbsoluteLocator, getAllPopups, getComponent, GetComponent, GetComponentId, getComponentParent, getComponentProperty, GetComponentVisible, getDescendantComponents, getDomContentElement, getDomContentElementForComponent, GetDomContentElementForNode, getDomDocument, getDomElement, getDomElementForComponent, getDomNode, GetDomNodeForCommentComponent, getDomNodeForComponent, getDragOverFeedback, GetDragOverFeedback, getDragTransferable, GetDragTransferable, getFirstAncestorComponent, getInlineEditor, GetInlineEditor, getInlineStyleProperty, getLocatorByDomElement, getPagePosition, getPopupWindow, GetRichResourceURL, getSubIdDomElement, hideAllPopups, hidePopup, InitClass, initialize, isActive, isInActiveHeirarchy, isPopupVisible, messageNotify, messageShow, needsChildVisibilityChanges, 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

_SUB_ID_MAP

private static Object _SUB_ID_MAP

richTextEditor component publishes the following sub ids [External Subid --> Internal Client SubId]:- 1. [label --> label] - richTextEditor label 2. [content --> content] - richTextEditor content 3. [cont --> cont] - richTextEditor content-input-container If a subId is not contained in the map below, it's corresponding DOM is located programmatically in AdfDhtmlRichTextEditorPeer.GetSubIdDomElement().

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

focus

public Object focus(AdfUIComponent component)

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

Parameters:
component  -  The component
Return:
Object
Overrides:
AdfUIPeer.focus(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.

_getOneThroughSevenFontSize

private Object _getOneThroughSevenFontSize(Object value)

Parameters:
value    
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

GetSubIdDomElement

protected Object GetSubIdDomElement(Object subElementId)

Returns the DOM element identified by the passed in subId.

Parameters:
subElementId    
Return:
Object - the DOM element
Overrides:
AdfRichUIPeer.getSubIdDomElement(Object, 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()

_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 2009.04.27 01:06 UTC
Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.