1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *******************************************************************************/
14 package org.eclipse.ui.texteditor;
15 
16 import org.eclipse.core.runtime.CoreException;
17 import org.eclipse.core.runtime.content.IContentType;
18 
19 
20 /**
21  * Extension interface for {@link org.eclipse.ui.texteditor.IDocumentProvider}.
22  * Extends a document provider with the ability to query the content type
23  * of a given element.
24  * <p>
25  * This interface may be implemented by clients.
26  * </p>
27  *
28  * @see org.eclipse.ui.texteditor.IDocumentProvider
29  * @since 3.1
30  */
31 public interface IDocumentProviderExtension4 {
32 
33 	/**
34 	 * Returns the content type of for the given element or
35 	 * <code>null</code> if none could be determined. If the element's
36 	 * document can be saved, the returned content type is determined by the
37 	 * document's current content.
38 	 *
39 	 * @param element the element
40 	 * @return the content type or <code>null</code>
41 	 * @throws CoreException if reading or accessing the underlying store
42 	 *                 fails
43 	 */
getContentType(Object element)44 	IContentType getContentType(Object element) throws CoreException;
45 }
46