[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.rcp] Nebula widgets GalleryItem & DefaultGalleryItemRenderer
|
Hi,
I am using nebula widgets (Gallery) to give view like ICON view in Windows.
by the following code.
public static void main (final String[] args)
{
final Display display = new Display();
final Image itemImage = new Image(display, Program.findProgram("gif").getImageData());
final Shell shell = new Shell(display);
shell.setSize(400, 300);
shell.setLayout(new FillLayout());
final Gallery gallery = new Gallery(shell, SWT.V_SCROLL | SWT.MULTI);
// Renderers
final NoGroupRenderer gr = new NoGroupRenderer();
gr.setMinMargin(2);
gr.setItemSize(76, 56);
gr.setAutoMargin(true);
gallery.setGroupRenderer(gr);
final DefaultGalleryItemRenderer ir = new DefaultGalleryItemRenderer();
gallery.setItemRenderer(ir);
for (int g = 0; g < 1; g++)
{
final GalleryItem group = new GalleryItem(gallery, SWT.NONE);
group.setText("Group " + g);
group.setExpanded(true);
for (int i = 0; i < 1; i++)
{
final GalleryItem item = new GalleryItem(group, SWT.NONE);
if (itemImage != null)
{
item.setImage(itemImage);
}
item.setText("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
}
}
shell.open();
while (!shell.isDisposed())
{
if (!display.readAndDispatch())
{
display.sleep();
}
}
if (itemImage != null)
{
itemImage.dispose();
}
display.dispose();
}
here problem is that when I select an item I get a rectanle around it.(By modifying implementation of render class I removed that recatangle.) But now I need to make that image of the selected item must be selected as in the windows means only image must get a thin blue layer on it which makes it as selected.
Can any body help me??
Thanks..
With BR
Sandeep Goel...