Skip to main content

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

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