### Eclipse Workspace Patch 1.0
#P sophie
Index: modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/element/ElementLogic.java
===================================================================
--- modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/element/ElementLogic.java	(revision 8460)
+++ modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/element/ElementLogic.java	(working copy)
@@ -175,6 +175,10 @@
 				// prepare the child models and refs in final ImmLists to use in the AutoAction
 				ResourceAccess fakeParentAccess = locator.create(fakeParentRef, null , head);
 				ResourceRefList resourcesToPaste = ResourceR4.KEY_CHILDREN.getRefs(fakeParentAccess);
+				if (resourcesToPaste == null) {
+					return false;
+				}
+				
 				ImmList<ResourceModel> childModels = ImmTreeList.<ResourceModel>empty();
 				ImmList<ResourceRefR4> childRefs = ImmTreeList.<ResourceRefR4>empty();
 				for (ResourceRefR4 ref : resourcesToPaste) {
Index: modules/org.sophie2.main.func.text/src/main/java/org/sophie2/main/func/text/view/TextFrameLogic.java
===================================================================
--- modules/org.sophie2.main.func.text/src/main/java/org/sophie2/main/func/text/view/TextFrameLogic.java	(revision 8460)
+++ modules/org.sophie2.main.func.text/src/main/java/org/sophie2/main/func/text/view/TextFrameLogic.java	(working copy)
@@ -4,29 +4,24 @@
 import org.sophie2.base.commons.structures.ImmTreeMap;
 import org.sophie2.base.commons.util.ImmMap.ImmEntry;
 import org.sophie2.base.commons.util.position.ImmPoint;
-import org.sophie2.base.dnd.SophieDragDropHandler;
 import org.sophie2.base.model.book.MouseLinkTriggers;
 import org.sophie2.base.model.book.links.LinkTrigger;
 import org.sophie2.base.model.resources.r4.access.ResourceAccess;
 import org.sophie2.base.model.text.Attachment;
 import org.sophie2.base.model.text.mvc.TextView;
-import org.sophie2.base.model.text.mvc.TextViewFlow;
 import org.sophie2.base.model.text.smart.HotPos;
 import org.sophie2.base.model.text.smart.ImmHotText;
 import org.sophie2.base.model.text.smart.layout.HotLayoutPoint;
 import org.sophie2.base.model.text.smart.position.HotInterval;
-import org.sophie2.base.visual.VisualElement;
 import org.sophie2.base.visual.interaction.InputEventR3;
 import org.sophie2.base.visual.interaction.MouseButton;
 import org.sophie2.core.mvc.EventFilterBuilder;
 import org.sophie2.core.mvc.LogicR3;
 import org.sophie2.core.mvc.OperationDef;
-import org.sophie2.core.mvc.SortKey;
 import org.sophie2.core.mvc.events.EventR3;
 import org.sophie2.main.app.commons.frame.FrameView;
 import org.sophie2.main.app.commons.links.LinkAttachment;
 import org.sophie2.main.app.commons.links.LinkProcessorLogic;
-import org.sophie2.main.app.halos.common.AppHaloUtil;
 import org.sophie2.main.func.text.model.HotTextResourceH;
 
 /**
@@ -36,92 +31,8 @@
  * @author pap
  */
 public enum TextFrameLogic implements OperationDef {
-	
-	/**
-	 *	Handles "copy" regarding text. 
-	 */
-	@SortKey("mmm-copy-text")
-	ON_COPY {
 
-		public void defineFilter(EventFilterBuilder filter) {
-			filter.setEventId(SophieDragDropHandler.TransferEventIds.COPY);
-			filter.setSourceClass(VisualElement.class);
-		}
-
-		public boolean handle(EventR3 event) {
-			VisualElement source = event.getSource(VisualElement.class);
-			TextFrameView selectedFrame = AppHaloUtil.getSingleSelected(source, TextFrameView.class);
-			if (selectedFrame != null) {
-				TextView textView = selectedFrame.textView().get();
-				TextViewFlow flow = selectedFrame.textFlow().get();
-				//TODO : This comparator sucks. The interval seems to have an idea about the
-				//ImmHotText it is part of.
-				if ( !flow.getSelectionInterval().isEmpty(flow.getText().getPosComparator()) ) {
-					return LogicR3.fire(textView, null, null, event, TextView.EventIds.COPY);
-				}
-			}
-			
-			return false;
-		}
-		
-	},
-	
 	/**
-	 * Handles "Cut" regarding text 
-	 */
-	@SortKey("mmm-cut-text")
-	ON_CUT {
-
-		public void defineFilter(EventFilterBuilder filter) {
-			filter.setEventId(SophieDragDropHandler.TransferEventIds.CUT);
-			filter.setSourceClass(VisualElement.class);
-		}
-
-		public boolean handle(EventR3 event) {
-			VisualElement source = event.getSource(VisualElement.class);
-			TextFrameView selectedFrame = AppHaloUtil.getSingleSelected(source, TextFrameView.class);
-			if (selectedFrame != null) {
-				TextView textView = selectedFrame.textView().get();
-				TextViewFlow flow = selectedFrame.textFlow().get();
-				//TODO : This comparator sucks. The interval seems to have an idea about the
-				//ImmHotText it is part of.
-				if ( !flow.getSelectionInterval().isEmpty(flow.getText().getPosComparator()) ) {
-					return LogicR3.fire(textView, null, null, event, TextView.EventIds.CUT);
-				}
-			}
-			
-			return false;
-		}
-		
-		
-	},
-	
-	/**
-	 * Handles pasting of text.
-	 */
-	@SortKey("mmm-paste-text")
-	ON_PASTE {
-
-		public void defineFilter(EventFilterBuilder filter) {
-			filter.setEventId(SophieDragDropHandler.TransferEventIds.PASTE);
-			filter.setSourceClass(VisualElement.class);
-		}
-
-		public boolean handle(EventR3 event) {
-			VisualElement source = event.getSource(VisualElement.class);
-			TextFrameView selectedFrame = AppHaloUtil.getSingleSelected(source, TextFrameView.class);
-			if (selectedFrame != null) {
-				TextView textView = selectedFrame.textView().get();
-				return LogicR3.fire(textView, null, null, event, TextView.EventIds.PASTE);
-			}
-			
-			return false;
-		}
-		
-
-	},
-
-	/**
 	 * Takes care of highlighting hovered text links 
 	 * and firing {@link LinkProcessorLogic.LinkEvent#LINK_ACTION_TRIGGERED} event
 	 * if the {@link MouseLinkTriggers}'s MOUSE_ENTER or MOUSE_LEAVE triggers have been evoked.
Index: modules/org.sophie2.main.func.text/src/main/java/org/sophie2/main/func/text/view/HotTextLogic.java
===================================================================
--- modules/org.sophie2.main.func.text/src/main/java/org/sophie2/main/func/text/view/HotTextLogic.java	(revision 8460)
+++ modules/org.sophie2.main.func.text/src/main/java/org/sophie2/main/func/text/view/HotTextLogic.java	(working copy)
@@ -27,6 +27,7 @@
 import org.sophie2.base.model.text.smart.position.HotInterval;
 import org.sophie2.base.model.text.smart.style.HotStyleDef;
 import org.sophie2.base.visual.BaseVisualElement;
+import org.sophie2.base.visual.VisualElement;
 import org.sophie2.core.mvc.EventFilterBuilder;
 import org.sophie2.core.mvc.LogicR3;
 import org.sophie2.core.mvc.OperationDef;
@@ -38,6 +39,7 @@
 import org.sophie2.main.app.commons.book.panels.QuickSearchPanel;
 import org.sophie2.main.app.commons.element.ElementView;
 import org.sophie2.main.app.commons.page.PageWorkArea;
+import org.sophie2.main.app.halos.common.AppHaloUtil;
 import org.sophie2.main.func.text.model.HotTextResourceH;
 import org.sophie2.main.func.text.model.HotTextResourceR4;
 import org.sophie2.main.func.text.rtf.RtfTextImportManager;
@@ -241,6 +243,91 @@
 			
 			return false;
 		}
+	},
+	
+	/**
+	 *	Handles "copy" regarding text. 
+	 */
+	@SortKey("mmm-copy-text")
+	ON_MENU_COPY {
+
+		public void defineFilter(EventFilterBuilder filter) {
+			filter.setEventId(SophieDragDropHandler.TransferEventIds.COPY);
+			filter.setSourceClass(VisualElement.class);
+		}
+
+		public boolean handle(EventR3 event) {
+			VisualElement source = event.getSource(VisualElement.class);
+			ElementView selectedElement = AppHaloUtil.getSingleSelected(source, ElementView.class);
+			if (selectedElement != null && selectedElement instanceof TextElement) {
+				TextView textView = ((TextElement) selectedElement).textView().get();
+				TextViewFlow flow = textView.textFlow().get();
+				//TODO : This comparator sucks. The interval seems to have an idea about the
+				//ImmHotText it is part of.
+				if ( !flow.getSelectionInterval().isEmpty(flow.getText().getPosComparator()) ) {
+					return LogicR3.fire(textView, null, null, event, TextView.EventIds.COPY);
+				}
+			}
+			
+			return false;
+		}
+		
+	},
+	
+	/**
+	 * Handles "Cut" regarding text 
+	 */
+	@SortKey("mmm-cut-text")
+	ON_MENU_CUT {
+
+		public void defineFilter(EventFilterBuilder filter) {
+			filter.setEventId(SophieDragDropHandler.TransferEventIds.CUT);
+			filter.setSourceClass(VisualElement.class);
+		}
+
+		public boolean handle(EventR3 event) {
+			VisualElement source = event.getSource(VisualElement.class);
+			ElementView selectedElement = AppHaloUtil.getSingleSelected(source, ElementView.class);
+			if (selectedElement != null && selectedElement instanceof TextElement) {
+				TextView textView = ((TextElement)selectedElement).textView().get();
+				TextViewFlow flow = textView.textFlow().get();
+				//TODO : This comparator sucks. The interval seems to have an idea about the
+				//ImmHotText it is part of.
+				if ( !flow.getSelectionInterval().isEmpty(flow.getText().getPosComparator()) ) {
+					return LogicR3.fire(textView, null, null, event, TextView.EventIds.CUT);
+				}
+			}
+			
+			return false;
+		}
+		
+		
+	},
+	
+	/**
+	 * Handles pasting of text.
+	 */
+	@SortKey("mmm-paste-text")
+	ON_MENU_PASTE {
+
+		public void defineFilter(EventFilterBuilder filter) {
+			filter.setEventId(SophieDragDropHandler.TransferEventIds.PASTE);
+			filter.setSourceClass(VisualElement.class);
+		}
+
+		public boolean handle(EventR3 event) {
+			VisualElement source = event.getSource(VisualElement.class);
+			ElementView selectedElement = AppHaloUtil.getSingleSelected(source, ElementView.class);
+			if (selectedElement != null && selectedElement instanceof TextElement) {
+				TextView textView = ((TextElement)selectedElement).textView().get();
+				LogicR3.fire(textView, null, null, event, TextView.EventIds.PASTE);
+				return true;
+			}
+			
+			return false;
+		}
+		
+
 	};
 	
 	/**

