This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Eclipse's AbstractTextEditor - making links Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Eclipse Watch "Eclipse New topic
Author

Eclipse's AbstractTextEditor - making links "alive"

Dudu Amar
Greenhorn

Joined: Jul 29, 2009
Posts: 2
Hi All

I have a basic class i've written extending AbstractTextEditor. I use it only to display text files, not to edit them.
I want that when the text contains links (or paths like /usr/bin/mydir) - they will be clickable and i can control what happens when user clicks on them. If they can be drawn in another color, it's even better.

How can I do that?

Thanks, D.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

Use a JEditorPane with HTML text. Then you can use a HyperLinkListener to listen for the link events. Don't forget to make the JEditorPane non-editable.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Dudu Amar
Greenhorn

Joined: Jul 29, 2009
Posts: 2
Thanks but i'm not using Swing. I'm using and RCP application with Jface/SWT components.
Any solution with that libraries?

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse's AbstractTextEditor - making links "alive"
 
Similar Threads
using SMS to send jar/jad OTA
Right Driver, Page, and Time To Download?
How do i draw ?
Which are the most used Mock Exams?
Dynamically Creating PDFs in a Web Application