Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EPF » Databinding and rich text editor
Databinding and rich text editor [message #53364] Tue, 09 September 2008 07:12 Go to next message
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 #53392 is a reply to message #53364] Tue, 09 September 2008 20:34 Go to previous messageGo to next message
Eclipse User
Originally posted by: eclipse-news.rizzoweb.com

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 #53470 is a reply to message #53392] Wed, 10 September 2008 07:03 Go to previous messageGo to next message
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 13:41 Go to previous messageGo to next message
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 14:19 Go to previous messageGo to next message
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 12:49 Go to previous messageGo to next message
Flavio Donze is currently offline Flavio Donze
Messages: 159
Registered: July 2009
Location: Switzerland
Senior Member
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
>>


Organisations- und Prozessdokumentation Software
Qualität Management QMS :: Information Management IMS
http://www.scodi.ch
Re: Databinding and rich text editor [message #485942 is a reply to message #53524] Tue, 15 September 2009 15:18 Go to previous messageGo to next message
Flavio Donze is currently offline Flavio Donze
Messages: 159
Registered: July 2009
Location: Switzerland
Senior Member
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?


Organisations- und Prozessdokumentation Software
Qualität Management QMS :: Information Management IMS
http://www.scodi.ch
Re: Databinding and rich text editor [message #506473 is a reply to message #485942] Thu, 07 January 2010 16:23 Go to previous messageGo to next message
Flavio Donze is currently offline Flavio Donze
Messages: 159
Registered: July 2009
Location: Switzerland
Senior Member
see https://bugs.eclipse.org/bugs/show_bug.cgi?id=265664
for more information on this issue


Organisations- und Prozessdokumentation Software
Qualität Management QMS :: Information Management IMS
http://www.scodi.ch
Re: Databinding and rich text editor [message #590448 is a reply to message #53364] Tue, 09 September 2008 20:34 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric Rizzo
Messages: 2327
Registered: July 2009
Senior Member
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 #590493 is a reply to message #53392] Wed, 10 September 2008 07:03 Go to previous messageGo to next message
Mario Cervera is currently offline Mario Cervera
Messages: 66
Registered: July 2009
Member
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 13:41 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric Rizzo
Messages: 2327
Registered: July 2009
Senior Member
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 14:19 Go to previous messageGo to next message
Mario Cervera is currently offline Mario Cervera
Messages: 66
Registered: July 2009
Member
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 12:49 Go to previous messageGo to next message
Flavio Donze is currently offline Flavio Donze
Messages: 159
Registered: July 2009
Location: Switzerland
Senior Member
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
>>


Organisations- und Prozessdokumentation Software
Qualität Management QMS :: Information Management IMS
http://www.scodi.ch
Re: Databinding and rich text editor [message #598863 is a reply to message #53524] Tue, 15 September 2009 15:18 Go to previous messageGo to next message
Flavio Donze is currently offline Flavio Donze
Messages: 159
Registered: July 2009
Location: Switzerland
Senior Member
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?


Organisations- und Prozessdokumentation Software
Qualität Management QMS :: Information Management IMS
http://www.scodi.ch
Re: Databinding and rich text editor [message #599047 is a reply to message #485942] Thu, 07 January 2010 16:23 Go to previous message
Flavio Donze is currently offline Flavio Donze
Messages: 159
Registered: July 2009
Location: Switzerland
Senior Member
see https://bugs.eclipse.org/bugs/show_bug.cgi?id=265664
for more information on this issue


Organisations- und Prozessdokumentation Software
Qualität Management QMS :: Information Management IMS
http://www.scodi.ch
Previous Topic:Creating projects programmatically (how to use API)
Next Topic:EPF Composer - Activity Diagram Editor fail to open
Goto Forum:
  


Current Time: Fri Oct 31 06:37:54 GMT 2014

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

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