Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 458925f6f0263993631f6d25688e9fd57507f13f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*******************************************************************************
 * Copyright (c) 2000, 2015 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     Jan-Hendrik Diederich, Bredex GmbH - bug 201052
 *******************************************************************************/
package org.eclipse.ui;

import org.eclipse.jface.resource.ImageDescriptor;

/**
 * An association between a file name/extension and a list of known editors for
 * files of that type.
 * <p>
 * The name and extension can never empty or null. The name may contain the
 * single wild card character (*) to indicate the editor applies to all files
 * with the same extension (e.g. *.doc). The name can never embed the wild card
 * character within itself (i.e. rep*)
 * </p>
 * <p>
 * This interface is not intended to be implemented by clients.
 * </p>
 *
 * @see IEditorRegistry#getFileEditorMappings
 * @noimplement This interface is not intended to be implemented by clients.
 */
public interface IFileEditorMapping {
	/**
	 * Returns the default editor registered for this type mapping.
	 *
	 * @return the descriptor of the default editor, or <code>null</code> if there
	 *         is no default editor registered. Will also return <code>null</code>
	 *         if the default editor exists but fails the Expressions check.
	 */
	IEditorDescriptor getDefaultEditor();

	/**
	 * Returns the list of editors registered for this type mapping.
	 *
	 * @return a possibly empty list of editors.
	 */
	IEditorDescriptor[] getEditors();

	/**
	 * Returns the list of editors formerly registered for this type mapping which
	 * have since been deleted.
	 *
	 * @return a possibly empty list of editors
	 */
	IEditorDescriptor[] getDeletedEditors();

	/**
	 * Returns the file's extension for this type mapping.
	 *
	 * @return the extension for this mapping
	 */
	String getExtension();

	/**
	 * Returns the descriptor of the image to use for a file of this type.
	 * <p>
	 * The image is obtained from the default editor. A default file image is
	 * returned if no default editor is available.
	 * </p>
	 *
	 * @return the descriptor of the image to use for a resource of this type
	 */
	ImageDescriptor getImageDescriptor();

	/**
	 * Returns the label to use for this mapping. Labels have the form
	 * "<i>name.extension</i>".
	 *
	 * @return the label to use for this mapping
	 */
	String getLabel();

	/**
	 * Returns the file's name for this type mapping.
	 *
	 * @return the name for this mapping
	 */
	String getName();
}

Back to the top