@@ -59,7 +59,7 @@ public class LauncherPlugin extends AbstractUIPlugin {
5959 LAUNCH_ITEMS_XML_ATTRIB_ENABLED = "enabled" ,
6060 LAUNCH_ITEMS_XML_ATTRIB_CATEGORY = "category" ,
6161 LAUNCH_ITEMS_XML_VALUE_TRUE = "true" ,
62- LAUNCH_ITEMS_XML_VALUE_FALSE = "false" ;
62+ LAUNCH_ITEMS_XML_VALUE_FALSE = "false" ;
6363
6464 static final int
6565 liClosedFolder = 0 ,
@@ -84,7 +84,7 @@ public void start(BundleContext context) throws Exception {
8484 super .start (context );
8585 resourceBundle = Platform .getResourceBundle (getBundle ());
8686 }
87-
87+
8888 /**
8989 * Clean up
9090 */
@@ -107,7 +107,7 @@ public static LauncherPlugin getDefault() {
107107 public static void initResources () {
108108 if (images == null ) {
109109 images = new Image [imageLocations .length ];
110-
110+
111111 for (int i = 0 ; i < imageLocations .length ; ++i ) {
112112 images [i ] = getImageFromPlugin (plugin .getBundle (), imageLocations [i ]);
113113 if (images [i ] == null ) {
@@ -116,7 +116,7 @@ public static void initResources() {
116116 throw new IllegalStateException ();
117117 }
118118 }
119- }
119+ }
120120 }
121121
122122 /**
@@ -133,7 +133,7 @@ public static void freeResources() {
133133
134134 /**
135135 * Log an error to the ILog for this plugin
136- *
136+ *
137137 * @param message the localized error message text
138138 * @param exception the associated exception, or null
139139 */
@@ -154,7 +154,7 @@ public static String getResourceString(String key) {
154154 return key ;
155155 } catch (NullPointerException e ) {
156156 return "!" + key + "!" ;
157- }
157+ }
158158 }
159159
160160 /**
@@ -174,7 +174,7 @@ public static String getResourceString(String key, Object[] args) {
174174
175175 /**
176176 * Constructs a list of available programs from registered extensions.
177- *
177+ *
178178 * @return an ItemTreeNode representing the root of a tree of items (the root is not to be displayed)
179179 */
180180 public static ItemTreeNode getLaunchItemTree () {
@@ -186,41 +186,41 @@ public static ItemTreeNode getLaunchItemTree() {
186186 // retrieve all configuration elements registered at our launchItems extension-point
187187 IConfigurationElement [] configurationElements =
188188 extensionRegistry .getConfigurationElementsFor (LAUNCH_ITEMS_POINT_ID );
189-
189+
190190 if (configurationElements == null || configurationElements .length == 0 ) {
191191 logError (getResourceString ("error.CouldNotFindRegisteredExtensions" ), null );
192192 return categoryTree ;
193193 }
194-
194+
195195 /* Collect all launch categories -- coalesce those with same ID */
196196 HashMap <String , ItemTreeNode > idMap = new HashMap <>();
197197 for (IConfigurationElement ce : configurationElements ) {
198198 final String ceName = ce .getName ();
199199 final String attribId = getItemAttribute (ce , LAUNCH_ITEMS_XML_ATTRIB_ID , null );
200-
200+
201201 if (idMap .containsKey (attribId )) continue ;
202202 if (ceName .equalsIgnoreCase (LAUNCH_ITEMS_XML_CATEGORY )) {
203- final String attribName = getItemName (ce );
203+ final String attribName = getItemName (ce );
204204 ItemDescriptor theDescriptor = new ItemDescriptor (attribId , attribName ,
205205 getItemDescription (ce ), null , null , null , null , ce );
206206 idMap .put (attribId , new ItemTreeNode (theDescriptor ));
207207 }
208208 }
209-
209+
210210 /* Generate launch category hierarchy */
211211 Set <String > tempIdSet = new HashSet <>(); // used to prevent duplicates from being entered into the tree
212212 for (IConfigurationElement ce : configurationElements ) {
213213 final String ceName = ce .getName ();
214214 final String attribId = getItemAttribute (ce , LAUNCH_ITEMS_XML_ATTRIB_ID , null );
215-
215+
216216 if (tempIdSet .contains (attribId )) continue ;
217217 if (ceName .equalsIgnoreCase (LAUNCH_ITEMS_XML_CATEGORY )) {
218218 final ItemTreeNode theNode = idMap .get (attribId );
219219 addItemByCategory (ce , categoryTree , theNode , idMap );
220220 tempIdSet .add (attribId );
221221 }
222222 }
223-
223+
224224 /* Generate program tree */
225225 for (IConfigurationElement ce : configurationElements ) {
226226 final String ceName = ce .getName ();
@@ -230,11 +230,11 @@ public static ItemTreeNode getLaunchItemTree() {
230230 if (ceName .equalsIgnoreCase (LAUNCH_ITEMS_XML_CATEGORY )) {
231231 // ignore
232232 } else if (ceName .equalsIgnoreCase (LAUNCH_ITEMS_XML_ITEM )) {
233- final String enabled = getItemAttribute (ce , LAUNCH_ITEMS_XML_ATTRIB_ENABLED ,
233+ final String enabled = getItemAttribute (ce , LAUNCH_ITEMS_XML_ATTRIB_ENABLED ,
234234 LAUNCH_ITEMS_XML_VALUE_TRUE );
235235 if (enabled .equalsIgnoreCase (LAUNCH_ITEMS_XML_VALUE_FALSE )) continue ;
236- ItemDescriptor theDescriptor = createItemDescriptor (ce , attribId );
237-
236+ ItemDescriptor theDescriptor = createItemDescriptor (ce , attribId );
237+
238238 if (theDescriptor != null ) {
239239 final ItemTreeNode theNode = new ItemTreeNode (theDescriptor );
240240 addItemByCategory (ce , categoryTree , theNode , idMap );
@@ -245,28 +245,28 @@ public static ItemTreeNode getLaunchItemTree() {
245245 return categoryTree ;
246246 }
247247
248-
248+
249249 /**
250250 * Adds an item to the category tree.
251251 */
252252 private static void addItemByCategory (IConfigurationElement ce , ItemTreeNode root ,
253253 ItemTreeNode theNode , HashMap <String , ItemTreeNode > idMap ) {
254254 final String attribCategory = getItemAttribute (ce , LAUNCH_ITEMS_XML_ATTRIB_CATEGORY , null );
255-
255+
256256 // locate the parent node
257257 ItemTreeNode parentNode = null ;
258258 if (attribCategory != null ) {
259259 parentNode = idMap .get (attribCategory );
260260 }
261261 if (parentNode == null ) parentNode = root ;
262-
262+
263263 // add the item
264264 parentNode .addSortedNode (theNode );
265265 }
266266
267267 /**
268268 * Creates an ItemDescriptor from an XML definition.
269- *
269+ *
270270 * @param ce the IConfigurationElement describing the item
271271 * @param attribId the attribute id
272272 * @return a new ItemDescriptor, or null if an error occurs
@@ -279,7 +279,7 @@ private static ItemDescriptor createItemDescriptor(IConfigurationElement ce, Str
279279 IConfigurationElement viewCE = getItemElement (ce , LAUNCH_ITEMS_XML_VIEW );
280280 if (viewCE != null ) {
281281 //Item is a view
282- final String attribView = getItemAttribute (viewCE , LAUNCH_ITEMS_XML_VIEW_VIEWID , null );
282+ final String attribView = getItemAttribute (viewCE , LAUNCH_ITEMS_XML_VIEW_VIEWID , null );
283283 if (attribView == null ) {
284284 logError (getResourceString ("error.IncompleteViewLaunchItem" ,
285285 new Object [] { attribId } ), null );
@@ -310,7 +310,7 @@ private static ItemDescriptor createItemDescriptor(IConfigurationElement ce, Str
310310
311311 /**
312312 * Returns the first instance of a particular child XML element.
313- *
313+ *
314314 * @param ce the IConfigurationElement parent
315315 * @param element the name of the element to fetch
316316 * @return the element's IConfigurationElement, or null if not found
@@ -322,7 +322,7 @@ private static IConfigurationElement getItemElement(IConfigurationElement ce, St
322322
323323 /**
324324 * Returns the value of an XML attribute for an item.
325- *
325+ *
326326 * @param ce the IConfigurationElement describing the item
327327 * @param attribute the attribute to fetch
328328 * @param defaultValue the value to return if the attribute is not found
@@ -335,7 +335,7 @@ private static String getItemAttribute(IConfigurationElement ce, String attribut
335335
336336 /**
337337 * Returns the description string given the IConfigurationElement for an item.
338- *
338+ *
339339 * @param ce the IConfigurationElement describing the item
340340 * @return a newline-delimited string that describes this item, or null if none
341341 */
@@ -346,7 +346,7 @@ private static String getItemDescription(IConfigurationElement ce) {
346346
347347 /**
348348 * Returns the name of an item.
349- *
349+ *
350350 * @param ce the IConfigurationElement describing the item
351351 * @return the attribute value
352352 */
@@ -358,7 +358,7 @@ private static String getItemName(IConfigurationElement ce) {
358358
359359 /**
360360 * Returns the icon for an item.
361- *
361+ *
362362 * @param ce the IConfigurationElement describing the item
363363 * @return an icon
364364 */
@@ -392,7 +392,7 @@ private static Image getImageFromPlugin(Bundle bundle, String iconPath) {
392392 URL installUrl = bundle .getEntry ("/" );
393393 URL url = new URL (installUrl , iconPath );
394394 is = url .openConnection ().getInputStream ();
395- ImageData source = new ImageData (is );
395+ ImageData source = ImageData . load (is );
396396 ImageData mask = source .getTransparencyMask ();
397397 Image image = new Image (null , source , mask );
398398 return image ;
0 commit comments