KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > IEditorLauncher


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;
12
13 import org.eclipse.core.runtime.IPath;
14
15 /**
16  * An editor launcher is used to launch external editors on a
17  * file in the local file system.
18  * <p>
19  * Clients should implement this interface to define a new type of editor
20  * launcher. Each new launcher must be registered as an editor in the
21  * workbench's editor extension point
22  * (named <code>"org.eclipse.ui.editors"</code>).
23  *
24  * For example, the plug-in's XML markup might contain:
25  * <pre>
26  * &LT;extension point = "org.eclipse.ui.editors"&GT;
27  * &LT;editor
28  * id="org.eclipse.ui.SwingEditorLauncher"
29  * name="Swing Editor"
30  * extensions="xml"
31  * launcher="org.eclipse.ui.examples.swingeditor.SwingEditorLauncher"
32  * icon="icons/xml.gif"&GT;
33  * &LT;/editor&GT;
34  * &LT;/extension&GT;
35  * </pre>
36  * </p><p>
37  * In this example a launcher has been registered for use with <code>xml</code>
38  * files. Once registered, the launcher will appear in the <code>Open With</code>
39  * menu for an <code>xml</code> file. If the item is invoked the workbench will
40  * create an instance of the launcher class and call <code>open</code> on it,
41  * passing the input file.
42  * </p>
43  */

44 public interface IEditorLauncher {
45
46     /**
47      * Launches this external editor to edit the file at the given
48      * location in the local file system.
49      *
50      * @param file the local file system path of the file to edit
51      */

52     public void open(IPath file);
53 }
54
Popular Tags