Closed GoogleCodeExporter closed 9 years ago
attached patch to get rid of NPE, now it complains:
31.03.2010 18:03:05 jsyntaxpane.components.LineNumbersRuler install
WARNING: JEditorPane is not enclosed in JScrollPane, no LineNumbers will be
displayed
every time I open any JEditorPane component.
Original comment by Penkov.V...@gmail.com
on 31 Mar 2010 at 2:08
Attachments:
That was opened before. You need to create the editor inside a JScrollPane.
Otherwise
Line Numbering will not work properly.
Let me know if you still need help, or you think that patch is needed.
Original comment by ayman.al...@gmail.com
on 1 Apr 2010 at 4:53
I do not want to create any JEditorPanes inside JScrollPane when I use
JXErrorPane.
Instead I want to just use JXErrorPane which contains JEditorPane. I guess,
DefaultSyntaxKit.initKit(); installs JSyntaxPane support globally to any
JEditopPane,
even if it doesn't need it.
Anyway, you still are able to get NPE without this patch (for example you
forget to
use JScrollPane, but it is not the reason to produce NPE).
Original comment by Penkov.V...@gmail.com
on 1 Apr 2010 at 5:35
also, you'll get NPE when using forms, designed by Jetbrains IDEA, 'cause it
generates
static code
Original comment by Penkov.V...@gmail.com
on 1 Apr 2010 at 5:37
[deleted comment]
[deleted comment]
Please reopen this issue. The problem can be reproduced in the 0.9.6 branch.
The issue here is that JXErrorPane in SwingX (and, presumably, several other
third-party UI libraries) uses a JEditorPane that is not contained in a
JScrollPane.
I suggest two things to fix this issue:
1) Remove the call to DefaultSyntaxKit.initKit() from DefaultSyntaxKit's static
initializer block. Changing application behavior as a direct result of loading
a utility class is the sort of thing you'd expect from malware, not a
legitimate library.
2) Don't require a JEditorPane to be contained within a JScrollPane. An
application developer using a third-party UI library doesn't have control over
whether or not the library will comply with this requirement.
Original comment by sworisbr...@gmail.com
on 18 Nov 2010 at 5:51
Attached is a patch for the 0.9.6 branch to address point 2 of my previous
comment.
A suggestion for point 1 of my previous comment: It seems like the motivation
for registering the syntax kit automatically is to make things easier for
developers who wish to use jsyntaxpane. It seems like a better solution than
globally altering the behavior of JEditorPane would be to provide a subclass of
JEditorPane with the syntax kit applied to it. A developer could then use this
UI component when they want the features provided by jsyntaxpane, without
affecting the use of JEditorPane in third-party libraries.
Original comment by sworisbr...@gmail.com
on 18 Nov 2010 at 6:10
Attachments:
Original issue reported on code.google.com by
Penkov.V...@gmail.com
on 31 Mar 2010 at 1:40