ComboBoxPropertyDescriptor problem. I can't see combobox in the propertyviewer. [message #247968] |
Mon, 30 March 2009 21:58 |
Eclipse User |
|
|
|
Originally posted by: sjgleam.gmail.com
source code is below..
protected static IPropertyDescriptor[] descriptors = null;
static {
PropertyDescriptor acDescriptor = new TextPropertyDescriptor("ac", "AC");
PropertyDescriptor stDescriptor = new TextPropertyDescriptor("st", "ST");
PropertyDescriptor tStopDescriptor1 = new TextPropertyDescriptor("tstop1",
"TStop1");
String [] values = new String[]{"x1", "x2"};
ComboBoxPropertyDescriptor cOutputDescriptor = new
ComboBoxPropertyDescriptor("output", "Output", values);
cOutputDescriptor.setDescription("aa");
cOutputDescriptor.setCategory("Test");
descriptors = new IPropertyDescriptor[] {
acDescriptor, stDescriptor, tStopDescriptor1, cOutputDescriptor};
}
public AcType14() {
setSize(new Dimension(80, 50));
setPropertyValue("ac", "");
setPropertyValue("st", "");
setPropertyValue("tstop1", "1 (s)");
setPropertyValue("output", "1");
}
public IPropertyDescriptor[] getPropertyDescriptors() {
return descriptors;
}
final void setPropertyValue(String propName, Object val) {
if(val == null) {
return;
}
Object oldValue = null;
if(properties.containsKey(propName)) {
oldValue = properties.get(propName);
if(oldValue.equals(val)){
return;
}
}
if("Output".equals(propName)){
properties.put(propName, Integer.parseInt(val.toString()));
}else{
properties.put(propName, val);
}
firePropertyChange(propName, oldValue, val);
}
what's the problem with this code?
somebody help please
|
|
|
Powered by
FUDForum. Page generated in 0.03693 seconds