Class Button

    • Field Detail

      • DEFAULT_VERTICAL_ALIGNMENT

        private static final VerticalAlignment DEFAULT_VERTICAL_ALIGNMENT
      • DEFAULT_TEXT_ALIGNMENT

        private static final TextAlignment DEFAULT_TEXT_ALIGNMENT
      • DEFAULT_BACKGROUND_COLOR

        private static final Color DEFAULT_BACKGROUND_COLOR
      • singleLine

        private boolean singleLine
        Indicates if it's the button with only single line caption.
    • Constructor Detail

      • Button

        public Button​(java.lang.String id)
        Creates a new Button instance.
        Parameters:
        id - the id
    • Method Detail

      • add

        public Button add​(IBlockElement element)
        Adds any block element to the div's contents.
        Parameters:
        element - a BlockElement
        Returns:
        this Element
      • add

        public Button add​(Image element)
        Adds an image to the div's contents.
        Parameters:
        element - an Image
        Returns:
        this Element
      • isSingleLine

        public boolean isSingleLine()
        Indicates if this element represents an input with type button in html.
        Returns:
        true if it's the button with only one line caption.
      • setSingleLineValue

        public Button setSingleLineValue​(java.lang.String value)
        Sets passed string value to the single line button caption. Value will be clipped if it is not fit into single line. For multiple line value use setValue(String). Note that when adding other elements to the button after this method is called, this added value can be multiline.
        Parameters:
        value - string value to be set as caption.
        Returns:
        this same Button instance.
      • setValue

        public IFormField setValue​(java.lang.String value)
        Adds passed string value as paragraph to the button. Value can be multiline if it is not fit into single line. For single line value use setSingleLineValue(String). Note that the new value will replace all already added elements.
        Specified by:
        setValue in interface IFormField
        Overrides:
        setValue in class FormField<Button>
        Parameters:
        value - string value to be added into button.
        Returns:
        this same IFormField instance
      • getDefaultProperty

        public <T1> T1 getDefaultProperty​(int property)
        Gets the default property from this entity.
        Specified by:
        getDefaultProperty in interface IPropertyContainer
        Overrides:
        getDefaultProperty in class FormField<Button>
        Type Parameters:
        T1 - the return type associated with the property
        Parameters:
        property - the property to be retrieved
        Returns:
        the default property value. If the default property is not defined, null will be returned