Class ViewType

java.lang.Object
com.atlassian.gadgets.view.ViewType
All Implemented Interfaces:
Serializable

public final class ViewType extends Object implements Serializable
Represents a context under which a gadget will be viewed. ViewTypes can be registered via createViewType and unregistered via removeViewType.
See Also:
  • Field Details

    • DEFAULT

      public static final ViewType DEFAULT
    • DIRECTORY

      public static final ViewType DIRECTORY
    • CANVAS

      public static final ViewType CANVAS
  • Method Details

    • createViewType

      public static ViewType createViewType(String name, String... aliases)
      Creates a ViewType with the given canonical name and optional aliases. The name and aliases must be unique : no two ViewTypes can share names or aliases. If any of the name or aliases is associated with another ViewType, an IllegalArgumentException will be thrown
      Parameters:
      name - the unique canonical name for the ViewType
      aliases - optional aliases for this ViewType
      Returns:
      the created ViewType
    • removeViewType

      public static boolean removeViewType(ViewType viewType)
      Removes a ViewType. Its name and all its aliases are free to be used in new ViewTypes
      Parameters:
      viewType -
      Returns:
    • getCanonicalName

      public String getCanonicalName()
      Gets the canonical name of this ViewType
      Returns:
      the canonical name
    • getAliases

      public Collection<String> getAliases()
      Gets the aliases for this ViewType
      Returns:
      this ViewType's aliases
    • valueOf

      public static ViewType valueOf(String value)
      Returns the ViewType associated with the value. Previously, a ViewType must have been created (and not subsequently deleted) with the name value or with an alias value. If no such ViewType exists, an IllegalArgumentException will be thrown.
      Parameters:
      value -
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object