Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 90b710d8940827af69beaa408e6007ed4f8bf33e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*******************************************************************************
 * Copyright (c) 2004, 2008 John Krasnay and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     John Krasnay - initial API and implementation
 *******************************************************************************/
package org.eclipse.wst.xml.vex.core.internal.layout;

/**
 * An empty inline box that simply takes up space.
 */
public class SpaceBox extends AbstractInlineBox {

	/**
	 * Class constructor.
	 * 
	 * @param width
	 *            width of the box
	 * @param height
	 *            height of the box
	 */
	public SpaceBox(int width, int height) {
		this.setWidth(width);
		this.setHeight(height);
	}

	/**
	 * @see org.eclipse.wst.xml.vex.core.internal.layout.InlineBox#getBaseline()
	 */
	public int getBaseline() {
		return this.getHeight();
	}

	public boolean isEOL() {
		return false;
	}

	/**
	 * @see org.eclipse.wst.xml.vex.core.internal.layout.InlineBox#split(org.eclipse.wst.xml.vex.core.internal.layout.LayoutContext,
	 *      int, boolean)
	 */
	public Pair split(LayoutContext context, int maxWidth, boolean force) {
		return new Pair(null, this);
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return "[spacer]";
	}

}

Back to the top