org.xwiki.gwt.wysiwyg.client.plugin.color
Class ColorPlugin

java.lang.Object
  extended by org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugin
      extended by org.xwiki.gwt.wysiwyg.client.plugin.color.ColorPlugin
All Implemented Interfaces:
com.google.gwt.event.dom.client.ClickHandler, com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel>, com.google.gwt.event.shared.EventHandler, Plugin
Direct Known Subclasses:
MozillaColorPlugin

public class ColorPlugin
extends org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugin
implements com.google.gwt.event.dom.client.ClickHandler, com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel>

Plug-in for controlling the text color and the background color. It installs two push buttons on the tool bar, each opening a color picker dialog, which is synchronized with the text area.

Version:
$Id: ColorPlugin.java 26786 2010-02-07 16:46:17Z mflorea $

Field Summary
static java.lang.String DEFAULT_COLORS
          The colors available by default on the color palette.
static java.lang.String DEFAULT_COLUMN_COUNT
          The default number of columns displayed by the color palette.
 
Constructor Summary
ColorPlugin()
           
 
Method Summary
 void destroy()
          Notifies the plug-in to release its resources before being unloaded from the WYSIWYG editor.
protected  Executable getBackColorExecutable()
           
protected  ColorPicker getColorPicker()
          Lazy loads the color picker.
 void init(RichTextArea textArea, Config config)
          Initialize the plug-in.
 void onClick(com.google.gwt.event.dom.client.ClickEvent event)
          
 void onClose(com.google.gwt.event.logical.shared.CloseEvent<com.google.gwt.user.client.ui.PopupPanel> event)
          
 
Methods inherited from class org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugin
getConfig, getTextArea, getUIExtensionList, getUIExtensions, saveRegistration, saveRegistrations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_COLORS

public static final java.lang.String DEFAULT_COLORS
The colors available by default on the color palette.

See Also:
Constant Field Values

DEFAULT_COLUMN_COUNT

public static final java.lang.String DEFAULT_COLUMN_COUNT
The default number of columns displayed by the color palette.

See Also:
Constant Field Values
Constructor Detail

ColorPlugin

public ColorPlugin()
Method Detail

init

public void init(RichTextArea textArea,
                 Config config)
Initialize the plug-in. Plug-ins need to know the text area in order to provide only those feature that are supported.

Specified by:
init in interface Plugin
Overrides:
init in class org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugin
Parameters:
textArea - the text area of the editor
config - the configuration object
See Also:
AbstractPlugin.init(RichTextArea, Config)

destroy

public void destroy()
Notifies the plug-in to release its resources before being unloaded from the WYSIWYG editor.

Specified by:
destroy in interface Plugin
Overrides:
destroy in class org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugin
See Also:
AbstractPlugin.destroy()

onClick

public void onClick(com.google.gwt.event.dom.client.ClickEvent event)

Specified by:
onClick in interface com.google.gwt.event.dom.client.ClickHandler
See Also:
ClickHandler.onClick(ClickEvent)

onClose

public void onClose(com.google.gwt.event.logical.shared.CloseEvent<com.google.gwt.user.client.ui.PopupPanel> event)

Specified by:
onClose in interface com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel>
See Also:
CloseHandler.onClose(CloseEvent)

getColorPicker

protected ColorPicker getColorPicker()
Lazy loads the color picker.

Returns:
the color picker

getBackColorExecutable

protected Executable getBackColorExecutable()
Returns:
the executable used to change the background color of the selected text


Copyright © 2004-2010 XWiki. All Rights Reserved.