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

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.Panel
              extended by com.google.gwt.user.client.ui.ComplexPanel
                  extended by com.google.gwt.user.client.ui.FlowPanel
                      extended by org.xwiki.gwt.wysiwyg.client.plugin.color.ColorCell
All Implemented Interfaces:
com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.IndexedPanel, com.google.gwt.user.client.ui.InsertPanel, java.lang.Iterable<com.google.gwt.user.client.ui.Widget>

public class ColorCell
extends com.google.gwt.user.client.ui.FlowPanel

Defines a cell in the ColorPalette that can be selected by being clicked.

Version:
$Id: ColorCell.java 27018 2010-02-14 18:49:29Z mflorea $

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
static java.lang.String HOVERED_STYLE_NAME
          The CSS class name used when the color cell is hovered.
static java.lang.String NORMAL_STYLE_NAME
          The CSS class name used when the color cell is neither selected nor hovered.
static java.lang.String SELECTED_STYLE_NAME
          The CSS class name used when the color cell is selected.
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
ColorCell(java.lang.String color)
          Creates a new color cell using the specified color code.
 
Method Summary
 java.lang.String getColor()
           
 boolean isSelected()
           
 void onBrowserEvent(com.google.gwt.user.client.Event event)
          
 void setSelected(boolean selected)
          Sets the selected state of this color cell.
 
Methods inherited from class com.google.gwt.user.client.ui.FlowPanel
add, clear, insert
 
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, insert, insert, iterator, remove, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
adopt, adopt, disown, doAttachChildren, doDetachChildren, onLoad, onUnload, orphan
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addDomHandler, addHandler, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, 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, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, 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.user.client.ui.IndexedPanel
getWidget, getWidgetCount, getWidgetIndex, remove
 

Field Detail

NORMAL_STYLE_NAME

public static final java.lang.String NORMAL_STYLE_NAME
The CSS class name used when the color cell is neither selected nor hovered.

See Also:
Constant Field Values

SELECTED_STYLE_NAME

public static final java.lang.String SELECTED_STYLE_NAME
The CSS class name used when the color cell is selected.

See Also:
Constant Field Values

HOVERED_STYLE_NAME

public static final java.lang.String HOVERED_STYLE_NAME
The CSS class name used when the color cell is hovered.

See Also:
Constant Field Values
Constructor Detail

ColorCell

public ColorCell(java.lang.String color)
Creates a new color cell using the specified color code.

Parameters:
color - the code of the color to fill the new cell
Method Detail

getColor

public java.lang.String getColor()
Returns:
color

isSelected

public boolean isSelected()
Returns:
selected

setSelected

public void setSelected(boolean selected)
Sets the selected state of this color cell.

Parameters:
selected - true to mark this cell as selected, false otherwise

onBrowserEvent

public void onBrowserEvent(com.google.gwt.user.client.Event event)

Specified by:
onBrowserEvent in interface com.google.gwt.user.client.EventListener
Overrides:
onBrowserEvent in class com.google.gwt.user.client.ui.Widget
See Also:
Widget.onBrowserEvent(Event)


Copyright © 2004-2011 XWiki. All Rights Reserved.