Ticket #2487: 2487.patch
File 2487.patch, 4.9 KB (added by deni, 15 years ago) |
---|
-
modules/org.sophie2.main.func.resources/src/main/java/org/sophie2/main/func/resources/logic/ResourceImportLogic.java
### Eclipse Workspace Patch 1.0 #P sophie
47 47 import org.sophie2.main.app.commons.frame.FrameView; 48 48 import org.sophie2.main.app.commons.page.MainPageView; 49 49 import org.sophie2.main.app.commons.page.PageWorkArea; 50 import org.sophie2.main.app.commons.page.PwaSelector; 50 51 import org.sophie2.main.app.commons.util.AppViewUtil; 51 52 import org.sophie2.main.app.menus.insert.InsertResourceMenuItem; 52 53 import org.sophie2.main.dialogs.input.file.FileDialogInput; … … 491 492 } 492 493 493 494 public boolean handle(EventR3 event) { 494 FrameView view = event.getSource(FrameView.class); 495 FrameView view = event.getSource(FrameView.class); 496 if (view.getViewOptions().isPreviewMode()) { 497 return false; 498 } 495 499 496 if (view.getViewOptions().isPreviewMode()497 || !view.getPwa().getSel().isEditable(view)) {500 PwaSelector selector = view.getPwa().getSel(); 501 if (!selector.getSelected().contains(view)) { 498 502 return false; 499 503 } 500 504 -
modules/org.sophie2.main.func.resources/src/main/java/org/sophie2/main/func/resources/logic/DndChangeBackgroundLogic.java
14 14 import org.sophie2.core.mvc.events.EventR3; 15 15 import org.sophie2.main.app.commons.element.ElementView; 16 16 import org.sophie2.main.app.commons.frame.FrameView; 17 import org.sophie2.main.app.commons.page.PwaSelector; 17 18 import org.sophie2.main.app.commons.page.RootPageView; 18 19 19 20 /** … … 43 44 return false; 44 45 } 45 46 47 PwaSelector selector = view.getPwa().getSel(); 48 if (!selector.getSelected().contains(view)) { 49 return false; 50 } 51 46 52 // check whether the resource was dropped over the background zone or not 47 53 ImmPoint point = event.getEventParam( 48 54 SophieDragDropHandler.TransferEventIds.POINT_PARAM_INDEX, -
modules/org.sophie2.main.func.templates/src/main/java/org/sophie2/main/func/templates/frame/FrameTemplateLogic.java
27 27 import org.sophie2.main.app.commons.frame.FrameView; 28 28 import org.sophie2.main.app.commons.page.MainPageView; 29 29 import org.sophie2.main.app.commons.page.PageWorkArea; 30 import org.sophie2.main.app.commons.page.PwaSelector; 30 31 import org.sophie2.main.app.commons.util.AppViewUtil; 31 32 import org.sophie2.main.app.commons.util.TemplateUtil; 32 33 import org.sophie2.main.dnd.TemplateRefData; … … 62 63 return false; 63 64 } 64 65 66 PwaSelector selector = frameView.getPwa().getSel(); 67 if (!selector.getSelected().contains(frameView)) { 68 return false; 69 } 70 65 71 TemplateRefData data = preImport.getTransferable().getDndData(TemplateRefData.class); 66 72 if (data == null) { 67 73 return false; -
modules/org.sophie2.main.func.templates/src/main/java/org/sophie2/main/func/templates/book/CreateBookByTemplateHandler.java
9 9 import org.sophie2.main.app.commons.element.ResourceDropHandler; 10 10 import org.sophie2.main.app.commons.util.AppViewUtil; 11 11 import org.sophie2.main.dnd.TemplateRefData; 12 import org.sophie2.main.func.templates.frame.ApplyFrameTemplateHandler;13 12 14 13 /** 15 14 * Creates a new book from a template. This handler is called when a book … … 26 25 } 27 26 28 27 /** 29 * Gets the {@link ApplyFrameTemplateHandler}.28 * Gets the {@link CreateBookByTemplateHandler}. 30 29 * 31 30 * @return 32 * The {@link ApplyFrameTemplateHandler} instance.31 * The {@link CreateBookByTemplateHandler} instance. 33 32 */ 34 33 public static CreateBookByTemplateHandler get() { 35 34 if (instance == null) {