Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mylyn-docs-dev] Finding out when a HtmlComposer is initialised for change detection

Robert,

Sorry, for the delayed answer, I was not aware that I didn't subscribe to
this list, yet.

See my comments and the patch in Bug 340938. Would be nice, if you could
apply the patch and verify if that addresses your problem.

Thanks
Tom


> -----Ursprüngliche Nachricht-----
> Von: mylyn-docs-dev-bounces@xxxxxxxxxxx [mailto:mylyn-docs-dev-
> bounces@xxxxxxxxxxx] Im Auftrag von mylyn-docs-dev-request@xxxxxxxxxxx
> Gesendet: Freitag, 25. März 2011 12:33
> An: tom.seidel@xxxxxxxxxxxxxxxxxx
> Betreff: Welcome to the "mylyn-docs-dev" mailing list
> Hi,
>
> I've been investigating the use of the HtmlComposer as an attribute
> editor for the MantisBT connector for Mylyn. So far it looks quite
> promising. I have one stumbling block though - finding out when the
> composer is fully initialised, so that I can mark attributes as dirty.
>
> I am using code similar to:
>
>                            composer.addModifyListener(new ModifyListener()
{
>
>                                 public void modifyText(ModifyEvent e) {
>
>                                     String oldValue =
> getAttributeMapper().getValue(getTaskAttribute());
>
>                                     String newValue = composer.getHtml();
>
>
> getAttributeMapper().setValue(getTaskAttribute(), newValue);
>
>                                     boolean attributeChanged =
> oldValue != "" && !(newValue.equals(oldValue));
>
>                                     if ( attributeChanged  )
>                                         attributeChanged();
>                                 }
>                             });
>
> The problem is that I'm seeing spurious changes which seem to be
> internal to the HtmlComposer, for instance:
>
> - from <pre>Wow</pre> to <pre>Wow</pre>\n ( extra newline )
> - from <b>Oops</b> to <p><b>Oops</b></p> ( wrapped in <p></p> )
> - from Let's see how this works. to <p>Let&#39;s see how this
> works.</p> ( wrapped in<p></p>, encode entities )
>
> I am interested in skipping these events, so want to find out whether
> I can register for events later on, after the editor is fully
> initialised, or find out if the events are internal.
>
> Thanks,
>
> Robert
>
> -- 
> Sent from my (old) computer




Back to the top