01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui;
11:
12: import org.eclipse.jface.resource.ImageDescriptor;
13:
14: /**
15: * An association between a file name/extension and a list of known editors for
16: * files of that type.
17: * <p>
18: * The name and extension can never empty or null. The name may contain
19: * the single wild card character (*) to indicate the editor applies to
20: * all files with the same extension (e.g. *.doc). The name can never
21: * embed the wild card character within itself (i.e. rep*)
22: * </p>
23: * <p>
24: * This interface is not intended to be implemented by clients.
25: * </p>
26: *
27: * @see IEditorRegistry#getFileEditorMappings
28: */
29: public interface IFileEditorMapping {
30: /**
31: * Returns the default editor registered for this type mapping.
32: *
33: * @return the descriptor of the default editor, or <code>null</code> if there
34: * is no default editor registered
35: */
36: public IEditorDescriptor getDefaultEditor();
37:
38: /**
39: * Returns the list of editors registered for this type mapping.
40: *
41: * @return a possibly empty list of editors
42: */
43: public IEditorDescriptor[] getEditors();
44:
45: /**
46: * Returns the list of editors formerly registered for this type mapping
47: * which have since been deleted.
48: *
49: * @return a possibly empty list of editors
50: */
51: public IEditorDescriptor[] getDeletedEditors();
52:
53: /**
54: * Returns the file's extension for this type mapping.
55: *
56: * @return the extension for this mapping
57: */
58: public String getExtension();
59:
60: /**
61: * Returns the descriptor of the image to use for a file of this type.
62: * <p>
63: * The image is obtained from the default editor. A default file image is
64: * returned if no default editor is available.
65: * </p>
66: *
67: * @return the descriptor of the image to use for a resource of this type
68: */
69: public ImageDescriptor getImageDescriptor();
70:
71: /**
72: * Returns the label to use for this mapping.
73: * Labels have the form "<it>name</it>.<it>extension</it>".
74: *
75: * @return the label to use for this mapping
76: */
77: public String getLabel();
78:
79: /**
80: * Returns the file's name for this type mapping.
81: *
82: * @return the name for this mapping
83: */
84: public String getName();
85: }
|