package net.sourceforge.phpdt.internal.compiler.ast;
-import net.sourceforge.phpdt.internal.compiler.parser.OutlineableWithChildren;
+import java.util.ArrayList;
+import java.util.List;
+
import net.sourceforge.phpdt.internal.compiler.parser.Outlineable;
+import net.sourceforge.phpdt.internal.compiler.parser.OutlineableWithChildren;
import net.sourceforge.phpdt.internal.ui.PHPUiImages;
+
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.text.Position;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* It's a php document.
* This class is an outlineable object
public AstNode[] nodes;
public char[] name;
+
/** The parent of the object. */
public Object parent;
* Create the PHPDocument.
* @param parent the parent object (it should be null isn't it ?)
*/
- public PHPDocument(Object parent, char[] name) {
+ public PHPDocument(final Object parent,
+ final char[] name) {
this.parent = parent;
this.name = name;
position = new Position(1,name.length);
break;
}
buff.append(node.toString(0));
- buff.append("\n");
+ if (node instanceof HTMLCode) {
+ buff.append("\n");//$NON-NLS-1$
+ } else {
+ buff.append(";\n");//$NON-NLS-1$
+ }
}
}
return buff.toString();
* @param o the new outlineable
* @return does the addition worked ?
*/
- public boolean add(Outlineable o) {
+ public boolean add(final Outlineable o) {
return children.add(o);
}
* @param index the index
* @return an outlineable object
*/
- public Outlineable get(int index) {
+ public Outlineable get(final int index) {
return (Outlineable) children.get(index);
}