View | Details | Raw Unified | Return to bug 105230 | Differences between
and this patch

Collapse All | Expand All

(-)plugin.xml (-1 / +1 lines)
Lines 78-84 Link Here
78
         point="org.eclipse.ui.editors">
78
         point="org.eclipse.ui.editors">
79
      <editor
79
      <editor
80
            name="%defaultCompareEditor.name"
80
            name="%defaultCompareEditor.name"
81
            icon="icons/full/eview16/compare_view.gif"
81
            icon="$nl$/icons/full/eview16/compare_view.gif"
82
            contributorClass="org.eclipse.compare.internal.CompareEditorContributor"
82
            contributorClass="org.eclipse.compare.internal.CompareEditorContributor"
83
            class="org.eclipse.compare.internal.CompareEditor"
83
            class="org.eclipse.compare.internal.CompareEditor"
84
            id="org.eclipse.compare.CompareEditor">
84
            id="org.eclipse.compare.CompareEditor">
(-)compare/org/eclipse/compare/internal/CompareUIPlugin.java (-28 / +56 lines)
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
	/**
(-)compare/org/eclipse/compare/internal/Utilities.java (-22 / +47 lines)
Lines 10-52 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.BufferedReader;
14
import java.io.ByteArrayOutputStream;
15
import java.io.IOException;
16
import java.io.InputStream;
17
import java.io.InputStreamReader;
18
import java.io.UnsupportedEncodingException;
14
import java.text.MessageFormat;
19
import java.text.MessageFormat;
15
import java.util.*;
20
import java.util.ArrayList;
21
import java.util.HashMap;
22
import java.util.Iterator;
16
import java.util.List;
23
import java.util.List;
24
import java.util.Map;
25
import java.util.MissingResourceException;
26
import java.util.ResourceBundle;
17
27
18
import org.eclipse.swt.widgets.*;
28
import org.eclipse.compare.CompareConfiguration;
19
29
import org.eclipse.compare.CompareUI;
20
import org.eclipse.core.resources.IEncodedStorage;
30
import org.eclipse.compare.IEncodedStreamContentAccessor;
21
import org.eclipse.core.resources.IFile;
31
import org.eclipse.compare.IStreamContentAccessor;
22
import org.eclipse.core.resources.ResourceAttributes;
23
import org.eclipse.core.resources.ResourcesPlugin;
24
25
import org.eclipse.jface.action.IAction;
26
import org.eclipse.jface.resource.ImageDescriptor;
27
import org.eclipse.jface.util.*;
28
import org.eclipse.jface.viewers.*;
29
import org.eclipse.jface.dialogs.ErrorDialog;
30
32
31
import org.eclipse.core.resources.IResource;
32
import org.eclipse.core.runtime.CoreException;
33
import org.eclipse.core.runtime.CoreException;
33
import org.eclipse.core.runtime.IAdaptable;
34
import org.eclipse.core.runtime.IAdaptable;
35
import org.eclipse.core.runtime.IPath;
34
import org.eclipse.core.runtime.IStatus;
36
import org.eclipse.core.runtime.IStatus;
35
import org.eclipse.core.runtime.MultiStatus;
37
import org.eclipse.core.runtime.MultiStatus;
38
import org.eclipse.core.runtime.Path;
36
import org.eclipse.core.runtime.Status;
39
import org.eclipse.core.runtime.Status;
37
40
38
import org.eclipse.ui.*;
41
import org.eclipse.core.resources.IEncodedStorage;
42
import org.eclipse.core.resources.IFile;
43
import org.eclipse.core.resources.IResource;
44
import org.eclipse.core.resources.ResourceAttributes;
45
import org.eclipse.core.resources.ResourcesPlugin;
39
46
40
import org.eclipse.compare.CompareConfiguration;
47
import org.eclipse.swt.widgets.Composite;
41
import org.eclipse.compare.CompareUI;
48
import org.eclipse.swt.widgets.Control;
42
import org.eclipse.compare.IEncodedStreamContentAccessor;
49
import org.eclipse.swt.widgets.Display;
43
import org.eclipse.compare.IStreamContentAccessor;
50
import org.eclipse.swt.widgets.Shell;
51
import org.eclipse.swt.widgets.Widget;
52
53
import org.eclipse.jface.action.IAction;
54
import org.eclipse.jface.dialogs.ErrorDialog;
55
import org.eclipse.jface.resource.ImageDescriptor;
56
import org.eclipse.jface.util.IPropertyChangeListener;
57
import org.eclipse.jface.util.ListenerList;
58
import org.eclipse.jface.util.PropertyChangeEvent;
59
import org.eclipse.jface.viewers.ISelection;
60
import org.eclipse.jface.viewers.IStructuredSelection;
61
62
import org.eclipse.ui.IActionBars;
63
import org.eclipse.ui.IKeyBindingService;
64
import org.eclipse.ui.IViewPart;
65
import org.eclipse.ui.IWorkbenchPart;
66
import org.eclipse.ui.IWorkbenchPartSite;
44
67
45
/**
68
/**
46
 * Convenience and utility methods.
69
 * Convenience and utility methods.
47
 */
70
 */
48
public class Utilities {
71
public class Utilities {
49
	
72
	
73
	private static final IPath ICONS_PATH= new Path("$nl$/icons/full/"); //$NON-NLS-1$
74
	
50
	public static void registerAction(IKeyBindingService kbs, IAction a, String id) {
75
	public static void registerAction(IKeyBindingService kbs, IAction a, String id) {
51
		if (kbs != null) {
76
		if (kbs != null) {
52
			a.setActionDefinitionId(id);
77
			a.setActionDefinitionId(id);
Lines 186-193 Link Here
186
		return bos.toByteArray();
211
		return bos.toByteArray();
187
	}
212
	}
188
213
189
	public static String getIconPath(Display display) {
214
	public static IPath getIconPath(Display display) {
190
		return "icons/full/";	//$NON-NLS-1$
215
		return ICONS_PATH;
191
	}
216
	}
192
	
217
	
193
	/*
218
	/*

Return to bug 105230