ComboBoxPropertyDescriptor BUG [message #204051] |
Mon, 01 March 2004 09:52 |
Eclipse User |
|
|
|
Originally posted by: giant1972.hotmail.com
Hi.
I have a little problem.
I create a Property Sheet and implementing:
myEditPart implements org.eclipse.ui.views.properties.IPropertySource...
...
...
public IPropertyDescriptor[] getPropertyDescriptors(){
String[] truefalse={"true","false","none"};
IPropertyDescriptor[] ret=new IPropertyDescriptor[parameters.length+3];
ret[0]=new TextPropertyDescriptor("size","size");
ret[1]=new TextPropertyDescriptor("position","position");
ret[2]=new TextPropertyDescriptor("name","name");
for (int i=0;i<parameters.length;i++){
if (parameters[i][0].equals("visible")){
ComboBoxPropertyDescriptor a=new
ComboBoxPropertyDescriptor(parameters[i][0],parameters[i][0] ,truefalse);
ret[i+3]=a;
}
else {
TextPropertyDescriptor a=new
TextPropertyDescriptor(parameters[i][0],parameters[i][0]);
ret[i+3]=a;
}
}
for (int i=0;i<ret.length;i++){
IPropertyDescriptor td=ret[i];
if
(td.getDisplayName().startsWith("font"))((TextPropertyDescriptor)td).setCategory( "Graph");
else else if
(td.getDisplayName().equals("visible" ))((org.eclipse.ui.views.properties.ComboBoxPropertyDescript or)td).setCategory( "Graph");
}
return ret;
}
...
This is done to use a ComboBox to select between 2 or more choices (in my
example the choices are "true", "false" and "none") in the propertysheet
called "visible".
The problem is that when I click on this property ("visible") I reach:
Reason:
Assertion failed:
Unhandled exception caught in event loop.
I see the Eclipse code in debug and see that this Exception goes up when
the environment expect an Integer and find a String (I use "true", "false"
and "none" that are Strings NOT number).
In the example and in the documentation there is:
public class ComboBoxPropertyDescriptor
extends PropertyDescriptor
...Example:
String[] values = {"Top left", "Top right", "Bottom left", "Bottom
right"};
IPropertyDescriptor pd = new ComboBoxPropertyDescriptor("origin",
"Origin", values);
Now, the example given with documentation doesn't go, WHY?
I think this is a bug. Is really??
Thanks all, Gino.
|
|
|
Powered by
FUDForum. Page generated in 0.05369 seconds