Skip to content

SamTh3D3v/Morphic-Widgets-FastTable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 

Repository files navigation

Morphic-Widgets-FastTable

FastTables are a couple of table implementations for Pharo. They were integrated into Pharo to provide better performance, unlimited data source size, and extensible tables that could handle complex element morphs very well. The following repository contains the core package used to implement FastTables. A couple of improvements and extensions were made to the original package to provide some better FT family widgets that could fulfill much bigger variety of applications. The improvements are highlighted below and a link to a demo video is also provided at the end.

Improvements:

  • Cell's selection:
    • keyboard and mouse selection.
    • selection shortcuts.
    • multicell selection.
|table|
table := FTTableMorph new.
"... table setup"
Message Description
table isCellSelectionMode returns true if cell's selection mode is enabled.
table enableCellSelectionMode enable cell selection mode.
table enableRowSelectionMode enable row selection mode.
table SelectedCellsIndex return the single selected cell.
table selectedCellsIndexes return a collection of selected cell indexes.
table selectCellIndex: aPoint select a single cell programmatically.
table selectCellIndexes: anArray select multiple cells is multiple selection mode is enabled.
table selectAllCells select all table's cells.
table deselectAllCells deselect all cells.
... ...
  • Row height changing

  • Column sorting

  • Cell widgets:

    • FTHeaderColumnCellMorph. An example of creating the header cells from the data source:
    headerColumn: column
      column id ifNil: [ ^ nil ]. 
      ^ FTHeaderColumnCellMorph new 
      	listCentering: #left;
      	column: column;
      	table:self table;
      	addMorph: (self getCellMorphContent:column);
      	yourself
    

    Note that the header's cells needs to know about which property it is bound to in order for the sorting other column related stuff to work. You need to pass the property #name to each column (one place to do it is when creating the data source in the cellColumn:row: message, like so column id = 'columnId' ifTrue: [ column property: #propertyName. ^ self propertyCellCreator: column row: rowIndex ]. )

    • FTCheckBoxCellMorph.
    FTCheckBoxCellMorph table: aFastTable content: aBoolean  allowEdit: aBoolean position: anArrayWithRowAndColumnIndexes
    
    • FTDateCellMorph.
    FTDateCellMorph  table: aFastTable  date: aDate allowEdit: aBoolean position: anArrayWithRowAndColumnIndexes
    
    • FTDropListCellMorph.
    FTDropListCellMorph table: aFastTable datasource: anArray selectedItem: anObject allowEdit: aBoolean position: anArrayWithRowAndColumnIndexes
    
    • FTLabelCellMorph.
    FTLabelCellMorph table: aFastTable content: aString allowEdit: aBoolean position: anArrayWithRowAndColumnIndexes
    
    • FTTextEditCellMorph.
    FTTextEditCellMorph table: aFastTable content: aString allowEdit: aBoolean position: anArrayWithRowAndColumnIndexes
    

Check out exampleTable7 for a full demo about the above cell widgets.

Remaining work

  • Build a data sheet widget, to create sheet objects easily. The widget is based on fast tables and on the FTTextEditCellMorph with some advanced functionalities. The spreadsheet has its own repository: https://github.com/SamTheDev/PharoSpreadSheet
  • Migritte implementation to map domain objects to cells.
  • Improve FasteTrees;

Demo video

Installation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •