AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Syntax highlighting

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits
View previous topic :: View next topic  
Author Message
Faisal Reza UL-HAQUE via
Guest





PostPosted: Wed Nov 10, 2004 3:04 pm    Post subject: Syntax highlighting Reply with quote



Hello,
I am trying to create an IDE as part of my degree project. I have completed the syntax highlighter and it works perfectly, but with just one problem.
I would like it to (obviously) highlght as text is typed in. In order to listen for changes, I am using a DocumentListener to listen for insert and remove updates. Having read around on the subject, I gather that a write lock is established when inserting (from user input). As the highlighter also attemts to change attributes when these update events occur, it comes across this write lock and an exception is thrown.

Any hints or pointers would be greatly appreciated.

Thanks.

*****************************************
* This message was posted via http://www.javakb.com
*
* Report spam or abuse by clicking the following URL:
* http://www.javakb.com/Uwe/Abuse.aspx?aid=ab3fcb9a28f34afaa298e3b732ac8f93
*****************************************
Back to top
Thomas Weidenfeller
Guest





PostPosted: Wed Nov 10, 2004 3:44 pm    Post subject: Re: Syntax highlighting Reply with quote



Faisal Reza UL-HAQUE via JavaKB.com wrote:
Quote:
Hello,
I am trying to create an IDE as part of my degree project. I have completed the syntax highlighter

The Swingset2 demo which is part of the JDK contains an example of
syntax highlighting. I have no idea if this is useful.

Quote:
and it works perfectly, but with just one problem.
I would like it to (obviously) highlght as text is typed in. In order to listen for changes, I am using a DocumentListener to listen for insert and remove updates. Having read around on the subject, I gather that a write lock is established when inserting (from user input). As the highlighter also attemts to change attributes when these update events occur, it comes across this write lock and an exception is thrown.

I have never looked into this issue, but could you schedule the
attribute changes on the event queue with invokeLater()?

You could also have a look at some existing java editors who do syntax
highlighting. I think the BlueJ IDE's editor source is at
http://www.bluej.org/download/files/bluej-editor-src-202.jar

(Hint: before you look, check your university's rules for academic
(dis)honesty and if you look at it, do mention it in the documentation
of your degree, or whatever your rules require).


Quote:
*****************************************
* This message was posted via http://www.javakb.com

Can you please have a word with this people running your service, that
they should follow established usenet standards, which includes:

(a) best to not add such useless advertising at all, or to at least
separate it with a sig separator '-- ' (see RFC 1855 for a start). Even
better, to place int in an "Organization:" header.

Quote:
* Report spam or abuse by clicking the following URL:
* http://www.javakb.com/Uwe/Abuse.aspx?aid=ab3fcb9a28f34afaa298e3b732ac8f93

(b) Such information is nowadays usually put in the header with an
"X-Abuse:" header name (which is a non-standard header, but common).

(c) That they generate messages which properly line wrap at somewhere
between 66 - 72 characters per line (if they like long lines, with the
relative new format=flowed content type info).

/Thomas

Back to top
Mike
Guest





PostPosted: Wed Nov 10, 2004 5:29 pm    Post subject: Re: Syntax highlighting Reply with quote



Thomas,

Thank you for your suggestions. We will change the signature later this
week.

Michael
http://www.javakb.com

Quote:

Can you please have a word with this people running your service, that
they should follow established usenet standards, which includes:

(a) best to not add such useless advertising at all, or to at least
separate it with a sig separator '-- ' (see RFC 1855 for a start). Even
better, to place int in an "Organization:" header.

* Report spam or abuse by clicking the following URL:
*
http://www.javakb.com/Uwe/Abuse.aspx?aid=ab3fcb9a28f34afaa298e3b732ac8f93

(b) Such information is nowadays usually put in the header with an
"X-Abuse:" header name (which is a non-standard header, but common).

(c) That they generate messages which properly line wrap at somewhere
between 66 - 72 characters per line (if they like long lines, with the
relative new format=flowed content type info).

/Thomas



Back to top
Andrew Thompson
Guest





PostPosted: Wed Nov 10, 2004 6:04 pm    Post subject: Re: Syntax highlighting Reply with quote

