[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Re: Table or TableViewerer - cell renderer

Hi,

Well Table/TableViewer is IMHO not 100% suited to display a lot of images because all images have to have the same size besides that what you need what you want to do Ownerdraw is not really needed.

If I where you and have to diplay images in Table like fashion I'd look at the http://www.eclipse.org/nebula/widgets/gallery/gallery.php it's designed for exactly this purpose.

If you still want to use a native table you should take a look at the CellLabelProvider-API which can return a background color for a cell (or if you are on pre 3.3 IColorProvider/ITableColorProvider).

Tom

lowell schrieb:
Hi, im new to Eclipse & swt . Im hoping to use a table or tableviewer to display a list of selectable images, im hoping to highlight the cell with a light foreground when the mouse is over, and keep the normal cell rendering when the item is selected i.e. dark blue. ive added a variable to a listerner for mouse events on the table which is set on mouse hover, or mouse enter, and use this variable in the listener for paint item events below...
#just some pseudo code
table.addListener(SWT.PaintItem, new Listener() {
public void handleEvent(Event event) {
// if selected display one colour
else if mouse over variable set select another else dipslay normal cell rendering


}
     }
   });

The mouse over variable is not being taken into consideration i.e. the behaviour i want for the mouse over highlight cell is not being done.
Any ideas, or am i using the wrong widget for this behaviour/?
Lowell





--
B e s t S o l u t i o n . at
--------------------------------------------------------------------
Tom Schindl                                          JFace-Committer
--------------------------------------------------------------------