Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fill Handle] In combination with freeze the fill handle is not working #113

Closed
fipro78 opened this issue Aug 15, 2024 · 1 comment
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@fipro78
Copy link
Contributor

fipro78 commented Aug 15, 2024

When you try to enable the fill handle in a NatTable that has also the freeze feature enabled, the fill handle does not work in the frozen areas.

The reason is that the FillHandleLayerPainter stores the bounds of the fill handle internally, so they can be inspected in other places. In the freeze composition the FillHandleLayerPainter is executed for every region, so the fill handle bounds are only available for the non-frozen area.

The combination of freeze and fill handle should be possible in every case.

@fipro78 fipro78 self-assigned this Aug 15, 2024
@fipro78 fipro78 added the bug Something isn't working label Aug 15, 2024
@fipro78 fipro78 added this to the 2.5.0 milestone Aug 15, 2024
fipro78 added a commit that referenced this issue Aug 15, 2024
@fipro78
Copy link
Contributor Author

fipro78 commented Aug 15, 2024

To support the combination of the fill handle and the freeze functionality, the following changes needed to be introduced:

  • Added a new interface FillHandleBoundsProvider
  • Added a new helper class FillHandleLayerPainterHelper to retrieve fill handle configurations
  • Extended CompositeLayer#CompositeLayerPainter and added the method processLayerPainterInformation(ILayerPainterpainter) which is called after each sub layer painter
  • Added a new class FillHandleCompositeFreezeLayerPainter that makes use of the new processLayerPainterInformation() method to store the fill handle bounds from all 4 freeze regions once, and to paint the fill handle over the freeze border
  • Added new constructors inDefaultFormulaConfiguration and FillHandleConfiguration that additionally takes a FillHandleBoundsProvider that should be used with the matcher

To make the combination of freeze and fill handle work correctly, the FillHandleCompositeFreezeLayerPainter needs to be used and configured:

this.compositeFreezeLayerPainter = new FillHandleCompositeFreezeLayerPainter(this.compositeFreezeLayer);
this.compositeFreezeLayer.setLayerPainter(this.compositeFreezeLayerPainter);

... 

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

natTable.addConfiguration(
        new DefaultFormulaConfiguration(
                bodyLayer.getFormulaDataProvider(),
                bodyLayer.getSelectionLayer(),
                natTable.getInternalCellClipboard(),
                bodyLayer.getCompositeFreezeLayerPainter()));

There is also a new example _819_FormulaDataWithFreezeExample that shows the combination of formula support, fill handle, freeze and additionally the export to xlsx and showing the JFace ProgressDialog on export.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant