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

java.lang.Object
  extended by org.xwiki.gwt.wysiwyg.client.plugin.macro.MacroSelector
All Implemented Interfaces:
com.google.gwt.event.dom.client.KeyUpHandler, com.google.gwt.event.dom.client.MouseDownHandler, com.google.gwt.event.shared.EventHandler, CommandListener, Updatable

public class MacroSelector
extends java.lang.Object
implements Updatable, com.google.gwt.event.dom.client.MouseDownHandler, com.google.gwt.event.dom.client.KeyUpHandler, CommandListener

Controls the currently selected macros.

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

Constructor Summary
MacroSelector(MacroDisplayer displayer)
          Creates a new macro selector.
 
Method Summary
 boolean canUpdate()
          
 void destroy()
          Destroys this selector.
 MacroDisplayer getDisplayer()
           
 Element getMacro(int index)
           
 int getMacroCount()
           
 boolean onBeforeCommand(CommandManager sender, Command command, java.lang.String param)
          
 void onCommand(CommandManager sender, Command command, java.lang.String param)
          
 void onKeyUp(com.google.gwt.event.dom.client.KeyUpEvent event)
          
 void onMouseDown(com.google.gwt.event.dom.client.MouseDownEvent event)
          
 void update()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MacroSelector

public MacroSelector(MacroDisplayer displayer)
Creates a new macro selector.

Parameters:
displayer - the displayer to be used for selecting the macros
Method Detail

destroy

public void destroy()
Destroys this selector.


onMouseDown

public void onMouseDown(com.google.gwt.event.dom.client.MouseDownEvent event)

Specified by:
onMouseDown in interface com.google.gwt.event.dom.client.MouseDownHandler
See Also:
MouseDownHandler.onMouseDown(MouseDownEvent)

onKeyUp

public void onKeyUp(com.google.gwt.event.dom.client.KeyUpEvent event)

Specified by:
onKeyUp in interface com.google.gwt.event.dom.client.KeyUpHandler
See Also:
KeyUpHandler.onKeyUp(KeyUpEvent)

onBeforeCommand

public boolean onBeforeCommand(CommandManager sender,
                               Command command,
                               java.lang.String param)

Specified by:
onBeforeCommand in interface CommandListener
See Also:
CommandListener.onBeforeCommand(CommandManager, Command, String)

onCommand

public void onCommand(CommandManager sender,
                      Command command,
                      java.lang.String param)

Specified by:
onCommand in interface CommandListener
See Also:
CommandListener.onCommand(CommandManager, Command, String)

update

public void update()

Specified by:
update in interface Updatable
See Also:
Updatable.update()

canUpdate

public boolean canUpdate()

Specified by:
canUpdate in interface Updatable
See Also:
Updatable.canUpdate()

getMacroCount

public int getMacroCount()
Returns:
the number of macros currently selected

getMacro

public Element getMacro(int index)
Parameters:
index - the index of the selected macro to return
Returns:
the selected macro at the specified index

getDisplayer

public MacroDisplayer getDisplayer()
Returns:
the displayer used to select and detect macros


Copyright © 2004-2010 XWiki. All Rights Reserved.