1 | ### Eclipse Workspace Patch 1.0 |
---|
2 | #P sophie2-platform |
---|
3 | Index: modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/MainAppMenusModule.java |
---|
4 | =================================================================== |
---|
5 | --- modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/MainAppMenusModule.java (revision 2334) |
---|
6 | +++ modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/MainAppMenusModule.java (working copy) |
---|
7 | @@ -38,7 +38,7 @@ |
---|
8 | import org.sophie2.main.app.menus.insert.InsertMenu; |
---|
9 | import org.sophie2.main.app.menus.insert.InsertTextItem; |
---|
10 | import org.sophie2.main.app.menus.skins.DefaultSkinItem; |
---|
11 | -import org.sophie2.main.app.menus.skins.HackersSkinItem; |
---|
12 | +import org.sophie2.main.app.menus.skins.AlternativeSkinItem; |
---|
13 | import org.sophie2.main.app.menus.skins.SkinsMenu; |
---|
14 | import org.sophie2.main.app.menus.tabbar.MinimizeAllItem; |
---|
15 | import org.sophie2.main.app.menus.tabbar.RestoreAllItem; |
---|
16 | @@ -173,7 +173,7 @@ |
---|
17 | res.add(SimpleVisualProvider.createExtension(DefaultSkinItem.class, |
---|
18 | SkinsMenu.class, "default-skin-menu-item", "111-default-skin-menu-item")); |
---|
19 | |
---|
20 | - res.add(SimpleVisualProvider.createExtension(HackersSkinItem.class, |
---|
21 | + res.add(SimpleVisualProvider.createExtension(AlternativeSkinItem.class, |
---|
22 | SkinsMenu.class, "hackers-skin-menu-item", "222-hackers-skin-menu-item")); |
---|
23 | |
---|
24 | |
---|
25 | @@ -387,12 +387,12 @@ |
---|
26 | res.add(SkinUtil.getElementId(DefaultSkinItem.class), MenuMember.MNEMONIC_PROP_ID, 0); |
---|
27 | res.add(SkinUtil.getElementId(DefaultSkinItem.class), MenuMember.ACCELERATOR_PROP_ID, null); |
---|
28 | |
---|
29 | - res.add(SkinUtil.getElementId(HackersSkinItem.class), BaseVisualElement.TITLE_PROP_ID, |
---|
30 | - "Hackers skin"); |
---|
31 | - res.add(SkinUtil.getElementId(HackersSkinItem.class), BaseVisualElement.TOOL_TIP_PROP_ID, |
---|
32 | - "Click to switch to hackers skin."); |
---|
33 | - res.add(SkinUtil.getElementId(HackersSkinItem.class), MenuMember.MNEMONIC_PROP_ID, 0); |
---|
34 | - res.add(SkinUtil.getElementId(HackersSkinItem.class), MenuMember.ACCELERATOR_PROP_ID, null); |
---|
35 | + res.add(SkinUtil.getElementId(AlternativeSkinItem.class), BaseVisualElement.TITLE_PROP_ID, |
---|
36 | + "Alternative skin"); |
---|
37 | + res.add(SkinUtil.getElementId(AlternativeSkinItem.class), BaseVisualElement.TOOL_TIP_PROP_ID, |
---|
38 | + "Click to switch to alternative skin."); |
---|
39 | + res.add(SkinUtil.getElementId(AlternativeSkinItem.class), MenuMember.MNEMONIC_PROP_ID, 0); |
---|
40 | + res.add(SkinUtil.getElementId(AlternativeSkinItem.class), MenuMember.ACCELERATOR_PROP_ID, null); |
---|
41 | |
---|
42 | // help items |
---|
43 | res.add(SkinUtil.getElementId(HelpMenu.class), BaseVisualElement.TITLE_PROP_ID, "Help"); |
---|
44 | Index: modules/org.sophie2.main.skin.alternative/src/main/java/org/sophie2/main/skin/alternative/SkinDefIds.java |
---|
45 | =================================================================== |
---|
46 | --- modules/org.sophie2.main.skin.alternative/src/main/java/org/sophie2/main/skin/alternative/SkinDefIds.java (revision 2334) |
---|
47 | +++ modules/org.sophie2.main.skin.alternative/src/main/java/org/sophie2/main/skin/alternative/SkinDefIds.java (working copy) |
---|
48 | @@ -11,244 +11,6 @@ |
---|
49 | */ |
---|
50 | public class SkinDefIds { |
---|
51 | |
---|
52 | -// static String DEFAULT_SKIN_DEF_IDS [] = { |
---|
53 | -// "main.func.config.config-tab/title : text : Config", |
---|
54 | -// "main.func.config.config-tab/tool-tip : text : instruments for application configuration.", |
---|
55 | -// "main.func.config.plugin-about-palette/title : text : Plugin information", |
---|
56 | -// "main.func.config.plugin-about-palette/tool-tip : text : Displays information about the currently registered plugin.", |
---|
57 | -// "main.func.config.plugins-palette/title : text : Plugins", |
---|
58 | -// "main.func.config.plugins-palette/tool-tip : text : List of available application plugins.", |
---|
59 | -// "app.menus.file-menu/title : text : File", |
---|
60 | -// "app.menus.file-menu/tool-tip : text : File menu", |
---|
61 | -// "app.menus.file.new-book-menu-item/title : text : New Book", |
---|
62 | -// "app.menus.file.new-book-menu-item/tool-tip : text : Create a new book.", |
---|
63 | -// "app.menus.file.open-book-menu-item/title : text : open Book", |
---|
64 | -// "app.menus.file.open-book-menu-item/tool-tip : text : open an existing book.", |
---|
65 | -// "app.menus.file.save-book-menu-item/title : text : save", |
---|
66 | -// "app.menus.file.save-book-menu-item/tool-tip : text : save the current book to a file.", |
---|
67 | -// "app.menus.file.save-book-as-menu-item/title : text : save as", |
---|
68 | -// "app.menus.file.save-book-as-menu-item/tool-tip : text : save the current book to another file.", |
---|
69 | -// "app.menus.file.save-book-as-template-menu-item/title : text : save as Template", |
---|
70 | -// "app.menus.file.save-book-as-template-menu-item/tool-tip : text : save the current book as a template.", |
---|
71 | -// "app.menus.file.book-properties-menu-item/title : text : Book Properties", |
---|
72 | -// "app.menus.file.book-properties-menu-item/tool-tip : text : show the properties of the current book.", |
---|
73 | -// "app.menus.file.close-book-menu-item/title : text : Close", |
---|
74 | -// "app.menus.file.close-book-menu-item/tool-tip : text : Close the current book.", |
---|
75 | -// "app.menus.file.exit-menu-item/title : text : Quit sophie 2", |
---|
76 | -// "app.menus.file.exit-menu-item/tool-tip : text : Close sophie 2.", |
---|
77 | -// "app.menus.edit-menu/title : text : edit", |
---|
78 | -// "app.menus.edit-menu/tool-tip : text : edit menu", |
---|
79 | -// "app.menus.edit.undo-menu-item/title : text : {generated}", |
---|
80 | -// "app.menus.edit.undo-menu-item/tool-tip : text : Revert the last change made.", |
---|
81 | -// "app.menus.edit.redo-menu-item/title : text : {generated}", |
---|
82 | -// "app.menus.edit.redo-menu-item/tool-tip : text : Restore the last reverted change.", |
---|
83 | -// "app.menus.edit.set-title-menu-item/title : text : set Title", |
---|
84 | -// "app.menus.edit.set-title-menu-item/tool-tip : text : set the title of the current book.", |
---|
85 | -// "app.menus.edit.show-connections-menu-item/title : text : {generated}", |
---|
86 | -// "app.menus.edit.show-connections-menu-item/tool-tip : text : Toggle the display of text frame chain connections.", |
---|
87 | -// "app.menus.insert-menu/title : text : ToDo", |
---|
88 | -// "app.menus.insert-menu/tool-tip : text : insert menu", |
---|
89 | -// "app.menus.insert.insert-text-menu-item/title : text : Text", |
---|
90 | -// "app.menus.insert.insert-text-menu-item/tool-tip : text : add a text frame to the current page.", |
---|
91 | -// "app.menus.window-menu/title : text : Window", |
---|
92 | -// "app.menus.window-menu/tool-tip : text : Window menu", |
---|
93 | -// "app.menus.window.cascade-menu-item/title : text : Cascade", |
---|
94 | -// "app.menus.window.cascade-menu-item/tool-tip : text : Cascade the open documents.", |
---|
95 | -// "app.menus.window.tile-menu-item/title : text : Tile", |
---|
96 | -// "app.menus.window.tile-menu-item/tool-tip : text : Tile the open documents.", |
---|
97 | -// "app.menus.window.document-menu-item/title : text : {generated:document-title}", |
---|
98 | -// "app.menus.window.document-menu-item/tool-tip : text : null", |
---|
99 | -// "app.menus.help-menu/title : text : Help", |
---|
100 | -// "app.menus.help-menu/tool-tip : text : Help menu", |
---|
101 | -// "org.sophie2.main.app.menus.tabbar.MinimizeAllItem/title : text : Minimizeall", |
---|
102 | -// "org.sophie2.main.app.menus.tabbar.MinimizeAllItem/tool-tip : text : Click here to hide all windows and show the desktop.", |
---|
103 | -// "main.view.menus.tabbar.restore-all-item/title : text : Restoreall", |
---|
104 | -// "main.view.menus.tabbar.restore-all-item/tool-tip : text : Click here to show all windows that are minimized.", |
---|
105 | -// "main.view.layout.books-tab/title : text : Books", |
---|
106 | -// "main.view.layout.books-tab/tool-tip : text : instruments for books.", |
---|
107 | -// "main.view.layout.books.open-books-palette/title : text : open Books", |
---|
108 | -// "main.view.layout.books.open-books-palette/tool-tip : text : List of open books", |
---|
109 | -// "main.view.layout.pages.page-preview-palette/title : text : Page Preview", |
---|
110 | -// "main.view.layout.pages.page-preview-palette/tool-tip : text : Preview of the book pages.", |
---|
111 | -// "main.view.layout.pages-tab/title : text : Pages", |
---|
112 | -// "main.view.layout.pages-tab/tool-tip : text : instruments for pages", |
---|
113 | -// "main.view.layout.timelines-tab/title : text : Timelines", |
---|
114 | -// "main.view.layout.timelines-tab/tool-tip : text : instruments for timelines.", |
---|
115 | -// "main.view.layout.tools.search-palette/title : text : search", |
---|
116 | -// "main.view.layout.tools.search-palette/tool-tip : text : allows searching in the text content of the book.", |
---|
117 | -// "main.view.layout.tools-tab/title : text : Tools", |
---|
118 | -// "main.view.layout.tools-tab/tool-tip : text : Book related instruments", |
---|
119 | -// "main.view.layout.library.book-templates-palette/title : text : Book Templates", |
---|
120 | -// "main.view.layout.library.book-templates-palette/tool-tip : text : Templates for new books.", |
---|
121 | -// "main.view.layout.library.components-palette/title : text : Frames", |
---|
122 | -// "main.view.layout.library.components-palette/tool-tip : text : Frame components", |
---|
123 | -// "main.view.layout.library-tab/title : text : Library", |
---|
124 | -// "main.view.layout.library-tab/tool-tip : text : Provides book and frame components", |
---|
125 | -// "main.view.layout.library.page-templates-palette/title : text : Page Templates Palette", |
---|
126 | -// "main.view.layout.library.page-templates-palette/tool-tip : text : Templates for new Pages", |
---|
127 | -// "main.view.layout.library.frame-templates-palette/title : text : Frame Templates Palette", |
---|
128 | -// "main.view.layout.library.frame-templates-palette/tool-tip : text : Templates for new Frames", |
---|
129 | -// "main.view.layout.styles-tab/title : text : styles", |
---|
130 | -// "main.view.layout.styles-tab/tool-tip : text : style related palettes.", |
---|
131 | -// "main.func.servers.servers-tab/title : text : servers", |
---|
132 | -// "main.func.servers.servers-tab/tool-tip : text : server related things.", |
---|
133 | -// "main.func.servers.connections-palette/title : text : Connections", |
---|
134 | -// "main.func.servers.connections-palette/tool-tip : text : server connections.", |
---|
135 | -// "main.view.layout.books.embedded-books-palette/title : text : embedded Books", |
---|
136 | -// "main.view.layout.books.embedded-books-palette/tool-tip : text : List of currently embedded books.", |
---|
137 | -// "main.view.layout.resources.all-resources-palette/title : text : Resources", |
---|
138 | -// "main.view.layout.resources.all-resources-palette/tool-tip : text : all resources currently used in the book.", |
---|
139 | -// "main.view.layout.resources-tab/title : text : Resources", |
---|
140 | -// "main.view.layout.resources-tab/tool-tip : text : The resources in the current book", |
---|
141 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderInsetsTop/title : text : Top border size:", |
---|
142 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderInsetsTop/tool-tip : text : Change the top size of the border.", |
---|
143 | -// "base.bound.base-bound-control/ok-icon : icon : approve.png", |
---|
144 | -// "base.bound.base-bound-control/error-icon : icon : disapprove.png", |
---|
145 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderInsetsRight/title : text : Right border size:", |
---|
146 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderInsetsRight/tool-tip : text : Change the right size of the border.", |
---|
147 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderInsetsBottom/title : text : Bottom border size:", |
---|
148 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderInsetsBottom/tool-tip : text : Change the bottom size of the border.", |
---|
149 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderInsetsLeft/title : text : Left border size:", |
---|
150 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderInsetsLeft/tool-tip : text : Change the left size of the border.", |
---|
151 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderColorField/title : text : Border color:", |
---|
152 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderColorField/tool-tip : text : Change the color of the border", |
---|
153 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderUseTemplate/title : text : Border template: ", |
---|
154 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderUseTemplate/tool-tip : text : Use the border from the template.", |
---|
155 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderLocked/title : text : Lock the border: ", |
---|
156 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BorderLocked/tool-tip : text : Prevent the border from any changes.", |
---|
157 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BackgroundColorField/title : text : Background color:", |
---|
158 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$BackgroundColorField/tool-tip : text : Change the color of the background", |
---|
159 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$FrameVisibleCheck/title : text : Frame visible: ", |
---|
160 | -// "org.sophie2.main.app.halos.huds.BackgroundAndBorderHud$FrameVisibleCheck/tool-tip : text : toggle the initial visibility of the frame.", |
---|
161 | -// "main.view.halos.huds.background-and-border-hud/tool-tip : text : edit the border and background of a frame.", |
---|
162 | -// "main.view.halos.shared.background-and-border-halo-button/tool-tip : text : Change the border and background.", |
---|
163 | -// "main.view.halos.shared.background-and-border-halo-button/halo-icon : icon : frameBackground.png", |
---|
164 | -// "org.sophie2.main.app.halos.huds.InsetsHud$FramePaddingTop/title : text : Top padding:", |
---|
165 | -// "org.sophie2.main.app.halos.huds.InsetsHud$FramePaddingTop/tool-tip : text : Change the top padding of the frame.", |
---|
166 | -// "org.sophie2.main.app.halos.huds.InsetsHud$FramePaddingRight/title : text : Right padding:", |
---|
167 | -// "org.sophie2.main.app.halos.huds.InsetsHud$FramePaddingRight/tool-tip : text : Change the right padding of the frame.", |
---|
168 | -// "org.sophie2.main.app.halos.huds.InsetsHud$FramePaddingBottom/title : text : Bottom padding:", |
---|
169 | -// "org.sophie2.main.app.halos.huds.InsetsHud$FramePaddingBottom/tool-tip : text : Change the bottom padding of the frame.", |
---|
170 | -// "org.sophie2.main.app.halos.huds.InsetsHud$FramePaddingLeft/title : text : Left padding:", |
---|
171 | -// "org.sophie2.main.app.halos.huds.InsetsHud$FramePaddingLeft/tool-tip : text : Change the left padding of the frame.", |
---|
172 | -// "org.sophie2.main.app.halos.huds.InsetsHud$FrameMarginRight/title : text : Right margin:", |
---|
173 | -// "org.sophie2.main.app.halos.huds.InsetsHud$FrameMarginRight/tool-tip : text : Change the right margin of the frame.", |
---|
174 | -// "org.sophie2.main.app.halos.huds.InsetsHud$FrameMarginBottom/title : text : Bottom margin:", |
---|
175 | -// "org.sophie2.main.app.halos.huds.InsetsHud$FrameMarginBottom/tool-tip : text : Change the bottom margin of the frame.", |
---|
176 | -// "org.sophie2.main.app.halos.huds.InsetsHud$FrameMarginLeft/title : text : Left margin:", |
---|
177 | -// "org.sophie2.main.app.halos.huds.InsetsHud$FrameMarginLeft/tool-tip : text : Change the left margin of the frame.", |
---|
178 | -// "main.view.halos.huds.insets-hud/tool-tip : text : edit the padding/margin properties of a frame.", |
---|
179 | -// "main.view.halos.frame.frame-insets-halo-button/tool-tip : text : edit frame margin and padding settings.", |
---|
180 | -// "main.view.halos.frame.frame-insets-halo-button/halo-icon : icon : frameInsets.png", |
---|
181 | -// "main.view.halos.frame.frame-z-order-up-halo-button/tool-tip : text : increase the z-order of this frame.", |
---|
182 | -// "main.view.halos.frame.frame-z-order-up-halo-button/halo-icon : icon : zOrderUp.png", |
---|
183 | -// "main.view.halos.frame.frame-z-order-down-halo-button/tool-tip : text : Decrease the z-order of this frame.", |
---|
184 | -// "main.view.halos.frame.frame-z-order-down-halo-button/halo-icon : icon : zOrderDown.png", |
---|
185 | -// "org.sophie2.main.app.halos.huds.ShadowHud$ShadowPositionX/title : text : X:", |
---|
186 | -// "org.sophie2.main.app.halos.huds.ShadowHud$ShadowPositionX/tool-tip : text : Change the shadow on the X axis.", |
---|
187 | -// "org.sophie2.main.app.halos.huds.ShadowHud$ShadowPositionY/title : text : Y:", |
---|
188 | -// "org.sophie2.main.app.halos.huds.ShadowHud$ShadowPositionY/tool-tip : text : Change the shadow on the Y axis.", |
---|
189 | -// "org.sophie2.main.app.halos.huds.ShadowHud$ShadowColorField/title : text : Color:", |
---|
190 | -// "org.sophie2.main.app.halos.huds.ShadowHud$ShadowColorField/tool-tip : text : Change the color of the shadow", |
---|
191 | -// "main.view.halos.huds.shadow-hud/tool-tip : text : edit the shadow properties of a page.", |
---|
192 | -// "main.view.halos.frame.frame-shadow-halo-button/tool-tip : text : edit shadow settings.", |
---|
193 | -// "main.view.halos.frame.frame-shadow-halo-button/halo-icon : icon : pageShadowHalo.png", |
---|
194 | -// "main.view.halos.frame.frame-content-use-template-halo-button/tool-tip : text : Use the content from the template.", |
---|
195 | -// "main.view.halos.frame.frame-content-use-template-halo-button/icon-on : icon : useTemplateOn.png", |
---|
196 | -// "main.view.halos.frame.frame-content-use-template-halo-button/icon-off : icon : useTemplateOff.png", |
---|
197 | -// "main.view.halos.page.page-frames-use-template-halo-button/tool-tip : text : show the frames from the template.", |
---|
198 | -// "main.view.halos.page.page-frames-use-template-halo-button/icon-on : icon : useTemplateOn.png", |
---|
199 | -// "main.view.halos.page.page-frames-use-template-halo-button/icon-off : icon : useTemplateOff.png", |
---|
200 | -// "main.view.shared.frame.add-template/tool-tip : text : add the object as a template.", |
---|
201 | -// "main.view.shared.frame.add-template/halo-icon : icon : addTemplate.png", |
---|
202 | -// "org.sophie2.main.app.halos.align.AlignElementsLeft/title : text : align left", |
---|
203 | -// "org.sophie2.main.app.halos.align.AlignElementsLeft/tool-tip : text : Click to align selected elements' left sides.", |
---|
204 | -// "org.sophie2.main.app.halos.align.AlignElementsRight/title : text : align right", |
---|
205 | -// "org.sophie2.main.app.halos.align.AlignElementsRight/tool-tip : text : Click to align selected elements' right sides.", |
---|
206 | -// "org.sophie2.main.app.halos.align.AlignElementsTop/title : text : align top", |
---|
207 | -// "org.sophie2.main.app.halos.align.AlignElementsTop/tool-tip : text : Click to align selected elements' top sides.", |
---|
208 | -// "org.sophie2.main.app.halos.align.AlignElementsBottom/title : text : align bottom", |
---|
209 | -// "org.sophie2.main.app.halos.align.AlignElementsBottom/tool-tip : text : Click to align selected elements' bottom sides.", |
---|
210 | -// "org.sophie2.main.app.halos.align.AlignElementsHorizontally/title : text : align horizontally", |
---|
211 | -// "org.sophie2.main.app.halos.align.AlignElementsHorizontally/tool-tip : text : Click to align selected elements' horizontally.", |
---|
212 | -// "org.sophie2.main.app.halos.align.AlignElementsVertically/title : text : align vertically", |
---|
213 | -// "org.sophie2.main.app.halos.align.AlignElementsVertically/tool-tip : text : Click to align selected elements' vertically.", |
---|
214 | -// "main.view.halos.align.aligning-page-elements-hud/tool-tip : text : align the selected page elements.", |
---|
215 | -// "main.view.halos.buttons.huds.align-elements-halo-button/tool-tip : text : align the selected page elements.", |
---|
216 | -// "main.view.halos.buttons.huds.align-elements-halo-button/halo-icon : icon : alignElements.png", |
---|
217 | -// "main.view.halos.grouping.group-page-elements-button/tool-tip : text : Click to group the selected page elements.", |
---|
218 | -// "main.view.halos.grouping.group-page-elements-button/halo-icon : icon : groupElements.png", |
---|
219 | -// "main.view.halos.grouping.ungroup-page-elements-button/tool-tip : text : Click to ungroup the selected page elements.", |
---|
220 | -// "main.view.halos.grouping.ungroup-page-elements-button/halo-icon : icon : ungroupElements.png", |
---|
221 | -// "org.sophie2.main.func.links.LinksHud$CurrentRule/title : text : Rule:", |
---|
222 | -// "org.sophie2.main.func.links.LinksHud$CurrentRule/tool-tip : text : select a rule", |
---|
223 | -// "org.sophie2.main.func.links.LinksHud$AddRule/tool-tip : text : add new rule", |
---|
224 | -// "org.sophie2.main.func.links.LinksHud$RemoveRule/tool-tip : text : Remove the selected rule", |
---|
225 | -// "org.sophie2.main.func.links.LinksHud$AvailableTriggers/title : text : Trigger:", |
---|
226 | -// "org.sophie2.main.func.links.LinksHud$AvailableTriggers/tool-tip : text : select a trigger for this rule", |
---|
227 | -// "org.sophie2.main.func.links.LinksHud$AvailableActions/title : text : action:", |
---|
228 | -// "org.sophie2.main.func.links.LinksHud$AvailableActions/tool-tip : text : select action for this rule", |
---|
229 | -// "org.sophie2.main.func.links.actions.navigation.GoToPageConfigurationPanel$AvailablePages/title : text : Go to page:", |
---|
230 | -// "org.sophie2.main.func.links.actions.navigation.GoToPageConfigurationPanel$AvailablePages/tool-tip : text : Go To Page", |
---|
231 | -// "org.sophie2.main.func.links.actions.showing.ShowFrameConfigurationPanel$FrameSelector/title : text : select frame:", |
---|
232 | -// "org.sophie2.main.func.links.actions.showing.ShowFrameConfigurationPanel$FrameSelector/tool-tip : text : show frame", |
---|
233 | -// "main.func.links.links-hud/tool-tip : text : Manage links.", |
---|
234 | -// "main.func.links.links-halo-button/tool-tip : text : Manage links.", |
---|
235 | -// "main.func.links.links-halo-button/halo-icon : icon : LinksHalo.png", |
---|
236 | -// "main.view.halos.frame.move.frame-move-halo-button/halo-icon : icon : move.png", |
---|
237 | -// "main.view.halos.frame.move.frame-move-halo-button/tool-tip : text : Drag to move the frame", |
---|
238 | -// "main.view.halos.frame.move.frame-remove-halo-button/halo-icon : icon : remove.png", |
---|
239 | -// "main.view.halos.frame.move.frame-remove-halo-button/tool-tip : text : Click to delete the frame.", |
---|
240 | -// "extra.annotations.sticky-remove-halo-button/halo-icon : icon : remove.png", |
---|
241 | -// "extra.annotations.sticky-remove-halo-button/tool-tip : text : Click to remove the sticky", |
---|
242 | -// "org.sophie2.main.func.text.halos.TextFontHud$TextItalicStyle/title : text : italic:", |
---|
243 | -// "org.sophie2.main.func.text.halos.TextFontHud$TextItalicStyle/tool-tip : text : set on/off italic", |
---|
244 | -// "org.sophie2.main.func.text.halos.TextFontHud$TextBoldStyle/title : text : Bold: ", |
---|
245 | -// "org.sophie2.main.func.text.halos.TextFontHud$TextBoldStyle/tool-tip : text : set on/off bold.", |
---|
246 | -// "org.sophie2.main.func.text.halos.TextFontHud$TextUnderlineStyle/title : text : Underline: ", |
---|
247 | -// "org.sophie2.main.func.text.halos.TextFontHud$TextUnderlineStyle/tool-tip : text : set on/off underline", |
---|
248 | -// "org.sophie2.main.func.text.halos.TextFontHud$TextStrikethroughStyle/title : text : strikethrough: ", |
---|
249 | -// "org.sophie2.main.func.text.halos.TextFontHud$TextStrikethroughStyle/tool-tip : text : set on/off strikethrough", |
---|
250 | -// "main.func.text.hud.text-font/tool-tip : text : Choose font family name, size adn style", |
---|
251 | -// "main.func.text.halos.text-font-button/tool-tip : text : Choose font", |
---|
252 | -// "main.func.text.halos.text-font-button/halo-icon : icon : font.png", |
---|
253 | -// "org.sophie2.main.app.commons.app.AppTabBar/title : text : TabBar", |
---|
254 | -// "org.sophie2.main.app.commons.app.AppTabBar/tool-tip : text : open Books", |
---|
255 | -// "org.sophie2.main.app.commons.app.AppTabBar/show-desktop-icon : icon : showDesktop.png", |
---|
256 | -// "org.sophie2.main.app.commons.app.AppTabBar/show-desktop-tool-tip : text : Click here to hide all windows and show the desktop.", |
---|
257 | -// "app.menus.file.file-print-menu-item/title : text : Print...", |
---|
258 | -// "app.menus.file.file-print-menu-item/tool-tip : text : Print current book", |
---|
259 | -// "app.menus.file.file-print-to-file-menu-item/title : text : Print To File...", |
---|
260 | -// "app.menus.file.file-print-to-file-menu-item/tool-tip : text : Print current book to file", |
---|
261 | -// "app.menus.insert.insert-image-menu-item/title : text : image", |
---|
262 | -// "app.menus.insert.insert-image-menu-item/tool-tip : text : add an image frame to the current page.", |
---|
263 | -// "app.menus.insert.insert-audio-menu-item/title : text : audio", |
---|
264 | -// "app.menus.insert.insert-audio-menu-item/tool-tip : text : add an audio frame to the current page.", |
---|
265 | -// "app.menus.insert.insert-video-menu-item/title : text : Video", |
---|
266 | -// "app.menus.insert.insert-video-menu-item/tool-tip : text : add a video frame to the current page.", |
---|
267 | -// "app.menus.insert.insert-pdf-menu-item/title : text : Pdf", |
---|
268 | -// "app.menus.insert.insert-pdf-menu-item/tool-tip : text : add a PDF frame to the current page.", |
---|
269 | -// "app.menus.insert.insert-book-menu-item/title : text : Book", |
---|
270 | -// "app.menus.insert.insert-book-menu-item/tool-tip : text : embed a book in the current page.", |
---|
271 | -// "app.menus.help.help-contents-menu-item/title : text : Help Contents", |
---|
272 | -// "app.menus.help.help-contents-menu-item/tool-tip : text : Displays the main help index", |
---|
273 | -// "app.menus.help.about-menu-item/title : text : about", |
---|
274 | -// "app.menus.help.about-menu-item/tool-tip : text : Displays version information, license used, etc.", |
---|
275 | -// "extra.annotations.all-annotations-palette/title : text : all annotations", |
---|
276 | -// "extra.annotations.all-annotations-palette/tool-tip : text : Load/save annotations, manage annotations from different users", |
---|
277 | -// "extra.annotations.stickies-palette/title : text : stickies", |
---|
278 | -// "extra.annotations.stickies-palette/tool-tip : text : add new sticky, show or hide stickies", |
---|
279 | -// "main.view.layout.resources.book-extras/title : text : Book extras", |
---|
280 | -// "main.view.layout.resources.book-extras/tool-tip : text : Manage book extras - show/hide, export/import, etc.", |
---|
281 | -// "extra.annotations.annotations-tab/title : text : annotations", |
---|
282 | -// "extra.annotations.annotations-tab/tool-tip : text : stick notes to the book, highlight some text or record your voice comments", |
---|
283 | -// "main.view.layout.resources.resources-detail-palette/tool-tip : text : Detail View", |
---|
284 | -// "main.view.layout.resources.resources-detail-palette/title : text : Detail View", |
---|
285 | -// "main.view.layout.changes.all-changes-palette/title : text : Changes", |
---|
286 | -// "main.view.layout.changes.all-changes-palette/tool-tip : text : all changes done..", |
---|
287 | -// "main.view.halos.page.resize.page-resize-halo-button/halo-icon : icon : resize.png" |
---|
288 | -// }; |
---|
289 | - |
---|
290 | /** |
---|
291 | * Alternative skin's definintion. |
---|
292 | */ |
---|
293 | Index: modules/org.sophie2.main.layout.mydoggy/src/main/java/org/sophie2/main/layout/mydoggy/MDTab.java |
---|
294 | =================================================================== |
---|
295 | --- modules/org.sophie2.main.layout.mydoggy/src/main/java/org/sophie2/main/layout/mydoggy/MDTab.java (revision 2334) |
---|
296 | +++ modules/org.sophie2.main.layout.mydoggy/src/main/java/org/sophie2/main/layout/mydoggy/MDTab.java (working copy) |
---|
297 | @@ -7,6 +7,7 @@ |
---|
298 | import org.noos.xing.mydoggy.ToolWindow; |
---|
299 | import org.noos.xing.mydoggy.ToolWindowAnchor; |
---|
300 | import org.noos.xing.mydoggy.ToolWindowGroup; |
---|
301 | +import org.noos.xing.mydoggy.ToolWindowManager; |
---|
302 | import org.noos.xing.mydoggy.plaf.MyDoggyToolWindowManager; |
---|
303 | import org.sophie2.base.layout.model.Palette; |
---|
304 | import org.sophie2.base.layout.model.Tab; |
---|
305 | @@ -28,6 +29,8 @@ |
---|
306 | * @author nvasilev |
---|
307 | */ |
---|
308 | public class MDTab extends MDCompoundLayoutElement { |
---|
309 | + |
---|
310 | + private static final String GROUP = "Group"; |
---|
311 | |
---|
312 | // --- Properties ---------------------------------------------------------- |
---|
313 | |
---|
314 | @@ -49,14 +52,15 @@ |
---|
315 | protected Prop<MDFlap> parent() { |
---|
316 | return getBean().makeParentProp(MDFlap.class); |
---|
317 | } |
---|
318 | - |
---|
319 | + |
---|
320 | @Override |
---|
321 | public RwProp<ToolWindowAnchor> orientation() { |
---|
322 | class orientation extends AutoProperty<ToolWindowAnchor> { |
---|
323 | - |
---|
324 | + |
---|
325 | @Override |
---|
326 | protected ToolWindowAnchor compute() { |
---|
327 | - if (parent().get() == null || parent().get().orientation().get() == null) { |
---|
328 | + if (parent().get() == null |
---|
329 | + || parent().get().orientation().get() == null) { |
---|
330 | return null; |
---|
331 | } |
---|
332 | return parent().get().orientation().get(); |
---|
333 | @@ -64,8 +68,7 @@ |
---|
334 | } |
---|
335 | return getBean().makeProp(orientation.class); |
---|
336 | } |
---|
337 | - |
---|
338 | - |
---|
339 | + |
---|
340 | // TODO: this used some bad things to synchronize.. |
---|
341 | // make sure that the following two are executed |
---|
342 | // // Registering the element in the tool window manager |
---|
343 | @@ -122,32 +125,42 @@ |
---|
344 | // do nothing |
---|
345 | } |
---|
346 | |
---|
347 | + private String oldTitle; |
---|
348 | + |
---|
349 | @Override |
---|
350 | protected void setup(JPanel swingComponent) { |
---|
351 | swingComponent.setLayout(new BorderLayout()); |
---|
352 | |
---|
353 | - ToolWindowGroup group = toolWindowManager().get() |
---|
354 | - .getToolWindowGroup(title().get() + "Group"); |
---|
355 | + String currentTitle = title().get(); |
---|
356 | + ToolWindowManager toolWindowManager = toolWindowManager().get(); |
---|
357 | |
---|
358 | - for (ToolWindow win : toolWindowManager().get() |
---|
359 | - .getToolWindows()) { |
---|
360 | - group.removeToolWindow(win); |
---|
361 | + if (!currentTitle.equals(this.oldTitle)) { |
---|
362 | + removeWindowsGroup(this.oldTitle + GROUP); |
---|
363 | + this.oldTitle = currentTitle; |
---|
364 | } |
---|
365 | |
---|
366 | - toolWindowManager().get().unregisterAllToolWindow(); |
---|
367 | + removeWindowsGroup(currentTitle + GROUP); |
---|
368 | + toolWindowManager.unregisterAllToolWindow(); |
---|
369 | |
---|
370 | for (MDPalette palette : paletteViews().get()) { |
---|
371 | addMDElement(palette); |
---|
372 | } |
---|
373 | |
---|
374 | - if (paletteViews().get().size() != 0) { |
---|
375 | - group.setImplicit(true); |
---|
376 | - group.setVisible(true); |
---|
377 | - } |
---|
378 | - |
---|
379 | swingComponent.add(toolWindowManager().get(), |
---|
380 | BorderLayout.CENTER); |
---|
381 | } |
---|
382 | + |
---|
383 | + private final void removeWindowsGroup(String groupName) { |
---|
384 | + ToolWindowManager toolWindowManager = toolWindowManager().get(); |
---|
385 | + ToolWindowGroup group = toolWindowManager |
---|
386 | + .getToolWindowGroup(groupName); |
---|
387 | + |
---|
388 | + for (ToolWindow win : toolWindowManager.getToolWindows()) { |
---|
389 | + group.removeToolWindow(win); |
---|
390 | + } |
---|
391 | + |
---|
392 | + toolWindowManager.removeToolWindowGroup(groupName); |
---|
393 | + } |
---|
394 | } |
---|
395 | |
---|
396 | return getBean().makeProp(swingComponent.class); |
---|
397 | @@ -177,7 +190,7 @@ |
---|
398 | // Creating palettes group |
---|
399 | ToolWindowGroup group = toolWindowManager.getToolWindowGroup(title() |
---|
400 | .get() |
---|
401 | - + "Group"); |
---|
402 | + + GROUP); |
---|
403 | |
---|
404 | // Adding the pallete to the palettes group |
---|
405 | ToolWindow paletteToolWindow = toolWindowManager |
---|
406 | @@ -211,7 +224,7 @@ |
---|
407 | // Obtaining palettes group |
---|
408 | ToolWindowGroup group = toolWindowManager.getToolWindowGroup(title() |
---|
409 | .get() |
---|
410 | - + "Group"); |
---|
411 | + + GROUP); |
---|
412 | ToolWindow paletteToolWindow = toolWindowManager |
---|
413 | .getToolWindow(mdPalette.title().get()); |
---|
414 | |
---|
415 | Index: modules/org.sophie2.main.layout.mydoggy/src/main/java/org/sophie2/main/layout/mydoggy/MDToolWindowFactory.java |
---|
416 | =================================================================== |
---|
417 | --- modules/org.sophie2.main.layout.mydoggy/src/main/java/org/sophie2/main/layout/mydoggy/MDToolWindowFactory.java (revision 2334) |
---|
418 | +++ modules/org.sophie2.main.layout.mydoggy/src/main/java/org/sophie2/main/layout/mydoggy/MDToolWindowFactory.java (working copy) |
---|
419 | @@ -27,7 +27,7 @@ |
---|
420 | configureDockedDescriptor(toolWindow); |
---|
421 | configureSlidingDescriptor(toolWindow); |
---|
422 | configureFloatingDescriptor(toolWindow); |
---|
423 | - configureFloatingLiveDescriptor(toolWindow); |
---|
424 | + //configureFloatingLiveDescriptor(toolWindow); |
---|
425 | } |
---|
426 | |
---|
427 | /** |
---|
428 | Index: modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/skins/AlternativeSkinItem.java |
---|
429 | =================================================================== |
---|
430 | --- modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/skins/AlternativeSkinItem.java (revision 2304) |
---|
431 | +++ modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/skins/AlternativeSkinItem.java (working copy) |
---|
432 | @@ -13,7 +13,7 @@ |
---|
433 | * |
---|
434 | */ |
---|
435 | @SkinElementId("app.menus.skins.hackers-skin-item") |
---|
436 | -public class HackersSkinItem extends MenuItem { |
---|
437 | +public class AlternativeSkinItem extends MenuItem { |
---|
438 | |
---|
439 | @Override |
---|
440 | public void clicked() { |
---|
441 | Index: modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/skins/HackersSkinItem.java |
---|
442 | =================================================================== |
---|
443 | --- modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/skins/HackersSkinItem.java (revision 2334) |
---|
444 | +++ modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/skins/HackersSkinItem.java (working copy) |
---|
445 | @@ -1,29 +0,0 @@ |
---|
446 | -package org.sophie2.main.app.menus.skins; |
---|
447 | - |
---|
448 | -import org.sophie2.base.menus.MenuItem; |
---|
449 | -import org.sophie2.base.skins.Skin; |
---|
450 | -import org.sophie2.base.skins.SkinElementId; |
---|
451 | -import org.sophie2.base.skins.SkinManager; |
---|
452 | -import org.sophie2.base.skins.SkinsNames; |
---|
453 | - |
---|
454 | -/** |
---|
455 | - * A menu item to switch to the Hackers skin in Sophie2. |
---|
456 | - * |
---|
457 | - * @author peko, nenko |
---|
458 | - * |
---|
459 | - */ |
---|
460 | -@SkinElementId("app.menus.skins.hackers-skin-item") |
---|
461 | -public class HackersSkinItem extends MenuItem { |
---|
462 | - |
---|
463 | - @Override |
---|
464 | - public void clicked() { |
---|
465 | - SkinManager.get().currentSkin().set( |
---|
466 | - new Skin(SkinsNames.ALTERNATIVE_NAME, new Skin(SkinsNames.DEFAULT_NAME, null))); |
---|
467 | - } |
---|
468 | - |
---|
469 | - @Override |
---|
470 | - protected boolean computeEnabled() { |
---|
471 | - return true; |
---|
472 | - } |
---|
473 | - |
---|
474 | -} |
---|
475 | Index: modules/org.sophie2.base.skins/src/test/java/org/sophie2/base/skins/SkinsTest.java |
---|
476 | =================================================================== |
---|
477 | --- modules/org.sophie2.base.skins/src/test/java/org/sophie2/base/skins/SkinsTest.java (revision 0) |
---|
478 | +++ modules/org.sophie2.base.skins/src/test/java/org/sophie2/base/skins/SkinsTest.java (revision 0) |
---|
479 | @@ -0,0 +1,233 @@ |
---|
480 | +package org.sophie2.base.skins; |
---|
481 | + |
---|
482 | +import java.util.List; |
---|
483 | + |
---|
484 | +import org.sophie2.core.modularity.FakeModuleRegistry; |
---|
485 | +import org.sophie2.core.modularity.SophieExtension; |
---|
486 | +import org.sophie2.core.modularity.SophieExtensionPoint; |
---|
487 | +import org.sophie2.core.modularity.SophieModule; |
---|
488 | +import org.sophie2.core.prolib.impl.AutoProperty; |
---|
489 | +import org.sophie2.core.prolib.impl.BaseProObject; |
---|
490 | +import org.sophie2.core.prolib.interfaces.Prop; |
---|
491 | +import org.sophie2.core.testing.IntegrationTestBase; |
---|
492 | + |
---|
493 | +/** |
---|
494 | + * A test for Skins. Should test whether {@link Skin}s are |
---|
495 | + * properly changing. |
---|
496 | + * |
---|
497 | + * @author peko |
---|
498 | + * |
---|
499 | + */ |
---|
500 | +@SuppressWarnings("unchecked") |
---|
501 | +public class SkinsTest extends IntegrationTestBase{ |
---|
502 | + |
---|
503 | + //create the skin values for both skins. These are just Strings but can be |
---|
504 | + //any other types. => |
---|
505 | + |
---|
506 | + //default Skin values. |
---|
507 | + private static String defaultSkinToolTip = "This is a tool-tip for the SkinsTest"; |
---|
508 | + private static String defaultSkinTitle = "This is a title for the SkinsTest"; |
---|
509 | + private static String defaultSkinString = "This is just a String..."; |
---|
510 | + |
---|
511 | + //alternative Skin values. |
---|
512 | + private static String altSkinToolTip = "Th15 15 4 t00l-t1p f0r the Sk1n5Te5t"; |
---|
513 | + private static String altSkinTitle = "Th15 15 4 t1tle f0r the 5k1n5Te5t"; |
---|
514 | + private static String altSkinString = "Th15 15 ju5t 4 5tr1ng..."; |
---|
515 | + |
---|
516 | + //cool Skin value. |
---|
517 | + private static String coolSkinTitle = "<html>This is<br>a test title with <br> three lines </html>"; |
---|
518 | + |
---|
519 | + private static String titleId = "test-title"; |
---|
520 | + private static String tooltipId = "test-tooltip"; |
---|
521 | + private static String stringId = "test-string"; |
---|
522 | + |
---|
523 | + //the class for use in the record ids. |
---|
524 | + private static Class clazz = DummySkinableComponent.class; |
---|
525 | + |
---|
526 | + private Skin defaultSkin; |
---|
527 | + private Skin alternativeSkin; |
---|
528 | + |
---|
529 | + //the third skin will be used to set part of the values |
---|
530 | + //so that its fallback skin is used. |
---|
531 | + private Skin coolSkin3; |
---|
532 | + private static String coolSkin3Name = "Cool Skin"; |
---|
533 | + |
---|
534 | + private DummySkinableComponent component; |
---|
535 | + |
---|
536 | + |
---|
537 | + /** |
---|
538 | + * A module providing the needed extensions for the test. |
---|
539 | + * @author pap |
---|
540 | + * |
---|
541 | + */ |
---|
542 | + public static class DemoModule extends SophieModule{ |
---|
543 | + |
---|
544 | + @Override |
---|
545 | + protected void defineExtensionPoints(List<SophieExtensionPoint<?>> res) { |
---|
546 | + // TODO Auto-generated method stub |
---|
547 | + |
---|
548 | + } |
---|
549 | + |
---|
550 | + @Override |
---|
551 | + protected void defineExtensions(List<SophieExtension<?>> res) { |
---|
552 | + makeSkinParts(res); |
---|
553 | + } |
---|
554 | + |
---|
555 | + @SuppressWarnings("synthetic-access") |
---|
556 | + private void makeSkinParts(List<SophieExtension<?>> list) { |
---|
557 | + //the default skin will have two SkinParts. |
---|
558 | + //create skin parts and add skin records to them. |
---|
559 | + BaseSkinPart part1 = new BaseSkinPart(SkinsNames.DEFAULT_NAME); |
---|
560 | + BaseSkinPart part2 = new BaseSkinPart(SkinsNames.DEFAULT_NAME); |
---|
561 | + //the alternative skin will have only one skin part. |
---|
562 | + BaseSkinPart part3 = new BaseSkinPart(SkinsNames.ALTERNATIVE_NAME); |
---|
563 | + //the skinpart for the third skin. |
---|
564 | + BaseSkinPart part4 = new BaseSkinPart(coolSkin3Name); |
---|
565 | + |
---|
566 | + part1.add(SkinUtil.getElementId(clazz), tooltipId, defaultSkinToolTip); |
---|
567 | + part1.add(SkinUtil.getElementId(clazz), titleId, defaultSkinTitle); |
---|
568 | + part2.add(SkinUtil.getElementId(clazz), stringId, defaultSkinString); |
---|
569 | + |
---|
570 | + part3.add(SkinUtil.getElementId(clazz), tooltipId, altSkinToolTip); |
---|
571 | + part3.add(SkinUtil.getElementId(clazz), titleId, altSkinTitle); |
---|
572 | + part3.add(SkinUtil.getElementId(clazz), stringId, altSkinString); |
---|
573 | + |
---|
574 | + part4.add(SkinUtil.getElementId(clazz), titleId, coolSkinTitle); |
---|
575 | + |
---|
576 | + list.add(part1.asExtension()); |
---|
577 | + list.add(part2.asExtension()); |
---|
578 | + list.add(part3.asExtension()); |
---|
579 | + list.add(part4.asExtension()); |
---|
580 | + } |
---|
581 | + |
---|
582 | + } |
---|
583 | + |
---|
584 | + /** |
---|
585 | + * |
---|
586 | + * A dummy implementation for a skinable component. |
---|
587 | + * |
---|
588 | + * @author peko |
---|
589 | + * |
---|
590 | + */ |
---|
591 | + class DummySkinableComponent extends BaseProObject{ |
---|
592 | + |
---|
593 | + /** |
---|
594 | + * The tool-tip of this component. |
---|
595 | + * @return property. |
---|
596 | + */ |
---|
597 | + public Prop<String> toolTip() { |
---|
598 | + class toolTip extends AutoProperty<String> { |
---|
599 | + |
---|
600 | + @SuppressWarnings({ "synthetic-access", "static-access" }) |
---|
601 | + @Override |
---|
602 | + protected String compute() { |
---|
603 | + String res = SkinUtil.getSkinValue(SkinsTest.this.clazz, |
---|
604 | + tooltipId, String.class); |
---|
605 | + return res; |
---|
606 | + } |
---|
607 | + } |
---|
608 | + return getBean().makeProp(toolTip.class); |
---|
609 | + } |
---|
610 | + |
---|
611 | + /** |
---|
612 | + * The title of this component. |
---|
613 | + * |
---|
614 | + * @return property. |
---|
615 | + */ |
---|
616 | + public Prop<String> title() { |
---|
617 | + class title extends AutoProperty<String> { |
---|
618 | + |
---|
619 | + @SuppressWarnings({ "synthetic-access", "static-access" }) |
---|
620 | + @Override |
---|
621 | + protected String compute() { |
---|
622 | + String res = SkinUtil.getSkinValue(SkinsTest.this.clazz, |
---|
623 | + titleId, String.class); |
---|
624 | + return res; |
---|
625 | + } |
---|
626 | + } |
---|
627 | + return getBean().makeProp(title.class); |
---|
628 | + } |
---|
629 | + |
---|
630 | + /** |
---|
631 | + * A string containing property for this component. |
---|
632 | + * |
---|
633 | + * @return property. |
---|
634 | + */ |
---|
635 | + public Prop<String> string() { |
---|
636 | + class string extends AutoProperty<String> { |
---|
637 | + |
---|
638 | + @SuppressWarnings({ "synthetic-access", "static-access" }) |
---|
639 | + @Override |
---|
640 | + protected String compute() { |
---|
641 | + String res = SkinUtil.getSkinValue(SkinsTest.this.clazz, |
---|
642 | + stringId, String.class); |
---|
643 | + return res; |
---|
644 | + } |
---|
645 | + } |
---|
646 | + return getBean().makeProp(string.class); |
---|
647 | + } |
---|
648 | + |
---|
649 | + } |
---|
650 | + |
---|
651 | + @Override |
---|
652 | + protected void setUp() throws Exception { |
---|
653 | + super.setUp(); |
---|
654 | + |
---|
655 | + FakeModuleRegistry.start(BaseSkinsModule.class, DemoModule.class); |
---|
656 | + |
---|
657 | + //the default skin. |
---|
658 | + this.defaultSkin = new Skin(SkinsNames.DEFAULT_NAME, null); |
---|
659 | + //an alternative skin. |
---|
660 | + this.alternativeSkin = new Skin(SkinsNames.ALTERNATIVE_NAME, this.defaultSkin); |
---|
661 | + |
---|
662 | + //the third skin. |
---|
663 | + this.coolSkin3 = new Skin(coolSkin3Name, this.defaultSkin); |
---|
664 | + |
---|
665 | + this.component = new DummySkinableComponent(); |
---|
666 | + } |
---|
667 | + |
---|
668 | + @Override |
---|
669 | + protected void tearDown() throws Exception { |
---|
670 | + FakeModuleRegistry.stop(); |
---|
671 | + super.tearDown(); |
---|
672 | + } |
---|
673 | + |
---|
674 | + /** |
---|
675 | + * Tests the whether the changing of {@link Skin}s changes values properly. |
---|
676 | + */ |
---|
677 | + @SuppressWarnings("static-access") |
---|
678 | + public void testChangeSkin(){ |
---|
679 | + |
---|
680 | + //setting the skin in the SkinManager. |
---|
681 | + SkinManager.get().currentSkin().set(this.defaultSkin); |
---|
682 | + |
---|
683 | + assertSame(this.component.toolTip().get(), this.defaultSkinToolTip); |
---|
684 | + assertSame(this.component.title().get(), this.defaultSkinTitle); |
---|
685 | + assertSame(this.component.string().get(), this.defaultSkinString); |
---|
686 | + |
---|
687 | + //changing the skin in the SkinManager. |
---|
688 | + SkinManager.get().currentSkin().set(this.alternativeSkin); |
---|
689 | + |
---|
690 | + assertSame(this.component.toolTip().get(), this.altSkinToolTip); |
---|
691 | + assertSame(this.component.title().get(), this.altSkinTitle); |
---|
692 | + assertSame(this.component.string().get(), this.altSkinString); |
---|
693 | + |
---|
694 | + //resetting the skin to the initial default skin value. |
---|
695 | + SkinManager.get().currentSkin().set(this.defaultSkin); |
---|
696 | + |
---|
697 | + assertSame(this.component.toolTip().get(), this.defaultSkinToolTip); |
---|
698 | + assertSame(this.component.title().get(), this.defaultSkinTitle); |
---|
699 | + assertSame(this.component.string().get(), this.defaultSkinString); |
---|
700 | + |
---|
701 | + //setting the cool skin so that the fallback skin is used (the default one). |
---|
702 | + SkinManager.get().currentSkin().set(this.coolSkin3); |
---|
703 | + //from fallback skin. |
---|
704 | + assertSame(this.component.toolTip().get(), this.defaultSkinToolTip); |
---|
705 | + //from cool skin |
---|
706 | + assertSame(this.component.title().get(), this.coolSkinTitle); |
---|
707 | + //from fallback skin again. |
---|
708 | + assertSame(this.component.string().get(), this.defaultSkinString); |
---|
709 | + |
---|
710 | + } |
---|
711 | + |
---|
712 | +} |
---|
713 | \ No newline at end of file |
---|