Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » event listening in editors
event listening in editors [message #464458] Wed, 07 March 2007 15:02 Go to next message
Bryan is currently offline BryanFriend
Messages: 6
Registered: July 2009
Junior Member
Hi,

Iam have created my own editor using rcp text editor.What shuuld i do to
add
event handling to my editor.Like i open my file in my editor,then again i
open my file in a notepad and modify it,a event should be generated in my
editor saying
file has been chnaged externally..!

How shud i get started for this..?

BR,
Bryan
Re: event listening in editors [message #464596 is a reply to message #464458] Mon, 12 March 2007 13:34 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Bryan wrote:

>
> Hi,
>
> Iam have created my own editor using rcp text editor.What shuuld i do
> to add event handling to my editor.Like i open my file in my
> editor,then again i open my file in a notepad and modify it,a event
> should be generated in my editor saying file has been chnaged
> externally..!
>
> How shud i get started for this..?

If you are using latest 3.3 builds then the easiest is to add
'org.eclipse.ui.editors' as required plug-in and base your editor off
AbstractDectoratedTextEditor. If you do this you get the desired
behavior for free.

Dani

>
> BR,
> Bryan
>
Re: event listening in editors [message #464763 is a reply to message #464596] Thu, 15 March 2007 09:24 Go to previous messageGo to next message
Bryan is currently offline BryanFriend
Messages: 6
Registered: July 2009
Junior Member
Hey Daniel,

Thanks for the reply!Its actually behaving the other way.
I have kept org.eclipse.ui.editors in my plug in dependencies.I have a
editor say
"MYEDITOR" which extends rcp based TextEditor.I also have a file
associated to myeditor.Now i open it in myeditor ,it is getting associated
correctly.Now i open it in text editor and update it ,when i go back to
myeditor ,no notification pops up where as when i update my file in
myeditor and switch back to text editor it pops up saying it has been
changed ..!
What do i need to do for the other way to happen?

Br,
bryan
Re: event listening in editors [message #464814 is a reply to message #464763] Thu, 15 March 2007 16:51 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Bryan wrote:

>
> Hey Daniel,
>
> Thanks for the reply!Its actually behaving the other way.
> I have kept org.eclipse.ui.editors in my plug in dependencies.I have a
> editor say "MYEDITOR" which extends rcp based TextEditor.

What class exactly?

> I also have a file associated to myeditor.Now i open it in myeditor
> ,it is getting associated correctly.Now i open it in text editor and
> update it ,when i go back to myeditor ,no notification pops up where
> as when i update my file in myeditor and switch back to text editor it
> pops up saying it has been changed ..!
> What do i need to do for the other way to happen?

If you edit the exact same file (even if external) then there should be
no notification.

Dani

>
> Br,
> bryan
>
Re: event listening in editors [message #464826 is a reply to message #464814] Fri, 16 March 2007 03:58 Go to previous messageGo to next message
Bryan is currently offline BryanFriend
Messages: 6
Registered: July 2009
Junior Member
The exact class is org.eclipse.ui.editors.text.TextEditor.
When there is a notification getting generated when u edit the file in the
associated editor and then switch to notepad ,why do u think there should
be no notification ,when iam trying to do the other way round?

Thanks in advance
Bryan
Re: event listening in editors [message #464834 is a reply to message #464826] Fri, 16 March 2007 07:28 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Bryan wrote:

>
> The exact class is org.eclipse.ui.editors.text.TextEditor.
> When there is a notification getting generated when u edit the file in
> the associated editor and then switch to notepad ,why do u think there
> should be no notification ,when iam trying to do the other way round?

I didn't say that. I said, if you edit the same file with two different
ECLIPSE editors then they should share the same document and hence if
you type in one editor the change should automatically be reflected in
the other Eclipse editor.

Dani

>
> Thanks in advance
> Bryan
>
>
Previous Topic:Changing default browse location of "File > Open File"
Next Topic:Adding listeners to editors
Goto Forum:
  


Current Time: Wed Sep 11 23:57:51 GMT 2024

Powered by FUDForum. Page generated in 0.03673 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top