public abstract class ToolbarButton
extends java.lang.Object
To execute Javascript in the browser, override getJavascriptToExecute()
to return the
Javascript code as String, that should be interpreted by the browser.
To execute Java via callback, override execute()
and ensure that
getJavascriptToExecute()
returns null
.
The available toolbars a button can be added to are configured via
ToolbarConfiguration.getToolbarGroupConfiguration()
. It is possible to specify the
position of the button in the toolbar group via comma separated index, e.g. other,1 will
place a new button at the first position of the toolbar group with the name other.
Constructor and Description |
---|
ToolbarButton(java.lang.String buttonName,
java.lang.String commandName,
java.lang.String buttonLabel,
java.lang.String toolbar,
java.net.URL iconURL)
Create a
ToolbarButton with the given information. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
execute()
The code that should be executed via Javascript callback when this button is pressed.
|
java.lang.String |
getButtonLabel() |
java.lang.String |
getButtonName() |
java.lang.String |
getCommandName() |
java.net.URL |
getIconURL() |
java.lang.String |
getJavascriptToExecute()
This method can be used to specify Javascript calls that should be executed.
|
java.lang.String |
getToolbar() |
public ToolbarButton(java.lang.String buttonName, java.lang.String commandName, java.lang.String buttonLabel, java.lang.String toolbar, java.net.URL iconURL)
ToolbarButton
with the given information.buttonName
- The unique name of the dynamically created CKEditor button.commandName
- The unique name of the dynamically created CKEditor command that is called by
pressing this button.buttonLabel
- The textual part of the button (if visible) and its tooltip.toolbar
- The toolbar group into which the button will be added. An optional index value
(separated by a comma) determines the button position within the group.iconURL
- The URL
of the image that should be show as button icon.public java.lang.String getButtonName()
public java.lang.String getCommandName()
public java.lang.String getButtonLabel()
public java.lang.String getToolbar()
public java.net.URL getIconURL()
URL
of the image that should be show as button icon.public java.lang.String getJavascriptToExecute()
null
, the specified Javascript code is evaluated. Otherwise the
Java code specified in execute()
is executed via Javascript callback.null
to execute the callback.public java.lang.Object execute()