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

Bug 67217

Summary: Properties sheet comboboxes throwing exceptions when not selected
Product: z_Archived Reporter: Alasdair McDowell <alasdair_mcdowell>
Component: VEAssignee: Richard Kulp <richkulp>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: jeff.myers, walkerp
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 67698    
Bug Blocks:    

Description Alasdair McDowell CLA 2004-06-15 08:48:19 EDT
20040613
Create a Shell
Select the "capture" property on the Properties sheet
Click off the property without setting it
An ArrayIndexOutOfBoundsException is thrown


The combobox is validated with a selection of element index -1
When the ComboBoxCellEditor tries to set the error message, it attempts to get 
the current value (items[-1]) which throws an exception

This occurs because the combobox is not populated correctly when the SWT 
component is selected.
Comment 1 Peter Walker CLA 2004-06-15 10:33:26 EDT
Alasdair,
I notice this happens for other properties on a Shell that have a true/false
setting such as 'visible'. This doesn't occur for the same type setting for JFC
components such as JFrame. Why is this? Are we using a different combo box cell
editor? Please investigate.
Comment 2 Alasdair McDowell CLA 2004-06-15 12:45:55 EDT
Update: Properties sheet inheriting null values from org.eclipse.ve.internal.
java.core.JavaCommandStackPropertySheetEntry
Comment 3 Peter Walker CLA 2004-06-17 14:21:03 EDT
Rich... please look at... needed for stable build.. thx
Comment 4 Richard Kulp CLA 2004-06-17 15:09:36 EDT
There are two problems here. The first is that the combobox cell editor in JFace
can't handle an invalid value. I opened bug 67698 to address this.

The second is, capture isn't really a property. It is set method on Control, but
there is no get method. So by introspection rules this is a write-only property.
The problem is that for write-only properties we can't get the current value. So
we always return null. However since this is a primitive boolean, null is
invalid. This is what messes up the combox cell editor. We can't just return
false or something because in all cases of comboxcell editors, we could choose
an invalid value and we would be back we were.

The thing is capture isn't really a property either, it is state that says
capture the mouse. That's not really a property. But the problem is we don't
have any properties shown in the beaninfo, so it did reflection instead and
found this. The best solution for capture is to have a beaninfo on Control that
doesn't return capture as a property.

But that doesn't fix it for other places where an invalid value can be set into
a combobox cell editor.
Comment 5 Peter Walker CLA 2004-06-18 08:00:33 EDT
Need to add beaninfo for controls so that write-only properties are hidden on
the property sheet.
Comment 6 Peter Walker CLA 2004-07-09 11:42:45 EDT
Rich, is there anything more that can be done here? I believe Jeff has made
changes to all beaninfos to hide the write only properties. And we have a
dependency on a JFace bug fix.
Comment 7 Richard Kulp CLA 2004-07-10 15:52:32 EDT
No, nothing we can do. It is an eclipse bug now.

Comment 8 Gili Mendel CLA 2004-07-12 10:58:42 EDT
With the fix on 67698 this bug is resolved.
Comment 9 Richard Kulp CLA 2004-07-31 11:19:10 EDT
1.0M2 is out, so these are now closed in M2.