diff --git a/openide.util/apichanges.xml b/openide.util/apichanges.xml --- a/openide.util/apichanges.xml +++ b/openide.util/apichanges.xml @@ -49,6 +49,21 @@ Actions API + + + Added loadIcon(String resource, boolean localized) + + + + + +

+ Convenient method for loading icons. +

+
+ + +
Added keyToString(KeyStroke stroke, boolean portable) diff --git a/openide.util/arch.xml b/openide.util/arch.xml --- a/openide.util/arch.xml +++ b/openide.util/arch.xml @@ -1001,4 +1001,49 @@ + + + + + +

+ XXX no answer for compat-deprecation +

+
+ + + + + +

+ XXX no answer for resources-preferences +

+
+ diff --git a/openide.util/nbproject/project.properties b/openide.util/nbproject/project.properties --- a/openide.util/nbproject/project.properties +++ b/openide.util/nbproject/project.properties @@ -42,7 +42,7 @@ module.jar.dir=lib cp.extra=${nb_all}/apisupport.harness/external/openjdk-javac-6-b12.jar -spec.version.base=7.21.0 +spec.version.base=7.22.0 # For XMLSerializer, needed for XMLUtil.write to work w/ namespaces under JDK 1.4: diff --git a/openide.util/src/org/openide/util/ImageUtilities.java b/openide.util/src/org/openide/util/ImageUtilities.java --- a/openide.util/src/org/openide/util/ImageUtilities.java +++ b/openide.util/src/org/openide/util/ImageUtilities.java @@ -137,7 +137,20 @@ */ public static final Image loadImage(String resource, boolean localized) { return getIcon(resource, localized); - } + } + + /** + * Loads an icon based on resource path. + * Similar to {@link #loadImage(String, boolean)}, returns Icon instead of Image. + * @param resource resource path of the icon (no initial slash) + * @param localized localized resource should be used + * @return Icon or null, if the icon cannot be loaded. + * @since 7.22 + */ + public static final Icon loadIcon(String resource, boolean localized) { + Image image = getIcon(resource, localized); + return image2Icon(image); + } /** This method merges two images into the new one. The second image is drawn * over the first one with its top-left corner at x, y. Images need not be of the same size.