Re: Plugin Development

"[email protected]" <[email protected]> Wed, 25 Oct 2017 11:42:50 +0200
Newsgroups gmane.comp.java.netbeans.devel
Message-ID <[email protected]>
--Apple-Mail=_E3538D9B-B9BD-4E6A-B6C7-6B94FF96C854
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

That should be [email protected].

Send an empty mail to [email protected] to =
subscribe.

Details: =
https://cwiki.apache.org/confluence/display/NETBEANS/How+to+Participate


Geertjan Wielenga | Principal Product Manager
Phone: +31620320056 |=20
Oracle Developer Tools

ORACLE Netherlands | Hertogswetering 163-167 | 3543 AS Utrecht | =
Netherlands


Oracle is committed to developing practices and products that help =
protect the environment

> On 25 Oct 2017, at 11:40, Emilian Bold <[email protected]> wrote:
>=20
> It's an one-liner but I can't give you an example now since I don't
> remember the exact utils classes.
>=20
> See
> * http://wiki.netbeans.org/DevFaqGetOpenEditorWindows
> * =
http://bits.netbeans.org/8.0/javadoc/org-openide-text/org/openide/text/NbD=
ocument.html#findLineNumber(javax.swing.text.StyledDocument,
> int)
> * JEditorPane javadoc for getting the visible rectangle / lines
>=20
> PS: Please use [email protected] , this mailing list will be =
closed soon.
>=20
>=20
> --emi
>=20
>=20
> On Tue, Oct 24, 2017 at 9:32 AM, DosBox <[email protected]> wrote:
>> Hi all,
>>=20
>> I am trying to create a NetBeans plugin and I need to somehow find =
out the range of lines currently visible in the editor.
>>=20
>> Example: let say a opened file has 100 lines, editor displays 20 =
lines, scroll position is in the middle. I would like to find such =
functions that used like this:
>>=20
>>=20
>> Code:
>> int start =3D XXX.getVisibleLinesStart();
>> int end   =3D XXX.getVisibleLinesEnd();
>>=20
>>=20
>>=20
>> should return:
>>=20
>>=20
>> Code:
>> start =3D 40;
>> end   =3D 60;
>>=20
>>=20
>>=20
>> Is this possible to achieve with NetBeans API? Which component holds =
the information about document view? Where to look?
>> I found out that it does not have to be lines, the first and last =
visible character would do.
>>=20
>>=20
>>=20
>>=20


--Apple-Mail=_E3538D9B-B9BD-4E6A-B6C7-6B94FF96C854
Content-Type: multipart/related;
	type="text/html";
	boundary="Apple-Mail=_2FF6A8F0-4640-4222-84F4-76F229C94350"


--Apple-Mail=_2FF6A8F0-4640-4222-84F4-76F229C94350
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space;">That should be&nbsp;<a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>.<div class=3D""><br =
class=3D""></div><div class=3D"">Send an empty mail to&nbsp;<a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a> to =
subscribe.</div><div class=3D""><br class=3D""></div><div =
class=3D"">Details:&nbsp;<a =
href=3D"https://cwiki.apache.org/confluence/display/NETBEANS/How+to+Partic=
ipate" =
class=3D"">https://cwiki.apache.org/confluence/display/NETBEANS/How+to+Par=
ticipate</a></div><div class=3D""><br class=3D""><div =
class=3D""><span><img apple-inline=3D"yes" =
id=3D"D85E544B-1241-4717-8617-7C0CD0424DCA" =
src=3D"cid:[email protected]" class=3D""></span><br =
class=3D"">Geertjan Wielenga | Principal&nbsp;Product&nbsp;Manager<br =
class=3D"">Phone:&nbsp;+31620320056&nbsp;|&nbsp;<br =
class=3D"">Oracle&nbsp;Developer Tools<br class=3D""><br class=3D"">ORACLE=
 Netherlands |&nbsp;Hertogswetering 163-167 |&nbsp;3543 AS&nbsp;Utrecht =
