Home

# Class goog.editor.plugins.AbstractBubblePlugin

Base class for bubble plugins. This is used for to connect user behavior in the editor to a goog.ui.editor.Bubble UI element that allows the user to modify the properties of an element on their page (e.g. the alt text of an image tag). Subclasses should override the abstract method getBubbleTargetFromSelection() with code to determine if the current selection should activate the bubble type. The other abstract method createBubbleContents() should be overriden with code to create the inside markup of the bubble. The base class creates the rest of the bubble.

extends goog.editor.Plugin

Instance Method Summary
| `closeBubble()` Closes the bubble.
| `createBubble(?Element targetElement)` Creates and shows the property bubble.
| `createBubbleContents(?Element bubbleContainer)` Should be overriden by subclasses to add the type specific contents to the bubble.
| `createLink(string linkId, string linkText, ?Function= opt_onClick, ?Element= opt_container) ⇒ ?Element` Helper method that creates a link with text set to linkText and optionaly wires up a listener for the CLICK event or the link.
| `createLinkHelper(string linkId, string linkText, boolean isAnchor, ?Element= opt_container) ⇒ ?Element` Helper method to create a link to insert into the bubble.
| `createLinkOption(string id) ⇒ ?Element` Helper method that creates option links (such as edit, test, remove)
| `disable(?goog.editor.Field fieldObject)` Disables this plugin for the specified, registered field object.
| `getBubbleDom() ⇒ ?goog.dom.DomHelper`
| `getBubbleTargetFromSelection(?Element selectedElement) ⇒ ?Element` Should be overriden by subclasses to return the bubble target element or null if an element of their required type isn't found.
| `getBubbleTitle() ⇒ string`
| `getBubbleType() ⇒ string`
| `getSharedBubble_() ⇒ ?goog.ui.editor.Bubble`
| `getTargetElement() ⇒ ?Element` Returns the element whose properties the bubble manipulates.
| `handlePanelClosed_()` Handles when the bubble panel is closed. Invoked when the entire bubble is hidden and also directly when the panel is closed manually.
| `handleSelectionChangeInternal_(?Element selectedElement) ⇒ boolean` Pops up a property bubble for the given selection if appropriate and closes open property bubbles if no longer needed.
| `isVisible() ⇒ boolean`
| `onShow()` Called after the bubble is shown. The default implementation does nothing. Override it to provide your own one.
| `registerClickHandler(?Element target, ?Function handler)` Register the handler for the target's CLICK event.
| `reposition()` Reposition the property bubble.
| `setBubbleParent(?Element bubbleParent)` Sets the bubble parent.
| `setupLink(?Element link, string linkId, ?Element= opt_container)` Inserts a link in the given container if it is specified or removes the old link with this id and replaces it with the new link

Static Method Summary
| `defaultBubbleFactory_(!Element parent, number zIndex) ⇒ !goog.ui.editor.Bubble` Default factory function for creating a bubble UI component.
| `setBubbleFactory(function (Element, number): goog.ui.editor.Bubble bubbleFactory)` Sets the bubble factory function.