A massive organize imports and formatting of the sources using default Eclipse code...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / core / DefaultWorkingCopyOwner.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.core;
12
13 import net.sourceforge.phpdt.core.IBuffer;
14 import net.sourceforge.phpdt.core.ICompilationUnit;
15 import net.sourceforge.phpdt.core.WorkingCopyOwner;
16
17 /**
18  * A working copy owner that creates internal buffers. It also defines the
19  * PRIMARY working copy owner that is used by JDT/Core.
20  */
21 public class DefaultWorkingCopyOwner extends WorkingCopyOwner {
22
23         public WorkingCopyOwner primaryBufferProvider;
24
25         public static final DefaultWorkingCopyOwner PRIMARY = new DefaultWorkingCopyOwner();
26
27         private DefaultWorkingCopyOwner() {
28                 // only one instance can be created
29         }
30
31         /**
32          * @deprecated Marked deprecated as it is using deprecated code
33          */
34         public IBuffer createBuffer(ICompilationUnit workingCopy) {
35                 if (this.primaryBufferProvider != null)
36                         return this.primaryBufferProvider.createBuffer(workingCopy);
37                 return super.createBuffer(workingCopy);
38         }
39
40         public String toString() {
41                 return "Primary owner"; //$NON-NLS-1$
42         }
43 }