Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350924

Summary: [M2x IDE Integration] EditOutletDialog enhancement
Product: [Automotive] Sphinx Reporter: Lan Phan <quoclan>
Component: CoreAssignee: Idrissa Dieng <idydieng>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ali.akar82, idydieng
Version: 0.7.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Lan Phan CLA 2011-07-01 07:38:05 EDT
Build Identifier: Eclipse 3.6.2

In case "editableName" = false, Name field always displays "<default>" through this code:
protected Control createDialogArea(Composite ancestor) {
...
if (editableName) {
	if (outlet.getName() != null) {
		nameText.setText(outlet.getName());
	}
	nameText.addModifyListener(listener);
} else {
	nameText.setText(Messages.label_default);
}
...
}

The code is not generic enough (usecase: user don't want to edit name of Outlet "abc", but Name field displays "<default>" - NOT OK).

Proposed solution:
if (outlet.getName() != null) {
	nameText.setText(outlet.getName());
}
if (editableName) {
	nameText.addModifyListener(listener);
} else {
	if (outlet.getName() == null) {
		nameText.setText(Messages.label_default);
	}
}

Reproducible: Always
Comment 1 Idrissa Dieng CLA 2011-08-22 09:22:26 EDT
Fixed as proposed solution.
Comment 2 Balazs Grill CLA 2021-07-14 02:16:03 EDT
Mass-closing Resolved tickets