KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > texteditor > MarkerAnnotationPreferences


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.texteditor;
12
13 import java.net.URL JavaDoc;
14 import com.ibm.icu.text.Collator;
15 import java.util.ArrayList JavaDoc;
16 import java.util.Collections JavaDoc;
17 import java.util.Comparator JavaDoc;
18 import java.util.Iterator JavaDoc;
19 import java.util.List JavaDoc;
20
21 import org.osgi.framework.Bundle;
22
23 import org.eclipse.swt.graphics.RGB;
24
25 import org.eclipse.core.runtime.FileLocator;
26 import org.eclipse.core.runtime.IConfigurationElement;
27 import org.eclipse.core.runtime.IExtensionPoint;
28 import org.eclipse.core.runtime.Path;
29 import org.eclipse.core.runtime.Platform;
30
31 import org.eclipse.core.resources.IMarker;
32
33 import org.eclipse.jface.preference.IPreferenceStore;
34 import org.eclipse.jface.preference.PreferenceConverter;
35 import org.eclipse.jface.resource.ImageDescriptor;
36 import org.eclipse.jface.resource.StringConverter;
37
38 import org.eclipse.ui.editors.text.EditorsUI;
39
40 import org.eclipse.ui.internal.editors.text.EditorsPlugin;
41
42
43 /**
44  * Objects of this class provide access to all extensions declared for the <code>markerAnnotationSpecification</code> extension point.
45  * The extensions are represented as instances of {@link org.eclipse.ui.texteditor.AnnotationPreference}.
46  *
47  * @since 2.1
48  */

