Ticket #2355: resource-delete-exceptions.patch

File resource-delete-exceptions.patch, 4.3 KB (added by deni, 15 years ago)
  • src/main/java/org/sophie2/main/dnd/dnddata/FileListData.java

    ### Eclipse Workspace Patch 1.0
    #P org.sophie2.main.dnd
     
    99import java.net.URISyntaxException; 
    1010import java.util.ArrayList; 
    1111import java.util.List; 
    12 import java.util.StringTokenizer; 
    1312 
    1413import org.sophie2.base.dnd.AwtTransferable; 
    1514import org.sophie2.base.dnd.DndData; 
     
    7574                 
    7675                private static List<File> textURIListToFileList(String data) { 
    7776                        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")) { 
    8078                                if (str.startsWith("#")) { 
    8179                                        // the line is a comment (as per the RFC 2483) 
    8280                                        continue; 
  • src/main/java/org/sophie2/main/func/resources/logic/ResourceDeleteLogic.java

    #P org.sophie2.main.func.resources
     
    1919import org.sophie2.main.app.commons.book.BookView; 
    2020import org.sophie2.main.app.commons.element.ElementView; 
    2121import org.sophie2.main.app.commons.page.RootPageView; 
     22import org.sophie2.main.app.commons.util.AppViewUtil; 
    2223import org.sophie2.main.dialogs.input.ConfirmDialogInput; 
    2324import org.sophie2.main.dialogs.input.DialogUtils; 
    2425import org.sophie2.main.func.resources.view.ResourceDetailsPalette; 
     26import org.sophie2.main.func.resources.view.ResourceDetailsPalette.DeleteResourceButton; 
    2527import org.sophie2.main.func.resources.view.ResourcesPalette.ResourceItem; 
    26 import org.sophie2.main.func.resources.view.ResourceDetailsPalette.DeleteResourceButton; 
    2728 
    2829/** 
    2930 * Represents the logic for handling the deleting resources event. 
     
    4950 
    5051                        assert palette != null : "The source must not be null!"; 
    5152 
    52                         BookDocView bookDocView = palette.findNearestElement(null, BookDocView.class); 
     53                        BookDocView bookDocView = AppViewUtil.getCurrentBookDocView(palette); 
    5354                        ListPaletteItem selectedItem =  
    5455                                palette.resourcePalette().get().firstSelectedItem().get(); 
    5556 
     
    7677                                return deleteResource(resource, book); 
    7778                        } 
    7879 
    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"); 
    8182                        return true; 
    8283                } 
    8384        }; 
  • src/main/java/org/sophie2/main/app/commons/element/CopyUtil.java

    #P org.sophie2.main.app.commons
     
    234234                        for (String childName : children) { 
    235235                                RootKey key = RootKey.fromRef(ResourceRefR4.makeChild(childName)); 
    236236                                ResourceModel childModel = model.getSubModel(key); 
    237                                 decapsulate(bookModel, childModel, ResourceRefR4.makeChild(childName),  
     237                                decapsulate(bookModel, childModel, 
     238                                                bookToModel.append(ResourceRefR4.makeChild(childName)),  
    238239                                                bookChanger, false); 
    239240                        } 
    240241                } 
  • src/main/java/org/sophie2/main/app/halos/grouping/GroupHalosLogic.java

    #P org.sophie2.main.app.halos
     
    236236                        ElementH parentH = ((ElementView) groupView.parent().get()).model().get(); 
    237237                         
    238238                        final ResourceRefR4 relativeGroupRef =  
    239                                 ResourceRefR4.getRelativeRef(groupRef, parentH.getRef()); 
     239                                ResourceRefR4.getRelativeRef(parentH.getRef(), groupRef); 
    240240                        ResourceAccess parentAccess = parentH.getAccess(); 
    241241                        ImmList<ActivationChannel> channels =  
    242242                                CompositeElement.KEY_SUB_ELEMENTS.get(parentAccess);