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

java.lang.Object
  extended by org.xwiki.gwt.wysiwyg.client.plugin.macro.MacroWizard
All Implemented Interfaces:
WizardListener

public class MacroWizard
extends Object
implements WizardListener

A wizard that can be used to cast macro spells on a rich text area.

Version:
$Id$

Field Summary
static Command INSERT
          Rich text area command for inserting a macro in place of the current selection.
 
Constructor Summary
MacroWizard(MacroDisplayer displayer, Config config, MacroServiceAsync macroService)
          Creates a new macro wizard.
 
Method Summary
 void destroy()
          Destroy this wizard.
 void edit()
          Casts the edit macro spell on the underlying rich text area, allowing the user to edit the parameters and the content of the currently selected macro.
 void insert()
          Casts the insert macro spell on the underlying rich text area, allowing the user to insert a new macro in place of the current selection or at the current caret position.
 void insert(String macroId)
          Casts the insert macro spell on the underlying rich text area, allowing the user to insert the specified macro in place of the current selection or at the current caret position.
 void onCancel(Wizard sender)
          
 void onFinish(Wizard sender, Object result)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSERT

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

Constructor Detail

MacroWizard

public MacroWizard(MacroDisplayer displayer,
                   Config config,
                   MacroServiceAsync macroService)
Creates a new macro wizard.

Parameters:
displayer - the object used to get information about the displayed macros and to access the rich text area on which the spells are cast
config - the object used to configure this wizard
macroService - the macro service used to retrieve macro descriptors
Method Detail

edit

public void edit()
Casts the edit macro spell on the underlying rich text area, allowing the user to edit the parameters and the content of the currently selected macro.


insert

public void insert()
Casts the insert macro spell on the underlying rich text area, allowing the user to insert a new macro in place of the current selection or at the current caret position.


insert

public void insert(String macroId)
Casts the insert macro spell on the underlying rich text area, allowing the user to insert the specified macro in place of the current selection or at the current caret position.

Parameters:
macroId - a macro identifier

onCancel

public void onCancel(Wizard sender)

Specified by:
onCancel in interface WizardListener
See Also:
WizardListener.onCancel(Wizard)

onFinish

public void onFinish(Wizard sender,
                     Object result)

Specified by:
onFinish in interface WizardListener
See Also:
WizardListener.onFinish(Wizard, Object)

destroy

public void destroy()
Destroy this wizard.



Copyright © 2004-2012 XWiki. All Rights Reserved.