Class: OpenAction

sync.actions.OpenAction

new OpenAction(urlChooser)

Open action.
Parameters:
Name Type Description
urlChooser sync.api.UrlChooser the urlChooser the open action will use.
Source:

Extends

Methods

actionPerformed()

The actual action execution.
Overrides:
Source:

getActionId() → {string}

Get the action id.
Source:
Returns:
the action id or null if none was provided.
Type
string

getDescription() → {string}

Returns the description for the action - usually displayed on a tooltip.
Overrides:
Source:
Returns:
The description.
Type
string

getDisplayName() → {string}

Returns the display name for the action.
Overrides:
Source:
Returns:
The display name.
Type
string

(protected) getLargeIcon(devicePixelRationopt) → {string}

One should override this method to provide the absolute URL of the action's large icon.

When the action is defined in a framework, one can use the sync.ext.Registry.extensionURL to refer images inside the framework's web folder folder. When used inside a plugin, one may also want to expose a directory with static resources using a WebappStaticResourcesFolder extension.

The large icon should have a minimum size of 24 by 24 px for non-hidpi displays and can vary depending on the device pixel ration, the icon being used as the background of a 24 by 24 px DIV.

Parameters:
Name Type Attributes Description
devicePixelRation number <optional>
the device pixel ratio.
Overrides:
Source:
Returns:
The icon.
Type
string

getShortcut() → {string}

Returns the shortcut, represented as a string. E.g. "Ctrl B", "Alt Shift T". The shortcut may use platform-independent modifiers M1 to M4.
Inherited From:
Source:
Returns:
the string representation of the shortcut. If there is no shortcut, returns an empty string.
Type
string

(protected) getSmallIcon(devicePixelRationopt) → {string}

One should override this method to provide the absolute URL of the action's small icon.

When the action is defined in a framework, one can use the sync.ext.Registry.extensionURL to refer images inside the framework's web folder folder. When used inside a plugin, one may also want to expose a directory with static resources using a WebappStaticResourcesFolder extension.

The small icon should have a minimum size of 16 by 16 px for non-hidpi displays and can vary depending on the device pixel ration, the small icon being used as the background of a 16px by 16px div.

Parameters:
Name Type Attributes Description
devicePixelRation number <optional>
the device pixel ratio.
Overrides:
Source:
Returns:
The icon.
Type
string

isEnabled() → {boolean}

Tells whether the action is enabled. Note: The action is not permanently polled for its "enabled-ness". If you want the GUI to reflect the current status you will have to call sync.api.ActionsManager#refreshActionsStatus.
Overrides:
Source:
Returns:
Whether the action is enabled.
Type
boolean

openFile(fileUrl)

Opens a new file. (Replaces the old url param if there is one)
Parameters:
Name Type Description
fileUrl the file url to open.
Source:

renderLargeIcon() → {HTMLElement}

Handles the rendering of the action's large icon.
Overrides:
Source:
Returns:
the rendered large icon.
Type
HTMLElement

renderSmallIcon() → {HTMLElement}

This method renders the small icon of the action in a 16px by 16px DIV with the action's small icon as its background. This allows the getSmallIcon() method to return different sized icons depending on the device pixel ration, the size constraints being imposed by the enclosing DIV. It should be overridden only for custom rendering strategies, otherwise consider using the getSmallIcon method.
Inherited From:
Source:
Returns:
the rendering of the small icon image.
Type
HTMLElement

setActionId(newActionId)

Set the action id.
Parameters:
Name Type Description
newActionId the new action id.
Source:

setActionName(newName)

Sets the action name. The action name is displayed under the action large icon.
Parameters:
Name Type Description
newName the new name.
Source:

setDescription(newDescription)

Sets the action's description.
Parameters:
Name Type Description
newDescription the new action description.
Source:

setLargeIcon(newLargeIcon)

Setter for the action's large icon.
Parameters:
Name Type Description
newLargeIcon the new icon source.
Source: