KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > texteditor > EditPosition


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.texteditor;
12
13 import org.eclipse.core.runtime.Assert;
14
15 import org.eclipse.jface.text.Position;
16
17 import org.eclipse.ui.IEditorInput;
18
19 /**
20  * Data structure representing an edit position.
21  *
22  * @since 2.1
23  */

24 public final class EditPosition {
25
26     /** The editor input */
27     private final IEditorInput fEditorInput;
28     /** The editor ID */
29     private final String JavaDoc fEditorId;
30     /** The position */
31     private final Position fPosition;
32
33     /**
34      * Creates a new edit position.
35      * @param editorInput the editor input
36      * @param editorId the editor ID
37      * @param pos the position
38      */

39     public EditPosition(IEditorInput editorInput, String JavaDoc editorId, 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 JavaDoc 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 }
74
Popular Tags