49 public class MarkerAnnotationPreferences {
50
51     /**
52      * Initializes the given preference store with the default marker annotation values.
53      *
54      * @param store the preference store to be initialized
55      * @since 3.0
56      */

57     public static void initializeDefaultValues(IPreferenceStore store) {
58
59         boolean ignoreAnnotationsPrefPage= store.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.USE_ANNOTATIONS_PREFERENCE_PAGE);
60         boolean ignoreQuickDiffPrefPage= store.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.USE_QUICK_DIFF_PREFERENCE_PAGE);
61
62         MarkerAnnotationPreferences preferences= EditorsPlugin.getDefault().getMarkerAnnotationPreferences();
63         Iterator JavaDoc e= preferences.getAnnotationPreferences().iterator();
64         while (e.hasNext()) {
65             AnnotationPreference info= (AnnotationPreference) e.next();
66
67             if (ignoreAnnotationsPrefPage && info.isIncludeOnPreferencePage() && isComplete(info))
68                 continue;
69
70             if (ignoreQuickDiffPrefPage && (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffChange") //$NON-NLS-1$
71
|| (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffAddition")) //$NON-NLS-1$
72
|| (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffDeletion")) //$NON-NLS-1$
73
))
74                 continue;
75
76             store.setDefault(info.getTextPreferenceKey(), info.getTextPreferenceValue());
77             store.setDefault(info.getOverviewRulerPreferenceKey(), info.getOverviewRulerPreferenceValue());
78             if (info.getVerticalRulerPreferenceKey() != null)
79                 store.setDefault(info.getVerticalRulerPreferenceKey(), info.getVerticalRulerPreferenceValue());
80             PreferenceConverter.setDefault(store, info.getColorPreferenceKey(), info.getColorPreferenceValue());
81             if (info.getShowInNextPrevDropdownToolbarActionKey() != null)
82                 store.setDefault(info.getShowInNextPrevDropdownToolbarActionKey(), info.isShowInNextPrevDropdownToolbarAction());
83             if (info.getIsGoToNextNavigationTargetKey() != null)
84                 store.setDefault(info.getIsGoToNextNavigationTargetKey(), info.isGoToNextNavigationTarget());
85             if (info.getIsGoToPreviousNavigationTargetKey() != null)
86                 store.setDefault(info.getIsGoToPreviousNavigationTargetKey(), info.isGoToPreviousNavigationTarget());
87             if (info.getHighlightPreferenceKey() != null)
88                 store.setDefault(info.getHighlightPreferenceKey(), info.getHighlightPreferenceValue());
89             if (info.getTextStylePreferenceKey() != null)
90                 store.setDefault(info.getTextStylePreferenceKey(), info.getTextStyleValue());
91         }
92     }
93
94     /**
95      * Removes the marker annotation values which are shown on the
96      * general Annotations page from the given store and prevents
97      * setting the default values in the future.
98      * <p>
99      * Note: In order to work this method must be called before any
100      * call to {@link #initializeDefaultValues(IPreferenceStore)}
101      * </p>
102      * <p>
103      * This method is not part of the API and must only be called
104      * by {@link org.eclipse.ui.editors.text.EditorsUI}
105      * </p>
106      *
107      * @param store the preference store to be initialized
108      * @throws IllegalStateException if not called by {@link org.eclipse.ui.editors.text.EditorsUI}
109      * @since 3.0
110      */

111     public static void useAnnotationsPreferencePage(IPreferenceStore store) throws IllegalStateException JavaDoc {
112         checkAccess();
113
114         store.putValue(AbstractDecoratedTextEditorPreferenceConstants.USE_ANNOTATIONS_PREFERENCE_PAGE, Boolean.toString(true));
115
116         MarkerAnnotationPreferences preferences= EditorsPlugin.getDefault().getMarkerAnnotationPreferences();
117         Iterator JavaDoc e= preferences.getAnnotationPreferences().iterator();
118         while (e.hasNext()) {
119             AnnotationPreference info= (AnnotationPreference) e.next();
120
121             // Only reset annotations shown on Annotations preference page
122
if (!info.isIncludeOnPreferencePage() || !isComplete(info))
123                 continue;
124
125             store.setToDefault(info.getTextPreferenceKey());
126             store.setToDefault(info.getOverviewRulerPreferenceKey());
127             if (info.getVerticalRulerPreferenceKey() != null)
128                 store.setToDefault(info.getVerticalRulerPreferenceKey());
129             store.setToDefault(info.getColorPreferenceKey());
130             if (info.getShowInNextPrevDropdownToolbarActionKey() != null)
131                 store.setToDefault(info.getShowInNextPrevDropdownToolbarActionKey());
132             if (info.getIsGoToNextNavigationTargetKey() != null)
133                 store.setToDefault(info.getIsGoToNextNavigationTargetKey());
134             if (info.getIsGoToPreviousNavigationTargetKey() != null)
135                 store.setToDefault(info.getIsGoToPreviousNavigationTargetKey());
136             if (info.getHighlightPreferenceKey() != null)
137                 store.setToDefault(info.getHighlightPreferenceKey());
138             if (info.getTextStylePreferenceKey() != null)
139                 store.setToDefault(info.getTextStylePreferenceKey());
140         }
141     }
142
143     /**
144      * Removes the Quick Diff marker annotation values which are shown on the
145      * general Quick Diff page from the given store and prevents
146      * setting the default values in the future.
147      * <p>
148      * Note: In order to work this method must be called before any
149      * call to {@link #initializeDefaultValues(IPreferenceStore)}
150      * </p>
151      * <p>
152      * This method is not part of the API and must only be called
153      * by {@link EditorsUI}
154      * </p>
155      *
156      * @param store the preference store to be initialized
157      * @throws IllegalStateException if not called by {@link EditorsUI}
158      * @since 3.0
159      */

160     public static void useQuickDiffPreferencePage(IPreferenceStore store) throws IllegalStateException JavaDoc {
161         checkAccess();
162
163         store.putValue(AbstractDecoratedTextEditorPreferenceConstants.USE_QUICK_DIFF_PREFERENCE_PAGE, Boolean.toString(true));
164
165         MarkerAnnotationPreferences preferences= EditorsPlugin.getDefault().getMarkerAnnotationPreferences();
166         Iterator JavaDoc e= preferences.getAnnotationPreferences().iterator();
167         while (e.hasNext()) {
168             AnnotationPreference info= (AnnotationPreference) e.next();
169
170             // Only reset annotations shown on Quick Diff preference page
171

172             if (!(info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffChange") //$NON-NLS-1$
173
|| (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffAddition")) //$NON-NLS-1$
174
|| (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffDeletion")) //$NON-NLS-1$
175
))
176                 continue;
177
178             store.setToDefault(info.getTextPreferenceKey());
179             store.setToDefault(info.getOverviewRulerPreferenceKey());
180             if (info.getVerticalRulerPreferenceKey() != null)
181                 store.setToDefault(info.getVerticalRulerPreferenceKey());
182             store.setToDefault(info.getColorPreferenceKey());
183             if (info.getShowInNextPrevDropdownToolbarActionKey() != null)
184                 store.setToDefault(info.getShowInNextPrevDropdownToolbarActionKey());
185             if (info.getIsGoToNextNavigationTargetKey() != null)
186                 store.setToDefault(info.getIsGoToNextNavigationTargetKey());
187             if (info.getIsGoToPreviousNavigationTargetKey() != null)
188                 store.setToDefault(info.getIsGoToPreviousNavigationTargetKey());
189             if (info.getHighlightPreferenceKey() != null)
190                 store.setToDefault(info.getHighlightPreferenceKey());
191             if (info.getTextStylePreferenceKey() != null)
192                 store.setToDefault(info.getTextStylePreferenceKey());
193         }
194     }
195
196     private static final class AccessChecker extends SecurityManager JavaDoc {
197         public Class JavaDoc[] getClassContext() {
198             return super.getClassContext();
199         }
200     }
201     /**
202      * Checks correct access.
203      *
204      * @throws IllegalStateException if not called by {@link EditorsUI}
205      * @since 3.0
206      */

207     private static void checkAccess() throws IllegalStateException JavaDoc {
208         Class JavaDoc[] elements = new AccessChecker().getClassContext();
209         if (!(elements[3].equals(EditorsUI.class)
210                 || elements[4].equals(EditorsUI.class)))
211             throw new IllegalStateException JavaDoc();
212     }
213
214
215     /** The list of extension fragments. */
216     private List JavaDoc fFragments;
217     /** The list of extensions. */
218     private List JavaDoc fPreferences;
219
220     /**
221      * Creates a new marker annotation preferences to access
222      * marker annotation preferences.
223      */

224     public MarkerAnnotationPreferences() {
225         this(false);
226     }
227
228     /**
229      * Creates a new marker annotation preferences to access
230      * marker annotation preferences.
231      * @param initFromPreferences tells this instance to initialize itself from the preferences
232      *
233      * @since 3.2
234      */

235     private MarkerAnnotationPreferences(boolean initFromPreferences) {
236         if (initFromPreferences)
237             initializeSharedMakerAnnotationPreferences();
238     }
239
240     /**
241      * Returns all extensions provided for the <code>markerAnnotationSpecification</code> extension point.
242      *
243      * @return all extensions provided for the <code>markerAnnotationSpecification</code> extension point
244      */

245     public List JavaDoc getAnnotationPreferences() {
246         if (fPreferences == null)
247             initialize();
248         return fPreferences;
249     }
250
251     /**
252      * Returns all extensions provided for the <code>markerAnnotationSpecification</code>
253      * extension point including fragments. Fragments share the preference part
254      * with a marker annotation specifications provided for a super type but do
255      * change the presentation part.
256      *
257      * @return all extensions provided for the <code>markerAnnotationSpecification</code>
258      * extension point including fragments
259      */

260     public List JavaDoc getAnnotationPreferenceFragments() {
261         if (fFragments == null)
262             initialize();
263         return fFragments;
264     }
265
266     private void initialize() {
267         synchronized (EditorsPlugin.getDefault()) {
268             if (!EditorsPlugin.getDefault().isMarkerAnnotationPreferencesInitialized())
269                 EditorsPlugin.getDefault().setMarkerAnnotationPreferences(new MarkerAnnotationPreferences(true));
270         }
271
272         MarkerAnnotationPreferences sharedPrefs= EditorsPlugin.getDefault().getMarkerAnnotationPreferences();
273
274         fFragments= cloneAnnotationPreferences(sharedPrefs.fFragments);
275         fPreferences= cloneAnnotationPreferences(sharedPrefs.fPreferences);
276     }
277             
278     /**
279      * Reads all extensions provided for the <code>markerAnnotationSpecification</code> extension point and
280      * translates them into <code>AnnotationPreference</code> objects.
281      */

282     private void initializeSharedMakerAnnotationPreferences() {
283
284         // initialize lists - indicates that the initialization happened
285
fFragments= new ArrayList JavaDoc(2);
286         fPreferences= new ArrayList JavaDoc(2);
287
288         // populate list
289
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(EditorsUI.PLUGIN_ID, "markerAnnotationSpecification"); //$NON-NLS-1$
290
if (extensionPoint != null) {
291             IConfigurationElement[] elements= extensionPoint.getConfigurationElements();
292             for (int i= 0; i < elements.length; i++) {
293                 AnnotationPreference spec= createSpec(elements[i]);
294                 if (spec != null)
295                     fFragments.add(spec);
296                 if (isComplete(spec))
297                     fPreferences.add(spec);
298             }
299         }
300
301         final Collator collator= Collator.getInstance();
302         Collections.sort(fFragments, new Comparator JavaDoc() {
303             /*
304              * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
305              */

306             public int compare(Object JavaDoc o1, Object JavaDoc o2) {
307                 if (o1 == o2)
308                     return 0;
309
310                 AnnotationPreference ap1= (AnnotationPreference)o1;
311                 AnnotationPreference ap2= (AnnotationPreference)o2;
312
313                 String JavaDoc label1= ap1.getPreferenceLabel();
314                 String JavaDoc label2= ap2.getPreferenceLabel();
315
316                 if (label1 == null && label2 == null)
317                     return 0;
318
319                 if (label1 == null)
320                     return -1;
321
322                 if (label2 == null)
323                     return 1;
324
325                 return collator.compare(label1, label2);
326             }
327         });
328     }
329     
330     /**
331      * Deeply clones the given list of <code>AnnotationPreference</code>.
332      *
333      * @param annotationPreferences a list of <code>AnnotationPreference</code>
334      * @return the cloned list of cloned annotation preferences
335      * @since 3.1
336      */

337     private List JavaDoc cloneAnnotationPreferences(List JavaDoc annotationPreferences) {
338         if (annotationPreferences == null)
339             return null;
340         List JavaDoc clone= new ArrayList JavaDoc(annotationPreferences.size());
341         Iterator JavaDoc iter= annotationPreferences.iterator();
342         while (iter.hasNext())
343             clone.add(clone(((AnnotationPreference)iter.next())));
344         return clone;
345     }
346     
347     /**
348      * Clones the given annotation preference.
349      *
350      * @param annotationPreference the annotation preference to clone
351      * @return the cloned annotation preference
352      * @since 3.1
353      */

354     private AnnotationPreference clone(AnnotationPreference annotationPreference) {
355         if (annotationPreference == null)
356             return null;
357         
358         AnnotationPreference clone= new AnnotationPreference();
359         if (annotationPreference.getAnnotationType() != null) {
360             clone.setAnnotationType(annotationPreference.getAnnotationType());
361             clone.merge(annotationPreference);
362         }
363         
364         return clone;
365     }
366
367     /**
368      * Checks if <code>spec</code> has all the attributes previously required
369      * by the marker annotation preference extension point. These are: color, text
370      * and overview ruler preference keys.
371      *
372      * @param spec the <code>AnnotationPreference</code> to check
373      * @return <code>true</code> if <code>spec</code> is complete, <code>false</code> otherwise
374      * @since 3.0
375      */

376     private static boolean isComplete(AnnotationPreference spec) {
377         return spec.getColorPreferenceKey() != null
378                 && spec.getColorPreferenceValue() != null
379                 && spec.getTextPreferenceKey() != null
380                 && spec.getOverviewRulerPreferenceKey() != null;
381     }
382
383     /**
384      * Creates a <code>AnnotationPreference</code> the given configuration element.
385      *
386      * @param element the configuration element
387      * @return the created annotation preference
388      */

389     private AnnotationPreference createSpec(IConfigurationElement element) {
390
391         String JavaDoc s;
392         int i;
393         boolean b;
394
395         ReadOnlyAnnotationPreference info= new ReadOnlyAnnotationPreference();
396
397         s= element.getAttribute("annotationType"); //$NON-NLS-1$
398
if (s == null || s.trim().length() == 0) return null;
399         info.setAnnotationType(s);
400
401         s= element.getAttribute("label"); //$NON-NLS-1$
402
if (s != null && s.trim().length() > 0)
403             info.setPreferenceLabel(s);
404
405         s= element.getAttribute("markerType"); //$NON-NLS-1$
406
if (s != null && s.trim().length() > 0)
407             info.setMarkerType(s);
408
409         s= element.getAttribute("markerSeverity"); //$NON-NLS-1$
410
if (s != null && s.trim().length() > 0) {
411             i= StringConverter.asInt(s, IMarker.SEVERITY_INFO);
412             info.setSeverity(i);
413         }
414
415         s= element.getAttribute("textPreferenceKey"); //$NON-NLS-1$
416
if (s != null && s.trim().length() > 0)
417             info.setTextPreferenceKey(s);
418
419         s= element.getAttribute("textPreferenceValue"); //$NON-NLS-1$
420
if (s != null && s.trim().length() > 0) {
421             b= StringConverter.asBoolean(s, false);
422             info.setTextPreferenceValue(b);
423         }
424
425         s= element.getAttribute("highlightPreferenceKey"); //$NON-NLS-1$
426
if (s != null && s.trim().length() > 0)
427             info.setHighlightPreferenceKey(s);
428
429         s= element.getAttribute("highlightPreferenceValue"); //$NON-NLS-1$
430
if (s != null && s.trim().length() > 0) {
431             b= StringConverter.asBoolean(s, false);
432             info.setHighlightPreferenceValue(b);
433         }
434
435         s= element.getAttribute("overviewRulerPreferenceKey"); //$NON-NLS-1$
436
if (s != null && s.trim().length() > 0)
437             info.setOverviewRulerPreferenceKey(s);
438
439         s= element.getAttribute("overviewRulerPreferenceValue"); //$NON-NLS-1$
440
if (s != null && s.trim().length() > 0) {
441             b= StringConverter.asBoolean(s, false);
442             info.setOverviewRulerPreferenceValue(b);
443         }
444
445         s= element.getAttribute("verticalRulerPreferenceKey"); //$NON-NLS-1$
446
if (s != null && s.trim().length() > 0)
447             info.setVerticalRulerPreferenceKey(s);
448
449         s= element.getAttribute("verticalRulerPreferenceValue"); //$NON-NLS-1$
450
if (s != null && s.trim().length() > 0) {
451             b= StringConverter.asBoolean(s, true);
452             info.setVerticalRulerPreferenceValue(b);
453         }
454
455         s= element.getAttribute("colorPreferenceKey"); //$NON-NLS-1$
456
if (s != null && s.trim().length() > 0)
457             info.setColorPreferenceKey(s);
458
459         s= element.getAttribute("colorPreferenceValue"); //$NON-NLS-1$
460
if (s != null && s.trim().length() > 0) {
461             RGB rgb= StringConverter.asRGB(s);
462             info.setColorPreferenceValue(rgb == null ? new RGB(0,0,0) : rgb);
463         }
464
465         s= element.getAttribute("presentationLayer"); //$NON-NLS-1$
466
if (s != null && s.trim().length() > 0) {
467             i= StringConverter.asInt(s, 0);
468             info.setPresentationLayer(i);
469         }
470
471         s= element.getAttribute("contributesToHeader"); //$NON-NLS-1$
472
if (s != null && s.trim().length() > 0) {
473             b= StringConverter.asBoolean(s, false);
474             info.setContributesToHeader(b);
475         }
476
477         s= element.getAttribute("showInNextPrevDropdownToolbarActionKey"); //$NON-NLS-1$
478
if (s != null && s.trim().length() > 0)
479             info.setShowInNextPrevDropdownToolbarActionKey(s);
480
481         s= element.getAttribute("showInNextPrevDropdownToolbarAction"); //$NON-NLS-1$
482
if (s != null && s.trim().length() > 0) {
483             b= StringConverter.asBoolean(s, false);
484             info.setShowInNextPrevDropdownToolbarAction(b);
485         }
486
487         s= element.getAttribute("isGoToNextNavigationTargetKey"); //$NON-NLS-1$
488
if (s != null && s.trim().length() > 0)
489             info.setIsGoToNextNavigationTargetKey(s);
490
491         s= element.getAttribute("isGoToNextNavigationTarget"); //$NON-NLS-1$
492
if (s != null && s.trim().length() > 0) {
493             b= StringConverter.asBoolean(s, false);
494             info.setIsGoToNextNavigationTarget(b);
495         }
496
497         s= element.getAttribute("isGoToPreviousNavigationTargetKey"); //$NON-NLS-1$
498
if (s != null && s.trim().length() > 0)
499             info.setIsGoToPreviousNavigationTargetKey(s);
500
501         s= element.getAttribute("isGoToPreviousNavigationTarget"); //$NON-NLS-1$
502
if (s != null && s.trim().length() > 0) {
503             b= StringConverter.asBoolean(s, false);
504             info.setIsGoToPreviousNavigationTarget(b);
505         }
506
507         s= element.getAttribute("symbolicIcon"); //$NON-NLS-1$
508
if (s != null && s.trim().length() > 0)
509             info.setSymbolicImageName(s);
510
511         s= element.getAttribute("icon"); //$NON-NLS-1$
512
if (s != null && s.trim().length() > 0)
513             info.setImageDescriptor(getImageDescriptor(s, element));
514         
515         s= element.getAttribute("quickFixIcon"); //$NON-NLS-1$
516
if (s != null && s.trim().length() > 0)
517             info.setQuickFixImageDescriptor(getImageDescriptor(s, element));
518
519         s= element.getAttribute("annotationImageProvider"); //$NON-NLS-1$
520
if (s != null && s.trim().length() > 0)
521             info.setAnnotationImageProviderData(element, "annotationImageProvider"); //$NON-NLS-1$
522

523         s= element.getAttribute("textStylePreferenceKey"); //$NON-NLS-1$
524
if (s != null && s.trim().length() > 0)
525             info.setTextStylePreferenceKey(s);
526
527         s= element.getAttribute("textStylePreferenceValue"); //$NON-NLS-1$
528
if (s != null && s.trim().length() > 0) {
529
530             if (AnnotationPreference.STYLE_BOX.equals(s)
531                     || AnnotationPreference.STYLE_DASHED_BOX.equals(s)
532                     || AnnotationPreference.STYLE_IBEAM.equals(s)
533                     || AnnotationPreference.STYLE_SQUIGGLES.equals(s)
534                     || AnnotationPreference.STYLE_UNDERLINE.equals(s))
535                 info.setTextStyleValue(s);
536             else
537                 info.setTextStyleValue(AnnotationPreference.STYLE_NONE);
538
539         }
540
541         s= element.getAttribute("includeOnPreferencePage"); //$NON-NLS-1$
542
info.setIncludeOnPreferencePage(s == null || StringConverter.asBoolean(s, true));
543
544         info.markReadOnly();
545         
546         return info;
547     }
548
549     /**
550      * Returns the image descriptor for the icon path specified by the given configuration
551      * element.
552      *
553      * @param iconPath the icon path
554      * @param element the configuration element
555      * @return the image descriptor
556      * @since 3.0
557      */

558     private ImageDescriptor getImageDescriptor(String JavaDoc iconPath, IConfigurationElement element) {
559         String JavaDoc pluginId= element.getContributor().getName();
560         Bundle bundle= Platform.getBundle(pluginId);
561         if (bundle == null)
562             return null;
563
564         URL JavaDoc url= FileLocator.find(bundle, new Path(iconPath), null);
565         if (url != null)
566             return ImageDescriptor.createFromURL(url);
567         
568         return ImageDescriptor.getMissingImageDescriptor();
569     }
570 }
571
Popular Tags