Skip to main content
summaryrefslogtreecommitdiffstats
blob: e2dee1210de67f1c475f5bd529f6b1155ac99975 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*******************************************************************************
 * Copyright (c) 2000, 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.ui.internal.texteditor;

import org.eclipse.core.runtime.Assert;

import org.eclipse.jface.text.Position;

import org.eclipse.ui.IEditorInput;

/**
 * Data structure representing an edit position.
 *
 * @since 2.1
 */
public final class EditPosition {

	/** The editor input */
	private final IEditorInput fEditorInput;
	/** The editor ID */
	private final String fEditorId;
	/** The position */
	private final Position fPosition;

	/**
	 * Creates a new edit position.
	 * @param editorInput the editor input
	 * @param editorId the editor ID
	 * @param pos the position
	 */
	public EditPosition(IEditorInput editorInput, String editorId, Position pos) {
		Assert.isNotNull(editorInput);
		Assert.isNotNull(editorId);
		fEditorId= editorId;
		fEditorInput= editorInput;
		fPosition= pos;
	}

	/**
	 * Returns the editor input for this edit position.
	 *
	 * @return the editor input of this edit position
	 */
	public IEditorInput getEditorInput() {
		return fEditorInput;
	}

	/**
	 * Returns the editor id for this edit position.
	 *
	 * @return the editor input of this edit position
	 */
	public String getEditorId() {
		return fEditorId;
	}

	/**
	 * Returns the position.
	 *
	 * @return the position
	 */
	public Position getPosition() {
		return fPosition;
	}
}

Back to the top