Action Lists: oxy_action_list() Function
This function allows you to define a sequential list of actions directly in the CSS, rather than referencing them from the associated framework.
The oxy_action_list()
function is used from the oxy_buttonGroup() function that provides a
graphical group of buttons with multiple custom actions. These actions are normally defined in
the associated Document Type (framework configuration) but the
oxy_action_list()
function allows you to define the actions directly in the
CSS instead of the framework configuration.
The arguments received by the oxy_action_list()
function are a list of
actions (executed sequentially) that are defined with the oxy_action() function. The following properties are supported in the
oxy_action()
function:
- name - The name of the action. The name of the first defined action will be displayed as the label for the button or menu item.
- description (optional) - A short description with details about the result of the action. The description of the first defined action will be displayed in a tooltip.
- icon (optional) - A path relative to the CSS
pointing to an image (the icon for the action). The path can point to resources that are
packed in Oxygen XML Author (oxygen.jar) by starting its value
with
/
(for example, /images/Remove16.png). It can also be expressed using an editor variable. - operation - The name of the Java class
implementing the ro.sync.ecss.extensions.api.AuthorOperation
interface. There is also a variety of predefined operations that
can be used. Note: If the name of the operation specified in the CSS is not qualified (has no Java package name), then it is considered to be one of the built-in Oxygen XML Author operations. If the class is not found in this package, then it will be loaded using the specified name.
- arg-<string> - All arguments with the
arg-
prefix are passed to the operation (the string that follows thearg-
prefix is passed). The argument value supports editor variables. - ID - (optional) - The ID of the action from the framework. If this is specified, all others parameters are disregarded.
p:after {
content: oxy_buttonGroup(
label, 'A group of actions',
icon, url('http://www.oxygenxml.com/img/icn_oxy20.png'),
actions,
oxy_action_list(
oxy_action(
name, 'Insert a new paragraph',
description, 'Insert an element after the current one',
operation, 'InsertFragmentOperation',
arg-fragment, '<p></p>',
arg-insertLocation, '.',
arg-insertPosition, 'After'
),
oxy_action(
name, 'Delete',
description, 'Deletes the current element',
operation, 'DeleteElementOperation'
)
)
)
}
oxy_action_list
function with the Content Completion
Assistant by pressing Ctrl +
Space and select the
oxy_action_list
code template.