Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323687 - Grid: SWTException widget disposed exception when walking into grid with arrow keys
Summary: Grid: SWTException widget disposed exception when walking into grid with arro...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Nebula (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Thomas Schindl CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-26 05:21 EDT by Cosmin Ghita CLA
Modified: 2021-07-05 11:41 EDT (History)
1 user (show)

See Also:


Attachments
patch which fix the problem (766 bytes, patch)
2010-08-26 05:23 EDT, Cosmin Ghita CLA
tom.schindl: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cosmin Ghita CLA 2010-08-26 05:21:04 EDT
Build Identifier: 20100617-1415

This exception comes up in a grid which behaves as a tree which allows multiselection. It does not appear all the time just in certain cases. If is a selection in tree and we do a refresh and after that we just go up and down with arrow keys it will throw a widget disposed exception:

 at org.eclipse.swt.SWT.error( SWT.java: 4083)
        at org.eclipse.swt.SWT.error( SWT.java: 3998)
        at org.eclipse.swt.SWT.error( SWT.java: 3969)
        at org.eclipse.swt.widgets.Widget.error( Widget.java: 715)
        at org.eclipse.swt.widgets.Widget.checkWidget( Widget.java: 531)
        at org.eclipse.nebula.widgets.grid.GridColumn.isVisible( GridColumn.java: 474)
        at org.eclipse.nebula.widgets.grid.Grid.getVisibleColumn_DegradeLeft( Grid.java: 8568)
        at org.eclipse.nebula.widgets.grid.Grid.onKeyDown( Grid.java: 7499)
        at org.eclipse.nebula.widgets.grid.Grid.access$4( Grid.java: 7304)
        at org.eclipse.nebula.widgets.grid.Grid$8.handleEvent( Grid.java: 6467)
        at org.eclipse.swt.widgets.EventTable.sendEvent( EventTable.java: 84)
        at org.eclipse.swt.widgets.Display.sendEvent( Display.java: 3776)
        at org.eclipse.swt.widgets.Widget.sendEvent( Widget.java: 1367)
        at org.eclipse.swt.widgets.Widget.sendEvent( Widget.java: 1390)
        at org.eclipse.swt.widgets.Widget.sendEvent( Widget.java: 1375)
        at org.eclipse.swt.widgets.Widget.sendKeyEvent( Widget.java: 1404)
        at org.eclipse.swt.widgets.Widget.sendKeyEvent( Widget.java: 1400)
        at org.eclipse.swt.widgets.Canvas.sendKeyEvent( Canvas.java: 416)
        at org.eclipse.swt.widgets.Control.doCommandBySelector( Control.java: 939)
        at org.eclipse.swt.widgets.Display.windowProc( Display.java: 5068)
        at org.eclipse.swt.internal.cocoa.OS.objc_msgSend( OS.java: -2)
        at org.eclipse.swt.internal.cocoa.NSResponder.interpretKeyEvents( NSResponder.java: 56)
        at org.eclipse.swt.widgets.Composite.keyDown( Composite.java: 587)
        at org.eclipse.swt.widgets.Display.windowProc( Display.java: 4978)
        at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper( OS.java: -2)
        at org.eclipse.swt.widgets.Widget.callSuper( Widget.java: 220)
        at org.eclipse.swt.widgets.Widget.windowSendEvent( Widget.java: 1943)
        at org.eclipse.swt.widgets.Shell.windowSendEvent( Shell.java: 2008)
        at org.eclipse.swt.widgets.Display.windowProc( Display.java: 5040)

Reproducible: Always

Steps to Reproduce:
1.create  a grid which behaves like a tree
2.select a row 
3.refresh grid input
4.press arrow up/down to walk thru rows
Comment 1 Cosmin Ghita CLA 2010-08-26 05:23:39 EDT
Created attachment 177509 [details]
patch which fix the problem

I found the problem in Grid.java, line 7331: there we check if the focusColumn is null but we do not check if is diposed so I changed the line from:

        if (focusColumn == null)

to:


        if (focusColumn == null || focusColumn.isDisposed())

This fixed the problem that I had.
Comment 2 Thomas Schindl CLA 2010-09-18 16:05:45 EDT
thanks fixed patch applied