Bug 249568 - NullPointerException is occurred when press arrow_left key on grid.
Summary: NullPointerException is occurred when press arrow_left key on grid.
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Nebula (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Mirko Paturzo CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-03 02:11 EDT by Hidenobu Shinozuka CLA
Modified: 2021-07-05 11:39 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hidenobu Shinozuka CLA 2008-10-03 02:11:15 EDT
Build ID: I20080617-2000

Steps To Reproduce:

1.A GridColumn which index is 0 set visible to false.
2.Set focus a cell.
3.Press arrow_left key.

java.lang.NullPointerException
	at org.eclipse.nebula.widgets.grid.Grid.showColumn(Grid.java:3819)
	at org.eclipse.nebula.widgets.grid.Grid.onKeyDown(Grid.java:7233)
	at org.eclipse.nebula.widgets.grid.Grid.access$4(Grid.java:6951)
	at org.eclipse.nebula.widgets.grid.Grid$8.handleEvent(Grid.java:6051)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036)
	at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1653)
	at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:4122)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:3818)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:337)

More information:
Please fix this method:

class: org.eclipse.nebula.widgets.grid.Grid
method: private void onKeyDown(Event e)
line: 7095

-------------------------------------------
            case SWT.ARROW_LEFT :
                if (cellSelectionEnabled)
                {
                    if (impliedFocusItem != null && impliedFocusColumn != null)
                    {                    
                        newSelection = impliedFocusItem;
                        
                        int index = displayOrderedColumns.indexOf(impliedFocusColumn);
                        
                        if (index != 0)
                        {
                            newColumnFocus = (GridColumn)displayOrderedColumns.get(index -1);
                            
                            newColumnFocus = getVisibleColumn_DegradeLeft(impliedFocusItem, newColumnFocus);
                        
                            if(newColumnFocus == null) //Add this block
                            {
                            	newColumnFocus = impliedFocusColumn;
                            }
                            
                        }
                        else
                        {
                            newColumnFocus = impliedFocusColumn;
                        }                    
                    }
                    intendedFocusColumn = newColumnFocus;
                }
Comment 1 Thomas Schindl CLA 2009-04-24 10:00:07 EDT
header_footer fixed some corner cases here need to check if this is still true
Comment 2 Mirko Paturzo CLA 2014-03-21 10:21:01 EDT
Hi all,
I have commit on Gerrit a simple patch and i realized e simple test.

Mirko
Comment 3 Wim Jongman CLA 2014-03-21 12:23:52 EDT
Assigning to Mirko.
Comment 4 Mirko Paturzo CLA 2014-03-24 04:47:50 EDT
Gerrit review accepted by Wim Jongman and merged in repository.

https://git.eclipse.org/r/#/c/23720/