SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatControl
└─SwatActions
public class SwatActions
extends SwatControl
| Field Summary | |
|---|---|
| protected array | The available actions for this actions selector indexed by id. |
| boolean | Auto-reset. |
| SwatActionItem | Selected action. |
| boolean | Show blank. |
| Constructor Summary | |
|---|---|
SwatActions(string id) Creates a new actions list. |
|
| Method Summary | |
|---|---|
| void | addActionItem(SwatActionItem item) Adds an action item. |
| void | addChild(SwatActionItem child) Adds a child object. |
| SwatUIObject | copy(string id_suffix) Performs a deep copy of the UI tree starting with this UI object. |
| protected void | Creates and the composite flydown and button widgets of this actions control. |
| void | display() Displays this list of actions. |
| protected void | Displays the button for this action list. |
| array | Gets the array of current SwatActions. |
| protected array | Gets the array of CSS classes that are applied to this actions list. |
| array | Gets descendant states. |
| array | getDescendants(string class_name) Gets descendant UI-objects. |
| SwatUIObject | getFirstDescendant(string class_name) Gets the first descendant UI-object of a specific class. |
| SwatHtmlHeadEntrySet | Gets the SwatHtmlHeadEntry objects needed by this actions list. |
| protected string | Gets inline JavaScript required to show and hide selected action items. |
| protected string | getInlineJavaScriptTranslations() Gets translatable string resources for the JavaScript object for this widget. |
| void | init() Initializes this action item. |
| void | process() Figures out what action item is selected. |
| void | setDescendantStates(array states) Sets descendant states. |
| void | setViewSelector(SwatView view, SwatViewSelector selector) Sets the optional view and selector of this actions control. |
| 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 | |
protected array $action_items_by_id = array()
The available actions for this actions selector indexed by id
This array only contains actions that have a non-null id.
public boolean $auto_reset = true
Auto-reset
Whether to auto reset the action flydown to the default action after processing.
public SwatActionItem $selected = null
Selected action
The currently selected action item, or null.
public boolean $show_blank = true
Show blank
Whether to show an inital blank option in the flydown.
public SwatActions(string id)
Creates a new actions list
id - a non-visible unique id for this widget.public void addActionItem(SwatActionItem item)
Adds an action item
Adds a SwatActionItem to this SwatActions widget.
item - a reference to the item to add.public void addChild(SwatActionItem child)
Adds a child object
This method fulfills the SwatUIParent interface. It is used
by SwatUI when building a widget tree and should not need to be
called elsewhere. To add an action item to an actions object use
SwatActions::addActionItem().
child - a reference to a child object to add.public SwatUIObject copy(string id_suffix)
Performs a deep copy of the UI tree starting with this UI object
id_suffix - optional. A suffix to append to copied UI objects in the UI tree.protected void createCompositeWidgets()
Creates and the composite flydown and button widgets of this actions control
public void display()
Displays this list of actions
Internal widgets are automatically created if they do not exist. Javascript is displayed, then the display methods of the internal widgets are called.
protected void displayButton()
Displays the button for this action list
Subclasses may override this method to display more buttons.
public array getActionItems()
Gets the array of current SwatActions
protected array getCSSClassNames()
Gets the array of CSS classes that are applied to this actions list
public array getDescendantStates()
Gets descendant states
Retrieves an array of states of all stateful UI-objects in the widget subtree below this actions widget.
public array getDescendants(string class_name)
Gets descendant UI-objects
class_name - optional class name. If set, only UI-objects that are instances of $class_name are returned.public SwatUIObject getFirstDescendant(string class_name)
Gets the first descendant UI-object of a specific class
class_name - class name to look for.public SwatHtmlHeadEntrySet getHtmlHeadEntrySet()
Gets the SwatHtmlHeadEntry objects needed by this actions list
protected string getInlineJavaScript()
Gets inline JavaScript required to show and hide selected action items
protected string getInlineJavaScriptTranslations()
Gets translatable string resources for the JavaScript object for this widget
public void init()
Initializes this action item
This initializes the action items contained in this actions list.
public void process()
Figures out what action item is selected
This method creates internal widgets if they do not exist, and then determines what SwatActionItem was selected by the user by calling the process methods of the internal widgets.
public void setDescendantStates(array states)
Sets descendant states
Sets states on all stateful UI-objects in the widget subtree below this actions widget.
states - an array of UI-object states with UI-object identifiers as array keys.public void setViewSelector(SwatView view, SwatViewSelector selector)
Sets the optional view and selector of this actions control
If a view and selector are specified for this actions control, submitting the form is prevented until one or more items in the view are selected by the selector.
view - the view items must be selected in. Specify null to remove any existing view selector.selector - optional. The selector in the view that must select the items. If not specified, the first selector in the view is used.
Actions widget