| Home » Archived » EPF » Databinding and rich text editor
 Goto Forum:| 
| Databinding and rich text editor [message #53364] | Tue, 09 September 2008 03:12  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: mcervera.integranova.com 
 Hi.
 
 I am trying to use databinding with the rich text editor. I've managed
 to make it work by simply returning an instance of
 RichTextObservableValue the same way observeText returns
 TextObservableValue. RichTextObservableValue is a class I've implemented
 which inherites from AbstractVetoableValue. Everything is ok but I have
 problems with the modify listener, that is, the ModifyEvent is not fired
 when I write in the RichTextEditor, therefore my editor is not set as
 dirty. To my surprise, this event is fired when pressing keys like
 delete, back space... but not when I press simple characters. I don't
 understand what is going on. Has anyone experienced anything similar?
 Has anyone got to make databinding work with this editor?
 
 Thanks in advance.
 
 Mario
 |  |  |  |  |  |  | 
| Re: Databinding and rich text editor [message #53470 is a reply to message #53392] | Wed, 10 September 2008 03:03   |  | 
| Eclipse User  |  |  |  |  | Originally posted by: mcervera.integranova.com 
 Hi Eric,
 
 that's the class I'm using but the method modifyText is not invoked as
 much as I'd like to. It's strange but it's invoked when I either use the
 toolbar or press Del, back space... but not when I write simple
 characters :S. The problem of this is that I have problems to set my
 model as dirty. I could use the focus out event but the listener I use
 doesn't get called either.
 
 Mario
 
 Eric Rizzo escribió:
 > Mario Cervera wrote:
 >> Hi.
 >>
 >> I am trying to use databinding with the rich text editor. I've managed
 >> to make it work by simply returning an instance of
 >> RichTextObservableValue the same way observeText returns
 >> TextObservableValue. RichTextObservableValue is a class I've
 >> implemented which inherites from AbstractVetoableValue. Everything is
 >> ok but I have problems with the modify listener, that is, the
 >> ModifyEvent is not fired when I write in the RichTextEditor, therefore
 >> my editor is not set as dirty. To my surprise, this event is fired
 >> when pressing keys like delete, back space... but not when I press
 >> simple characters. I don't understand what is going on. Has anyone
 >> experienced anything similar? Has anyone got to make databinding work
 >> with this editor?
 >
 > We use a custom RichTextObservableValue and it works correctly on
 > Eclipse 3.3. I have not yet started testing our stuff on 3.4, however.
 > The class is in this package:
 > < https://www.skywayperspectives.org/fisheye/browse/CVS_OpenSo urce/skyway/common/plugins/org.skyway.ui/src/org/skyway/ui/r ichtext>
 >
 >
 > Hope this helps,
 >     Eric
 |  |  |  |  | 
| Re: Databinding and rich text editor [message #53497 is a reply to message #53470] | Wed, 10 September 2008 09:41   |  | 
| Eclipse User  |  |  |  |  | Originally posted by: eclipse-news.rizzoweb.com 
 Mario Cervera wrote:
 > Hi Eric,
 >
 > that's the class I'm using but the method modifyText is not invoked as
 > much as I'd like to. It's strange but it's invoked when I either use the
 > toolbar or press Del, back space... but not when I write simple
 > characters :S. The problem of this is that I have problems to set my
 > model as dirty.
 
 Are you trying it on Eclipse 3.4? I know our class works on 3.3 - we get
 modify events as expected.
 
 Eric
 
 
 > Eric Rizzo escribió:
 >> Mario Cervera wrote:
 >>> Hi.
 >>>
 >>> I am trying to use databinding with the rich text editor. I've
 >>> managed to make it work by simply returning an instance of
 >>> RichTextObservableValue the same way observeText returns
 >>> TextObservableValue. RichTextObservableValue is a class I've
 >>> implemented which inherites from AbstractVetoableValue. Everything is
 >>> ok but I have problems with the modify listener, that is, the
 >>> ModifyEvent is not fired when I write in the RichTextEditor,
 >>> therefore my editor is not set as dirty. To my surprise, this event
 >>> is fired when pressing keys like delete, back space... but not when I
 >>> press simple characters. I don't understand what is going on. Has
 >>> anyone experienced anything similar? Has anyone got to make
 >>> databinding work with this editor?
 >>
 >> We use a custom RichTextObservableValue and it works correctly on
 >> Eclipse 3.3. I have not yet started testing our stuff on 3.4, however.
 >> The class is in this package:
 >> < https://www.skywayperspectives.org/fisheye/browse/CVS_OpenSo urce/skyway/common/plugins/org.skyway.ui/src/org/skyway/ui/r ichtext>
 >>
 >>
 >> Hope this helps,
 >>     Eric
 |  |  |  |  | 
| Re: Databinding and rich text editor [message #53524 is a reply to message #53497] | Wed, 10 September 2008 10:19   |  | 
| Eclipse User  |  |  |  |  | Originally posted by: mcervera.integranova.com 
 Yes I am using eclipse 3.4.0, maybe that's the reason :(
 
 Eric Rizzo escribió:
 > Mario Cervera wrote:
 >> Hi Eric,
 >>
 >> that's the class I'm using but the method modifyText is not invoked as
 >> much as I'd like to. It's strange but it's invoked when I either use
 >> the toolbar or press Del, back space... but not when I write simple
 >> characters :S. The problem of this is that I have problems to set my
 >> model as dirty.
 >
 > Are you trying it on Eclipse 3.4? I know our class works on 3.3 - we get
 > modify events as expected.
 >
 > Eric
 >
 >
 >> Eric Rizzo escribió:
 >>> Mario Cervera wrote:
 >>>> Hi.
 >>>>
 >>>> I am trying to use databinding with the rich text editor. I've
 >>>> managed to make it work by simply returning an instance of
 >>>> RichTextObservableValue the same way observeText returns
 >>>> TextObservableValue. RichTextObservableValue is a class I've
 >>>> implemented which inherites from AbstractVetoableValue. Everything
 >>>> is ok but I have problems with the modify listener, that is, the
 >>>> ModifyEvent is not fired when I write in the RichTextEditor,
 >>>> therefore my editor is not set as dirty. To my surprise, this event
 >>>> is fired when pressing keys like delete, back space... but not when
 >>>> I press simple characters. I don't understand what is going on. Has
 >>>> anyone experienced anything similar? Has anyone got to make
 >>>> databinding work with this editor?
 >>>
 >>> We use a custom RichTextObservableValue and it works correctly on
 >>> Eclipse 3.3. I have not yet started testing our stuff on 3.4, however.
 >>> The class is in this package:
 >>> < https://www.skywayperspectives.org/fisheye/browse/CVS_OpenSo urce/skyway/common/plugins/org.skyway.ui/src/org/skyway/ui/r ichtext>
 >>>
 >>>
 >>> Hope this helps,
 >>>     Eric
 >
 |  |  |  |  | 
| Re: Databinding and rich text editor [message #485886 is a reply to message #53524] | Tue, 15 September 2009 08:49   |  | 
| Eclipse User  |  |  |  |  | Hello 
 I'm using Eclipse 3.5.0 having the same problem, the ModifyListener is not
 notified after text was tipped.
 
 Was there any work done on this issue? Does a bug report exists? Should I
 report one? Is there a workaround available?
 
 greets
 Flavio
 
 Mario Cervera wrote:
 
 > Yes I am using eclipse 3.4.0, maybe that's the reason :(
 
 > Eric Rizzo escribió:
 >> Mario Cervera wrote:
 >>> Hi Eric,
 >>>
 >>> that's the class I'm using but the method modifyText is not invoked as
 >>> much as I'd like to. It's strange but it's invoked when I either use
 >>> the toolbar or press Del, back space... but not when I write simple
 >>> characters :S. The problem of this is that I have problems to set my
 >>> model as dirty.
 >>
 >> Are you trying it on Eclipse 3.4? I know our class works on 3.3 - we get
 >> modify events as expected.
 >>
 >> Eric
 >>
 >>
 >>> Eric Rizzo escribió:
 >>>> Mario Cervera wrote:
 >>>>> Hi.
 >>>>>
 >>>>> I am trying to use databinding with the rich text editor. I've
 >>>>> managed to make it work by simply returning an instance of
 >>>>> RichTextObservableValue the same way observeText returns
 >>>>> TextObservableValue. RichTextObservableValue is a class I've
 >>>>> implemented which inherites from AbstractVetoableValue. Everything
 >>>>> is ok but I have problems with the modify listener, that is, the
 >>>>> ModifyEvent is not fired when I write in the RichTextEditor,
 >>>>> therefore my editor is not set as dirty. To my surprise, this event
 >>>>> is fired when pressing keys like delete, back space... but not when
 >>>>> I press simple characters. I don't understand what is going on. Has
 >>>>> anyone experienced anything similar? Has anyone got to make
 >>>>> databinding work with this editor?
 >>>>
 >>>> We use a custom RichTextObservableValue and it works correctly on
 >>>> Eclipse 3.3. I have not yet started testing our stuff on 3.4, however.
 >>>> The class is in this package:
 >>>>
 < https://www.skywayperspectives.org/fisheye/browse/CVS_OpenSo urce/skyway/common/plugins/org.skyway.ui/src/org/skyway/ui/r ichtext>
 >>>>
 >>>>
 >>>> Hope this helps,
 >>>>     Eric
 >>
 |  |  |  |  | 
| Re: Databinding and rich text editor [message #485942 is a reply to message #53524] | Tue, 15 September 2009 11:18   |  | 
| Eclipse User  |  |  |  |  | hello 
 I kind of patched the "rte.js" and it kind of works now :-).
 One strange behavior, the first key tip is not forwarded as modify event
 and
 some modify events will now probably be fired twice, but I don't care :-).
 
 But here part of the org.eclipse.epf.richtext_1.5.0.x/rte/rte.js script:
 
 
 var excludeModify = new Array(16, KEY_ARROW_DOWN, KEY_ARROW_LEFT,
 KEY_ARROW_RIGHT, KEY_ARROW_UP, KEY_END, KEY_HOME, KEY_PAGE_DOWN,
 KEY_PAGE_UP, KEY_TAB);
 
 // Handles the key events.
 function keyPressed(event) {
 var keyCode = event.keyCode;
 if (keyCode == 0 && !document.all) {
 keyCode = event.charCode;
 switch (keyCode) {
 case 99:
 keyCode = KEY_C;
 break;
 case 102:
 keyCode = KEY_F;
 break;
 case 115:
 keyCode = KEY_S;
 break;
 case 118:
 keyCode = KEY_V;
 break;
 case 120:
 keyCode = KEY_X;
 break;
 case 122:
 keyCode = KEY_Z;
 break;
 }
 }
 var ctrlKey = event.ctrlKey;
 var shiftKey = event.shiftKey;
 var altKey = event.altKey;
 
 if ( !ctrlKey && !altKey ) {
 var modified = true;
 for (var i = 0; i < excludeModify.length; i++ ) {
 if ( keyCode == excludeModify[i] ) {
 modified = false;
 }
 }
 if ( modified == true ) {
 setStatus(STATUS_MODIFIED, keyCode);
 }
 }
 
 
 Maybe this can be a starting point to resolve this issue?
 |  |  |  |  |  |  |  |  | 
| Re: Databinding and rich text editor [message #590493 is a reply to message #53392] | Wed, 10 September 2008 03:03   |  | 
| Eclipse User  |  |  |  |  | Hi Eric, 
 that's the class I'm using but the method modifyText is not invoked as
 much as I'd like to. It's strange but it's invoked when I either use the
 toolbar or press Del, back space... but not when I write simple
 characters :S. The problem of this is that I have problems to set my
 model as dirty. I could use the focus out event but the listener I use
 doesn't get called either.
 
 Mario
 
 Eric Rizzo escribió:
 > Mario Cervera wrote:
 >> Hi.
 >>
 >> I am trying to use databinding with the rich text editor. I've managed
 >> to make it work by simply returning an instance of
 >> RichTextObservableValue the same way observeText returns
 >> TextObservableValue. RichTextObservableValue is a class I've
 >> implemented which inherites from AbstractVetoableValue. Everything is
 >> ok but I have problems with the modify listener, that is, the
 >> ModifyEvent is not fired when I write in the RichTextEditor, therefore
 >> my editor is not set as dirty. To my surprise, this event is fired
 >> when pressing keys like delete, back space... but not when I press
 >> simple characters. I don't understand what is going on. Has anyone
 >> experienced anything similar? Has anyone got to make databinding work
 >> with this editor?
 >
 > We use a custom RichTextObservableValue and it works correctly on
 > Eclipse 3.3. I have not yet started testing our stuff on 3.4, however.
 > The class is in this package:
 > < https://www.skywayperspectives.org/fisheye/browse/CVS_OpenSo urce/skyway/common/plugins/org.skyway.ui/src/org/skyway/ui/r ichtext>
 >
 >
 > Hope this helps,
 >     Eric
 |  |  |  |  | 
| Re: Databinding and rich text editor [message #590519 is a reply to message #53470] | Wed, 10 September 2008 09:41   |  | 
| Eclipse User  |  |  |  |  | Mario Cervera wrote: > Hi Eric,
 >
 > that's the class I'm using but the method modifyText is not invoked as
 > much as I'd like to. It's strange but it's invoked when I either use the
 > toolbar or press Del, back space... but not when I write simple
 > characters :S. The problem of this is that I have problems to set my
 > model as dirty.
 
 Are you trying it on Eclipse 3.4? I know our class works on 3.3 - we get
 modify events as expected.
 
 Eric
 
 
 > Eric Rizzo escribió:
 >> Mario Cervera wrote:
 >>> Hi.
 >>>
 >>> I am trying to use databinding with the rich text editor. I've
 >>> managed to make it work by simply returning an instance of
 >>> RichTextObservableValue the same way observeText returns
 >>> TextObservableValue. RichTextObservableValue is a class I've
 >>> implemented which inherites from AbstractVetoableValue. Everything is
 >>> ok but I have problems with the modify listener, that is, the
 >>> ModifyEvent is not fired when I write in the RichTextEditor,
 >>> therefore my editor is not set as dirty. To my surprise, this event
 >>> is fired when pressing keys like delete, back space... but not when I
 >>> press simple characters. I don't understand what is going on. Has
 >>> anyone experienced anything similar? Has anyone got to make
 >>> databinding work with this editor?
 >>
 >> We use a custom RichTextObservableValue and it works correctly on
 >> Eclipse 3.3. I have not yet started testing our stuff on 3.4, however.
 >> The class is in this package:
 >> < https://www.skywayperspectives.org/fisheye/browse/CVS_OpenSo urce/skyway/common/plugins/org.skyway.ui/src/org/skyway/ui/r ichtext>
 >>
 >>
 >> Hope this helps,
 >>     Eric
 |  |  |  |  | 
| Re: Databinding and rich text editor [message #590546 is a reply to message #53497] | Wed, 10 September 2008 10:19   |  | 
| Eclipse User  |  |  |  |  | Yes I am using eclipse 3.4.0, maybe that's the reason :( 
 Eric Rizzo escribió:
 > Mario Cervera wrote:
 >> Hi Eric,
 >>
 >> that's the class I'm using but the method modifyText is not invoked as
 >> much as I'd like to. It's strange but it's invoked when I either use
 >> the toolbar or press Del, back space... but not when I write simple
 >> characters :S. The problem of this is that I have problems to set my
 >> model as dirty.
 >
 > Are you trying it on Eclipse 3.4? I know our class works on 3.3 - we get
 > modify events as expected.
 >
 > Eric
 >
 >
 >> Eric Rizzo escribió:
 >>> Mario Cervera wrote:
 >>>> Hi.
 >>>>
 >>>> I am trying to use databinding with the rich text editor. I've
 >>>> managed to make it work by simply returning an instance of
 >>>> RichTextObservableValue the same way observeText returns
 >>>> TextObservableValue. RichTextObservableValue is a class I've
 >>>> implemented which inherites from AbstractVetoableValue. Everything
 >>>> is ok but I have problems with the modify listener, that is, the
 >>>> ModifyEvent is not fired when I write in the RichTextEditor,
 >>>> therefore my editor is not set as dirty. To my surprise, this event
 >>>> is fired when pressing keys like delete, back space... but not when
 >>>> I press simple characters. I don't understand what is going on. Has
 >>>> anyone experienced anything similar? Has anyone got to make
 >>>> databinding work with this editor?
 >>>
 >>> We use a custom RichTextObservableValue and it works correctly on
 >>> Eclipse 3.3. I have not yet started testing our stuff on 3.4, however.
 >>> The class is in this package:
 >>> < https://www.skywayperspectives.org/fisheye/browse/CVS_OpenSo urce/skyway/common/plugins/org.skyway.ui/src/org/skyway/ui/r ichtext>
 >>>
 >>>
 >>> Hope this helps,
 >>>     Eric
 >
 |  |  |  |  | 
| Re: Databinding and rich text editor [message #598854 is a reply to message #53524] | Tue, 15 September 2009 08:49   |  | 
| Eclipse User  |  |  |  |  | Hello 
 I'm using Eclipse 3.5.0 having the same problem, the ModifyListener is not
 notified after text was tipped.
 
 Was there any work done on this issue? Does a bug report exists? Should I
 report one? Is there a workaround available?
 
 greets
 Flavio
 
 Mario Cervera wrote:
 
 > Yes I am using eclipse 3.4.0, maybe that's the reason :(
 
 > Eric Rizzo escribió:
 >> Mario Cervera wrote:
 >>> Hi Eric,
 >>>
 >>> that's the class I'm using but the method modifyText is not invoked as
 >>> much as I'd like to. It's strange but it's invoked when I either use
 >>> the toolbar or press Del, back space... but not when I write simple
 >>> characters :S. The problem of this is that I have problems to set my
 >>> model as dirty.
 >>
 >> Are you trying it on Eclipse 3.4? I know our class works on 3.3 - we get
 >> modify events as expected.
 >>
 >> Eric
 >>
 >>
 >>> Eric Rizzo escribió:
 >>>> Mario Cervera wrote:
 >>>>> Hi.
 >>>>>
 >>>>> I am trying to use databinding with the rich text editor. I've
 >>>>> managed to make it work by simply returning an instance of
 >>>>> RichTextObservableValue the same way observeText returns
 >>>>> TextObservableValue. RichTextObservableValue is a class I've
 >>>>> implemented which inherites from AbstractVetoableValue. Everything
 >>>>> is ok but I have problems with the modify listener, that is, the
 >>>>> ModifyEvent is not fired when I write in the RichTextEditor,
 >>>>> therefore my editor is not set as dirty. To my surprise, this event
 >>>>> is fired when pressing keys like delete, back space... but not when
 >>>>> I press simple characters. I don't understand what is going on. Has
 >>>>> anyone experienced anything similar? Has anyone got to make
 >>>>> databinding work with this editor?
 >>>>
 >>>> We use a custom RichTextObservableValue and it works correctly on
 >>>> Eclipse 3.3. I have not yet started testing our stuff on 3.4, however.
 >>>> The class is in this package:
 >>>>
 < https://www.skywayperspectives.org/fisheye/browse/CVS_OpenSo urce/skyway/common/plugins/org.skyway.ui/src/org/skyway/ui/r ichtext>
 >>>>
 >>>>
 >>>> Hope this helps,
 >>>>     Eric
 >>
 |  |  |  |  | 
| Re: Databinding and rich text editor [message #598863 is a reply to message #53524] | Tue, 15 September 2009 11:18   |  | 
| Eclipse User  |  |  |  |  | hello 
 I kind of patched the "rte.js" and it kind of works now :-).
 One strange behavior, the first key tip is not forwarded as modify event
 and
 some modify events will now probably be fired twice, but I don't care :-).
 
 But here part of the org.eclipse.epf.richtext_1.5.0.x/rte/rte.js script:
 
 
 var excludeModify = new Array(16, KEY_ARROW_DOWN, KEY_ARROW_LEFT,
 KEY_ARROW_RIGHT, KEY_ARROW_UP, KEY_END, KEY_HOME, KEY_PAGE_DOWN,
 KEY_PAGE_UP, KEY_TAB);
 
 // Handles the key events.
 function keyPressed(event) {
 var keyCode = event.keyCode;
 if (keyCode == 0 && !document.all) {
 keyCode = event.charCode;
 switch (keyCode) {
 case 99:
 keyCode = KEY_C;
 break;
 case 102:
 keyCode = KEY_F;
 break;
 case 115:
 keyCode = KEY_S;
 break;
 case 118:
 keyCode = KEY_V;
 break;
 case 120:
 keyCode = KEY_X;
 break;
 case 122:
 keyCode = KEY_Z;
 break;
 }
 }
 var ctrlKey = event.ctrlKey;
 var shiftKey = event.shiftKey;
 var altKey = event.altKey;
 
 if ( !ctrlKey && !altKey ) {
 var modified = true;
 for (var i = 0; i < excludeModify.length; i++ ) {
 if ( keyCode == excludeModify[i] ) {
 modified = false;
 }
 }
 if ( modified == true ) {
 setStatus(STATUS_MODIFIED, keyCode);
 }
 }
 
 
 Maybe this can be a starting point to resolve this issue?
 |  |  |  |  |  | 
 
 
 Current Time: Fri Oct 31 17:44:47 EDT 2025 
 Powered by FUDForum . Page generated in 0.06037 seconds |