Class Image

    • Field Detail

      • PN_IMAGE_MAP

        public static final java.lang.String PN_IMAGE_MAP
        name of the image map property
        See Also:
        Constant Field Values
    • Constructor Detail

      • Image

        public Image​(Resource resource)
        Creates a new image based on the given resource. the image properties are considered to 'on' the given resource.
        Parameters:
        resource - resource of the image
        Throws:
        java.lang.IllegalArgumentException - if the given resource is not adaptable to node.
      • Image

        public Image​(Resource resource,
                     java.lang.String imageName)
        Creates a new image based on the given resource. the image properties are considered to 'on' the given resource unless imageName is specified. then the respective child resource holds the image properties.
        Parameters:
        resource - current resource
        imageName - name of the image resource
        Throws:
        java.lang.IllegalArgumentException - if the given resource is not adaptable to node.
    • Method Detail

      • setDropTargetId

        public void setDropTargetId​(java.lang.String id,
                                    java.lang.String classifier)
        Sets the drop target id for this image. the id is added as css class to the image attribute. and has the format: ""cq-dd-"{id}-{classifier}"
        Parameters:
        id - the drop target id as configured in edit config.
        classifier - optional classifier
      • setDropTargetId

        public void setDropTargetId​(java.lang.String id)
        Sets the drop target id for this image, using the name of the resources as path.
        Parameters:
        id - the drop target id as configured in edit config.
      • hasNoPlaceholder

        public boolean hasNoPlaceholder()
        Returns the placeholder flag.
        Returns:
        true if no placeholder for empty content should be drawn.
      • setNoPlaceholder

        public void setNoPlaceholder​(boolean noPlaceholder)
        Sets the placeholder flag.
        Parameters:
        noPlaceholder - if true no placeholder for empty content is used.
      • loadStyleData

        public void loadStyleData​(Style style)
        Loads several definitions from style.

        Currently, the minimum/maximum width and height are transferred from the given style.

        Parameters:
        style - style to load definitions from
      • getIconPath

        public java.lang.String getIconPath()
        Returns a path to an icon representing the file. Checks if the component of the resource provides an icon for the respective type.
        Overrides:
        getIconPath in class DownloadResource
        Returns:
        a path to an icon or null.