editor.Plugin Extends goog.events.EventTarget
Abstract API for trogedit plugins.

Inheritance

Object
     goog.Disposable
          goog.events.EventTarget
               goog.editor.Plugin

Constructor

goog.editor.Plugin()

Instance Methods

Public Protected Private
activeOnUneditableFields()
No description.
Returns:   If true, field will not disable the command when the field becomes uneditable.
code »
disable(fieldObject)
Disables this plugin for the specified, registered field object.
Arguments:
fieldObject :
The field object.
code »
disposeInternal()
No description.
code »
enable(fieldObject)
Enables this plugin for the specified, registered field object. A field object should only be enabled when it is loaded.
Arguments:
fieldObject :
The field object.
code »
execCommand(commandvar_args)
Object | undefined
Handles execCommand. This default implementation handles dispatching BEFORECHANGE, CHANGE, and SELECTIONCHANGE events, and calls execCommandInternal to perform the actual command. Plugins that want to do their own event dispatching should override execCommand, otherwise it is preferred to only override execCommandInternal. This version of execCommand will only work for single field plugins. Multi-field plugins must override execCommand.
Arguments:
command :
The command to execute.
var_args :
Any additional parameters needed to execute the command.
Returns: 
Object | undefined
  The result of the execCommand, if any.
code »
getFieldDomHelper()
No description.
Returns:   The dom helper object associated with the currently active field.
code »
isAutoDispose()
No description.
Returns:   Whether or not this plugin should automatically be disposed when it's registered field is disposed.
code »
isEnabled(fieldObject)
Returns whether this plugin is enabled for the field object.
Arguments:
fieldObject :
The field object.
Returns:   Whether this plugin is enabled for the field object.
code »
isSilentCommand()
No description.
Returns:   If true, field will not dispatch change events for commands of this type. This is useful for "seamless" plugins like dialogs and lorem ipsum.
code »
isSupportedCommand(command)
Whether the string corresponds to a command this plugin handles.
Arguments:
command :
Command string to check.
Returns:   Whether the plugin handles this type of command.
code »
registerFieldObject(fieldObject)
Registers the field object for use with this plugin.
Arguments:
fieldObject :
The editable field object.
code »
setAutoDispose(autoDispose)
Set if this plugin should automatically be disposed when the registered field is disposed.
Arguments:
autoDispose :
Whether to autoDispose.
code »
unregisterFieldObject(fieldObj)
Unregisters and disables this plugin for the current field object.
Arguments:
fieldObj :
The field object. For single-field plugins, this parameter is ignored.
code »
addEventListener(typehandleropt_captureopt_handlerScope)
Adds an event listener to the event target. The same handler can only be added once per the type. Even if you add the same handler multiple times using the same type then it will only be called once when the event is dispatched. Supported for legacy but use goog.events.listen(src, type, handler) instead.
Arguments:
type :
The type of the event to listen for.
handler :
The function to handle the event. The handler can also be an object that implements the handleEvent method which takes the event object as argument.
opt_capture :
In DOM-compliant browsers, this determines whether the listener is fired during the capture or bubble phase of the event.
opt_handlerScope :
Object in whose scope to call the listener.
code »
dispatchEvent(e)
Dispatches an event (or event like object) and calls all listeners listening for events of this type. The type of the event is decided by the type property on the event object. If any of the listeners returns false OR calls preventDefault then this function will return false. If one of the capture listeners calls stopPropagation, then the bubble listeners won't fire.
Arguments:
e :
Event object.
Returns:   If anyone called preventDefault on the event object (or if any of the handlers returns false this will also return false.
code »
disposeInternal()
Unattach listeners from this object. Classes that extend EventTarget may need to override this method in order to remove references to DOM Elements and additional listeners, it should be something like this:
MyClass.prototype.disposeInternal = function() {
MyClass.superClass_.disposeInternal.call(this);
// Dispose logic for MyClass
};
code »
getParentEventTarget()
Returns the parent of this event target to use for bubbling.
Returns:   The parent EventTarget or null if there is no parent.
code »
removeEventListener(typehandleropt_captureopt_handlerScope)
Removes an event listener from the event target. The handler must be the same object as the one added. If the handler has not been added then nothing is done.
Arguments:
type :
The type of the event to listen for.
handler :
The function to handle the event. The handler can also be an object that implements the handleEvent method which takes the event object as argument.
opt_capture :
In DOM-compliant browsers, this determines whether the listener is fired during the capture or bubble phase of the event.
opt_handlerScope :
Object in whose scope to call the listener.
code »
setParentEventTarget(parent)
Sets the parent of this event target to use for bubbling.
Arguments:
parent :
Parent EventTarget (null if none).
code »
dispose()
No description.
code »
disposeInternal()
Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend {@code goog.Disposable} should override this method. For example:
mypackage.MyClass = function() {
goog.Disposable.call(this);
// Constructor logic specific to MyClass.
...
};
goog.inherits(mypackage.MyClass, goog.Disposable);

mypackage.MyClass.prototype.disposeInternal = function() {
mypackage.MyClass.superClass_.disposeInternal.call(this);
// Dispose logic specific to MyClass.
...
};
code »
getDisposed()
No description.
Returns:   Whether the object has been disposed of.
code »
isDisposed()
No description.
Returns:   Whether the object has been disposed of.
code »

Instance Properties

autoDispose_ :
Indicates if this plugin should be automatically disposed when the registered field is disposed. This should be changed to false for plugins used as multi-field plugins.
Code »
fieldObject :
The field object this plugin is attached to.
Code »
The logger for this plugin.
Code »
customEvent_ :
Used to tell if an event is a real event in goog.events.listen() so we don't get listen() calling addEventListener() and vice-versa.
Code »
parentEventTarget_ :
Parent event target, used during event bubbling.
Code »
disposed_ :
Whether the object has been disposed of.
Code »

Package editor

Package Reference