PFGrid toolkit and widgets for SWT Eclipse

...Empower your UI with our Winforms and SWT controls!

SWT Grid Filter-Row

A filter-row can be shown above the grid to filter values of the grid's columns. The filter-row can contain cell-editors or cells for direct-editing - like a tri-state CheckBox:

SWT grid with filterrow

In the example project the filter-row is used to query data of a SQLite-database which is included in the eclipse-plugin. This is the code to configure the PFGrid.SWT for this feature:

table.setAllowEdit(true);
table.setMultiSelect(false);
table.setSelectionType(SelectionType.Cell);
table.setEditorMouseOpenType(EditorMouseOpenType.SingleClick);
table.setEditorOpenOnCellFocus(true);
table.setShowFilterRow(true);
        

Cell-Validators for the grid

For each cell a cell-validator can be used to display an error-icon for input which is not valid (see image above). A cell-validator can be added like this (implement CellValidator):

table.setCellValidator(this);

@Override
public void validate(CellValidationEvent e) {
	TreeListColumn column = e.getCell().getParentColumn();
	if (column == colDepartment) {

		e.isValid = !e.getCell().isEmpty();
		e.errorText = "Please insert the name of a department!";

	} else if (column == colId || column == colZip) {

		e.isValid = ConvertUtil.isInteger(e.getCell().getText());
		e.errorText = "Please insert a numeric value (integer)!";
	}
}