On 3/11/2011 10:11 AM, Silenio Quarti wrote:
The method TextModel.onChange()
is public
(not prefixed by _) to let application code written with dojo
(for example)
use dojo.connect() instead of adding a listener to the model
(TextModel.addListener()).
As Susan said, most applications
will
only need to add listeners to the editor (not to the model).
Adding
a listener on the editor is done by calling
Editor.addEventListener().
If you want to know when the editor modified the model hook the
"Modify"
listener. If you want to know when any modification is done in
the
model hook "ModelChanged". Again, you could use dojo.connect()
instead of Editor.addEventListener().
Thanks!
Just feedback:
The object-based addListener() api is much more convenient than the
function oriented addEventListener() .
jjb
Silenio
The editor guys can explain the original intent
behind
"toolkit framework," but I think about some heavy duty text
framework
that perhaps presents a higher level API to clients but needs to
know more
detail about the implementation.
I read this as saying "if you want to know when the editor makes
a
change, hook an onModelChanged listener on the editor rather
than knowing
about the editor model and using it directly."
Ideally if you are just trying to embed the editor and respond
to changes,
you can get by with using only public editor "application" API.
If you can't get by, then we would want to know and would look
at expanding
the API.
susan
John
J Barton ---03/10/2011 05:09:51 PM---editor/web/js/model.js
onChange says:
This notification is intended to be used only by the editor. A
From: John J Barton
<johnjbarton@xxxxxxxxxxxxxxx>
To: Orion developer discussions
<orion-dev@xxxxxxxxxxx>
Date: 03/10/2011 05:09 PM
Subject: [orion-dev] application client
vs toolkit
frameworks?
Sent by: orion-dev-bounces@xxxxxxxxxxx
editor/web/js/model.js onChange says:
This notification is intended to be used only by the editor.
Application
clients should
* use {@link eclipse.Editor#event:onModelChanged}.
* </p>
* <p>
* NOTE: This method is not meant to called
directly by
application code. It is called internally by the TextModel
* as part of the implementation of {@link #setText}.
This
method is included in the public API for documentation
* purposes and to allow integration with other
toolkit frameworks.
What is an application client and what is "other toolkit
framework"?
I have a program that wants to know when the editor makes a
change.
jjb
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/orion-dev
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/orion-dev
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/orion-dev
|