| Netherlands<br class=3D""><span><img apple-inline=3D"yes" =
id=3D"A881A709-2C1C-43D8-87AD-FAEA44BB335A" =
src=3D"cid:[email protected]" class=3D""></span><br =
class=3D""><br class=3D"">Oracle is committed to developing practices =
and products that help protect the environment<br class=3D""></div><br =
class=3D""><blockquote type=3D"cite" class=3D"">On 25 Oct 2017, at =
11:40, Emilian Bold &lt;<a href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:<br class=3D""><br =
class=3D"">It's an one-liner but I can't give you an example now since I =
don't<br class=3D"">remember the exact utils classes.<br class=3D""><br =
class=3D"">See<br class=3D"">* <a =
href=3D"http://wiki.netbeans.org/DevFaqGetOpenEditorWindows" =
class=3D"">http://wiki.netbeans.org/DevFaqGetOpenEditorWindows</a><br =
class=3D"">* <a =
href=3D"http://bits.netbeans.org/8.0/javadoc/org-openide-text/org/openide/=
text/NbDocument.html#findLineNumber" =
class=3D"">http://bits.netbeans.org/8.0/javadoc/org-openide-text/org/openi=
de/text/NbDocument.html#findLineNumber</a>(javax.swing.text.StyledDocument=
,<br class=3D"">int)<br class=3D"">* JEditorPane javadoc for getting the =
visible rectangle / lines<br class=3D""><br class=3D"">PS: Please use <a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a> , this mailing list will be =
closed soon.<br class=3D""><br class=3D""><br class=3D"">--emi<br =
class=3D""><br class=3D""><br class=3D"">On Tue, Oct 24, 2017 at 9:32 =
AM, DosBox &lt;<a href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:<br class=3D""><blockquote =
type=3D"cite" class=3D"">Hi all,<br class=3D""><br class=3D"">I am =
trying to create a NetBeans plugin and I need to somehow find out the =
range of lines currently visible in the editor.<br class=3D""><br =
class=3D"">Example: let say a opened file has 100 lines, editor displays =
20 lines, scroll position is in the middle. I would like to find such =
functions that used&nbsp;like this:<br class=3D""><br class=3D""><br =
class=3D"">Code:<br class=3D"">int start =3D =
XXX.getVisibleLinesStart();<br class=3D"">int end &nbsp; =3D =
XXX.getVisibleLinesEnd();<br class=3D""><br class=3D""><br class=3D""><br =
class=3D"">should return:<br class=3D""><br class=3D""><br =
class=3D"">Code:<br class=3D"">start =3D 40;<br class=3D"">end &nbsp; =3D =
60;<br class=3D""><br class=3D""><br class=3D""><br class=3D"">Is this =
possible to achieve with NetBeans API? Which component holds the =
information about document view? Where to look?<br class=3D"">I found =
out that it does not have to be lines, the first and last visible =
character would do.<br class=3D""><br class=3D""><br class=3D""><br =
class=3D""><br class=3D""></blockquote></blockquote><br =
class=3D""></div></body></html>=

--Apple-Mail=_2FF6A8F0-4640-4222-84F4-76F229C94350
Content-Transfer-Encoding: base64
Content-Disposition: inline;
	filename="Mail Attachment.gif"
Content-Type: image/gif;
	x-unix-mode=0666;
	name="Mail Attachment.gif"
Content-Id: <[email protected]>

R0lGODlhcgAaAMQAAP8QEP/w8P/Q0P/g4P8wMP9gYP8gIP+goP9QUP+QkP+wsP9wcP+AgP9AQP/A
wP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAA
AAAALAAAAAByABoAAAX/ICSOZGmeaKqubOu+cCzPdC0GCqPvvBKUDp5wp1gFdIPVIDfcOQa6A8yR
aO4gweQoUHh4v2Bw4SdihM9egyBF8ALIpkEXDR44vA2XwkD/IgYGAAZbbX1nBGRmhl8AWiUJYicC
AIsPDFh4LXOGjQ4NAAhrEIUPBQcOqKmoB5sEZV4JqqoHhQVxlGAOJQG4AAunsqg/dw95KwdfBgzB
qKIEBMaQDwCiKpOwEIq6KANuJg14igZwEHPULMTGKbxetjF8D1ItxK7aKl8lCl8DAfALW1+2rUi3
QtqgGN2mwYCXzYvAON624LoEQZ9DEfRcEFSBIE2DjyBDfnyIqRgMcA8a/z5AZQWXOxEdHxwUgfIg
sX/zMqlAWclVCQFefLpAqdJBAFJn3owgtpJEQkslEWjUmYLnomokcDlS4s0eFzQNqvXDEyzmAwFP
yaXYmGJBuxlzELWIacueiE0AFGyF4HbaNTquUEpFRxUFUC9YXQzARYAkEJSNipKQ9kDu0i9SKKNZ
9iXswMIoYgI4oJYFskpgzkkmcdrviELqmPVt1HpRAaaLqCE1lBgjvEpqRtgl8Tevygd7TcCuiKvP
m8OVEkAIYLYPThSsRIpEQJr1x94QBIT09FH6QJC6AiRAoB1kEb7tRb4MvyB+AwSlbejfz7+///8A
BijggAQWaOCBCCao4A+CDDbo4IMQRijhhBQKGAIAOw==
--Apple-Mail=_2FF6A8F0-4640-4222-84F4-76F229C94350
Content-Transfer-Encoding: base64
Content-Disposition: inline;
	filename="Mail Attachment.gif"
Content-Type: image/gif;
	x-unix-mode=0666;
	name="Mail Attachment.gif"
Content-Id: <[email protected]>

R0lGODlhLAAcAMQAAP///0x9RHmec9Pf0aa+oleFULHGrmKNW+nv6I+uivT39N7n3W6VZ7zPuZu2
lsjXxYSmfwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAA
AAAALAAAAAAsABwAQAXhICCOZGmeaDoaReC+sKAMR7GopIA6boIvLgPAVSAgALxjSYdrOp/Q6NPg
YqIEPkTBV2taTwgGbEw+PAZo3FfKbqMQQfeJ8DoY0Hg0wxhAKBgHCl5XLgMqDwFCAAIFPIYDgidr
OUQGkSh0cQMJAQyXOXKhoqOkpaanI2aoIwMErq+uCY0BMlANKpxkYwQGBH82TpMicD0pAgQACToD
AchqhAG3KQ4HIlQNnErG0IYqB9EAiEQvwEsozC43hy0CAeXMwsLDLS8MAvf497ruCZ+gOA0gfNt3
AIK0J/JWKVzIsEQIADs=
--Apple-Mail=_2FF6A8F0-4640-4222-84F4-76F229C94350--

--Apple-Mail=_E3538D9B-B9BD-4E6A-B6C7-6B94FF96C854--