Lines 10-41
Link Here
|
10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
11 |
package org.eclipse.compare.internal; |
11 |
package org.eclipse.compare.internal; |
12 |
|
12 |
|
13 |
import java.io.*; |
13 |
import java.io.BufferedInputStream; |
|
|
14 |
import java.io.IOException; |
15 |
import java.io.InputStream; |
14 |
import java.lang.reflect.InvocationTargetException; |
16 |
import java.lang.reflect.InvocationTargetException; |
15 |
import java.net.*; |
17 |
import java.net.URL; |
16 |
import java.util.*; |
18 |
import java.util.ArrayList; |
|
|
19 |
import java.util.HashMap; |
20 |
import java.util.HashSet; |
21 |
import java.util.Hashtable; |
22 |
import java.util.Iterator; |
17 |
import java.util.List; |
23 |
import java.util.List; |
18 |
|
24 |
import java.util.Map; |
19 |
import org.eclipse.ui.*; |
25 |
import java.util.ResourceBundle; |
20 |
import org.eclipse.ui.model.IWorkbenchAdapter; |
26 |
import java.util.Set; |
21 |
import org.eclipse.ui.plugin.AbstractUIPlugin; |
27 |
import java.util.StringTokenizer; |
22 |
|
28 |
|
23 |
import org.eclipse.core.runtime.*; |
29 |
import org.eclipse.compare.CompareConfiguration; |
|
|
30 |
import org.eclipse.compare.CompareEditorInput; |
31 |
import org.eclipse.compare.IStreamContentAccessor; |
32 |
import org.eclipse.compare.IStreamMerger; |
33 |
import org.eclipse.compare.ITypedElement; |
34 |
import org.eclipse.compare.structuremergeviewer.ICompareInput; |
35 |
import org.eclipse.compare.structuremergeviewer.IStructureCreator; |
36 |
import org.eclipse.compare.structuremergeviewer.StructureDiffViewer; |
37 |
|
38 |
import org.eclipse.core.runtime.CoreException; |
39 |
import org.eclipse.core.runtime.IAdaptable; |
40 |
import org.eclipse.core.runtime.IConfigurationElement; |
41 |
import org.eclipse.core.runtime.IExtensionRegistry; |
42 |
import org.eclipse.core.runtime.IPath; |
43 |
import org.eclipse.core.runtime.IStatus; |
44 |
import org.eclipse.core.runtime.Platform; |
45 |
import org.eclipse.core.runtime.Status; |
24 |
import org.eclipse.core.runtime.content.IContentType; |
46 |
import org.eclipse.core.runtime.content.IContentType; |
25 |
import org.eclipse.core.runtime.content.IContentTypeManager; |
47 |
import org.eclipse.core.runtime.content.IContentTypeManager; |
26 |
|
48 |
|
27 |
import org.eclipse.swt.graphics.Image; |
49 |
import org.eclipse.swt.graphics.Image; |
28 |
import org.eclipse.swt.widgets.*; |
50 |
import org.eclipse.swt.widgets.Composite; |
|
|
51 |
import org.eclipse.swt.widgets.Shell; |
29 |
|
52 |
|
30 |
import org.eclipse.jface.dialogs.*; |
53 |
import org.eclipse.jface.dialogs.MessageDialog; |
31 |
import org.eclipse.jface.preference.IPreferenceStore; |
54 |
import org.eclipse.jface.preference.IPreferenceStore; |
32 |
import org.eclipse.jface.resource.ImageDescriptor; |
55 |
import org.eclipse.jface.resource.ImageDescriptor; |
33 |
import org.eclipse.jface.util.*; |
|
|
34 |
import org.eclipse.jface.util.Assert; |
56 |
import org.eclipse.jface.util.Assert; |
|
|
57 |
import org.eclipse.jface.util.IPropertyChangeListener; |
58 |
import org.eclipse.jface.util.PropertyChangeEvent; |
35 |
import org.eclipse.jface.viewers.Viewer; |
59 |
import org.eclipse.jface.viewers.Viewer; |
36 |
|
60 |
|
37 |
import org.eclipse.compare.*; |
61 |
import org.eclipse.ui.IEditorInput; |
38 |
import org.eclipse.compare.structuremergeviewer.*; |
62 |
import org.eclipse.ui.IEditorPart; |
|
|
63 |
import org.eclipse.ui.IEditorRegistry; |
64 |
import org.eclipse.ui.IReusableEditor; |
65 |
import org.eclipse.ui.ISharedImages; |
66 |
import org.eclipse.ui.IWorkbench; |
67 |
import org.eclipse.ui.IWorkbenchPage; |
68 |
import org.eclipse.ui.IWorkbenchWindow; |
69 |
import org.eclipse.ui.PartInitException; |
70 |
import org.eclipse.ui.PlatformUI; |
71 |
import org.eclipse.ui.model.IWorkbenchAdapter; |
72 |
import org.eclipse.ui.plugin.AbstractUIPlugin; |
73 |
|
39 |
import org.osgi.framework.BundleContext; |
74 |
import org.osgi.framework.BundleContext; |
40 |
|
75 |
|
41 |
|
76 |
|
Lines 515-534
Link Here
|
515 |
} |
550 |
} |
516 |
|
551 |
|
517 |
public static ImageDescriptor getImageDescriptor(String relativePath) { |
552 |
public static ImageDescriptor getImageDescriptor(String relativePath) { |
518 |
|
553 |
if (fgComparePlugin == null) |
519 |
URL installURL= null; |
554 |
return null; |
520 |
if (fgComparePlugin != null) |
555 |
IPath path= Utilities.getIconPath(null).append(relativePath); |
521 |
installURL= fgComparePlugin.getBundle().getEntry("/"); //$NON-NLS-1$ |
556 |
URL url= Platform.find(fgComparePlugin.getBundle(), path); |
522 |
|
557 |
if (url == null) |
523 |
if (installURL != null) { |
558 |
return null; |
524 |
try { |
559 |
return ImageDescriptor.createFromURL(url); |
525 |
URL url= new URL(installURL, Utilities.getIconPath(null) + relativePath); |
|
|
526 |
return ImageDescriptor.createFromURL(url); |
527 |
} catch (MalformedURLException e) { |
528 |
Assert.isTrue(false); |
529 |
} |
530 |
} |
531 |
return null; |
532 |
} |
560 |
} |
533 |
|
561 |
|
534 |
/** |
562 |
/** |