Skip to content

Commit

Permalink
[25838] MolemaxImage Viewer DND Fehler behoben (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daksic28 authored and huthomas committed Dec 14, 2023
1 parent 857344a commit 3e5f702
Showing 1 changed file with 11 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,43 +337,36 @@ public void drop(DropTargetEvent event) {
}
}
GalleryItem parentGroup = gallery.getItem(new Point(event.x, event.y));
GalleryItem newItem;
if (parentGroup != null && parentGroup.getParentItem() == null) {
GalleryItem newItem = new GalleryItem(parentGroup, SWT.NONE);
newItem.setImage(image);
newItem.setData(targetPath);
createdImages.add(image);
lastAddedItem = newItem;
newItem = new GalleryItem(parentGroup, SWT.NONE);
} else {
GalleryItem newItem = new GalleryItem(gallery, SWT.NONE);
newItem.setImage(image);
newItem.setData(targetPath);
createdImages.add(image);
lastAddedItem = newItem;
newItem = new GalleryItem(gallery, SWT.NONE);
}
} finally {
newItem.setImage(image);
newItem.setData(targetPath);
createdImages.add(image);
lastAddedItem = newItem;
} catch (Exception e) {
LoggerFactory.getLogger(getClass()).warn("Error processing image file", e);
if (image != null && !image.isDisposed()) {
image.dispose();
}
}
}
updateGalleryForPatient(aktuellerPatient);
for (GalleryItem group : gallery.getItems()) {
if (group.getText().equals(groupName)) {
group.setExpanded(true);
} else {
group.setExpanded(false);
}
group.setExpanded(group.getText().equals(groupName));
}
if (lastAddedItem != null && Arrays.asList(gallery.getItems()).contains(lastAddedItem)) {
gallery.setSelection(new GalleryItem[] { lastAddedItem });
}
} else {
}
} else {
String sourcePath = (String) event.data;
GalleryItem targetGroup = gallery.getItem(new Point(event.x, event.y));
if (targetGroup != null) {
}
}
}
}
});
Expand Down

0 comments on commit 3e5f702

Please sign in to comment.