| Summary: | plug-in manifest editor not picking up the correct default boolean value | ||
|---|---|---|---|
| Product: | [Eclipse Project] PDE | Reporter: | Murali Pattathe <pattathe> |
| Component: | UI | Assignee: | 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: | |||
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) {