Interface ClientItemContext

All Superinterfaces:
ClientItemConstants, org.timepedia.exporter.client.Exportable

public interface ClientItemContext extends org.timepedia.exporter.client.Exportable, ClientItemConstants
Context for which actions have been requested.
Since:
5.2.181105
  • Method Details

    • createItem

      @NotNull @NotNull ClientItem createItem(@Nullable @Nullable String iconUrl, @NotNull @NotNull String title, @NotNull @NotNull ClientItemPerformable handler)
      Creates an action using the given parameters.
      Example for the creation of a ClientItem:
           // context: ClientItemContext
           var clientItem = context.createItem("iconUrl", "title", function clientItemPerformable() {
               // Perform action
           });
       
      Parameters:
      iconUrl - The icon to be shown for the action.
      title - The title or tooltip of the action.
      handler - The handler performing the action.
      Returns:
      The created action.
      Since:
      5.2.181105
      See Also:
    • getProperty

      @Nullable @Nullable Object getProperty(String name)
      Returns the value of the given property, or null if there is no such property.
      Example for the request of a contextual property:
           // context: ClientItemContext
           var fsid = context.getProperty("fsid");
       
      The available properties for the specific context are documented on the context type itself, like for the FS_INDEX actions on ClientItemConstants.TYPE_INDEX.
      Parameters:
      name - The name of the property.
      Returns:
      The property's value or null.
      Since:
      5.2.181105
    • refresh

      void refresh()
      Triggers a refresh of the contextual view this action has been registered for, if the context provides such a functionality.
      Example for the refresh of the contextual view:
           // context: ClientItemContext
           var clientItem = context.createItem("iconUrl", "title", function clientItemPerformable() {
               // Perform action and refresh related view on modification
               context.refresh();
           });
       
      Since:
      5.2.181105