Class SimpleUiSupport<T extends ContentEntityObject>

    • Constructor Detail

      • SimpleUiSupport

        public SimpleUiSupport​(com.atlassian.plugin.webresource.WebResourceUrlProvider webResourceUrlProvider,
                               String iconPath,
                               String iconCssClass,
                               String contentCssClass,
                               String i18NKey)
    • Method Detail

      • getIconFilePath

        public String getIconFilePath​(T content,
                                      int size)
        Description copied from interface: ContentUiSupport
        Get the URL path to the icon for the gtiven piece of content, without prepending context or web static hashes. This method is usedful in conjunction with the DataSourceFactory, which does not handle context and web static hashes in the url.
        Specified by:
        getIconFilePath in interface ContentUiSupport<T extends ContentEntityObject>
        Parameters:
        content - the content to find an icon for
        size - the size. Currently, only 16 is supported, and thus this parameter is ignored.
        Returns:
        a URL for the icon.
      • getIconPath

        public String getIconPath​(T content,
                                  int size)
        Description copied from interface: ContentUiSupport
        Get the URL path to the icon for the given piece of content. Paths are relative to the site root, and will already have the context path prepended to them.

        All icons are square. If no icon is available at the requested size, the implementation should use the following priority to determine what to return:

        1. The smallest icon with width larger than the requested size
        2. If no icon is larger than the requested size, return the largest icon available

        In general you can only assume a 16x16 icon will be available, but this may change in the future.

        Specified by:
        getIconPath in interface ContentUiSupport<T extends ContentEntityObject>
        Parameters:
        content - the content to find an icon for
        size - the intended width/height at which the icon will be displayed in pixels
        Returns:
        the path to the icon that best suits the requested size
      • getIconCssClass

        public String getIconCssClass​(SearchResult result)
        Description copied from interface: ContentUiSupport
        Get the CSS class that can be applied to add an icon to some inline element describing the given result.
        Specified by:
        getIconCssClass in interface ContentUiSupport<T extends ContentEntityObject>
        Parameters:
        result - the search result to find an icon for
        Returns:
        the CSS class to add that icon to the element
      • getIconCssClass

        public String getIconCssClass​(T content)
        Description copied from interface: ContentUiSupport
        Get the CSS class that can be applied to add an icon to some inline element describing the given content.
        Specified by:
        getIconCssClass in interface ContentUiSupport<T extends ContentEntityObject>
        Parameters:
        content - the content to find an icon for
        Returns:
        the CSS class to add that icon to the element
      • getContentCssClass

        public String getContentCssClass​(String contentType,
                                         String contentPluginKey)
        Description copied from interface: ContentUiSupport
        Get the CSS class that can be applied to add an icon to some inline element describing the given content. The existence of both IconCssClass (used in the velocity macros) and ContentCssClass (used by the ContentTypesDisplayMapper) is redundant and confusing, and should be reconciled somehow.
        Specified by:
        getContentCssClass in interface ContentUiSupport<T extends ContentEntityObject>
        Parameters:
        contentType - the content to find an icon for
        contentPluginKey - the plugin key for the content it it is a ContentType plugin
        Returns:
        the CSS class to add that icon to the element
      • getContentCssClass

        public String getContentCssClass​(T content)
        Description copied from interface: ContentUiSupport
        Get the CSS class that can be applied to some inline element describing the given content
        Specified by:
        getContentCssClass in interface ContentUiSupport<T extends ContentEntityObject>
        Parameters:
        content - the content to find the css for
        Returns:
        the CSS class for this content
      • getUnknown

        public static ContentUiSupport getUnknown​(com.atlassian.plugin.webresource.WebResourceUrlProvider webResourceUrlProvider)