Thanks for sending me the source code for the autocompletion. I think I 
am onto something. The culprit seems to be Emacs and the X clipboard.

Here is what I did.

1) The tester app doesn't exhibit the problem. However, I was able to 
add a few logging calls to AutoCompletion.java, compile it, and add the 
class to the class path before xxe.jar. Then the logging calls showed up 
when I ran XXE.

2) I noticed that hidePopup would be called once a second when I had 
text selected in Emacs!

3) I then added a logging call to setEntry:
         Logger.global.log(Level.INFO, "text=" + text, new Throwable());

After selecting text in Emacs, every second or so, I get this stack 
trace. Note that the text is set to empty, which would explain why my 
keystrokes kept getting wiped out.

May 3, 2006 7:10:52 AM com.xmlmind.xmledit.guiutil.AutoCompletion setEntry
INFO: text=
java.lang.Throwable
         at 
com.xmlmind.xmledit.guiutil.AutoCompletion.setEntry(AutoCompletion.java:467)
         at 
com.xmlmind.xmledit.dialog.AttributeEditor.clearForm2(AttributeEditor.java:716)
         at 
com.xmlmind.xmledit.dialog.AttributeEditor.clearForm(AttributeEditor.java:699)
         at 
com.xmlmind.xmledit.dialog.AttributeEditor.tableChanged(AttributeEditor.java:504)
         at 
javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:280)
         at 
javax.swing.table.AbstractTableModel.fireTableDataChanged(AbstractTableModel.java:182)
         at 
com.xmlmind.xmledit.dialog.AttributeTableModel.setElement(AttributeTableModel.java:120)
         at 
com.xmlmind.xmledit.dialog.AttributeEditor.setElement(AttributeEditor.java:636)
         at 
com.xmlmind.xmleditapp.kit.part.EditAttributePane.editingContextChanged(EditAttributePane.java:185)
         at 
com.xmlmind.xmleditapp.kit.App.editingContextChanged(App.java:2235)
         at 
com.xmlmind.xmleditapp.kit.OpenedDocument.contextChanged(OpenedDocument.java:1877)
         at 
com.xmlmind.xmledit.edit.MarkManager.notifyContextChangeListeners(MarkManager.java:954)
         at 
com.xmlmind.xmledit.edit.MarkManager.notifyContextChangeListeners(MarkManager.java:945)
         at 
com.xmlmind.xmledit.view.DocumentView.notifyContextChangeListeners(DocumentView.java:1119)
         at 
com.xmlmind.xmleditapp.kit.part.ClipboardContentTool$1.run(ClipboardContentTool.java:74)
         at 
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at 
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at 
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at 
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) 
      at 
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) 
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
May 3, 2006 7:10:53 AM com.xmlmind.xmledit.guiutil.AutoCompletion setEntry
INFO: text=
java.lang.Throwable
         at
...

4) After closing down Emacs, the problem goes away immediately.

Now I am the first to agree that X selection is a festering mess, and I 
am probably not helping by setting x-select-enable-clipboard in Emacs 
(see http://www.emacswiki.org/cgi-bin/wiki/CopyAndPaste).

Still, it would seem to me that a clipboard change shouldn't affect the 
autocompletion.

Does this give you a clue? I'd be happy to do more sleuthing if you send 
me more source.

Cheers,

Cay

Hussein Shafie wrote:
> Cay Horstmann wrote:
>> Every once in a while, I can't use the XXE attribute editor in Gnone
>> (Fedora Core 5). I hit Ctrl+E and type in the first letter, say "c". The
>> dropdown window briefly flashes an entry "class", and then it goes away,
>> erasing the "c". I try clicking on "class". Another quick flash--the
>> name is entered into the top text field, then immediately erased.
>>
>> This used to also happen with element entries, but I solved that problem
>> by using the pop-up dialog.
>>
>> Personally, I'd be happy to use a pop-up dialog for the attributes as
>> well, but I don't know whether that is a configuration option.
> 
> No.
> 
>> I use Java 5. It also happens with the Java 6 beta (build 78).
> 
> I'm using XXE/Java 5/Gnome/SuSE 9.3 everyday and I've never had this
> problem.
> 
>> If I activate
>>
>> opt="-Dawt.toolkit=sun.awt.motif.MToolkit"
>>
>> in the startup script, the problem goes away.
> 
> This probably means that this problem is related to the Window Manager
> you use. I don't think that there is much to do in such case.
> 
>> I am using the free version, so I suppose I can't complain too much.
>> Would it help if I had a look at the source of the incremental search
>> component?
> 
> See the AutoCompletion.java attachement.

-- 

Cay S. Horstmann | http://horstmann.com | mailto:cay at horstmann.com

Reply via email to