org.xwiki.gwt.wysiwyg.client.plugin.macro
Class MacroPlugin

java.lang.Object
  extended by org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugin
      extended by org.xwiki.gwt.wysiwyg.client.plugin.macro.MacroPlugin
All Implemented Interfaces:
com.google.gwt.event.dom.client.DoubleClickHandler, com.google.gwt.event.shared.EventHandler, Plugin

public class MacroPlugin
extends org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugin
implements com.google.gwt.event.dom.client.DoubleClickHandler

WYSIWYG editor plug-in for inserting macros and for editing macro parameters.

Version:
$Id: MacroPlugin.java 31679 2010-10-08 15:53:52Z mflorea $

Field Summary
static Command COLLAPSE
          Rich text area command for collapsing all the macros.
static Command EXPAND
          Rich text area command for expanding all the macros.
static Command INSERT
          Rich text area command for inserting a macro in place of the current selection.
static Command REFRESH
          Rich text area command for refreshing macro output.
 
Constructor Summary
MacroPlugin(MacroServiceAsync macroService)
          Creates a new macro plug-in that uses the specified macro service.
 
Method Summary
 void destroy()
          Notifies the plug-in to release its resources before being unloaded from the WYSIWYG editor.
 void edit()
          Start the edit macro wizard.
 MacroSelector getSelector()
           
 void init(RichTextArea textArea, Config config)
          Initialize the plug-in.
 void insert()
          Start the insert macro wizard.
 void insert(java.lang.String macroId)
          Skip the select macro wizard step and go directly to the edit macro wizard step for the specified macro.
 void onDoubleClick(com.google.gwt.event.dom.client.DoubleClickEvent 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

REFRESH

public static final Command REFRESH
Rich text area command for refreshing macro output.


COLLAPSE

public static final Command COLLAPSE
Rich text area command for collapsing all the macros.


EXPAND

public static final Command EXPAND
Rich text area command for expanding all the macros.


INSERT

public static final Command INSERT
Rich text area command for inserting a macro in place of the current selection.

Constructor Detail

MacroPlugin

public MacroPlugin(MacroServiceAsync macroService)
Creates a new macro plug-in that uses the specified macro service.

Parameters:
macroService - the macro service to be used for retrieving the macro descriptors
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()

getSelector

public MacroSelector getSelector()
Returns:
the macro selector

edit

public void edit()
Start the edit macro wizard.


insert

public void insert()
Start the insert macro wizard.


insert

public void insert(java.lang.String macroId)
Skip the select macro wizard step and go directly to the edit macro wizard step for the specified macro.

Parameters:
macroId - a macro identifier

onDoubleClick

public void onDoubleClick(com.google.gwt.event.dom.client.DoubleClickEvent event)

Specified by:
onDoubleClick in interface com.google.gwt.event.dom.client.DoubleClickHandler
See Also:
DoubleClickHandler.onDoubleClick(DoubleClickEvent)


Copyright © 2004-2011 XWiki. All Rights Reserved.