Bug 463892 - [DiaGen] [DirectEdit] change an instanceof in the method performDirectEdit(char initialCharacter)
Summary: [DiaGen] [DirectEdit] change an instanceof in the method performDirectEdit(ch...
Status: NEW
Alias: None
Product: Papyrus
Classification: Modeling
Component: Diagram (show other bugs)
Version: 1.0.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 463550
  Show dependency tree
 
Reported: 2015-04-03 08:33 EDT by Vincent Lorenzo CLA
Modified: 2017-09-08 09:57 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Lorenzo CLA 2015-04-03 08:33:47 EDT
See bug 463550. The first character typed is lost since the fix of the  Bug 444063 - [Undo/Redo] Undo is broken after fast class creation. 
The class MultilineLabelDirectEditManager was not yet an instance of TextDirectEditManager, but an instance of DirectEditManagerBase. 

I propose to modify the template in order to generate this code :
	private void performDirectEdit(char initialCharacter) {
		if (getManager() instanceof DirectEditManagerBase) {
			((DirectEditManagerBase) getManager()).show(initialCharacter);
		} else {
			performDirectEdit();
		}
	}
	
instead of 

private void performDirectEdit(char initialCharacter) {
		if (getManager() instanceof TextDirectEditManager) {
			((TextDirectEditManager) getManager()).show(initialCharacter);
		} else {
			performDirectEdit();
		}
	}