[[BackLinksMenu]] [[TicketQuery(summary=APP_BASIC_MENUS_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|)]] = Analysis = == Overview == Define what menus are needed for Sophie. Try to keep the menus as clean and understandable as possible. Refactor the menus for Sophie to use the new base menu library developed in [wiki:BASE_MENUS_R0]. The current menus are found in org.sophie2.main.view.menus. This code should be changed to use the new extension point. == Task requirements == * Define the base application menus * Create a convention of menu items, where should they be put, what should be underlined, where to put "...", how to align text. * Put the convention in a wiki page and discuss it with the whole team * Apply the new menu design. * Define where extensions should put their menu items - for Export As menu, Insert menu, Skins menu * Make inactive menu items grey - marked in implementation idea. == Task result == The result of this task is code and menu design == Implementation idea == * __F__ile * __N__ew Book... Ctrl+N * __O__pen Book... Ctrl+O * __C__lose Book Ctrl+W * Separator * __S__ave Book Ctrl+S * Save Book __A__s... Ctrl+Shift+S * Save As __T__emplate * E__x__port Book As > * __P__DF... * __H__TML... * Separator * __P__rint * Print to __f__ile * Separator * Book P__r__operties... * Separator * __Q__uit Sophie2 Ctrl+W * __E__dit * __U__ndo Ctrl+Z * __R__edo Ctrl+Y * Separator * Cu__t__ Ctrl+X * __C__opy Ctrl+C * __P__aste Ctrl+V * __D__elete Delete * Separator * __B__ook Title (no need for "set" as it is implied by being in the Edit menu) * Pa__g__e Dimensions * __I__nsert * __T__ext Ctrl+Alt+T * __I__mage... Ctrl+Alt+I * __V__ideo... Ctrl+Alt+V * Audio __R__ecord... Ctrl+Alt+R * __A__udio... Ctrl+Alt+A * __P__DF... Ctrl+Alt+P * __B__rowser Ctrl+Alt+B * __V__iew * __N__ormal Mode * __F__ull Screen Mode F11 * __S__kins * __D__efault Skin * __A__lternative Skin * __W__indow * __C__ascade * __T__ile * Separator * * __H__elp * __H__elp Contents F1 * Send an __E__rror Report... * __A__bout Sophie * In Skins currently selected skin should be inactive. * In View current view should be inactive. == Related == [wiki:BASE_MENUS_R0] == How to demo == * Show convention. It must be part of the documentation * Show the refactored menus. = Design = Basic Menu Items order/style will be defined by a convention (which will be put for a public discussion – wiki page). * In every class that extends AppMenuItem class will be introduced method called defineSkin which specifies values to certain properties (like title, tooltips, shortcuts, mnemonics, etc.) of the skin's element - the item. It will get ''ElementSkinPart'' object as an argument, and will use it to define properties needed. Example implementation of the method for ''ExportToPDFItem'': {{{ @SkinPartDef private static void defineSkin(ElementSkinPart part) { part.add(TITLE_PROP_ID, "PDF..."); //title property defined as "PDF" part.add(TOOL_TIP_PROP_ID, "Exports current book to pdf file"); //Tool tip property defined part.add(MNEMONIC_PROP_ID, KeyEvent.VK_P); //Mnemonic - i.e. when P is pressed, combined with Alt. } }}} * Classes that will be affected by this change are as follow: * FileMenu * NewBookItem * OpenBookItem * CloseBookItem * BookPropertiesItem * SaveBookAsItem * SaveBookItem * CloseBookItem * EditMenu * RedoItem * UndoItem * SetBookTitleItem * SetPageSizeItem * ShowConnectionItem * InsertMenu * InsertPDFItem * InsertImageItem * InsertAudioItem * InsertAudioRecordItem * InsertVideoItem * InsertRtfItem * InsertBookItem * InsertPlainTextItem * InsertHtmlItem * ViewMenu * NormalModeItem * FullScreenItem * Skins * DefaultSkinItem * AlternativeSkinItem * WindowMenu * CascadeItem * TileItem * HelpMenu * HelpContentsItem * BugReportItem * AboutItem * InspecturMenuItem * A refactoniring will be needed, so every Item has the definition of its properties in itself, not in its Module class. (optional) * Items will be extracted in a specific module (one that has same functionality as the item itself), if such exists and register them accordinaly: * ExportToPDFItem to extra.func.print.pdf.export module * InsertPDFItem to extra.func.pdf.view module * InsertImageItem to extra.func.image.view module * InsertAudioItem to extra.func.media.view module * InsertAudioRecordItem to extra.func.media.view.controls module * InsertVideoItem to extra.func.media.view module * InsertRtfItem to extra.func.rtf.view module * InsertBookItem to extra.func.embedded.view module * InsertPlainTextItem to extra.func.plain.view module * InsertHtmlItem to extra.func.html.view module * ExportAsHtmlItem to extra.func.html module * InsertBrowserItem to extra.func.browser.view module * InsertScriptItem to extra.func.scripting.view module * InsertScriptFileItem to extra.func.scripting.view module * Specific (logical and intuitive) order of the Menus will be implemented: * File * Edit * Insert * View * Skins * Window * Help * Following shortcuts will be introduced using property ''ACCELERATOR_PROP_ID'' of ''ElementSkinPart'' argument of the defineSkin method: * Ctrl+N - New Book * Ctrl+O - Open Book * Ctrl+W - Close Book * Ctrl+S - Save Book * Ctrl+Shift+S - Save Book As * Ctrl+Z - Undo * Ctrl+Y - Redo * Ctrl+X - Cut * Ctrl+C - Copy * Ctrl+V - Paste * Ctrl+Alt+T - Insert Text * Ctrl+Alt+I - Insert Image * Ctrl+Alt+V - Insert Video * Ctrl+Alt+R - Insert Audio Record * Ctrl+Alt+A - Insert Audio * Ctrl+Alt+P - Insert PDF * Ctrl+Alt+B - Insert Browser * F11 - Full Screen Mode * F1 - Help Example for defining ''CTRL + P'' shortcut: {{{ @SkinPartDef private static void defineSkin(ElementSkinPart part) { part.add(ACCELERATOR_PROP_ID, KeyStroke.getKeyStroke(KeyEvent.VK_P, InputEvent.CTRL_MASK)); //Shortcut is added CTRL+P } }}} * Will be added "..." suffix of Item's property ''TITLE_PROP_ID'' for Items that, when clicked, open a Dialog. = Implementation = Working branch [http://www.sophie2.org/trac/browser/branches/private/stefan/sophie2-platform]. Code: * [4832] * [4892] Merged to the trunk in [5691]. = Testing = = Comments = ^(Write comments for this or later revisions here.)