Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] Storing Objects in CCombo


SWT doesn't work that way.  You'll have to provide strings for the combo.  You can use setData() to store an array of objects witht he combo and map the selected index back to an item in the array.  If the combo is editable, this obviously won't work because the user can enter an item that isn't in the list.



"Paul Cooper" <paul_premis@xxxxxxxxxxxxxxx>
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx

06/17/2005 04:47 PM

Please respond to
"Eclipse Platform SWT component developers list."

To
"'Eclipse Platform SWT component developers list.'" <platform-swt-dev@xxxxxxxxxxx>
cc
Subject
RE: [platform-swt-dev] Storing Objects in CCombo





Via the object.toString() method? That's how Swing works.

-----Original Message-----
From: platform-swt-dev-bounces@xxxxxxxxxxx
[mailto:platform-swt-dev-bounces@xxxxxxxxxxx] On Behalf Of Sam Detweiler
Sent: Friday, June 17, 2005 4:38 PM
To: Eclipse Platform SWT component developers list.
Subject: Re: [platform-swt-dev] Storing Objects in CCombo

How should a CCombo list render an 'object'?

Sam





                                                                         
            "Paul Cooper"                                                
            <paul_premis@coop                                            
            erscoop.com>                                               To
            Sent by:                  "SWT Mailing List"                  
            platform-swt-dev-         <platform-swt-dev@xxxxxxxxxxx>      
            bounces@eclipse.o                                          cc
            rg                                                            
                                                                  Subject
                                      [platform-swt-dev] Storing Objects  
            06/17/2005 02:40          in CCombo                          
            PM                                                            
                                                                         
                                                                         
            Please respond to                                            
            "Eclipse Platform                                            
              SWT component                                              
            developers list."                                            
                                                                         
                                                                         




Greetings list, I'm a SWT newbie but have worked with Swing for a
while.....I've done a fair amount of searching my question, and failed
miserably to find a solution to my question.

Is there a way to store Objects in the CCombo list? It appears from the API
that the only method available to set a combobox component list is
setData(String[]). Is there a method that allows storing Objects? Or is
there another Widget I should use for a Combo box?

TIA

Paul Cooper
Software Developer
EMS Performance Improvement Center

Department of Emergency Medicine
University of North Carolina-Chapel Hill
10002 Main Street
Chapel Hill, NC
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


Back to the top