1) Added missing strings for italic, underline and strike through.
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / core / PackageDeclaration.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 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.IJavaElement;
14 import net.sourceforge.phpdt.core.IPackageDeclaration;
15 import net.sourceforge.phpdt.core.JavaModelException;
16 import net.sourceforge.phpdt.core.jdom.IDOMNode;
17
18 /**
19  * @see IPackageDeclaration
20  */
21
22 /* package */class PackageDeclaration extends SourceRefElement implements
23                 IPackageDeclaration {
24         protected PackageDeclaration(CompilationUnit parent, String name) {
25                 super(parent, name);
26         }
27
28         public boolean equals(Object o) {
29                 if (!(o instanceof PackageDeclaration))
30                         return false;
31                 return super.equals(o);
32         }
33
34         /**
35          * @see JavaElement#equalsDOMNode
36          */
37         protected boolean equalsDOMNode(IDOMNode node) throws JavaModelException {
38                 return (node.getNodeType() == IDOMNode.PACKAGE)
39                                 && getElementName().equals(node.getName());
40         }
41
42         /**
43          * @see IJavaElement
44          */
45         public int getElementType() {
46                 return PACKAGE_DECLARATION;
47         }
48
49         /**
50          * @see JavaElement#getHandleMemento()
51          */
52         protected char getHandleMementoDelimiter() {
53                 return JavaElement.JEM_PACKAGEDECLARATION;
54         }
55
56         /**
57          * @private Debugging purposes
58          */
59         protected void toStringInfo(int tab, StringBuffer buffer, Object info) {
60                 buffer.append(this.tabString(tab));
61                 buffer.append("package "); //$NON-NLS-1$
62                 buffer.append(getElementName());
63                 if (info == null) {
64                         buffer.append(" (not open)"); //$NON-NLS-1$
65                 }
66         }
67 }