javalover520 / jsyntaxpane

Automatically exported from code.google.com/p/jsyntaxpane
0 stars 0 forks source link

Support for long line wrapping #45

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Current version does not support line wrapping.  It will be good to have
that feature.
Need to fine tune the Line Number if that is supported.  May need to create
a new document or view instance to support that.

Original issue reported on code.google.com by ayman.al...@gmail.com on 23 Nov 2008 at 6:08

GoogleCodeExporter commented 8 years ago
It could be a nice feature for XML editor. I don't think that it can be a 
usefull
feature for c/c++/java/javascript editor (but if you want to implement it you 
must
think about a custom line spliting for lines without spaces).

Original comment by ser...@mail.ru on 24 Nov 2008 at 10:49

GoogleCodeExporter commented 8 years ago
"I don't think that it can be a usefull feature for c/c++/java/javascript 
editor (but
if you want to implement it you must think about a custom line spliting for 
lines
without spaces)."

Yes, but it can be extremely useful if you need printing support...

Original comment by cyberpyt...@gmail.com on 13 Mar 2009 at 3:36

GoogleCodeExporter commented 8 years ago
Hey guys I was looking forward to see the line wrapping feature included in
jsyntaxpane.... Or at least xml syntax line breaking:

For example if you have this: <xml><stuff>Text<stuff><morestuff
id="2">Text2</morestuff></xml>

the represented text should be like this:
<xml>
   <stuff>Text<stuff>
   <morestuff id="2">Text2</morestuff
</xml>

One question is why does DefaultSyntaxKit extend DefaultEditorKit and not
StyledEditorKit ? (since line wrapping is included in JTextPane which uses
StyledEditorKit)

Original comment by hol...@googlemail.com on 17 Apr 2009 at 9:38

GoogleCodeExporter commented 8 years ago
Well, I tried to use a build-in XML formatting without re-inventing another 
wheel. 
DOes that not work properly?  I do not use XML that much, so did very basic 
testing.

As for StyledEditorKit use; the history behind that is that I initially designed
JSyntaxPane as part of another project to highlight (and not edit) simple 
scripts in
a larger application.  The scripts were Groovy, other simple languages, and very
simple xml configs.  So the most efficient class is the DefaultSyntaxKit.  
Styles are
not needed as JSyntaxPAne maintains its own memory efficient list of Tokens.

But I think you strung a chord here.  Maybe for XML types, the better approach 
is to
use StyledEditorKit.  I'll try to have a look, but that may take a while, as I 
am
getting very busy with other commitments.

Any takers?

Original comment by ayman.al...@gmail.com on 18 Apr 2009 at 6:09

GoogleCodeExporter commented 8 years ago
Not sure about line numbers, but there IS actually a fairly easy way to make 
line
wrapping possible using jsyntaxpane. Unfortunately at present it requires
modification of the sources. 

However all that you need to do is to change inheritance of SyntaxView from 
PlainView
to WrappedPlainView. Than because of some naming inconsistancy you'll also need 
to
rename updateDamage to changedUpdate (the parameter list is the same in both 
methods
and seems to have exactly the same semantics). 

So the suggested solution would be to have two classes SyntaxView and
WrappedSyntaxView possibly sharing as much code as possible and than to add an 
option
to the DefaultSyntaxKit to produce instances of either one or the other.

btw, this is a truly great package!

Original comment by paradoks...@gmail.com on 6 Oct 2009 at 12:16