Class AbstractCRUDTable.Column<C>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String header  
      protected java.lang.Class<C> type  
    • Constructor Summary

      Constructors 
      Constructor Description
      Column​(java.lang.Class<C> type, java.lang.String headerKey)  
      Column​(java.lang.Class<C> type, java.lang.String header, boolean doKeyLookup)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getHeader()  
      java.lang.Class<C> getType()  
      abstract C getValue​(T item)
      The main function of the Column class: to retrieve the proper value from the object
      int getWidth()  
      boolean isEditable()
      Override this if you want your column to be editable
      boolean isLoadOptions()
      If this column should be editable by a dropdown, override this to return true and also override loadOptions()
      boolean isVisible()
      If you change this, you'll need to call updateColumns()
      java.util.List<C> loadOptions()
      If you've overridden isLoadOptions(), then you also need to override this to proved the options.
      void onCellEdited​(T item, C value)
      If your column is editable, implement this.
      void setHeader​(java.lang.String header)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • header

        protected java.lang.String header
      • type

        protected java.lang.Class<C> type
    • Constructor Detail

      • Column

        public Column​(java.lang.Class<C> type,
                      java.lang.String headerKey)
        Parameters:
        type - The type of the column
        headerKey - A resource bundle key for the column header
      • Column

        public Column​(java.lang.Class<C> type,
                      java.lang.String header,
                      boolean doKeyLookup)
    • Method Detail

      • getHeader

        public java.lang.String getHeader()
      • getWidth

        public int getWidth()
      • setHeader

        public void setHeader​(java.lang.String header)
      • getValue

        public abstract C getValue​(T item)
        The main function of the Column class: to retrieve the proper value from the object
      • getType

        public java.lang.Class<C> getType()
      • isEditable

        public boolean isEditable()
        Override this if you want your column to be editable
      • onCellEdited

        public void onCellEdited​(T item,
                                 C value)
        If your column is editable, implement this.
      • isLoadOptions

        public boolean isLoadOptions()
        If this column should be editable by a dropdown, override this to return true and also override loadOptions()
      • loadOptions

        public java.util.List<C> loadOptions()
                                      throws java.lang.Exception
        If you've overridden isLoadOptions(), then you also need to override this to proved the options. will be run on a background thread.
        Throws:
        java.lang.Exception
      • isVisible

        public boolean isVisible()
        If you change this, you'll need to call updateColumns()