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.logical.shared.HasAttachHandlers, 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.HasWidgets, com.google.gwt.user.client.ui.HasWidgets.ForIsWidget, com.google.gwt.user.client.ui.IndexedPanel, com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget, com.google.gwt.user.client.ui.InsertPanel, com.google.gwt.user.client.ui.InsertPanel.ForIsWidget, com.google.gwt.user.client.ui.IsWidget, 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: 95dc04df9e8930639f7b20d2e08622b10ebbcb54 $

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
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.InsertPanel
com.google.gwt.user.client.ui.InsertPanel.ForIsWidget
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
 
Field Summary
static String HOVERED_STYLE_NAME
          The CSS class name used when the color cell is hovered.
static String NORMAL_STYLE_NAME
          The CSS class name used when the color cell is neither selected nor hovered.
static String SELECTED_DARK_STYLE_NAME
          The CSS class name used when a dark color is selected.
static String SELECTED_LIGHT_STYLE_NAME
          The CSS class name used when a light color is selected.
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
ColorCell(String color)
          Creates a new color cell using the specified color code.
 
Method Summary
 String getColor()
           
 String getHexColorCode()
           
 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, insert
 
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, adopt, disown, doAttachChildren, doDetachChildren, orphan, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, 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, resolvePotentialElement, 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.user.client.ui.InsertPanel.ForIsWidget
add
 
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget
getWidgetIndex
 
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel
getWidget, getWidgetCount, getWidgetIndex, remove
 

Field Detail

NORMAL_STYLE_NAME

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

See Also:
Constant Field Values

SELECTED_DARK_STYLE_NAME

public static final String SELECTED_DARK_STYLE_NAME
The CSS class name used when a dark color is selected.

See Also:
Constant Field Values

SELECTED_LIGHT_STYLE_NAME

public static final String SELECTED_LIGHT_STYLE_NAME
The CSS class name used when a light color is selected.

See Also:
Constant Field Values

HOVERED_STYLE_NAME

public static final 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(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 String getColor()
Returns:
color

getHexColorCode

public String getHexColorCode()
Returns:
the HEX code of this cell's 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–2015 XWiki. All rights reserved.