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

Collapse All | Expand All

(-)model/org/eclipse/jdt/core/IClassFileWorkingCopy.java (+5 lines)
Added Link Here
1
package org.eclipse.jdt.core;
2
3
public interface IClassFileWorkingCopy {
4
5
}
(-)model/org/eclipse/jdt/internal/core/ClassFileWorkingCopy.java (-2 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 14-19 Link Here
14
import org.eclipse.core.runtime.IPath;
14
import org.eclipse.core.runtime.IPath;
15
import org.eclipse.core.runtime.IProgressMonitor;
15
import org.eclipse.core.runtime.IProgressMonitor;
16
import org.eclipse.jdt.core.IBuffer;
16
import org.eclipse.jdt.core.IBuffer;
17
import org.eclipse.jdt.core.IClassFileWorkingCopy;
17
import org.eclipse.jdt.core.IJavaElement;
18
import org.eclipse.jdt.core.IJavaElement;
18
import org.eclipse.jdt.core.IJavaModelStatusConstants;
19
import org.eclipse.jdt.core.IJavaModelStatusConstants;
19
import org.eclipse.jdt.core.JavaModelException;
20
import org.eclipse.jdt.core.JavaModelException;
Lines 28-34 Link Here
28
/**
29
/**
29
 * A working copy on an <code>IClassFile</code>.
30
 * A working copy on an <code>IClassFile</code>.
30
 */
31
 */
31
public class ClassFileWorkingCopy extends CompilationUnit {
32
public class ClassFileWorkingCopy extends CompilationUnit implements IClassFileWorkingCopy {
32
33
33
	public ClassFile classFile;
34
	public ClassFile classFile;
34
35
(-)ui/org/eclipse/jdt/internal/ui/JavaPlugin.java (-3 / +8 lines)
Lines 69-74 Link Here
69
import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
69
import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
70
70
71
import org.eclipse.jdt.core.IBuffer;
71
import org.eclipse.jdt.core.IBuffer;
72
import org.eclipse.jdt.core.IClassFileWorkingCopy;
72
import org.eclipse.jdt.core.ICompilationUnit;
73
import org.eclipse.jdt.core.ICompilationUnit;
73
import org.eclipse.jdt.core.JavaCore;
74
import org.eclipse.jdt.core.JavaCore;
74
import org.eclipse.jdt.core.WorkingCopyOwner;
75
import org.eclipse.jdt.core.WorkingCopyOwner;
Lines 363-371 Link Here
363
			@Override
364
			@Override
364
			public IBuffer createBuffer(ICompilationUnit workingCopy) {
365
			public IBuffer createBuffer(ICompilationUnit workingCopy) {
365
				ICompilationUnit original= workingCopy.getPrimary();
366
				ICompilationUnit original= workingCopy.getPrimary();
366
				IResource resource= original.getResource();
367
				if (original instanceof IClassFileWorkingCopy) {
367
				if (resource instanceof IFile)
368
					return super.createBuffer(workingCopy);
368
					return new DocumentAdapter(workingCopy, (IFile) resource);
369
				} else {
370
					IResource resource= original.getResource();
371
					if (resource instanceof IFile)
372
						return new DocumentAdapter(workingCopy, (IFile) resource);
373
				}
369
				return DocumentAdapter.NULL;
374
				return DocumentAdapter.NULL;
370
			}
375
			}
371
		});
376
		});

Return to bug 337935