On Wed, 10 Nov 2004 12:29:39 -0500, Mike wrote:

Quote:
Thank you for your suggestions. We will change the signature later this
week.

Michael
http://www.javakb.com

Since you're making some changes Michael, you
might add 1 or 2 more things ot the list..

For example, at the home page..

"..Join the forums and talk with other Java professionals.
Our online database of questions and answers can help you
with everything from JDBC and JavaBeans to CORBA and JVM.

Every thread has a rating facility which you can use to
rate the relevance and importance of the provided
information. Based on your feedback, threads with
low rating are reviewed and removed from the system,
so only relevant and important topics are kept. "

Should read..

"..Use our access to the Usenet Newsgroups[1] and talk
with other Java developers[2].
Our online access to usenet archives[3] can help you
with everything from JDBC and JavaBeans to CORBA and JVM.

Every thread has a rating facility which you can use to
rate the relevance and importance of the provided
information. Based on your feedback, threads with
low rating are reviewed and barred from this site by the managament[4],
so only relevant and important topics are kept.

Before posting to the forums, read the FAQ's relating to them.[5]
Links follow..."

[1] You are giving the false impression that you host these forums,
rather than simply mirror/provide access to, an existing information
source.

[2] All types contribute to the Java forums, from clever students
to well studied hobbyists, to 'professional' developers and
teachers.

[3] These are discussion forums, *not* help desks (though they
can sometimes operate to that purpose)

[4] Pretending that you can censor usenet is ludicrous.

[5] Where are your explanations of usenet etiquette? Or how to
make most of the available resources by asking smart questions? etc..

If fear we are about to get swamped by clueless, screaming noobs
posting from yet another badly conceived, poorly executed web-interface,
thinking "that nasty man on the internet site" won't do their homework.

Will this post be rated as '..relevant and important' on your site? ;-)

<http://www.javakb.com/Uwe/Forum.aspx/java-gui/3275/Syntax-highlighting>
....hmmm. I notice that *your* post does not appear there.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane

Back to top
Andrew Thompson
Guest





PostPosted: Wed Nov 10, 2004 6:43 pm    Post subject: Re: Syntax highlighting Reply with quote

On Wed, 10 Nov 2004 18:04:21 GMT, Andrew Thompson wrote:

Quote:
[5] Where are your explanations of usenet etiquette? Or how to
make most of the available resources by asking smart questions? etc..

A prominent link to this might be a start..
<http://www.javakb.com/Uwe/Search/SearchResult.aspx?phrase=faq>

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane

Back to top
Mike
Guest





PostPosted: Wed Nov 10, 2004 6:44 pm    Post subject: Re: Syntax highlighting Reply with quote

Andrew,

Thank you for your commnets. My posting did not appear on the site because
it is related to the site itself and is not useful for Java developers. We
trying to build an archive of useful postings only, so people do not have to
waste time searching through spam and unrelated postings.

Quote:
[1] You are giving the false impression that you host these forums,
rather than simply mirror/provide access to, an existing information
source.

Our forum is not 100% mirror of usenet. It does not have some threads that
did not pass special filters as well as those that were voted out by the
users. Also it have some messages that do not appear in usenet (some
postings are not forwarded to newsgroups).

Quote:
[2] All types contribute to the Java forums, from clever students
to well studied hobbyists, to 'professional' developers and
teachers.

Agree

Quote:
[3] These are discussion forums, *not* help desks (though they
can sometimes operate to that purpose)

It will be extended soon with extra features that makes it much more than
just discussion forum.

Quote:
[4] Pretending that you can censor usenet is ludicrous.

We meant that we remove postings from the site, but I agree probably it is
better to replace 'system' with 'this Web site'.

Quote:
[5] Where are your explanations of usenet etiquette? Or how to
make most of the available resources by asking smart questions? etc..

Before one posts any messages he must read and agree with terms and
conditions that lists forum rules. No reason to place it on the home page if
one is not going to post anything.

Thanks,
Michael
http://www.javakb.com



"Andrew Thompson" <SeeMySites (AT) www (DOT) invalid> wrote

Quote:
On Wed, 10 Nov 2004 12:29:39 -0500, Mike wrote:

Thank you for your suggestions. We will change the signature later this
week.

