detect when editor closed in a mviewpane

User c23c5e9da4

14-01-2007 17:07:03

I need to either a) know when a double-click happens on an MViewPane (with setEditable set to 0) so I can open my own editor or b) know when the editor is closed if opened from the MViewPane (by setting setEditable to 2). No mouse events are being generated on MViewPane and the only way I have been able to detect an editor closing is by listening to changes to the doc0 property which won't work for this situation (because I don't want to be notified if I make a change to the molecule through the api).





Thanks,





Trevor

ChemAxon 7c2d26e5cf

15-01-2007 15:42:00

Hi Trevor,


In new Marvin, windowOpened and windowClosing PropertyChangeEvents are dropped when a window is opened from any cell of MViewPane or this detached window is closed. (Please try the ViewEventTest example among Marvin Beans example. This feature is available since Marvin 4.1.4.


Is it a suitable solution for you?

User c23c5e9da4

15-01-2007 21:38:43

How can I access the new molecule from the property change listener for the windowClosing property? If I call getM(0) on the MViewPane I get the old molecule.

ChemAxon 7c2d26e5cf

16-01-2007 23:24:11

"windowClosing" indicates only that a detached window is closed.


When a molecule is changed in a cell, a "doc0" (, "doc1", etc. ) PropertyChangeEvent is dropped.