KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > ICompatibleWorkbenchPage


1 /*******************************************************************************
2  * Copyright (c) 2004, 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;
12
13 import org.eclipse.core.resources.IFile;
14 import org.eclipse.core.resources.IMarker;
15 import org.eclipse.ui.IEditorPart;
16 import org.eclipse.ui.PartInitException;
17
18 /**
19  * Internal interface used in providing increased binary compatibility for
20  * pre-3.0 plug-ins. This declaration masks the empty interface of the same name
21  * declared in the Workbench proper. This interface declares IWorkbenchPage that
22  * existed in 2.1 but were removed in 3.0 because they referenced resource API.
23  * <p>
24  * Plug-ins should not refer to this type or its containing fragment from their
25  * class path. It is intended only to provide binary compatibility for pre-3.0
26  * plug-ins, and should not be referenced at development time.
27  * </p>
28  *
29  * @since 3.0
30  */

31 public interface ICompatibleWorkbenchPage {
32
33     /**
34      * Opens an editor on the given file resource.
35      * <p>
36      * If this page already has an editor open on the target object that editor
37      * is activated; otherwise, a new editor is opened.
38      * <p>
39      * <p>
40      * An appropriate editor for the input is determined using a multistep
41      * process.
42      * </p>
43      * <ol>
44      * <li>The workbench editor registry is consulted to determine if an editor
45      * extension has been registered for the file type. If so, an instance of
46      * the editor extension is opened on the file. See
47      * <code>IEditorRegistry.getDefaultEditor(IFile)</code>.
48      * <li>Next, the native operating system will be consulted to determine if
49      * a native editor exists for the file type. If so, a new process is started
50      * and the native editor is opened on the file.
51      * <li>If all else fails the file will be opened in a default text editor.
52      * </li>
53      * </ol>
54      * </p>
55      *
56      * @param input
57      * the file to edit
58      * @return an open and active editor, or <code>null</code> if a system
59      * editor was opened
60      * @exception PartInitException
61      * if the editor could not be initialized
62      * @deprecated In 3.0 this resource-specific method moved from this
63      * interface to
64      * <code>org.eclipse.ui.ide.IDE.openEditor(IWorkbenchPage,IFile)</code>.
65      * This method should not be referenced at development time. See
66      * the class comment for more details.
67      */

68     public IEditorPart openEditor(IFile input) throws PartInitException;
69
70     /**
71      * Opens an editor on the given file resource.
72      * <p>
73      * If this page already has an editor open on the target object that editor
74      * is brought to front; otherwise, a new editor is opened. If
75      * <code>activate == true</code> the editor will be activated.
76      * <p>
77      * <p>
78      * The editor type is determined by mapping <code>editorId</code> to an
79      * editor extension registered with the workbench. An editor id is passed
80      * rather than an editor object to prevent the accidental creation of more
81      * than one editor for the same input. It also guarantees a consistent
82      * lifecycle for editors, regardless of whether they are created by the user
83      * or restored from saved data.
84      * </p>
85      *
86      * @param input
87      * the file to edit
88      * @param editorId
89      * the id of the editor extension to use or null
90      * @param activate
91      * if <code>true</code> the editor will be activated
92      * @return an open and active editor
93      * @exception PartInitException
94      * if the editor could not be initialized
95      * @deprecated In 3.0 this resource-specific method moved from this
96      * interface to
97      * <code>org.eclipse.ui.ide.IDE.openEditor(IWorkbenchPage,IFile,String,boolean)</code>.
98      * This method should not be referenced at development time. See
99      * the class comment for more details.
100      */

101     public IEditorPart openEditor(IFile input, String JavaDoc editorId, boolean activate)
102             throws PartInitException;
103
104     /**
105      * Opens an editor on the given file resource.
106      * <p>
107      * If this page already has an editor open on the target object that editor
108      * is activated; otherwise, a new editor is opened.
109      * <p>
110      * <p>
111      * The editor type is determined by mapping <code>editorId</code> to an
112      * editor extension registered with the workbench. An editor id is passed
113      * rather than an editor object to prevent the accidental creation of more
114      * than one editor for the same input. It also guarantees a consistent
115      * lifecycle for editors, regardless of whether they are created by the user
116      * or restored from saved data.
117      * </p>
118      *
119      * @param editorId
120      * the id of the editor extension to use
121      * @param input
122      * the file to edit
123      * @return an open and active editor
124      * @exception PartInitException
125      * if the editor could not be initialized
126      * @deprecated In 3.0 this resource-specific method moved from this
127      * interface to
128      * <code>org.eclipse.ui.ide.IDE.openEditor(IWorkbenchPage,IFile,String)</code>.
129      * This method should not be referenced at development time. See
130      * the class comment for more details.
131      */

132     public IEditorPart openEditor(IFile input, String JavaDoc editorId)
133             throws PartInitException;
134
135     /**
136      * Opens an editor on the file resource of the given marker.
137      * <p>
138      * If this page already has an editor open on the target object that editor
139      * is activated; otherwise, a new editor is opened. The cursor and selection
140      * state of the editor is then updated from information recorded in the
141      * marker.
142      * <p>
143      * <p>
144      * If the marker contains an <code>EDITOR_ID_ATTR</code> attribute the
145      * attribute value will be used to determine the editor type to be opened.
146      * If not, the registered editor for the marker resource will be used.
147      * </p>
148      *
149      * @param marker
150      * the marker to open
151      * @return an open and active editor, or null if a system editor was opened
152      * @exception PartInitException
153      * if the editor could not be initialized
154      * @see IEditorPart#gotoMarker
155      * @deprecated In 3.0 this resource-specific method moved from this
156      * interface to
157      * <code>org.eclipse.ui.ide.IDE.openEditor(IWorkbenchPage,IMarker)</code>.
158      * This method should not be referenced at development time. See
159      * the class comment for more details.
160      */

161     public IEditorPart openEditor(IMarker marker) throws PartInitException;
162
163     /**
164      * Opens an editor on the file resource of the given marker.
165      * <p>
166      * If this page already has an editor open on the target object that editor
167      * is brought to front; otherwise, a new editor is opened. If
168      * <code>activate == true</code> the editor will be activated. The cursor
169      * and selection state of the editor are then updated from information
170      * recorded in the marker.
171      * <p>
172      * <p>
173      * If the marker contains an <code>EDITOR_ID_ATTR</code> attribute the
174      * attribute value will be used to determine the editor type to be opened.
175      * If not, the registered editor for the marker resource will be used.
176      * </p>
177      *
178      * @param marker
179      * the marker to open
180      * @param activate
181      * if <code>true</code> the editor will be activated
182      * @return an open editor, or null if a system editor was opened
183      * @exception PartInitException
184      * if the editor could not be initialized
185      * @see IEditorPart#gotoMarker
186      * @deprecated In 3.0 this resource-specific method moved from this
187      * interface to
188      * <code>org.eclipse.ui.ide.IDE.openEditor(IWorkbenchPage,IMarker,boolean)</code>.
189      * This method should not be referenced at development time. See
190      * the class comment for more details.
191      */

192     public IEditorPart openEditor(IMarker marker, boolean activate)
193             throws PartInitException;
194
195     /**
196      * Opens an operating system editor on a given file. Once open, the
197      * workbench has no knowledge of the editor or the state of the file being
198      * edited. Users are expected to perform a "Local Refresh" from the
199      * workbench user interface.
200      *
201      * @param input
202      * the file to edit
203      * @exception PartInitException
204      * if the editor could not be opened.
205      * @deprecated In 3.0 this resource-specific method was removed. Use
206      * <code>openEditor(new FileEditorInput(file), IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID)</code>
207      * instead. This method should not be referenced at development
208      * time. See the class comment for more details.
209      */

210     public void openSystemEditor(IFile input) throws PartInitException;
211 }
212
Popular Tags