### Eclipse Workspace Patch 1.0 #P sophie2-platform Index: modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/MainAppMenusModule.java =================================================================== --- modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/MainAppMenusModule.java (revision 2334) +++ modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/MainAppMenusModule.java (working copy) @@ -38,7 +38,7 @@ import org.sophie2.main.app.menus.insert.InsertMenu; import org.sophie2.main.app.menus.insert.InsertTextItem; import org.sophie2.main.app.menus.skins.DefaultSkinItem; -import org.sophie2.main.app.menus.skins.HackersSkinItem; +import org.sophie2.main.app.menus.skins.AlternativeSkinItem; import org.sophie2.main.app.menus.skins.SkinsMenu; import org.sophie2.main.app.menus.tabbar.MinimizeAllItem; import org.sophie2.main.app.menus.tabbar.RestoreAllItem; @@ -173,7 +173,7 @@ res.add(SimpleVisualProvider.createExtension(DefaultSkinItem.class, SkinsMenu.class, "default-skin-menu-item", "111-default-skin-menu-item")); - res.add(SimpleVisualProvider.createExtension(HackersSkinItem.class, + res.add(SimpleVisualProvider.createExtension(AlternativeSkinItem.class, SkinsMenu.class, "hackers-skin-menu-item", "222-hackers-skin-menu-item")); @@ -387,12 +387,12 @@ res.add(SkinUtil.getElementId(DefaultSkinItem.class), MenuMember.MNEMONIC_PROP_ID, 0); res.add(SkinUtil.getElementId(DefaultSkinItem.class), MenuMember.ACCELERATOR_PROP_ID, null); - res.add(SkinUtil.getElementId(HackersSkinItem.class), BaseVisualElement.TITLE_PROP_ID, - "Hackers skin"); - res.add(SkinUtil.getElementId(HackersSkinItem.class), BaseVisualElement.TOOL_TIP_PROP_ID, - "Click to switch to hackers skin."); - res.add(SkinUtil.getElementId(HackersSkinItem.class), MenuMember.MNEMONIC_PROP_ID, 0); - res.add(SkinUtil.getElementId(HackersSkinItem.class), MenuMember.ACCELERATOR_PROP_ID, null); + res.add(SkinUtil.getElementId(AlternativeSkinItem.class), BaseVisualElement.TITLE_PROP_ID, + "Alternative skin"); + res.add(SkinUtil.getElementId(AlternativeSkinItem.class), BaseVisualElement.TOOL_TIP_PROP_ID, + "Click to switch to alternative skin."); + res.add(SkinUtil.getElementId(AlternativeSkinItem.class), MenuMember.MNEMONIC_PROP_ID, 0); + res.add(SkinUtil.getElementId(AlternativeSkinItem.class), MenuMember.ACCELERATOR_PROP_ID, null); // help items res.add(SkinUtil.getElementId(HelpMenu.class), BaseVisualElement.TITLE_PROP_ID, "Help"); Index: modules/org.sophie2.main.skin.alternative/src/main/java/org/sophie2/main/skin/alternative/SkinDefIds.java =================================================================== --- modules/org.sophie2.main.skin.alternative/src/main/java/org/sophie2/main/skin/alternative/SkinDefIds.java (revision 2334) +++ modules/org.sophie2.main.skin.alternative/src/main/java/org/sophie2/main/skin/alternative/SkinDefIds.java (working copy) @@ -11,244 +11,6 @@ */ public class SkinDefIds { -// static String DEFAULT_SKIN_DEF_IDS [] = { -// "main.func.config.config-tab/title : text : Config", -// "main.func.config.config-tab/tool-tip : text : instruments for application configuration.", -// "main.func.config.plugin-about-palette/title : text : Plugin information", -// "main.func.config.plugin-about-palette/tool-tip : text : Displays information about the currently registered plugin.", -// "main.func.config.plugins-palette/title : text : Plugins", -// "main.func.config.plugins-palette/tool-tip : text : List of available application plugins.", -// "app.menus.file-menu/title : text : File", -// "app.menus.file-menu/tool-tip : text : File menu", -// "app.menus.file.new-book-menu-item/title : text : New Book", -// "app.menus.file.new-book-menu-item/tool-tip : text : Create a new book.", -// "app.menus.file.open-book-menu-item/title : text : open Book", -// "app.menus.file.open-book-menu-item/tool-tip : text : open an existing book.", -// "app.menus.file.save-book-menu-item/title : text : save", -// "app.menus.file.save-book-menu-item/tool-tip : text : save the current book to a file.", -// "app.menus.file.save-book-as-menu-item/title : text : save as", -// "app.menus.file.save-book-as-menu-item/tool-tip : text : save the current book to another file.", -// "app.menus.file.save-book-as-template-menu-item/title : text : save as Template", -// "app.menus.file.save-book-as-template-menu-item/tool-tip : text : save the current book as a template.", -// "app.menus.file.book-properties-menu-item/title : text : Book Properties", -// "app.menus.file.book-properties-menu-item/tool-tip : text : show the properties of the current book.", -// "app.menus.file.close-book-menu-item/title : text : Close", -// "app.menus.file.close-book-menu-item/tool-tip : text : Close the current book.", -// "app.menus.file.exit-menu-item/title : text : Quit sophie 2", -// "app.menus.file.exit-menu-item/tool-tip : text : Close sophie 2.", -// "app.menus.edit-menu/title : text : edit", -// "app.menus.edit-menu/tool-tip : text : edit menu", -// "app.menus.edit.undo-menu-item/title : text : {generated}", -// "app.menus.edit.undo-menu-item/tool-tip : text : Revert the last change made.", -// "app.menus.edit.redo-menu-item/title : text : {generated}", -// "app.menus.edit.redo-menu-item/tool-tip : text : Restore the last reverted change.", -// "app.menus.edit.set-title-menu-item/title : text : set Title", -// "app.menus.edit.set-title-menu-item/tool-tip : text : set the title of the current book.", -// "app.menus.edit.show-connections-menu-item/title : text : {generated}", -// "app.menus.edit.show-connections-menu-item/tool-tip : text : Toggle the display of text frame chain connections.", -// "app.menus.insert-menu/title : text : ToDo", -// "app.menus.insert-menu/tool-tip : text : insert menu", -// "app.menus.insert.insert-text-menu-item/title : text : Text", -// "app.menus.insert.insert-text-menu-item/tool-tip : text : add a text frame to the current page.", -// "app.menus.window-menu/title : text : Window", -// "app.menus.window-menu/tool-tip : text : Window menu", -// "app.menus.window.cascade-menu-item/title : text : Cascade", -// "app.menus.window.cascade-menu-item/tool-tip : text : Cascade the open documents.", -// "app.menus.window.tile-menu-item/title : text : Tile", -// "app.menus.window.tile-menu-item/tool-tip : text : Tile the open documents.", -// "app.menus.window.document-menu-item/title : text : {generated:document-title}", -// "app.menus.window.document-menu-item/tool-tip : text : null", -// "app.menus.help-menu/title : text : Help", -// "app.menus.help-menu/tool-tip : text : Help menu", -// "org.sophie2.main.app.menus.tabbar.MinimizeAllItem/title : text : Minimizeall", -// "org.sophie2.main.app.menus.tabbar.MinimizeAllItem/tool-tip : text : Click here to hide all windows and show the desktop.", -// "main.view.menus.tabbar.restore-all-item/title : text : Restoreall", -// "main.view.menus.tabbar.restore-all-item/tool-tip : text : Click here to show all windows that are minimized.", -// "main.view.layout.books-tab/title : text : Books", -// "main.view.layout.books-tab/tool-tip : text : instruments for books.", -// "main.view.layout.books.open-books-palette/title : text : open Books", -// "main.view.layout.books.open-books-palette/tool-tip : text : List of open books", -// "main.view.layout.pages.page-preview-palette/title : text : Page Preview", -// "main.view.layout.pages.page-preview-palette/tool-tip : text : Preview of the book pages.", -// "main.view.layout.pages-tab/title : text : Pages", -// "main.view.layout.pages-tab/tool-tip : text : instruments for pages", -// "main.view.layout.timelines-tab/title : text : Timelines", -// "main.view.layout.timelines-tab/tool-tip : text : instruments for timelines.", -// "main.view.layout.tools.search-palette/title : text : search", -// "main.view.layout.tools.search-palette/tool-tip : text : allows searching in the text content of the book.", -// "main.view.layout.tools-tab/title : text : Tools", -// "main.view.layout.tools-tab/tool-tip : text : Book related instruments", -// "main.view.layout.library.book-templates-palette/title : text : Book Templates", -// "main.view.layout.library.book-templates-palette/tool-tip : text : Templates for new books.", -// "main.view.layout.library.components-palette/title : text : Frames", -// "main.view.layout.library.components-palette/tool-tip : text : Frame components", -// "main.view.layout.library-tab/title : text : Library", -// "main.view.layout.library-tab/tool-tip : text : Provides book and frame components", -// "main.view.layout.library.page-templates-palette/title : text : Page Templates Palette", -// "main.view.layout.library.page-templates-palette/tool-tip : text : Templates for new Pages", -// "main.view.layout.library.frame-templates-palette/title : text : Frame Templates Palette", -// "main.view.layout.library.frame-templates-palette/tool-tip : text : Templates for new Frames", -// "main.view.layout.styles-tab/title : text : styles", -// "main.view.layout.styles-tab/tool-tip : text : style related palettes.", -// "main.func.servers.servers-tab/title : text : servers", -// "main.func.servers.servers-tab/tool-tip : text : server related things.", -// "main.func.servers.connections-palette/title : text : Connections", -// "main.func.servers.connections-palette/tool-tip : text : server connections.", -// "main.view.layout.books.embedded-books-palette/title : text : embedded Books", -// "main.view.layout.books.embedded-books-palette/tool-tip : text : List of currently embedded books.", -// "main.view.layout.resources.all-resources-palette/title : text : Resources", -// "main.view.layout.resources.all-resources-palette/tool-tip : text : all resources currently used in the book.", -// "main.view.layout.resources-tab/title : text : Resources", -// "main.view.layout.resources-tab/tool-tip : text : The resources in the current book", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderInsetsTop/title : text : Top border size:", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderInsetsTop/tool-tip : text : Change the top size of the border.", -// "base.bound.base-bound-control/ok-icon : icon : approve.png", -// "base.bound.base-bound-control/error-icon : icon : disapprove.png", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderInsetsRight/title : text : Right border size:", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderInsetsRight/tool-tip : text : Change the right size of the border.", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderInsetsBottom/title : text : Bottom border size:", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderInsetsBottom/tool-tip : text : Change the bottom size of the border.", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderInsetsLeft/title : text : Left border size:", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderInsetsLeft/tool-tip : text : Change the left size of the border.", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderColorField/title : text : Border color:", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderColorField/tool-tip : text : Change the color of the border", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderUseTemplate/title : text : Border template: ", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderUseTemplate/tool-tip : text : Use the border from the template.", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderLocked/title : text : Lock the border: ", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderLocked/tool-tip : text : Prevent the border from any changes.", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BackgroundColorField/title : text : Background color:", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BackgroundColorField/tool-tip : text : Change the color of the background", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$FrameVisibleCheck/title : text : Frame visible: ", -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$FrameVisibleCheck/tool-tip : text : toggle the initial visibility of the frame.", -// "main.view.halos.huds.background-and-border-hud/tool-tip : text : edit the border and background of a frame.", -// "main.view.halos.shared.background-and-border-halo-button/tool-tip : text : Change the border and background.", -// "main.view.halos.shared.background-and-border-halo-button/halo-icon : icon : frameBackground.png", -// "org.sophie2.main.app.halos.huds.InsetsHud$FramePaddingTop/title : text : Top padding:", -// "org.sophie2.main.app.halos.huds.InsetsHud$FramePaddingTop/tool-tip : text : Change the top padding of the frame.", -// "org.sophie2.main.app.halos.huds.InsetsHud$FramePaddingRight/title : text : Right padding:", -// "org.sophie2.main.app.halos.huds.InsetsHud$FramePaddingRight/tool-tip : text : Change the right padding of the frame.", -// "org.sophie2.main.app.halos.huds.InsetsHud$FramePaddingBottom/title : text : Bottom padding:", -// "org.sophie2.main.app.halos.huds.InsetsHud$FramePaddingBottom/tool-tip : text : Change the bottom padding of the frame.", -// "org.sophie2.main.app.halos.huds.InsetsHud$FramePaddingLeft/title : text : Left padding:", -// "org.sophie2.main.app.halos.huds.InsetsHud$FramePaddingLeft/tool-tip : text : Change the left padding of the frame.", -// "org.sophie2.main.app.halos.huds.InsetsHud$FrameMarginRight/title : text : Right margin:", -// "org.sophie2.main.app.halos.huds.InsetsHud$FrameMarginRight/tool-tip : text : Change the right margin of the frame.", -// "org.sophie2.main.app.halos.huds.InsetsHud$FrameMarginBottom/title : text : Bottom margin:", -// "org.sophie2.main.app.halos.huds.InsetsHud$FrameMarginBottom/tool-tip : text : Change the bottom margin of the frame.", -// "org.sophie2.main.app.halos.huds.InsetsHud$FrameMarginLeft/title : text : Left margin:", -// "org.sophie2.main.app.halos.huds.InsetsHud$FrameMarginLeft/tool-tip : text : Change the left margin of the frame.", -// "main.view.halos.huds.insets-hud/tool-tip : text : edit the padding/margin properties of a frame.", -// "main.view.halos.frame.frame-insets-halo-button/tool-tip : text : edit frame margin and padding settings.", -// "main.view.halos.frame.frame-insets-halo-button/halo-icon : icon : frameInsets.png", -// "main.view.halos.frame.frame-z-order-up-halo-button/tool-tip : text : increase the z-order of this frame.", -// "main.view.halos.frame.frame-z-order-up-halo-button/halo-icon : icon : zOrderUp.png", -// "main.view.halos.frame.frame-z-order-down-halo-button/tool-tip : text : Decrease the z-order of this frame.", -// "main.view.halos.frame.frame-z-order-down-halo-button/halo-icon : icon : zOrderDown.png", -// "org.sophie2.main.app.halos.huds.ShadowHud$ShadowPositionX/title : text : X:", -// "org.sophie2.main.app.halos.huds.ShadowHud$ShadowPositionX/tool-tip : text : Change the shadow on the X axis.", -// "org.sophie2.main.app.halos.huds.ShadowHud$ShadowPositionY/title : text : Y:", -// "org.sophie2.main.app.halos.huds.ShadowHud$ShadowPositionY/tool-tip : text : Change the shadow on the Y axis.", -// "org.sophie2.main.app.halos.huds.ShadowHud$ShadowColorField/title : text : Color:", -// "org.sophie2.main.app.halos.huds.ShadowHud$ShadowColorField/tool-tip : text : Change the color of the shadow", -// "main.view.halos.huds.shadow-hud/tool-tip : text : edit the shadow properties of a page.", -// "main.view.halos.frame.frame-shadow-halo-button/tool-tip : text : edit shadow settings.", -// "main.view.halos.frame.frame-shadow-halo-button/halo-icon : icon : pageShadowHalo.png", -// "main.view.halos.frame.frame-content-use-template-halo-button/tool-tip : text : Use the content from the template.", -// "main.view.halos.frame.frame-content-use-template-halo-button/icon-on : icon : useTemplateOn.png", -// "main.view.halos.frame.frame-content-use-template-halo-button/icon-off : icon : useTemplateOff.png", -// "main.view.halos.page.page-frames-use-template-halo-button/tool-tip : text : show the frames from the template.", -// "main.view.halos.page.page-frames-use-template-halo-button/icon-on : icon : useTemplateOn.png", -// "main.view.halos.page.page-frames-use-template-halo-button/icon-off : icon : useTemplateOff.png", -// "main.view.shared.frame.add-template/tool-tip : text : add the object as a template.", -// "main.view.shared.frame.add-template/halo-icon : icon : addTemplate.png", -// "org.sophie2.main.app.halos.align.AlignElementsLeft/title : text : align left", -// "org.sophie2.main.app.halos.align.AlignElementsLeft/tool-tip : text : Click to align selected elements' left sides.", -// "org.sophie2.main.app.halos.align.AlignElementsRight/title : text : align right", -// "org.sophie2.main.app.halos.align.AlignElementsRight/tool-tip : text : Click to align selected elements' right sides.", -// "org.sophie2.main.app.halos.align.AlignElementsTop/title : text : align top", -// "org.sophie2.main.app.halos.align.AlignElementsTop/tool-tip : text : Click to align selected elements' top sides.", -// "org.sophie2.main.app.halos.align.AlignElementsBottom/title : text : align bottom", -// "org.sophie2.main.app.halos.align.AlignElementsBottom/tool-tip : text : Click to align selected elements' bottom sides.", -// "org.sophie2.main.app.halos.align.AlignElementsHorizontally/title : text : align horizontally", -// "org.sophie2.main.app.halos.align.AlignElementsHorizontally/tool-tip : text : Click to align selected elements' horizontally.", -// "org.sophie2.main.app.halos.align.AlignElementsVertically/title : text : align vertically", -// "org.sophie2.main.app.halos.align.AlignElementsVertically/tool-tip : text : Click to align selected elements' vertically.", -// "main.view.halos.align.aligning-page-elements-hud/tool-tip : text : align the selected page elements.", -// "main.view.halos.buttons.huds.align-elements-halo-button/tool-tip : text : align the selected page elements.", -// "main.view.halos.buttons.huds.align-elements-halo-button/halo-icon : icon : alignElements.png", -// "main.view.halos.grouping.group-page-elements-button/tool-tip : text : Click to group the selected page elements.", -// "main.view.halos.grouping.group-page-elements-button/halo-icon : icon : groupElements.png", -// "main.view.halos.grouping.ungroup-page-elements-button/tool-tip : text : Click to ungroup the selected page elements.", -// "main.view.halos.grouping.ungroup-page-elements-button/halo-icon : icon : ungroupElements.png", -// "org.sophie2.main.func.links.LinksHud$CurrentRule/title : text : Rule:", -// "org.sophie2.main.func.links.LinksHud$CurrentRule/tool-tip : text : select a rule", -// "org.sophie2.main.func.links.LinksHud$AddRule/tool-tip : text : add new rule", -// "org.sophie2.main.func.links.LinksHud$RemoveRule/tool-tip : text : Remove the selected rule", -// "org.sophie2.main.func.links.LinksHud$AvailableTriggers/title : text : Trigger:", -// "org.sophie2.main.func.links.LinksHud$AvailableTriggers/tool-tip : text : select a trigger for this rule", -// "org.sophie2.main.func.links.LinksHud$AvailableActions/title : text : action:", -// "org.sophie2.main.func.links.LinksHud$AvailableActions/tool-tip : text : select action for this rule", -// "org.sophie2.main.func.links.actions.navigation.GoToPageConfigurationPanel$AvailablePages/title : text : Go to page:", -// "org.sophie2.main.func.links.actions.navigation.GoToPageConfigurationPanel$AvailablePages/tool-tip : text : Go To Page", -// "org.sophie2.main.func.links.actions.showing.ShowFrameConfigurationPanel$FrameSelector/title : text : select frame:", -// "org.sophie2.main.func.links.actions.showing.ShowFrameConfigurationPanel$FrameSelector/tool-tip : text : show frame", -// "main.func.links.links-hud/tool-tip : text : Manage links.", -// "main.func.links.links-halo-button/tool-tip : text : Manage links.", -// "main.func.links.links-halo-button/halo-icon : icon : LinksHalo.png", -// "main.view.halos.frame.move.frame-move-halo-button/halo-icon : icon : move.png", -// "main.view.halos.frame.move.frame-move-halo-button/tool-tip : text : Drag to move the frame", -// "main.view.halos.frame.move.frame-remove-halo-button/halo-icon : icon : remove.png", -// "main.view.halos.frame.move.frame-remove-halo-button/tool-tip : text : Click to delete the frame.", -// "extra.annotations.sticky-remove-halo-button/halo-icon : icon : remove.png", -// "extra.annotations.sticky-remove-halo-button/tool-tip : text : Click to remove the sticky", -// "org.sophie2.main.func.text.halos.TextFontHud$TextItalicStyle/title : text : italic:", -// "org.sophie2.main.func.text.halos.TextFontHud$TextItalicStyle/tool-tip : text : set on/off italic", -// "org.sophie2.main.func.text.halos.TextFontHud$TextBoldStyle/title : text : Bold: ", -// "org.sophie2.main.func.text.halos.TextFontHud$TextBoldStyle/tool-tip : text : set on/off bold.", -// "org.sophie2.main.func.text.halos.TextFontHud$TextUnderlineStyle/title : text : Underline: ", -// "org.sophie2.main.func.text.halos.TextFontHud$TextUnderlineStyle/tool-tip : text : set on/off underline", -// "org.sophie2.main.func.text.halos.TextFontHud$TextStrikethroughStyle/title : text : strikethrough: ", -// "org.sophie2.main.func.text.halos.TextFontHud$TextStrikethroughStyle/tool-tip : text : set on/off strikethrough", -// "main.func.text.hud.text-font/tool-tip : text : Choose font family name, size adn style", -// "main.func.text.halos.text-font-button/tool-tip : text : Choose font", -// "main.func.text.halos.text-font-button/halo-icon : icon : font.png", -// "org.sophie2.main.app.commons.app.AppTabBar/title : text : TabBar", -// "org.sophie2.main.app.commons.app.AppTabBar/tool-tip : text : open Books", -// "org.sophie2.main.app.commons.app.AppTabBar/show-desktop-icon : icon : showDesktop.png", -// "org.sophie2.main.app.commons.app.AppTabBar/show-desktop-tool-tip : text : Click here to hide all windows and show the desktop.", -// "app.menus.file.file-print-menu-item/title : text : Print...", -// "app.menus.file.file-print-menu-item/tool-tip : text : Print current book", -// "app.menus.file.file-print-to-file-menu-item/title : text : Print To File...", -// "app.menus.file.file-print-to-file-menu-item/tool-tip : text : Print current book to file", -// "app.menus.insert.insert-image-menu-item/title : text : image", -// "app.menus.insert.insert-image-menu-item/tool-tip : text : add an image frame to the current page.", -// "app.menus.insert.insert-audio-menu-item/title : text : audio", -// "app.menus.insert.insert-audio-menu-item/tool-tip : text : add an audio frame to the current page.", -// "app.menus.insert.insert-video-menu-item/title : text : Video", -// "app.menus.insert.insert-video-menu-item/tool-tip : text : add a video frame to the current page.", -// "app.menus.insert.insert-pdf-menu-item/title : text : Pdf", -// "app.menus.insert.insert-pdf-menu-item/tool-tip : text : add a PDF frame to the current page.", -// "app.menus.insert.insert-book-menu-item/title : text : Book", -// "app.menus.insert.insert-book-menu-item/tool-tip : text : embed a book in the current page.", -// "app.menus.help.help-contents-menu-item/title : text : Help Contents", -// "app.menus.help.help-contents-menu-item/tool-tip : text : Displays the main help index", -// "app.menus.help.about-menu-item/title : text : about", -// "app.menus.help.about-menu-item/tool-tip : text : Displays version information, license used, etc.", -// "extra.annotations.all-annotations-palette/title : text : all annotations", -// "extra.annotations.all-annotations-palette/tool-tip : text : Load/save annotations, manage annotations from different users", -// "extra.annotations.stickies-palette/title : text : stickies", -// "extra.annotations.stickies-palette/tool-tip : text : add new sticky, show or hide stickies", -// "main.view.layout.resources.book-extras/title : text : Book extras", -// "main.view.layout.resources.book-extras/tool-tip : text : Manage book extras - show/hide, export/import, etc.", -// "extra.annotations.annotations-tab/title : text : annotations", -// "extra.annotations.annotations-tab/tool-tip : text : stick notes to the book, highlight some text or record your voice comments", -// "main.view.layout.resources.resources-detail-palette/tool-tip : text : Detail View", -// "main.view.layout.resources.resources-detail-palette/title : text : Detail View", -// "main.view.layout.changes.all-changes-palette/title : text : Changes", -// "main.view.layout.changes.all-changes-palette/tool-tip : text : all changes done..", -// "main.view.halos.page.resize.page-resize-halo-button/halo-icon : icon : resize.png" -// }; - /** * Alternative skin's definintion. */ Index: modules/org.sophie2.main.layout.mydoggy/src/main/java/org/sophie2/main/layout/mydoggy/MDTab.java =================================================================== --- modules/org.sophie2.main.layout.mydoggy/src/main/java/org/sophie2/main/layout/mydoggy/MDTab.java (revision 2334) +++ modules/org.sophie2.main.layout.mydoggy/src/main/java/org/sophie2/main/layout/mydoggy/MDTab.java (working copy) @@ -7,6 +7,7 @@ import org.noos.xing.mydoggy.ToolWindow; import org.noos.xing.mydoggy.ToolWindowAnchor; import org.noos.xing.mydoggy.ToolWindowGroup; +import org.noos.xing.mydoggy.ToolWindowManager; import org.noos.xing.mydoggy.plaf.MyDoggyToolWindowManager; import org.sophie2.base.layout.model.Palette; import org.sophie2.base.layout.model.Tab; @@ -28,6 +29,8 @@ * @author nvasilev */ public class MDTab extends MDCompoundLayoutElement { + + private static final String GROUP = "Group"; // --- Properties ---------------------------------------------------------- @@ -49,14 +52,15 @@ protected Prop parent() { return getBean().makeParentProp(MDFlap.class); } - + @Override public RwProp orientation() { class orientation extends AutoProperty { - + @Override protected ToolWindowAnchor compute() { - if (parent().get() == null || parent().get().orientation().get() == null) { + if (parent().get() == null + || parent().get().orientation().get() == null) { return null; } return parent().get().orientation().get(); @@ -64,8 +68,7 @@ } return getBean().makeProp(orientation.class); } - - + // TODO: this used some bad things to synchronize.. // make sure that the following two are executed // // Registering the element in the tool window manager @@ -122,32 +125,42 @@ // do nothing } + private String oldTitle; + @Override protected void setup(JPanel swingComponent) { swingComponent.setLayout(new BorderLayout()); - ToolWindowGroup group = toolWindowManager().get() - .getToolWindowGroup(title().get() + "Group"); + String currentTitle = title().get(); + ToolWindowManager toolWindowManager = toolWindowManager().get(); - for (ToolWindow win : toolWindowManager().get() - .getToolWindows()) { - group.removeToolWindow(win); + if (!currentTitle.equals(this.oldTitle)) { + removeWindowsGroup(this.oldTitle + GROUP); + this.oldTitle = currentTitle; } - toolWindowManager().get().unregisterAllToolWindow(); + removeWindowsGroup(currentTitle + GROUP); + toolWindowManager.unregisterAllToolWindow(); for (MDPalette palette : paletteViews().get()) { addMDElement(palette); } - if (paletteViews().get().size() != 0) { - group.setImplicit(true); - group.setVisible(true); - } - swingComponent.add(toolWindowManager().get(), BorderLayout.CENTER); } + + private final void removeWindowsGroup(String groupName) { + ToolWindowManager toolWindowManager = toolWindowManager().get(); + ToolWindowGroup group = toolWindowManager + .getToolWindowGroup(groupName); + + for (ToolWindow win : toolWindowManager.getToolWindows()) { + group.removeToolWindow(win); + } + + toolWindowManager.removeToolWindowGroup(groupName); + } } return getBean().makeProp(swingComponent.class); @@ -177,7 +190,7 @@ // Creating palettes group ToolWindowGroup group = toolWindowManager.getToolWindowGroup(title() .get() - + "Group"); + + GROUP); // Adding the pallete to the palettes group ToolWindow paletteToolWindow = toolWindowManager @@ -211,7 +224,7 @@ // Obtaining palettes group ToolWindowGroup group = toolWindowManager.getToolWindowGroup(title() .get() - + "Group"); + + GROUP); ToolWindow paletteToolWindow = toolWindowManager .getToolWindow(mdPalette.title().get()); Index: modules/org.sophie2.main.layout.mydoggy/src/main/java/org/sophie2/main/layout/mydoggy/MDToolWindowFactory.java =================================================================== --- modules/org.sophie2.main.layout.mydoggy/src/main/java/org/sophie2/main/layout/mydoggy/MDToolWindowFactory.java (revision 2334) +++ modules/org.sophie2.main.layout.mydoggy/src/main/java/org/sophie2/main/layout/mydoggy/MDToolWindowFactory.java (working copy) @@ -27,7 +27,7 @@ configureDockedDescriptor(toolWindow); configureSlidingDescriptor(toolWindow); configureFloatingDescriptor(toolWindow); - configureFloatingLiveDescriptor(toolWindow); + //configureFloatingLiveDescriptor(toolWindow); } /** Index: modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/skins/AlternativeSkinItem.java =================================================================== --- modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/skins/AlternativeSkinItem.java (revision 2304) +++ modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/skins/AlternativeSkinItem.java (working copy) @@ -13,7 +13,7 @@ * */ @SkinElementId("app.menus.skins.hackers-skin-item") -public class HackersSkinItem extends MenuItem { +public class AlternativeSkinItem extends MenuItem { @Override public void clicked() { Index: modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/skins/HackersSkinItem.java =================================================================== --- modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/skins/HackersSkinItem.java (revision 2334) +++ modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/skins/HackersSkinItem.java (working copy) @@ -1,29 +0,0 @@ -package org.sophie2.main.app.menus.skins; - -import org.sophie2.base.menus.MenuItem; -import org.sophie2.base.skins.Skin; -import org.sophie2.base.skins.SkinElementId; -import org.sophie2.base.skins.SkinManager; -import org.sophie2.base.skins.SkinsNames; - -/** - * A menu item to switch to the Hackers skin in Sophie2. - * - * @author peko, nenko - * - */ -@SkinElementId("app.menus.skins.hackers-skin-item") -public class HackersSkinItem extends MenuItem { - - @Override - public void clicked() { - SkinManager.get().currentSkin().set( - new Skin(SkinsNames.ALTERNATIVE_NAME, new Skin(SkinsNames.DEFAULT_NAME, null))); - } - - @Override - protected boolean computeEnabled() { - return true; - } - -} Index: modules/org.sophie2.base.skins/src/test/java/org/sophie2/base/skins/SkinsTest.java =================================================================== --- modules/org.sophie2.base.skins/src/test/java/org/sophie2/base/skins/SkinsTest.java (revision 0) +++ modules/org.sophie2.base.skins/src/test/java/org/sophie2/base/skins/SkinsTest.java (revision 0) @@ -0,0 +1,233 @@ +package org.sophie2.base.skins; + +import java.util.List; + +import org.sophie2.core.modularity.FakeModuleRegistry; +import org.sophie2.core.modularity.SophieExtension; +import org.sophie2.core.modularity.SophieExtensionPoint; +import org.sophie2.core.modularity.SophieModule; +import org.sophie2.core.prolib.impl.AutoProperty; +import org.sophie2.core.prolib.impl.BaseProObject; +import org.sophie2.core.prolib.interfaces.Prop; +import org.sophie2.core.testing.IntegrationTestBase; + +/** + * A test for Skins. Should test whether {@link Skin}s are + * properly changing. + * + * @author peko + * + */ +@SuppressWarnings("unchecked") +public class SkinsTest extends IntegrationTestBase{ + + //create the skin values for both skins. These are just Strings but can be + //any other types. => + + //default Skin values. + private static String defaultSkinToolTip = "This is a tool-tip for the SkinsTest"; + private static String defaultSkinTitle = "This is a title for the SkinsTest"; + private static String defaultSkinString = "This is just a String..."; + + //alternative Skin values. + private static String altSkinToolTip = "Th15 15 4 t00l-t1p f0r the Sk1n5Te5t"; + private static String altSkinTitle = "Th15 15 4 t1tle f0r the 5k1n5Te5t"; + private static String altSkinString = "Th15 15 ju5t 4 5tr1ng..."; + + //cool Skin value. + private static String coolSkinTitle = "This is
a test title with
three lines "; + + private static String titleId = "test-title"; + private static String tooltipId = "test-tooltip"; + private static String stringId = "test-string"; + + //the class for use in the record ids. + private static Class clazz = DummySkinableComponent.class; + + private Skin defaultSkin; + private Skin alternativeSkin; + + //the third skin will be used to set part of the values + //so that its fallback skin is used. + private Skin coolSkin3; + private static String coolSkin3Name = "Cool Skin"; + + private DummySkinableComponent component; + + + /** + * A module providing the needed extensions for the test. + * @author pap + * + */ + public static class DemoModule extends SophieModule{ + + @Override + protected void defineExtensionPoints(List> res) { + // TODO Auto-generated method stub + + } + + @Override + protected void defineExtensions(List> res) { + makeSkinParts(res); + } + + @SuppressWarnings("synthetic-access") + private void makeSkinParts(List> list) { + //the default skin will have two SkinParts. + //create skin parts and add skin records to them. + BaseSkinPart part1 = new BaseSkinPart(SkinsNames.DEFAULT_NAME); + BaseSkinPart part2 = new BaseSkinPart(SkinsNames.DEFAULT_NAME); + //the alternative skin will have only one skin part. + BaseSkinPart part3 = new BaseSkinPart(SkinsNames.ALTERNATIVE_NAME); + //the skinpart for the third skin. + BaseSkinPart part4 = new BaseSkinPart(coolSkin3Name); + + part1.add(SkinUtil.getElementId(clazz), tooltipId, defaultSkinToolTip); + part1.add(SkinUtil.getElementId(clazz), titleId, defaultSkinTitle); + part2.add(SkinUtil.getElementId(clazz), stringId, defaultSkinString); + + part3.add(SkinUtil.getElementId(clazz), tooltipId, altSkinToolTip); + part3.add(SkinUtil.getElementId(clazz), titleId, altSkinTitle); + part3.add(SkinUtil.getElementId(clazz), stringId, altSkinString); + + part4.add(SkinUtil.getElementId(clazz), titleId, coolSkinTitle); + + list.add(part1.asExtension()); + list.add(part2.asExtension()); + list.add(part3.asExtension()); + list.add(part4.asExtension()); + } + + } + + /** + * + * A dummy implementation for a skinable component. + * + * @author peko + * + */ + class DummySkinableComponent extends BaseProObject{ + + /** + * The tool-tip of this component. + * @return property. + */ + public Prop toolTip() { + class toolTip extends AutoProperty { + + @SuppressWarnings({ "synthetic-access", "static-access" }) + @Override + protected String compute() { + String res = SkinUtil.getSkinValue(SkinsTest.this.clazz, + tooltipId, String.class); + return res; + } + } + return getBean().makeProp(toolTip.class); + } + + /** + * The title of this component. + * + * @return property. + */ + public Prop title() { + class title extends AutoProperty { + + @SuppressWarnings({ "synthetic-access", "static-access" }) + @Override + protected String compute() { + String res = SkinUtil.getSkinValue(SkinsTest.this.clazz, + titleId, String.class); + return res; + } + } + return getBean().makeProp(title.class); + } + + /** + * A string containing property for this component. + * + * @return property. + */ + public Prop string() { + class string extends AutoProperty { + + @SuppressWarnings({ "synthetic-access", "static-access" }) + @Override + protected String compute() { + String res = SkinUtil.getSkinValue(SkinsTest.this.clazz, + stringId, String.class); + return res; + } + } + return getBean().makeProp(string.class); + } + + } + + @Override + protected void setUp() throws Exception { + super.setUp(); + + FakeModuleRegistry.start(BaseSkinsModule.class, DemoModule.class); + + //the default skin. + this.defaultSkin = new Skin(SkinsNames.DEFAULT_NAME, null); + //an alternative skin. + this.alternativeSkin = new Skin(SkinsNames.ALTERNATIVE_NAME, this.defaultSkin); + + //the third skin. + this.coolSkin3 = new Skin(coolSkin3Name, this.defaultSkin); + + this.component = new DummySkinableComponent(); + } + + @Override + protected void tearDown() throws Exception { + FakeModuleRegistry.stop(); + super.tearDown(); + } + + /** + * Tests the whether the changing of {@link Skin}s changes values properly. + */ + @SuppressWarnings("static-access") + public void testChangeSkin(){ + + //setting the skin in the SkinManager. + SkinManager.get().currentSkin().set(this.defaultSkin); + + assertSame(this.component.toolTip().get(), this.defaultSkinToolTip); + assertSame(this.component.title().get(), this.defaultSkinTitle); + assertSame(this.component.string().get(), this.defaultSkinString); + + //changing the skin in the SkinManager. + SkinManager.get().currentSkin().set(this.alternativeSkin); + + assertSame(this.component.toolTip().get(), this.altSkinToolTip); + assertSame(this.component.title().get(), this.altSkinTitle); + assertSame(this.component.string().get(), this.altSkinString); + + //resetting the skin to the initial default skin value. + SkinManager.get().currentSkin().set(this.defaultSkin); + + assertSame(this.component.toolTip().get(), this.defaultSkinToolTip); + assertSame(this.component.title().get(), this.defaultSkinTitle); + assertSame(this.component.string().get(), this.defaultSkinString); + + //setting the cool skin so that the fallback skin is used (the default one). + SkinManager.get().currentSkin().set(this.coolSkin3); + //from fallback skin. + assertSame(this.component.toolTip().get(), this.defaultSkinToolTip); + //from cool skin + assertSame(this.component.title().get(), this.coolSkinTitle); + //from fallback skin again. + assertSame(this.component.string().get(), this.defaultSkinString); + + } + +} \ No newline at end of file