Ticket #2265: copy-paste-in-reader.patch

File copy-paste-in-reader.patch, 5.3 KB (added by deni, 15 years ago)
  • src/main/java/org/sophie2/extra/func/scripting/view/InsertScriptFileItem.java

    ### Eclipse Workspace Patch 1.0
    #P org.sophie2.extra.func.scripting
     
    66import org.sophie2.base.visual.skins.ElementSkinPart; 
    77import org.sophie2.base.visual.skins.SkinPartDef; 
    88import org.sophie2.base.visual.skins.VisualElementDef; 
     9import org.sophie2.main.app.commons.book.BookView; 
     10import org.sophie2.main.app.commons.util.AppViewUtil; 
    911import org.sophie2.main.app.menus.edit.EditMenu; 
    1012 
    1113/** 
     
    2729         
    2830        @Override 
    2931        protected boolean computeEnabled() { 
    30                 return true; 
     32                BookView bookView = AppViewUtil.getCurrentBookView(this); 
     33                return bookView != null && !bookView.getViewOptions().isPreviewMode(); 
    3134        } 
    3235} 
  • src/main/java/org/sophie2/extra/func/scripting/view/InsertScriptItem.java

     
    99import org.sophie2.base.visual.skins.ElementSkinPart; 
    1010import org.sophie2.base.visual.skins.SkinPartDef; 
    1111import org.sophie2.base.visual.skins.VisualElementDef; 
     12import org.sophie2.main.app.commons.book.BookView; 
     13import org.sophie2.main.app.commons.util.AppViewUtil; 
    1214import org.sophie2.main.app.menus.edit.EditMenu; 
    1315 
    1416/** 
     
    3032         
    3133        @Override 
    3234        protected boolean computeEnabled() { 
    33                 return true; 
     35                BookView bookView = AppViewUtil.getCurrentBookView(this); 
     36                return bookView != null && !bookView.getViewOptions().isPreviewMode(); 
    3437        } 
    3538} 
  • src/main/java/org/sophie2/base/scene/helpers/HotTextElementHelper.java

    #P org.sophie2.base.scene
     
    102102                                HotHighlight selectionHighlight = new HotHighlight(new HotInterval(markPos, caretPos),  
    103103                                                style); 
    104104         
    105                                  
    106                                 if (isEditable) { 
    107                                         highlights = highlights.add(0, selectionHighlight); 
    108                                 } 
     105                                highlights = highlights.add(0, selectionHighlight); 
    109106                        } 
    110107                        HotHighlightSet highlightSet = new HotHighlightSet(highlights); 
    111108 
  • src/main/java/org/sophie2/main/app/commons/element/ElementLogic.java

    #P org.sophie2.main.app.commons
     
    290290 
    291291        private static void handleCutOrCopy(VisualElement source, Operation operation) { 
    292292                BookDocView docView = AppViewUtil.getCurrentBookDocView(source); 
    293                 if (docView == null) { 
    294                         return ; 
     293                if (docView == null || docView.bookView().get().getViewOptions().isPreviewMode()) { 
     294                        return; 
    295295                } 
    296296                PageWorkArea workArea = docView.workArea().get(); 
    297297                 
  • src/main/java/org/sophie2/main/app/menus/edit/UndoItem.java

    #P org.sophie2.main.app.menus
     
    3030 
    3131        @Override 
    3232        protected boolean computeEnabled() { 
    33                 return ((getCurrentBookDocView() != null) &&  
    34                                 MetaChange.findRevToUndo( 
    35                                 getCurrentBookDocView().getAccess()) != null); 
     33                return getCurrentBookDocView() != null  
     34                        && !getCurrentBookDocView().bookView().get().getViewOptions().isPreviewMode() 
     35                        && MetaChange.findRevToUndo(getCurrentBookDocView().getAccess()) != null; 
    3636        } 
    3737         
    3838        @Override 
  • src/main/java/org/sophie2/main/app/menus/edit/RedoItem.java

     
    3030 
    3131        @Override 
    3232        protected boolean computeEnabled() { 
    33                 return (getCurrentBookDocView() != null) &&  
    34                                 MetaChange.findRevToRedo( 
    35                                 getCurrentBookDocView().getAccess()) != null; 
     33                return getCurrentBookDocView() != null  
     34                        && !getCurrentBookDocView().bookView().get().getViewOptions().isPreviewMode() 
     35                        && MetaChange.findRevToRedo(getCurrentBookDocView().getAccess()) != null; 
    3636        } 
    3737         
    3838        @Override 
  • src/main/java/org/sophie2/main/app/menus/edit/EditMenu.java

     
    2525 
    2626        @Override 
    2727        protected boolean computeEnabled() { 
    28                 return getCurrentBook() != null && getCurrentBookWindow() != null 
    29                                 && !getCurrentBookWindow().getViewOptions().isPreviewMode(); 
     28                return getCurrentBookWindow() != null; 
    3029        } 
    3130}