KickJava   Java API By Example, From Geeks To Geeks.

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


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.jface.resource.ImageDescriptor;
14
15 /**
16  * An association between a file name/extension and a list of known editors for
17  * files of that type.
18  * <p>
19  * The name and extension can never empty or null. The name may contain
20  * the single wild card character (*) to indicate the editor applies to
21  * all files with the same extension (e.g. *.doc). The name can never
22  * embed the wild card character within itself (i.e. rep*)
23  * </p>
24  * <p>
25  * This interface is not intended to be implemented by clients.
26  * </p>
27  *
28  * @see IEditorRegistry#getFileEditorMappings
29  */

30 public interface IFileEditorMapping {
31     /**
32      * Returns the default editor registered for this type mapping.
33      *
34      * @return the descriptor of the default editor, or <code>null</code> if there
35      * is no default editor registered
36      */

37     public IEditorDescriptor getDefaultEditor();
38
39     /**
40      * Returns the list of editors registered for this type mapping.
41      *
42      * @return a possibly empty list of editors
43      */

44     public IEditorDescriptor[] getEditors();
45
46     /**
47      * Returns the list of editors formerly registered for this type mapping
48      * which have since been deleted.
49      *
50      * @return a possibly empty list of editors
51      */

52     public IEditorDescriptor[] getDeletedEditors();
53
54     /**
55      * Returns the file's extension for this type mapping.
56      *
57      * @return the extension for this mapping
58      */

59     public String JavaDoc getExtension();
60
61     /**
62      * Returns the descriptor of the image to use for a file of this type.
63      * <p>
64      * The image is obtained from the default editor. A default file image is
65      * returned if no default editor is available.
66      * </p>
67      *
68      * @return the descriptor of the image to use for a resource of this type
69      */

70     public ImageDescriptor getImageDescriptor();
71
72     /**
73      * Returns the label to use for this mapping.
74      * Labels have the form "<it>name</it>.<it>extension</it>".
75      *
76      * @return the label to use for this mapping
77      */

78     public String JavaDoc getLabel();
79
80     /**
81      * Returns the file's name for this type mapping.
82      *
83      * @return the name for this mapping
84      */

85     public String JavaDoc getName();
86 }
87
Popular Tags