I'm beginning to use PaperClips and I find it useful.
However, I find it difficult to track where is the problem when the layout can't be processed. An exception is thrown but is only catched by SWT, and we don't get any stack trace to find where is the problem.
So I think the PaperClips.print method should throw an exception with a useful stack trace, don't you?
--
Patrick
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem is that under the current design there is too much lost information about the failed layout. This is due to PrintIterator's behavior of returning null as a magic value indicating that nothing could be laid out in the available space. Ideally, when layout fails you want to see the tree of content, with information about each PrintIterator's cursor. However by returning null from PrintIterator.next() we have lost that information. I don't see a way to fix this without breaking backward compatibility.
That is not to say that I don't plan on fixing this--just not yet. If anybody has a bright idea of how this could be fixed without breaking backward compatibility, I'm open to alternatives. Please fill out a feature request in the tracker and maybe we can come up with something.
Matthew
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I'm beginning to use PaperClips and I find it useful.
However, I find it difficult to track where is the problem when the layout can't be processed. An exception is thrown but is only catched by SWT, and we don't get any stack trace to find where is the problem.
So I think the PaperClips.print method should throw an exception with a useful stack trace, don't you?
--
Patrick
The problem is that under the current design there is too much lost information about the failed layout. This is due to PrintIterator's behavior of returning null as a magic value indicating that nothing could be laid out in the available space. Ideally, when layout fails you want to see the tree of content, with information about each PrintIterator's cursor. However by returning null from PrintIterator.next() we have lost that information. I don't see a way to fix this without breaking backward compatibility.
That is not to say that I don't plan on fixing this--just not yet. If anybody has a bright idea of how this could be fixed without breaking backward compatibility, I'm open to alternatives. Please fill out a feature request in the tracker and maybe we can come up with something.
Matthew