Class Cursor

  • All Implemented Interfaces:
    CssProperty, StateChangeInformer<Bean>, java.io.Serializable, java.lang.Cloneable


    public class Cursor
    extends AbstractCssProperty<Cursor>
    implements StateChangeInformer<Bean>
    cursor : alias | all-scroll | auto | cell | context-menu | col-resize | copy | crosshair | default | e-resize | ew-resize | grab | grabbing | help | move | n-resize | ne-resize | nesw-resize | ns-resize | nw-resize | nwse-resize | no-drop | none | not-allowed | pointer | progress | row-resize | s-resize | se-resize | sw-resize | text | URL | vertical-text | w-resize | wait | zoom-in | zoom-out | initial | inherit;
    Since:
    1.0.0
    See Also:
    Serialized Form
    • Constructor Detail

      • Cursor

        public Cursor​()
      • Cursor

        public Cursor​(java.lang.String cssValue)
        Parameters:
        cssValue - the cssValue to set.
        eg:- Cursor.ALIAS
      • Cursor

        public Cursor​(Cursor cursor)
        Parameters:
        cursor - the Cursor object from which the cssName and cssValue to set.
      • Cursor

        public Cursor​(java.lang.String cursorType,
                      java.lang.String... cursorUrls)
        This constructor is for CSS 2.1 cursor syntax.
        sample code :- new Cursor("auto", "Test.gif", "TestImage.png") creates cursor: url("Test.gif"), url("TestImage.png"), auto; . For css3 syntax method please use new Cursor(String cursorType, UrlCss3Value... urlCss3Values) or setCursorUrls(String cursorType, UrlCss3Value... urlCss3Values) method.
        Parameters:
        cursorType - This will be the last value, eg:- auto in cursor: url(Test.gif), url(TestImage.png), auto;. This value can not be null. And, it will throw NullValueException for null value.
        cursorUrls - an array of cursor urls, eg:- cursor.setCursorUrls("auto", "Test.gif", "TestImage.png") and the generated css will be cursor: url("Test.gif"), url("TestImage.png"), auto;
        Since:
        1.0.0
      • Cursor

        public Cursor​(java.lang.String cursorType,
                      UrlCss3Value... urlCss3Values)
        Parameters:
        cursorType - the any of the inbuilt cursor types. It will come as the last one in the css value.
        urlCss3Values - an array of UrlCss3Value objects.
    • Method Detail

      • getCssName

        public java.lang.String getCssName​()
        Specified by:
        getCssName in interface CssProperty
        Returns:
        the name portion in style, eg align-content for style align-content: center.
      • getCssValue

        public java.lang.String getCssValue​()
        Specified by:
        getCssValue in interface CssProperty
        Returns:
        the value portion in style, eg center for style align-content: center.
      • toString

        public java.lang.String toString​()
        Overrides:
        toString in class java.lang.Object
      • setCssValue

        public Cursor setCssValue​(java.lang.String cssValue)
        Specified by:
        setCssValue in class AbstractCssProperty<Cursor>
        Parameters:
        cssValue - null is considered as an invalid value.
        Returns:
        the current object.
        Since:
        1.0.0
      • setCursorType

        public void setCursorType​(java.lang.String cursorType)
        Parameters:
        cursorType - it should be one of the following Cursor.ALL_SCROLL , Cursor.AUTO , Cursor.CELL , Cursor.CONTEXT_MENU , Cursor.COL_RESIZE , Cursor.COPY , Cursor.CROSSHAIR , Cursor.DEFAULT , Cursor.E_RESIZE , Cursor.EW_RESIZE , Cursor.GRAB , Cursor.GRABBING , Cursor.HELP , Cursor.MOVE , Cursor.N_RESIZE , Cursor.NE_RESIZE , Cursor.NESW_RESIZE , Cursor.NS_RESIZE , Cursor.NW_RESIZE , Cursor.NWSE_RESIZE , Cursor.NO_DROP , Cursor.NONE , Cursor.NOT_ALLOWED , Cursor.POINTER , Cursor.PROGRESS , Cursor.ROW_RESIZE , Cursor.S_RESIZE , Cursor.SE_RESIZE , Cursor.SW_RESIZE , Cursor.TEXT , Cursor.URL , Cursor.VERTICAL_TEXT , Cursor.W_RESIZE , Cursor.WAIT , Cursor.ZOOM_IN , Cursor.ZOOM_OUT , Cursor.INITIAL or Cursor.INHERIT.
        Since:
        1.0.0
      • getCursorType

        public java.lang.String getCursorType​()
        Returns:
        Since:
        1.0.0
      • getCursorUrls

        public java.lang.String[] getCursorUrls​()
        Returns:
        the cursor urls as an array set by Cursor#setCursorUrls(String, String...) method. The returned array is just a copy of the cursor urls, modifying it will not affect the Cursor object.
        Since:
        1.0.0
      • setCursorUrls

        public void setCursorUrls​(java.lang.String cursorType,
                                  java.lang.String... cursorUrls)
        This method is for CSS 2.1 cursor syntax.
        sample code :- cursor.setCursorUrls("auto", "Test.gif", "TestImage.png") creates cursor: url("Test.gif"), url("TestImage.png"), auto;. For css3 syntax method please use setCursorUrls(String cursorType, UrlCss3Value... urlCss3Values) method.
        Parameters:
        cursorType - This will be the last value, eg:- auto in cursor: url(Test.gif), url(TestImage.png), auto;. This value can not be null. And, it will throw NullValueException for null value.
        cursorUrls - an array of cursor urls, eg:- cursor.setCursorUrls("auto", "Test.gif", "TestImage.png") and the generated css will be cursor: url("Test.gif"), url("TestImage.png"), auto;
        Since:
        1.0.0
      • setCursorUrls

        public void setCursorUrls​(java.lang.String cursorType,
                                  UrlCss3Value... urlCss3Values)
        Parameters:
        cursorType - * the any of the inbuilt cursor types. It will come as the last one in the css value.
        urlCss3Values - urlCss3Values an array of UrlCss3Value objects.
        Since:
        1.0.0
      • getUrlCss3Values

        public java.util.List<UrlCss3Value> getUrlCss3Values​()
        Returns:
        a new object of unmodifiable List<UrlCss3Value> whenever this method is called. Or null.
        Since:
        1.0.0
      • getAllCursorTypes

        public static java.lang.String[] getAllCursorTypes​()
        Returns:
        all inbuilt cursorTypes eg:- auto, default, grab etc..
        Since:
        1.0.0
      • getAllCursortypes

        protected static java.util.List<java.lang.String> getAllCursortypes​()
        To introduce additional cursor types, add those to this list.
        Returns:
        the allCursortypes
        Since:
        1.0.0