Eclipse Events [message #33120] |
Sat, 15 November 2008 13:51  |
Eclipse User |
|
|
|
Hello all,
I would like to create a plug-in that captures events within the Eclipse
IDE. For example, if a user opens a file, types text, or uses the
debugger. I am actually to capture the opening a file, and typing text
event. I can also capture the debugging event.
I would like to know if anyone has ever tried to do this? Also, is there a
way to capture all events?
Thanks in advance,
Jason
|
|
|
Re: Eclipse Events [message #33415 is a reply to message #33120] |
Mon, 17 November 2008 09:43   |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
On 11/15/2008 1:51 PM, Jason Carter wrote:
> Hello all,
>
>
> I would like to create a plug-in that captures events within the Eclipse
> IDE. For example, if a user opens a file, types text, or uses the
> debugger. I am actually to capture the opening a file, and typing text
> event. I can also capture the debugging event.
>
> I would like to know if anyone has ever tried to do this? Also, is there
> a way to capture all events?
There is really no definition of "all events" - it is too broad a term.
As you've seen, there are various mechanisms and API to receive
different kinds of events.
You might want to look at the Usage Data Collector (UDC):
http://dev.eclipse.org/blogs/mike/2008/06/05/collecting-usag e-data/
Hope this helps,
Eric
|
|
|
|
Re: Eclipse Events [message #34144 is a reply to message #33415] |
Sat, 22 November 2008 00:15  |
Eclipse User |
|
|
|
Thanks Eric.
I am interested in getting the text that a user has typed. I am able to
get this text and store it in a XML file.
I would like to programmatically insert this text into an editor. I am
able to get the current active editor, but when I insert text using the
document.replace(offset,0,text) function I get a BadLocationException
exception. I noticed that this exception only occurs when the text file is
empty or when there is no text at the offset to replace.
Any help is greatly appreciated
Thanks,
Jason
|
|
|
Re: Eclipse Events [message #585396 is a reply to message #33120] |
Mon, 17 November 2008 09:43  |
Eclipse User |
|
|
|
On 11/15/2008 1:51 PM, Jason Carter wrote:
> Hello all,
>
>
> I would like to create a plug-in that captures events within the Eclipse
> IDE. For example, if a user opens a file, types text, or uses the
> debugger. I am actually to capture the opening a file, and typing text
> event. I can also capture the debugging event.
>
> I would like to know if anyone has ever tried to do this? Also, is there
> a way to capture all events?
There is really no definition of "all events" - it is too broad a term.
As you've seen, there are various mechanisms and API to receive
different kinds of events.
You might want to look at the Usage Data Collector (UDC):
http://dev.eclipse.org/blogs/mike/2008/06/05/collecting-usag e-data/
Hope this helps,
Eric
|
|
|
Re: Eclipse Events [message #585686 is a reply to message #33415] |
Sat, 22 November 2008 00:11  |
Eclipse User |
|
|
|
Thanks so much for you reply Eric.
I am interested in getting the text the user is typing in an editor. I
have actually be able to get the text and store it in a log. What I would
like to do next is to take that text and programmatically enter it into an
editor.
This is the code I use to insert the text from the file. I use the
document.replace function.
while(e.hasMoreElements())
{
entry = e.nextElement();
int offset = Integer.parseInt(entry.getOffset());
int length = Integer.parseInt(entry.getLength());
String text = entry.getText();
try
{
document.replace(1,0,"some text");
}
catch(BadLocationException ex)
{
ex.printStackTrace();
}
The problem is every time I insert text I get a BadLocationException. I
noticed that this exception only occurs when the text file is empty or
when there is no text at the offset to replace.
Any help would be greatly appeciated.
Thanks,
Jason
|
|
|
Re: Eclipse Events [message #585694 is a reply to message #33415] |
Sat, 22 November 2008 00:15  |
Eclipse User |
|
|
|
Thanks Eric.
I am interested in getting the text that a user has typed. I am able to
get this text and store it in a XML file.
I would like to programmatically insert this text into an editor. I am
able to get the current active editor, but when I insert text using the
document.replace(offset,0,text) function I get a BadLocationException
exception. I noticed that this exception only occurs when the text file is
empty or when there is no text at the offset to replace.
Any help is greatly appreciated
Thanks,
Jason
|
|
|
Powered by
FUDForum. Page generated in 0.04716 seconds