silverorange Code


Swat.SwatSimpleColorEntry
/Swat/SwatSimpleColorEntry.php at line 20

Class SwatSimpleColorEntry

SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatControl
└─SwatInputControl
└─SwatSimpleColorEntry

public class SwatSimpleColorEntry
extends SwatInputControl

Simple color selector widget.

This color selector displays a simple palette to the user with a set of predefined color choices. It requires JavaScript to work correctly.

Copyright:
2005-2007 silverorange
License:
http://www.gnu.org/copyleft/lesser.html LGPL License 2.1

Field Summary
string

$access_key

Access key.

array

$colors

Array of colors to display in this color selector.

string

$value

Selected color.

Fields inherited from Swat.SwatInputControl
required
Constructor Summary

SwatSimpleColorEntry(string id)

Creates a new simple color selection widget.

Method Summary
void

display()

Displays this simple color selector widget.

protected array

getCSSClassNames()

Gets the array of CSS classes that are applied to this simple color entry widget.

protected string

getInlineJavaScript()

Gets simple color selector inline JavaScript.

string

getState()

Gets the current state of this simple color selector widget.

void

setState(string state)

Sets the current state of this simple color selector widget.

Methods inherited from Swat.SwatInputControl
getForm, init
Methods inherited from Swat.SwatControl
addMessage, getNote, printWidgetTree
Methods inherited from Swat.SwatWidget
addCompositeWidget, addMessage, confirmCompositeWidgets, copy, createCompositeWidgets, display, displayHtmlHeadEntries, getCSSClassNames, getCompositeWidget, getCompositeWidgets, getFocusableHtmlId, getHtmlHeadEntrySet, getMessages, hasMessage, init, isDisplayed, isInitialized, isProcessed, isSensitive, printWidgetTree, process, replaceWithContainer
Methods inherited from Swat.SwatUIObject
addComment, addJavaScript, addStyleSheet, addTangoAttribution, copy, getCSSClassNames, getCSSClassString, getFirstAncestor, getHtmlHeadEntrySet, getInlineJavaScript, getUniqueId, isVisible

Field Detail

/Swat/SwatSimpleColorEntry.php at line 40

access_key

public string $access_key = null

Access key

Access key for this simple color control, for keyboard nagivation.


/Swat/SwatSimpleColorEntry.php at line 53

colors

public array $colors = array(...)

Array of colors to display in this color selector

The array is flat and contains three or six digit hex color codes.

The default palette is the Tango Project color palette.


/Swat/SwatSimpleColorEntry.php at line 31

value

public string $value = null

Selected color

The selected color in three or six digit hexidecimal representation.


Constructor Detail

/Swat/SwatSimpleColorEntry.php at line 71

SwatSimpleColorEntry

public SwatSimpleColorEntry(string id)

Creates a new simple color selection widget

Parameters:
id - a non-visible unique id for this widget.
See Also:
SwatWidget::__construct()

Method Detail

/Swat/SwatSimpleColorEntry.php at line 97

display

public void display()

Displays this simple color selector widget


/Swat/SwatSimpleColorEntry.php at line 169

getCSSClassNames

protected array getCSSClassNames()

Gets the array of CSS classes that are applied to this simple color entry widget

Returns:
the array of CSS classes that are applied to this simple color entry widget.
See Also:
SwatUIObject::getCSSClassString()

/Swat/SwatSimpleColorEntry.php at line 186

getInlineJavaScript

protected string getInlineJavaScript()

Gets simple color selector inline JavaScript

The JavaScript is the majority of the simple color selector code

Returns:
simple color selector inline JavaScript.

/Swat/SwatSimpleColorEntry.php at line 139

getState

public string getState()

Gets the current state of this simple color selector widget

Returns:
the current state of this simple color selector widget.
See Also:
SwatState::getState()

/Swat/SwatSimpleColorEntry.php at line 154

setState

public void setState(string state)

Sets the current state of this simple color selector widget

Parameters:
state - the new state of this simple color selector widget.
See Also:
SwatState::setState()

silverorange Code