Bug 46805 prepare Compare for encoding support
I20031111 The Compare plugin only supports the global workspace encoding. It does not support encodings per file.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaCompareAction.java
public String getType() {
			return "JAVA"; 
		}
		
		public Image getImage() {
			return fJavaElementLabelProvider.getImage(fSource);
		}
		
		public InputStream getContents() throws CoreException {
			return new ByteArrayInputStream(fContents.getBytes());
		}	
	}
	
	private static final String BUNDLE_NAME= "org.eclipse.jdt.internal.ui.compare.CompareAction"; 
	private ISourceReference fLeft;
	private ISourceReference fRight;
	
	private JavaElementLabelProvider fJavaElementLabelProvider;
	
	public void selectionChanged(IAction action, ISelection selection) {
		action.setEnabled(isEnabled(selection));
	}
	
	public void run(IAction action) {
		Shell shell= JavaPlugin.getActiveWorkbenchShell();
		ResourceBundle bundle= ResourceBundle.getBundle(BUNDLE_NAME);
		CompareDialog d= new CompareDialog(shell, bundle);