[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: How to realize this kind of combobox in a table

I think the easiest way to do this is to add a table editor which will use a Combo control.

TableEditor myEditor = new TableEditor(yourSWTTable);
myEditor.addListener(SWT.FocusOut,this); //Implies your class implements Listener
myEditor.addListener(SWT.Traverse,this);
Combo comboEditor = new Combo(yourSWTTable,SWT.NONE);
// Add your own proposals
comboEditor.add( "Your combo proposals");
myEditor.setEditor(comboEditor,selectedTableItem.getText(selectedColumnIndex));


Have a look to the SWT snippets on "TableEditor" :
http://www.eclipse.org/swt/snippets/

Hope you will find what you need.

Christophe.


"Ace.M" <xxx@xxxxxxxxxxxx> a écrit dans le message de news:fhgskg$p5p$1@xxxxxxxxxxxxxxxxxxxx
Hi
   In my application, I need to realize this kind of combobox in a table:
    1. When the cell is activated, the drop down arrow of the combobox
will  show. When the cell loses the focus, the drop down arrow of the
combobox will disappear.(as is shown in the attached file)
    2. I need to change the background color of the combobox.

How can I reach it, thanks.