Skip to main content



      Home
Home » Eclipse Projects » GEF » ComboBoxPropertyDescriptor problem. I can't see combobox in the propertyviewer.
ComboBoxPropertyDescriptor problem. I can't see combobox in the propertyviewer. [message #247968] Mon, 30 March 2009 21:58
Eclipse UserFriend
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
Previous Topic:New Eclipse Project Proposal: AMP
Next Topic:PropertySheetView
Goto Forum:
  


Current Time: Sun Mar 16 16:35:52 EDT 2025

Powered by FUDForum. Page generated in 0.03693 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top