01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.texteditor;
11:
12: import org.eclipse.core.runtime.Assert;
13:
14: import org.eclipse.jface.text.Position;
15:
16: import org.eclipse.ui.IEditorInput;
17:
18: /**
19: * Data structure representing an edit position.
20: *
21: * @since 2.1
22: */
23: public final class EditPosition {
24:
25: /** The editor input */
26: private final IEditorInput fEditorInput;
27: /** The editor ID */
28: private final String fEditorId;
29: /** The position */
30: private final Position fPosition;
31:
32: /**
33: * Creates a new edit position.
34: * @param editorInput the editor input
35: * @param editorId the editor ID
36: * @param pos the position
37: */
38: public EditPosition(IEditorInput editorInput, String editorId,
39: Position pos) {
40: Assert.isNotNull(editorInput);
41: Assert.isNotNull(editorId);
42: fEditorId = editorId;
43: fEditorInput = editorInput;
44: fPosition = pos;
45: }
46:
47: /**
48: * Returns the editor input for this edit position.
49: *
50: * @return the editor input of this edit position
51: */
52: IEditorInput getEditorInput() {
53: return fEditorInput;
54: }
55:
56: /**
57: * Returns the editor id for this edit position.
58: *
59: * @return the editor input of this edit position
60: */
61: String getEditorId() {
62: return fEditorId;
63: }
64:
65: /**
66: * Returns the position.
67: *
68: * @return the position
69: */
70: Position getPosition() {
71: return fPosition;
72: }
73: }
|