### Eclipse Workspace Patch 1.0
#P org.sophie2.main.dnd
|
|
|
9 | 9 | import java.net.URISyntaxException; |
10 | 10 | import java.util.ArrayList; |
11 | 11 | import java.util.List; |
12 | | import java.util.StringTokenizer; |
13 | 12 | |
14 | 13 | import org.sophie2.base.dnd.AwtTransferable; |
15 | 14 | import org.sophie2.base.dnd.DndData; |
… |
… |
|
75 | 74 | |
76 | 75 | private static List<File> textURIListToFileList(String data) { |
77 | 76 | List<File> list = new ArrayList<File>(1); |
78 | | for (StringTokenizer st = new StringTokenizer(data, "\r\n"); st.hasMoreTokens();) { |
79 | | String str = st.nextToken(); |
| 77 | for (String str : data.split("\r\n")) { |
80 | 78 | if (str.startsWith("#")) { |
81 | 79 | // the line is a comment (as per the RFC 2483) |
82 | 80 | continue; |
#P org.sophie2.main.func.resources
|
|
|
19 | 19 | import org.sophie2.main.app.commons.book.BookView; |
20 | 20 | import org.sophie2.main.app.commons.element.ElementView; |
21 | 21 | import org.sophie2.main.app.commons.page.RootPageView; |
| 22 | import org.sophie2.main.app.commons.util.AppViewUtil; |
22 | 23 | import org.sophie2.main.dialogs.input.ConfirmDialogInput; |
23 | 24 | import org.sophie2.main.dialogs.input.DialogUtils; |
24 | 25 | import org.sophie2.main.func.resources.view.ResourceDetailsPalette; |
| 26 | import org.sophie2.main.func.resources.view.ResourceDetailsPalette.DeleteResourceButton; |
25 | 27 | import org.sophie2.main.func.resources.view.ResourcesPalette.ResourceItem; |
26 | | import org.sophie2.main.func.resources.view.ResourceDetailsPalette.DeleteResourceButton; |
27 | 28 | |
28 | 29 | /** |
29 | 30 | * Represents the logic for handling the deleting resources event. |
… |
… |
|
49 | 50 | |
50 | 51 | assert palette != null : "The source must not be null!"; |
51 | 52 | |
52 | | BookDocView bookDocView = palette.findNearestElement(null, BookDocView.class); |
| 53 | BookDocView bookDocView = AppViewUtil.getCurrentBookDocView(palette); |
53 | 54 | ListPaletteItem selectedItem = |
54 | 55 | palette.resourcePalette().get().firstSelectedItem().get(); |
55 | 56 | |
… |
… |
|
76 | 77 | return deleteResource(resource, book); |
77 | 78 | } |
78 | 79 | |
79 | | DialogUtils.showErrorDialog(null, "The selected resource is currently in use.", |
80 | | "Could not delete resource"); |
| 80 | DialogUtils.showErrorDialog(null, "The selected resource is currently in use.", |
| 81 | "Could not delete resource"); |
81 | 82 | return true; |
82 | 83 | } |
83 | 84 | }; |
#P org.sophie2.main.app.commons
|
|
|
234 | 234 | for (String childName : children) { |
235 | 235 | RootKey key = RootKey.fromRef(ResourceRefR4.makeChild(childName)); |
236 | 236 | ResourceModel childModel = model.getSubModel(key); |
237 | | decapsulate(bookModel, childModel, ResourceRefR4.makeChild(childName), |
| 237 | decapsulate(bookModel, childModel, |
| 238 | bookToModel.append(ResourceRefR4.makeChild(childName)), |
238 | 239 | bookChanger, false); |
239 | 240 | } |
240 | 241 | } |
#P org.sophie2.main.app.halos
|
|
|
236 | 236 | ElementH parentH = ((ElementView) groupView.parent().get()).model().get(); |
237 | 237 | |
238 | 238 | final ResourceRefR4 relativeGroupRef = |
239 | | ResourceRefR4.getRelativeRef(groupRef, parentH.getRef()); |
| 239 | ResourceRefR4.getRelativeRef(parentH.getRef(), groupRef); |
240 | 240 | ResourceAccess parentAccess = parentH.getAccess(); |
241 | 241 | ImmList<ActivationChannel> channels = |
242 | 242 | CompositeElement.KEY_SUB_ELEMENTS.get(parentAccess); |