Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[hyades-dev] odd editor behaviour

Hi,
 
I have an implementation of an editor in eclipse and when I start up two copies of it they appear in separate tabs as they should.  However, when I close one tab, it would appear that the editor tab image gets disposed with it.  This means that when I select the other editor instance, I get errors from eclipse trying to draw a disposed tab image.
 
I have appended an example of the exception at the bottom of this email.
 
This doesn't happen with other editors such as the text editor so it must be some problem with my editor, but I find it unlikely that my editor (which never loads the image - it is only ever specified in the plugin.xml) would somehow get a reference to the image and dispose of it.  The other possibility is that I am implementing my editor in such a way that something else is erroneously disposing of the image.  If this is the case it would be far more difficult for me to track down as I have no idea what could cause this to occur.
 
Does anyone know of any incorrect way I could implement an editor or anything I could do wrong which might dispose of the active editor tab image (other than directly disposing the image itself).  Is this perhaps even a bug that other editors have a workaround for?
 
Thanks
 
Antony Miguel
 
 
Here is an example of the exception thrown:
 
org.eclipse.swt.SWTException: Graphic is disposed
 at org.eclipse.swt.SWT.error(SWT.java:2332)
 at org.eclipse.swt.SWT.error(SWT.java:2262)
 at org.eclipse.swt.graphics.Image.getBounds(Image.java:1026)
 at org.eclipse.swt.custom.CTabItem.onPaint(CTabItem.java:350)
 at org.eclipse.swt.custom.CTabFolder.onPaint(CTabFolder.java:1196)
 at org.eclipse.swt.custom.CTabFolder.access$1(CTabFolder.java:1151)
 at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:198)
 at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:865)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:849)
 at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:730)
 at org.eclipse.swt.widgets.Control.windowProc(Control.java:2811)
 at org.eclipse.swt.widgets.Display.windowProc(Display.java:2361)
 at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
 at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1303)
 at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1543)
 at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
 at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
 at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845)
 at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
 at org.eclipse.core.launcher.Main.run(Main.java:747)
 at org.eclipse.core.launcher.Main.main(Main.java:583)

Back to the top