{"id":49,"date":"2009-05-22T09:27:14","date_gmt":"2009-05-22T07:27:14","guid":{"rendered":"http:\/\/wenzlaff.de\/cgi-bin\/weblog_basic\/index.php?p=49"},"modified":"2021-11-22T17:17:04","modified_gmt":"2021-11-22T16:17:04","slug":"icons-im-eclipse-plug-in-laden","status":"publish","type":"post","link":"http:\/\/blog.wenzlaff.de\/?p=49","title":{"rendered":"Icons im Eclipse Plug-In laden"},"content":{"rendered":"<p>Einige Methoden sind in Eclipse 3.4 (Ganymed) als <code>deprecated <\/code>gekennzeichnet. Wie kann ein Icon in einem Plug-In geladen werden? <!--more--><\/p>\n<p>Folgender Code liefert die <code>deprecated<\/code> Warnung f\u00fcr <strong>getDescriptor<\/strong>() und <strong>getInstallURL<\/strong>().<br \/>\nZ.b.<\/p>\n<p><code>private static ImageDescriptor closeImage;<br \/>\n\tstatic {<br \/>\n\t\tURL url = null;<br \/>\n\t\ttry {<br \/>\n\t\t\turl = new URL(Activator<br \/>\n\t\t\t\t\t.getDefault()<br \/>\n\t\t\t\t\t.<strong>getDescriptor<\/strong>()<br \/>\n\t\t\t\t\t.<strong>getInstallURL<\/strong>(),<br \/>\n\t\t\t\t\t\"icons\/nav_stop.gif\");<br \/>\n\t\t} catch (final MalformedURLException e) {<br \/>\n\t\t}<br \/>\n\t\tcloseImage = ImageDescriptor.createFromURL(url);<br \/>\n\t}<\/code><\/p>\n<p>Wie kann nun ein Icon ohne <code>deprecated<\/code> Warnung geladen werden? Mit Verwendung von <code>getBundel()<\/code>.<\/p>\n<p>Z.b.<\/p>\n<p><code>try {<br \/>\n\t\t\tfinal ImageDescriptor image = ImageDescriptor<br \/>\n\t\t\t\t\t.createFromURL(new URL(Activator<br \/>\n\t\t\t\t\t\t\t.getDefault()<br \/>\n\t\t\t\t\t\t\t.getBundle()<br \/>\n\t\t\t\t\t\t\t.getEntry(\"\/\"),<br \/>\n\t\t\t\t\t\t\t\"icons\/nav_go.gif\"));<br \/>\n\t\t\tthis.setImageDescriptor(image);<br \/>\n\t\t} catch (final MalformedURLException e) {<br \/>\n\t\t\tActivator.getDefault().log(e);<br \/>\n\t\t}<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Einige Methoden sind in Eclipse 3.4 (Ganymed) als deprecated gekennzeichnet. Wie kann ein Icon in einem Plug-In geladen werden?<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5,1975],"tags":[41,42,43,154,1707],"class_list":["post-49","post","type-post","status-publish","format-standard","hentry","category-eclipse","category-java","category-plugin","tag-icon","tag-icons","tag-image","tag-laden","tag-plug-in"],"_links":{"self":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/49","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=49"}],"version-history":[{"count":0,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/49\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}