Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 9f505f28da8821c7b473e531ea48e812f7ce70c3 (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
58
/*******************************************************************************
 * Copyright (c) 2008 IBM Corporation 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:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jface.internal.text.html;

import org.eclipse.jface.text.DefaultInformationControl;


/**
 * Provides input for a {@link BrowserInformationControl}.
 *
 * @since 3.4
 */
public abstract class BrowserInformationControlInput extends BrowserInput {

	/**
	 * Returns the leading image width.
	 *
	 * @return the size of the leading image, by default <code>0</code> is returned
	 * @since 3.4
	 */
	public int getLeadingImageWidth() {
		return 0;
	}

	/**
	 * Creates the next browser input with the given input as previous one.
	 *
	 * @param previous the previous input or <code>null</code> if none
	 */
	public BrowserInformationControlInput(BrowserInformationControlInput previous) {
		super(previous);
	}

	/**
	 * @return the HTML contents
	 */
	public abstract String getHtml();

	/**
	 * Returns the HTML from {@link #getHtml()}.
	 * This is a fallback mode for platforms where the {@link BrowserInformationControl}
	 * is not available and this input is passed to a {@link DefaultInformationControl}.
	 *
	 * @return {@link #getHtml()}
	 */
	@Override
	public String toString() {
		return getHtml();
	}
}

Back to the top