Changeset 8778

Show
Ignore:
Timestamp:
03/08/10 17:17:31 (6 months ago)
Author:
meddle
Message:
#2265 copy-paste-in-reader - The user should be able to copy text from frames and stickies, and to paste text into stickies. : Implementation (reviewed by meddle and deyan, implemented by deni)
Location:
trunk/sophie2-platform/modules
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/sophie2-platform/modules/org.sophie2.base.scene/src/main/java/org/sophie2/base/scene/helpers/HotTextElementHelper.java

    r8553 r8778  
    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); 
  • trunk/sophie2-platform/modules/org.sophie2.extra.func.scripting/src/main/java/org/sophie2/extra/func/scripting/view/InsertScriptFileItem.java

    r7871 r8778  
    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 
     
    2830        @Override 
    2931        protected boolean computeEnabled() { 
    30                 return true; 
     32                BookView bookView = AppViewUtil.getCurrentBookView(this); 
     33                return bookView != null && !bookView.getViewOptions().isPreviewMode(); 
    3134        } 
    3235} 
  • trunk/sophie2-platform/modules/org.sophie2.extra.func.scripting/src/main/java/org/sophie2/extra/func/scripting/view/InsertScriptItem.java

    r7871 r8778  
    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 
     
    3133        @Override 
    3234        protected boolean computeEnabled() { 
    33                 return true; 
     35                BookView bookView = AppViewUtil.getCurrentBookView(this); 
     36                return bookView != null && !bookView.getViewOptions().isPreviewMode(); 
    3437        } 
    3538} 
  • trunk/sophie2-platform/modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/element/ElementLogic.java

    r8635 r8778  
    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(); 
  • trunk/sophie2-platform/modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/edit/EditMenu.java

    r6264 r8778  
    2626        @Override 
    2727        protected boolean computeEnabled() { 
    28                 return getCurrentBook() != null && getCurrentBookWindow() != null 
    29                                 && !getCurrentBookWindow().getViewOptions().isPreviewMode(); 
     28                return getCurrentBookWindow() != null; 
    3029        } 
    3130} 
  • trunk/sophie2-platform/modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/edit/RedoItem.java

    r7974 r8778  
    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         
  • trunk/sophie2-platform/modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/edit/UndoItem.java

    r7974 r8778  
    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