org.xwiki.gwt.wysiwyg.client.plugin.symbol
Class SymbolPalette

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by org.xwiki.gwt.wysiwyg.client.plugin.symbol.SymbolPalette
All Implemented Interfaces:
com.google.gwt.event.dom.client.ClickHandler, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.logical.shared.HasSelectionHandlers<String>, com.google.gwt.event.shared.EventHandler, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.IsRenderable, com.google.gwt.user.client.ui.IsWidget

public class SymbolPalette
extends com.google.gwt.user.client.ui.Composite
implements com.google.gwt.event.logical.shared.HasSelectionHandlers<String>, com.google.gwt.event.dom.client.ClickHandler

A set of symbols from which the user can choose one by clicking.

Version:
$Id$

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
SymbolPalette(Object[][] symbols, int rows, int columns)
          Creates a new symbol palette using the given list of symbols to fill a symbol grid with the specified number of rows and columns.
 
Method Summary
 com.google.gwt.event.shared.HandlerRegistration addSelectionHandler(com.google.gwt.event.logical.shared.SelectionHandler<String> handler)
          
 String getSelectedSymbol()
           
protected  com.google.gwt.user.client.ui.Grid getSymbolGrid()
           
 void onClick(com.google.gwt.event.dom.client.ClickEvent event)
          
 void setSelectedSymbol(String symbol)
          Selects a symbol in the symbol grid.
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getWidget, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, performDetachedInitialization, render, render, resolvePotentialElement, setWidget, wrapElement
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

SymbolPalette

public SymbolPalette(Object[][] symbols,
                     int rows,
                     int columns)
Creates a new symbol palette using the given list of symbols to fill a symbol grid with the specified number of rows and columns.

Parameters:
symbols - the list of symbols that are used to fill the symbol grid
rows - the number of rows in the symbol grid
columns - the number of columns in the symbol grid
Method Detail

addSelectionHandler

public com.google.gwt.event.shared.HandlerRegistration addSelectionHandler(com.google.gwt.event.logical.shared.SelectionHandler<String> handler)

Specified by:
addSelectionHandler in interface com.google.gwt.event.logical.shared.HasSelectionHandlers<String>
See Also:
HasSelectionHandlers.addSelectionHandler(SelectionHandler)

getSymbolGrid

protected com.google.gwt.user.client.ui.Grid getSymbolGrid()
Returns:
the symbol grid that makes up this palette

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)

getSelectedSymbol

public String getSelectedSymbol()
Returns:
the symbol within the grid cell that was last clicked

setSelectedSymbol

public void setSelectedSymbol(String symbol)
Selects a symbol in the symbol grid.

Parameters:
symbol - the symbol to be selected


Copyright © 2004-2012 XWiki. All Rights Reserved.