Class SpreadsheetCellType<T>

    • Constructor Detail

      • SpreadsheetCellType

        public SpreadsheetCellType()
        Default constructor.
      • SpreadsheetCellType

        public SpreadsheetCellType​(StringConverter<T> converter)
        Constructor with the StringConverter directly provided.
        Parameters:
        converter - The converter to use
    • Method Detail

      • createEditor

        public abstract SpreadsheetCellEditor createEditor​(SpreadsheetView view)
        Creates an editor for this type of cells.
        Parameters:
        view - the spreadsheet that will own this editor
        Returns:
        the editor instance
      • toString

        public String toString​(T object,
                               String format)
        Return a string representation of the given item for the SpreadsheetView to display using the inner converter and the specified format.
        Parameters:
        object -
        format -
        Returns:
        a string representation of the given item.
      • toString

        public abstract String toString​(T object)
        Return a string representation of the given item for the SpreadsheetView to display using the inner converter.
        Parameters:
        object -
        Returns:
        a string representation of the given item.
      • match

        public boolean match​(Object value)
        Verify that the upcoming value can be set to the current cell. This is the first level of verification to prevent affecting a text to a double or a double to a date. For closer verification, use isError(Object).
        Parameters:
        value - the value to test
        Returns:
        true if it matches.
      • match

        public abstract boolean match​(Object value,
                                      Object... options)
        Verify that the upcoming value can be set to the current cell.This is the first level of verification to prevent affecting a text to a double or a double to a date. For closer verification, use isError(Object).
        Parameters:
        value - the value to test
        options - the options given by SpreadsheetCell.getOptionsForEditor()
        Returns:
        true if it matches.
      • isError

        public boolean isError​(Object value)
        Returns true if the value is an error regarding the specification of its type.
        Parameters:
        value -
        Returns:
        true if the value is an error.
      • convertValue

        public abstract T convertValue​(Object value)
        This method will be called when a commit is happening.
        This method will try to convert the value, be sure to call match(Object) before to see if this method will succeed.
        Parameters:
        value -
        Returns:
        null if not valid or the correct value otherwise.