Michael
http://www.javakb.com

Since you're making some changes Michael, you
might add 1 or 2 more things ot the list..

For example, at the home page..

"..Join the forums and talk with other Java professionals.
Our online database of questions and answers can help you
with everything from JDBC and JavaBeans to CORBA and JVM.

Every thread has a rating facility which you can use to
rate the relevance and importance of the provided
information. Based on your feedback, threads with
low rating are reviewed and removed from the system,
so only relevant and important topics are kept. "

Should read..

"..Use our access to the Usenet Newsgroups[1] and talk
with other Java developers[2].
Our online access to usenet archives[3] can help you
with everything from JDBC and JavaBeans to CORBA and JVM.

Every thread has a rating facility which you can use to
rate the relevance and importance of the provided
information. Based on your feedback, threads with
low rating are reviewed and barred from this site by the managament[4],
so only relevant and important topics are kept.

Before posting to the forums, read the FAQ's relating to them.[5]
Links follow..."

[1] You are giving the false impression that you host these forums,
rather than simply mirror/provide access to, an existing information
source.

[2] All types contribute to the Java forums, from clever students
to well studied hobbyists, to 'professional' developers and
teachers.

[3] These are discussion forums, *not* help desks (though they
can sometimes operate to that purpose)

[4] Pretending that you can censor usenet is ludicrous.

[5] Where are your explanations of usenet etiquette? Or how to
make most of the available resources by asking smart questions? etc..

If fear we are about to get swamped by clueless, screaming noobs
posting from yet another badly conceived, poorly executed web-interface,
thinking "that nasty man on the internet site" won't do their homework.

Will this post be rated as '..relevant and important' on your site? ;-)

http://www.javakb.com/Uwe/Forum.aspx/java-gui/3275/Syntax-highlighting
...hmmm. I notice that *your* post does not appear there.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane



Back to top
Andrew Thompson
Guest





PostPosted: Wed Nov 10, 2004 7:09 pm    Post subject: Re: Syntax highlighting Reply with quote

On Wed, 10 Nov 2004 13:44:00 -0500, Mike wrote:

Quote:
Thank you for your commnets.

...Anytime you want, and a lot of times you don't.

Speaking of which. You seem to have the hang of 'in-line posting',
but could I ask you to add 'trimming' to your repertoire? You have
directly repeated text that you quoted lower (no, don't look for it
in this message - I've trimmed it.)

Quote:
..My posting did not appear on the site because
it is related to the site itself and is not useful for Java developers. We
trying to build an archive of useful postings only, so people do not have to
waste time searching through spam and unrelated postings.

Define 'unrelated'?

If I criticise a poster for their style of posting, but do not
even begin to address their question, is that related, or not?
Careful how you answer that, the opinions of the regular
posters are split on that one.

If you were to trim my response, the rest of the posters here
may well be waiting for the OP to respond before jumping in to
the thread. If your guest does not see and respond to my post,
they are less likely to get help.

Quote:
[1] You are giving the false impression that you host these forums,
rather than simply mirror/provide access to, an existing information
source.

Our forum is not 100% mirror of usenet.

You need to both highlight that, and make the clear distinction
between the public and uncensored disussion forum, and these extra
'add ons' of your site.

What are they? URLs?

I had a bit of a look around, but didn't see anything beyond a
usenet front-end.

Quote:
[2] All types contribute to the Java forums, from clever students
to well studied hobbyists, to 'professional' developers and
teachers.

Agree

The wording will be changed?

Quote:
[4] Pretending that you can censor usenet is ludicrous.

We meant that we remove postings from the site, but I agree probably it is
better to replace 'system' with 'this Web site'.

ditto?

Quote:
[5] Where are your explanations of usenet etiquette? Or how to
make most of the available resources by asking smart questions? etc..

Before one posts any messages he must read and agree with terms and
conditions that lists forum rules.

Given the breathy excitement of people who want their
questions answered, I cannot imagine they closely examine
'some agreement they have to click yes to, before they post'.

What is the text? Put it up on a page post the URL.

Quote:
...No reason to place it on the home page if
one is not going to post anything.

I don't agree. A *link* from the home page is quite appropriate.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane

Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.