| Summary: | click once gets response twice with gallery selection listener | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | David Song <micromms> |
| Component: | Nebula | Assignee: | Nicolas Richeton <nicolas.richeton> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | laurent.caron |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
Tried this today, the bug is no longer existing. |
Build Identifier: 20100506-2000 selection listener to the gallery just like below: Gallery gallery = new Gallery(info, SWT.BORDER | SWT.VIRTUAL | SWT.V_SCROLL); gallery.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1)); gallery.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { GalleryItem item = (GalleryItem)e.item; new ImagePreviewDialog(getShell(), item.getImage(), item.getText(), item.getDescription()).open(); } }); DefaultGalleryGroupRenderer gr = new DefaultGalleryGroupRenderer(); gr.setMinMargin(2); gr.setItemHeight(56); gr.setItemWidth(72); gr.setAutoMargin(true); gr.setFillIfSingleColumn(true); gallery.setGroupRenderer(gr); ListItemRenderer gi = new ListItemRenderer(); gi.setShowLabels(true); gallery.setItemRenderer(gi); InputStream input = null; Image img = null; //add the licence image GalleryItem licenceGroup = new GalleryItem(gallery, SWT.NONE); licenceGroup.setExpanded(false); licenceGroup.setText("Licence"); try { GalleryItem licence = new GalleryItem(licenceGroup, SWT.NONE); input = c.getLicenceCopy().getBinaryStream(); img = new Image(getShell().getDisplay(), input); licence.setText("Licence"); licence.setImage(img); } catch (Exception e) { e.printStackTrace(); } //add attachement images GalleryItem attachmentGroup = new GalleryItem(gallery, SWT.NONE); attachmentGroup.setExpanded(false); attachmentGroup.setText("Attachment"); for (CustomerAttachment attchment : c.getAttachments()) { try { GalleryItem group = new GalleryItem(attachmentGroup, SWT.NONE); group.setText(attchment.getTitle()); //$NON-NLS-1$ input = attchment.getAttachment().getBinaryStream(); img = new Image(getShell().getDisplay(), input); group.setImage(img); group.setDescription(attchment.getMemo()); } catch (SQLException e) { e.printStackTrace(); } } but when I click on the item, the same dialog opened twice. Reproducible: Always