1) Added missing strings for italic, underline and strike through.
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / core / BufferFactoryWrapper.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  * Wraps an IBufferFactory. TODO remove when removing IBufferFactory
19  * 
20  * @deprecated
21  */
22 public class BufferFactoryWrapper extends WorkingCopyOwner {
23
24         public net.sourceforge.phpdt.core.IBufferFactory factory;
25
26         private BufferFactoryWrapper(
27                         net.sourceforge.phpdt.core.IBufferFactory factory) {
28                 this.factory = factory;
29         }
30
31         public static WorkingCopyOwner create(
32                         net.sourceforge.phpdt.core.IBufferFactory factory) {
33                 return new BufferFactoryWrapper(factory);
34         }
35
36         /*
37          * (non-Javadoc)
38          * 
39          * @see net.sourceforge.phpdt.core.WorkingCopyOwner#createBuffer(net.sourceforge.phpdt.core.ICompilationUnit)
40          */
41         public IBuffer createBuffer(ICompilationUnit workingCopy) {
42                 if (this.factory == null)
43                         return super.createBuffer(workingCopy);
44                 return this.factory.createBuffer(workingCopy);
45         }
46
47         public boolean equals(Object obj) {
48                 if (!(obj instanceof BufferFactoryWrapper))
49                         return false;
50                 BufferFactoryWrapper other = (BufferFactoryWrapper) obj;
51                 if (this.factory == null)
52                         return other.factory == null;
53                 return this.factory.equals(other.factory);
54         }
55
56         public int hashCode() {
57                 if (this.factory == null)
58                         return 0;
59                 return this.factory.hashCode();
60         }
61
62         public String toString() {
63                 return "FactoryWrapper for " + this.factory; //$NON-NLS-1$
64         }
65 }