feat: support freeze pane via @FreezePane or register WriteHandler on write#916
Open
bengbengbalabalabeng wants to merge 1 commit into
Open
feat: support freeze pane via @FreezePane or register WriteHandler on write#916bengbengbalabalabeng wants to merge 1 commit into
bengbengbalabalabeng wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds Excel sheet freeze pane support to Fesod’s write pipeline, enabling freeze panes to be configured either declaratively via a new @FreezePane class annotation or imperatively via a new SheetFreezePaneStrategy write handler (Closes #913).
Changes:
- Introduces
@FreezePaneplusSheetFreezePanePropertyto model freeze pane configuration derived from the head class. - Adds
SheetFreezePaneStrategy(aSheetWriteHandler) and wires it into annotation-driven handler initialization. - Adds unit/integration tests to validate property building and end-to-end freeze pane behavior for both
.xlsxand.xls.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| fesod-sheet/src/main/java/org/apache/fesod/sheet/annotation/write/style/FreezePane.java | New annotation to declare freeze pane configuration on the head model class. |
| fesod-sheet/src/main/java/org/apache/fesod/sheet/metadata/property/SheetFreezePaneProperty.java | New property object to map @FreezePane values into a runtime configuration. |
| fesod-sheet/src/main/java/org/apache/fesod/sheet/write/style/SheetFreezePaneStrategy.java | New SheetWriteHandler that applies Sheet#createFreezePane(...) after sheet creation. |
| fesod-sheet/src/main/java/org/apache/fesod/sheet/write/property/ExcelWriteHeadProperty.java | Captures @FreezePane into ExcelWriteHeadProperty for downstream handler setup. |
| fesod-sheet/src/main/java/org/apache/fesod/sheet/write/metadata/holder/AbstractWriteHolder.java | Registers SheetFreezePaneStrategy when @FreezePane is present on the head class. |
| fesod-sheet/src/test/java/org/apache/fesod/sheet/metadata/property/SheetFreezePanePropertyTest.java | Tests annotation-to-property mapping and defaulting behavior. |
| fesod-sheet/src/test/java/org/apache/fesod/sheet/write/style/SheetFreezePaneStrategyTest.java | Tests strategy validation and that it delegates to Sheet#createFreezePane(...). |
| fesod-sheet/src/test/java/org/apache/fesod/sheet/write/freezepane/SheetFreezePaneTest.java | End-to-end tests that confirm freeze panes are present/absent in generated workbooks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| property.setLeftmostColumn(3); | ||
| property.setTopRow(4); | ||
|
|
||
| Assertions.assertDoesNotThrow(() -> new SheetFreezePaneStrategy(property)); |
Comment on lines
+87
to
+95
| @Test | ||
| void afterSheetCreate_withZeroValues() { | ||
| SheetFreezePaneStrategy strategy = new SheetFreezePaneStrategy(0, 0, 0, 0); | ||
|
|
||
| WriteWorkbookHolder workbookHolder = Mockito.mock(WriteWorkbookHolder.class); | ||
| WriteSheetHolder sheetHolder = Mockito.mock(WriteSheetHolder.class); | ||
| Sheet sheet = Mockito.mock(Sheet.class); | ||
| org.mockito.Mockito.when(sheetHolder.getSheet()).thenReturn(sheet); | ||
|
|
Comment on lines
+39
to
+44
| int colSplit(); | ||
|
|
||
| /** | ||
| * Vertical position of split. | ||
| */ | ||
| int rowSplit(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of the pull request
Closed: #913
What's changed?
Added excel sheet freeze pane support.
Use Case:
Checklist