Class HippoIcon

  • All Implemented Interfaces:
    Serializable, Iterable<org.apache.wicket.Component>, org.apache.wicket.event.IEventSink, org.apache.wicket.event.IEventSource, org.apache.wicket.feedback.IFeedbackContributor, org.apache.wicket.IConverterLocator, org.apache.wicket.IMetadataContext<Serializable,​org.apache.wicket.Component>, org.apache.wicket.IQueueRegion, org.apache.wicket.markup.html.IHeaderContributor, org.apache.wicket.request.component.IRequestableComponent, org.apache.wicket.util.IHierarchical<org.apache.wicket.Component>, org.apache.wicket.util.io.IClusterable

    public abstract class HippoIcon
    extends org.apache.wicket.markup.html.panel.Panel
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class org.apache.wicket.markup.html.panel.Panel

        PANEL
      • Fields inherited from class org.apache.wicket.Component

        ENABLE, FLAG_INITIALIZED, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING, RFLAG_CONTAINER_HAS_REMOVALS
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void addCssClass​(String cssClass)
      Adds a CSS class to the top-level element of the rendered icon.
      static HippoIcon copy​(HippoIcon icon, String newId)
      Renders a copy of the given icon, with a different Wicket ID.
      static HippoIcon fromResource​(String id, org.apache.wicket.request.resource.ResourceReference reference)
      Renders an icon stored in a resource.
      static HippoIcon fromResource​(String id, org.apache.wicket.request.resource.ResourceReference reference, int width, int height)
      Renders an icon stored in a resource, including 'width' and 'height' attributes.
      static HippoIcon fromResource​(String id, org.apache.wicket.request.resource.ResourceReference reference, IconSize size)
      Renders an icon stored in a resource, including 'width' and 'height' attributes.
      static HippoIcon fromResourceModel​(String id, org.apache.wicket.model.IModel<org.apache.wicket.request.resource.ResourceReference> model)
      Renders an icon stored in a resource which is referenced by a Wicket model.
      static HippoIcon fromSprite​(String id, org.apache.wicket.model.IModel<Icon> model)
      Renders a hippo icon of size IconSize.M via a reference to the icon sprite.
      static HippoIcon fromSprite​(String id, org.apache.wicket.model.IModel<Icon> model, IconSize size)
      Renders a hippo icon via a reference to the icon sprite.
      static HippoIcon fromSprite​(String id, Icon icon)
      Renders a hippo icon of size IconSize.M via a reference to the icon sprite.
      static HippoIcon fromSprite​(String id, Icon icon, IconSize size)
      Renders a hippo icon via a reference to the icon sprite.
      static HippoIcon fromStream​(String id, org.apache.wicket.model.IModel<JcrResourceStream> model)
      Renders and icon/image from a JcrResourceStream which is referenced by an IModel.
      static HippoIcon fromStream​(String id, org.apache.wicket.model.IModel<JcrResourceStream> model, int width, int height)
      Renders and icon/image from a JcrResourceStream which is referenced by an IModel.
      static HippoIcon inline​(String id, org.apache.wicket.model.IModel<CmsIcon> model)
      Renders a hippo icon of size IconSize.M as an inline SVG.
      static HippoIcon inline​(String id, CmsIcon icon)
      Renders a hippo icon of size IconSize.M as an inline SVG.
      • Methods inherited from class org.apache.wicket.markup.html.panel.Panel

        getRegionMarkup, newMarkupSourcingStrategy
      • Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer

        getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession
      • Methods inherited from class org.apache.wicket.MarkupContainer

        add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onComponentTagBody, onDetach, onInitialize, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, stream, streamChildren, toString, toString, visitChildren, visitChildren
      • Methods inherited from class org.apache.wicket.Component

        add, addStateChange, beforeRender, canCallListener, canCallListenerAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, createConverter, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMarkupTag, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnModelChanged, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isInitialized, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderPart, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlForListener, urlForListener, visitParents, visitParents, warn, wrap
      • Methods inherited from interface org.apache.wicket.IQueueRegion

        dequeue, newDequeueContext
    • Method Detail

      • fromSprite

        public static HippoIcon fromSprite​(String id,
                                           Icon icon)
        Renders a hippo icon of size IconSize.M via a reference to the icon sprite.
        Parameters:
        id - the Wicket id of the icon
        icon - the icon to render
        Returns:
        the icon component
      • fromSprite

        public static HippoIcon fromSprite​(String id,
                                           Icon icon,
                                           IconSize size)
        Renders a hippo icon via a reference to the icon sprite.
        Parameters:
        id - the Wicket id of the icon
        icon - the icon to render
        size - the size of the icon
        Returns:
        the icon component
      • fromSprite

        public static HippoIcon fromSprite​(String id,
                                           org.apache.wicket.model.IModel<Icon> model)
        Renders a hippo icon of size IconSize.M via a reference to the icon sprite.
        Parameters:
        id - the Wicket id of the icon
        model - the model containing the icon to render
        Returns:
        the icon component
      • fromSprite

        public static HippoIcon fromSprite​(String id,
                                           org.apache.wicket.model.IModel<Icon> model,
                                           IconSize size)
        Renders a hippo icon via a reference to the icon sprite.
        Parameters:
        id - the Wicket id of the icon
        model - the model containing the icon to render
        size - the size of the icon
        Returns:
        the icon component
      • inline

        public static HippoIcon inline​(String id,
                                       CmsIcon icon)
        Renders a hippo icon of size IconSize.M as an inline SVG. This makes it possible to, for example, style the individual shapes in the SVG via CSS.
        Parameters:
        id - the Wicket id of the icon
        icon - the icon to render
        Returns:
        the icon component
      • inline

        public static HippoIcon inline​(String id,
                                       org.apache.wicket.model.IModel<CmsIcon> model)
        Renders a hippo icon of size IconSize.M as an inline SVG. This makes it possible to, for example, style the individual shapes in the SVG via CSS.
        Parameters:
        id - the Wicket id of the icon
        model - the model containing the icon to render
        Returns:
        the icon component
      • fromResource

        public static HippoIcon fromResource​(String id,
                                             org.apache.wicket.request.resource.ResourceReference reference)
        Renders an icon stored in a resource. When the icon's file extension is '.svg', the icon is rendered as an inline SVG image.
        Parameters:
        id - the Wicket id of the icon
        reference - the resource to render
        Returns:
        the icon component
      • fromResource

        public static HippoIcon fromResource​(String id,
                                             org.apache.wicket.request.resource.ResourceReference reference,
                                             IconSize size)
        Renders an icon stored in a resource, including 'width' and 'height' attributes. When the icon's file extension is '.svg', the icon is rendered as an inline SVG image.
        Parameters:
        id - the Wicket id of the icon
        reference - the resource to render
        size - the size to use as width and height value, in pixels
        Returns:
        the icon component
      • fromResource

        public static HippoIcon fromResource​(String id,
                                             org.apache.wicket.request.resource.ResourceReference reference,
                                             int width,
                                             int height)
        Renders an icon stored in a resource, including 'width' and 'height' attributes. When the icon's file extension is '.svg', the icon is rendered as an inline SVG image.
        Parameters:
        id - the Wicket id of the icon
        reference - the resource to render
        width - the width of the icon in pixels
        height - the height of the icon in pixels
        Returns:
        the icon component
      • fromResourceModel

        public static HippoIcon fromResourceModel​(String id,
                                                  org.apache.wicket.model.IModel<org.apache.wicket.request.resource.ResourceReference> model)
        Renders an icon stored in a resource which is referenced by a Wicket model. When the icon's file extension is '.svg', the icon is rendered as an inline SVG image.
        Parameters:
        id - the Wicket id of the icon
        model - the model containing the resource to render
        Returns:
        the icon component
      • fromStream

        public static HippoIcon fromStream​(String id,
                                           org.apache.wicket.model.IModel<JcrResourceStream> model,
                                           int width,
                                           int height)
        Renders and icon/image from a JcrResourceStream which is referenced by an IModel. Delegates rendering to the JcrImage which simply outputs an <img /> element.
        Parameters:
        id - the Wicket id of the icon
        model - the model containing the icon stream
        width - the width of the icon in pixels
        height - the height of the icon in pixels
        Returns:
        the icon component
      • fromStream

        public static HippoIcon fromStream​(String id,
                                           org.apache.wicket.model.IModel<JcrResourceStream> model)
        Renders and icon/image from a JcrResourceStream which is referenced by an IModel. Delegates rendering to the JcrImage which simply outputs an <img /> element.
        Parameters:
        id - the Wicket id of the icon
        model - the model containing the icon stream
        Returns:
        the icon component
      • copy

        public static HippoIcon copy​(HippoIcon icon,
                                     String newId)
        Renders a copy of the given icon, with a different Wicket ID.
        Parameters:
        icon - the icon to render
        newId - the new Wicket ID
        Returns:
        a copy of the given icon
      • addCssClass

        public abstract void addCssClass​(String cssClass)
        Adds a CSS class to the top-level element of the rendered icon.
        Parameters:
        cssClass - the CSS class to add.