Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How do a add cell editors to my property descriptors
How do a add cell editors to my property descriptors [message #466865] Wed, 18 January 2006 18:05 Go to next message
Eclipse UserFriend
Originally posted by: erica.mitchell.iona.com

I'm creating ComboBoxPropertyDescriptor for both enums and booleans. when i go to edit the value i'm getting an exception in ComboBoxCellEditor in doSetValue because its not getting an Integer for the boolean string. Can i programatically set the cell editors that each type of proeprty descriptor should be using?
Re: How do a add cell editors to my property descriptors [message #466871 is a reply to message #466865] Wed, 18 January 2006 19:09 Go to previous message
Eclipse UserFriend
Originally posted by: erica.mitchell.iona.com

found a solution

public class BooleanCellEditor extends ComboBoxCellEditor {

final Integer intTrue = new Integer(0);
final Integer intFalse = new Integer(1);

public BooleanCellEditor(Composite parent, int style) {
super(parent, new String[] {"true", "false"}, style);
}

protected Object doGetValue() {
return new Boolean(
((Integer)super.doGetValue()).intValue() == 0
);
}


protected void doSetValue(Object value) {
Assert.isTrue( value instanceof Boolean );
super.doSetValue( ((Boolean)value).booleanValue() ? intTrue : intFalse );
}
Previous Topic:OLE integration
Next Topic:About OutofmemoryException
Goto Forum:
  


Current Time: Mon Oct 14 05:53:26 GMT 2019

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

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

Back to the top