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

Bug 68092

Summary: plug-in manifest editor not picking up the correct default boolean value
Product: [Eclipse Project] PDE Reporter: Murali Pattathe <pattathe>
Component: UIAssignee: PDE-UI-Inbox <pde-ui-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: P3    
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Murali Pattathe CLA 2004-06-21 16:18:09 EDT
An attribute is defined in the schema definition file as <attribute 
name="myAttr" type="boolean" use="default" value="true">. When a corresponding 
extension is created in the plug-in manifest editor, the element details page 
(on the right) always shows this default value as false, even though the 
attribute is not explicitly defined in the plugin.xml file and the schema 
definition indicates it should be true. 

The problem is in 
org.eclipse.pde.internal.ui.editor.plugin.rows.BooleanAttributeRow.update(). 
The code is as follows:

	protected void update() {
		blockNotification = true;
		String value = getValue();
		boolean state = value != null && value.toLowerCase().equals
("true"); //$NON-NLS-1$
		if (value==null) {
			//check the default
			ISchemaAttribute att = getAttribute();
			if (att.getUse()==ISchemaAttribute.DEFAULT) {
				Object dvalue = att.getValue();
				if (dvalue!=null && dvalue.equals("true")) //
$NON-NLS-1$
					state = true;
			}
		}
		button.setSelection(state);
		updateText();
		blockNotification=false;
	}

The problem is that the result of getValue() always returns an empty string 
(not null) when the attribute is not defined in the plugin.xml file. Therefore, 
the "if" check should be:

	if (value == null || value.length() == 0) {
Comment 1 Wassim Melhem CLA 2004-07-14 11:32:18 EDT
The checkbox has been changed to a combo box for several important reasons.
As a consequence, this bug will be addressed as part of bug 68785

*** This bug has been marked as a duplicate of 68785 ***