Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 484880

Summary: Add fill drag handle to support autofill actions
Product: [Technology] NatTable Reporter: Dirk Fauth <dirk.fauth>
Component: CoreAssignee: Dirk Fauth <dirk.fauth>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 1.3.0   
Target Milestone: 1.4.0   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/63261
https://git.eclipse.org/c/nattable/org.eclipse.nebula.widgets.nattable.git/commit/?id=0d4c91b45b272f328ecbe075b2775b4b8eb92b39
Whiteboard:
Bug Depends on: 486276    
Bug Blocks:    

Description Dirk Fauth CLA 2015-12-24 08:16:37 EST
In well-known spreadsheet applications a functionality is supported to autofill cells based on the current selection.

NatTable should support the same feature.
Comment 1 Eclipse Genie CLA 2015-12-24 08:18:22 EST
New Gerrit change created: https://git.eclipse.org/r/63261
Comment 2 Dirk Fauth CLA 2015-12-24 08:45:05 EST
Added several modifications to support the fill drag handle. 

Mainly these modifications are:
- FillHandleLayerPainter to render the fill drag handle
- FillHandleEventMatcher to be able to perform actions when moving the mouse over the fill drag handle
- FillHandleDragMode to perform actions on dragging the fill drag handle
- FillHandlePasteCommand and FillHandlePasteCommandHandler to perform a paste action on releasing the fill drag handle

Additionally there are modifications in the SelectionLayer, the painters, the labels etc. to integrate the fill drag handle nicely into the existing architecture.

It can simply be enabled by adding the default configuration to a NatTable instance.

natTable.addConfiguration(new FillHandleConfiguration(bodyLayer.getSelectionLayer()));

The paste actions will only work if the cells are editable.

The appearance and functionality of the fill drag handle can be configured via ConfigAttributes

FillHandleConfigAttributes.FILL_HANDLE_BORDER_STYLE - the border style of the fill drag handle
FillHandleConfigAttributes.FILL_HANDLE_COLOR - the color of the fill drag handle
FillHandleConfigAttributes.FILL_HANDLE_REGION_BORDER_STYLE - the border style of the line that is rendered to visualize the fill handle region
FillHandleConfigAttributes.INCREMENT_DATE_FIELD - the date field that should be incremented for date fields
FillHandleConfigAttributes.ALLOWED_FILL_DIRECTION - the direction in which a fill drag is allowed
Comment 4 Dirk Fauth CLA 2015-12-24 08:46:16 EST
Fixed with applied Gerrit patch
Comment 5 Dirk Fauth CLA 2016-06-01 17:12:11 EDT
Released with 1.4.0