r1187 - in jaxx/trunk/jaxx-runtime-api: . src/main/java/jaxx/runtime
Author: tchemit Date: 2009-01-24 21:07:09 +0000 (Sat, 24 Jan 2009) New Revision: 1187 Modified: jaxx/trunk/jaxx-runtime-api/changelog.txt jaxx/trunk/jaxx-runtime-api/src/main/java/jaxx/runtime/Util.java Log: - add methods to retreave icons from UIManager Modified: jaxx/trunk/jaxx-runtime-api/changelog.txt =================================================================== --- jaxx/trunk/jaxx-runtime-api/changelog.txt 2009-01-24 21:04:10 UTC (rev 1186) +++ jaxx/trunk/jaxx-runtime-api/changelog.txt 2009-01-24 21:07:09 UTC (rev 1187) @@ -1,4 +1,5 @@ 1.1 chemit 200901?? + * 20090124 [chemit] - add methods to retreave icons from UIManager in Util class * 20090123 [chemit] - add a simple createIcon method in Util classe (to create an icon with no path prefix) - add a UIManager key "default.icon.path" to be able to change the path where to find icons * 20090122 [chemit] - refactor poms (sibling dependencies, pluginsManagment,...) Modified: jaxx/trunk/jaxx-runtime-api/src/main/java/jaxx/runtime/Util.java =================================================================== --- jaxx/trunk/jaxx-runtime-api/src/main/java/jaxx/runtime/Util.java 2009-01-24 21:04:10 UTC (rev 1186) +++ jaxx/trunk/jaxx-runtime-api/src/main/java/jaxx/runtime/Util.java 2009-01-24 21:07:09 UTC (rev 1187) @@ -6,6 +6,7 @@ import org.jdesktop.jxlayer.JXLayer; import javax.swing.DefaultListCellRenderer; +import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JComponent; import javax.swing.JList; @@ -449,13 +450,32 @@ /** * @param path the location of icons in root directory icons - * @return the icon at "/icons/"+path + * @return the icon at {@link #getIconPath()}+path */ public static ImageIcon createImageIcon(String path) { String iconPath = getIconPath(); return createIcon(iconPath + path); } + /** + * @param key the key of the icon to retreave from {@link UIManager} + * @return the icon, or <code>null if no icon found in {@link UIManager} + */ + public static Icon getUIManagerIcon(String key) { + return UIManager.getIcon(key); + } + + /** + * retreave for the {@link UIManager} the icon prefixed by <code>action.</code> + * + * @param key the key of the action icon to retreave from {@link UIManager} + * @return the icon, or <code>null if no icon found in {@link UIManager} + */ + public static Icon getUIManagerActionIcon(String key) { + return getUIManagerIcon("action." + key); + } + + public static ImageIcon createActionIcon(String name) { String iconPath = getIconPath(); return createIcon(iconPath + "action-" + name + ".png");
participants (1)
-
tchemit@users.labs.libre-entreprise.org