Bug 306165 - Text label no longer editable after cancel edit via escape key
Summary: Text label no longer editable after cancel edit via escape key
Status: NEW
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal
Target Milestone: ---   Edit
Assignee: Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-17 06:46 EDT by E. Waldin CLA
Modified: 2010-03-22 07:08 EDT (History)
2 users (show)

See Also:


Attachments
Stack trace of null pointer exception location (6.76 KB, text/plain)
2010-03-17 06:48 EDT, E. Waldin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description E. Waldin CLA 2010-03-17 06:46:20 EDT
Build Identifier: 20100218-1602

If you edit a text label via direct edit and cancel by using the escape key, that label can no longer be edited. Neither clicking in the label nor using F2 will enable direct edit for that label.

Reproducible: Sometimes

Steps to Reproduce:
To reproduce this problem, use the geoshapes example that comes with GMF. Create a shape on a diagram with a label (e.g., an oval with label "abc"). Click select the label to enter direct edit mode. Press the escape key to cancel the edit and exit direct edit mode. The label can no longer be edited via direct selection or using F2.

This problem happens 95% of the time when I use my GMF-based diagram. But the geoshapes example is the easiest way for someone else to reproduce it.

In the geoshapes example, the problem doesn't happen every time, but for some reason, having a short label of 2-3 characters and using an oval make it happen more often, at least for me.

The problem appears to be a null pointer exception in SWT's Display class that occurs as a result of the call getCellEditor().dispose() in method bringDown on line 115 of DirectEditManager. The NPE occurs in the method fieldEditorProc in class Display on the line

 return widget.shouldChangeTextInRange_replacementString(id, sel, arg0, arg1) ? 1 : 0;

The variable "widget" is null.

The only workaround is to save, close and re-open the diagram.

The problem also occurs when using GMF's logic example with a note. It does not happen if I use GEF's logic example, although both go through the same logic in class DirectEditManager. GMF has its own TextDirectEditManager and TextCellEditorEx class, so it may be the way GMF interacts with SWT.

I can't reproduce the problem on Windows, so it appears to be Mac only for now.

I'm running Mac OSX Snowleopard on a 64 bit Mac.
Comment 1 E. Waldin CLA 2010-03-17 06:48:57 EDT
Created attachment 162263 [details]
Stack trace of null pointer exception location

I've attached a stack trace of where the NPE occurs in Display.
Comment 2 Eclipse Webmaster CLA 2010-07-19 12:30:27 EDT
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug