01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 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.texteditor;
11:
12: import org.eclipse.core.runtime.CoreException;
13: import org.eclipse.core.runtime.content.IContentType;
14:
15: /**
16: * Extension interface for {@link org.eclipse.ui.texteditor.IDocumentProvider}.
17: * Extends a document provider with the ability to query the content type
18: * of a given element.
19: * <p>
20: * This interface may be implemented by clients.
21: * </p>
22: *
23: * @see org.eclipse.ui.texteditor.IDocumentProvider
24: * @since 3.1
25: */
26: public interface IDocumentProviderExtension4 {
27:
28: /**
29: * Returns the content type of for the given element or
30: * <code>null</code> if none could be determined. If the element's
31: * document can be saved, the returned content type is determined by the
32: * document's current content.
33: *
34: * @param element the element
35: * @return the content type or <code>null</code>
36: * @throws CoreException if reading or accessing the underlying store
37: * fails
38: */
39: IContentType getContentType(Object element) throws CoreException;
40: }
|