Revision 38763 branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/extension/develtools/IconThemeDevelTool.java
IconThemeDevelTool.java | ||
---|---|---|
20 | 20 |
public class IconThemeDevelTool { |
21 | 21 |
|
22 | 22 |
public void showDefaultIconTheme() { |
23 |
String html = this.getIconThemeInformationByGroup();
|
|
24 |
InfoPanel.save2file("iconthemeinfo", html);
|
|
23 |
String html = "<html>\n<body>\n"+ this.getIconThemeInformationByGroup()+"</body>\n</html>\n";
|
|
24 |
InfoPanel.save2file("icontheme-report", html);
|
|
25 | 25 |
InfoPanel.showPanel("Icon theme information", WindowManager.MODE.WINDOW, html); |
26 | 26 |
} |
27 | 27 |
|
28 | 28 |
public void showDefaultIconThemeByPlugin() { |
29 |
String html = this.getIconThemeInformationByPlugin();
|
|
30 |
InfoPanel.save2file("iconthemeinfo", html);
|
|
29 |
String html = "<html>\n<body>\n"+ this.getIconThemeInformationByPlugin()+"</body>\n</html>\n";
|
|
30 |
InfoPanel.save2file("icontheme-report", html);
|
|
31 | 31 |
InfoPanel.showPanel("Icon theme information", WindowManager.MODE.WINDOW, html); |
32 | 32 |
} |
33 | 33 |
|
... | ... | |
51 | 51 |
return getIconThemeInformation(theme, themeIconsIt); |
52 | 52 |
} |
53 | 53 |
|
54 |
public String getIconThemeInformationOfPlugin(String pluginName) { |
|
55 |
if( pluginName == null ) { |
|
56 |
return ""; |
|
57 |
} |
|
58 |
IconThemeManager manager = ToolsSwingLocator.getIconThemeManager(); |
|
59 |
IconTheme theme = manager.getDefault(); |
|
60 |
|
|
61 |
List<IconTheme.Icon>themeIcons = new ArrayList<IconTheme.Icon>(); |
|
62 |
Iterator<IconTheme.Icon> themeIconsIt = theme.getThemeIcons(); |
|
63 |
while (themeIconsIt.hasNext()) { |
|
64 |
IconTheme.Icon iconTheme = (IconTheme.Icon) themeIconsIt.next(); |
|
65 |
if( !pluginName.equalsIgnoreCase(iconTheme.getProviderName()) ) { |
|
66 |
continue; |
|
67 |
} |
|
68 |
themeIcons.add(iconTheme); |
|
69 |
} |
|
70 |
Collections.sort(themeIcons, new Comparator<IconTheme.Icon>() { |
|
71 |
public int compare(IconTheme.Icon o1, IconTheme.Icon o2) { |
|
72 |
String s1 = String.format("%s:%s:%s", o1.getProviderName(), o1.getGroup(), o1.getName()); |
|
73 |
String s2 = String.format("%s:%s:%s", o2.getProviderName(), o2.getGroup(), o2.getName()); |
|
74 |
return s1.compareTo(s2); |
|
75 |
} |
|
76 |
}); |
|
77 |
themeIconsIt = themeIcons.iterator(); |
|
78 |
return getIconThemeInformation(theme, themeIconsIt); |
|
79 |
} |
|
80 |
|
|
54 | 81 |
private String getIconThemeInformationByGroup() { |
55 | 82 |
IconThemeManager manager = ToolsSwingLocator.getIconThemeManager(); |
56 | 83 |
IconTheme theme = manager.getDefault(); |
... | ... | |
95 | 122 |
|
96 | 123 |
String previousPluginName = null; |
97 | 124 |
|
98 |
buffer.append("<html>\n"); |
|
99 |
buffer.append("<body>\n"); |
|
125 |
buffer.append("<div>\n"); |
|
100 | 126 |
buffer.append("<h2>Icon theme information</h2>\n"); |
101 | 127 |
buffer.append("<br>\n"); |
102 | 128 |
buffer.append("Theme: "); |
... | ... | |
111 | 137 |
buffer.append(" <td>Preview</td>\n"); |
112 | 138 |
buffer.append(" <td>Group</td>\n"); |
113 | 139 |
buffer.append(" <td>Name</td>\n"); |
114 |
buffer.append(" <td>Plugin</td>\n"); |
|
140 |
buffer.append(" <td>Provider/Plugin</td>\n");
|
|
115 | 141 |
buffer.append(" <td>Resource</td>\n"); |
116 | 142 |
buffer.append(" </tr>\n"); |
117 | 143 |
|
... | ... | |
230 | 256 |
buffer.append(" </tr>\n"); |
231 | 257 |
} |
232 | 258 |
buffer.append("</table>\n"); |
233 |
buffer.append("</body>\n"); |
|
234 |
buffer.append("</html>\n"); |
|
259 |
buffer.append("</div>\n"); |
|
235 | 260 |
|
236 | 261 |
return buffer.toString(); |
237 | 262 |
} |
Also available in: Unified diff