org.eclipse.core.runtime.content
Interface IContentTypeManager
-
All Superinterfaces:
-
IContentTypeMatcher
-
public interface IContentTypeManager
- extends
IContentTypeMatcher
The content type manager provides facilities for file name and content-based
type lookup and content description.
This interface is not intended to be implemented by clients.
-
Since:
- 3.0
-
See Also:
-
IContentTypeMatcher
Field Summary
|
static
String
|
CT_TEXT
Content type identifier constant for platform's primary
text-based content type: org.eclipse.core.runtime.text . |
CT_TEXT
static final
String CT_TEXT
- Content type identifier constant for platform's primary
text-based content type:
org.eclipse.core.runtime.text
.
All text-based content types ought to be sub types of the content type
identified by this string. This provides a simple way for detecting
whether a content type is text-based:
IContentType text = Platform.getContentTypeManager().getContentType(IContentTypeManager.CT_TEXT);
IContentType someType = ...;
boolean isTextBased = someType.isKindOf(text);
-
See Also:
-
Constant Field Values
addContentTypeChangeListener
void addContentTypeChangeListener(
IContentTypeManager.IContentTypeChangeListener listener)
- Register the given listener for notification of content type changes.
Calling this method multiple times with the same listener has no effect. The
given listener argument must not be
null
.
-
-
-
Parameters:
-
listener
- the content type change listener to register -
See Also:
-
removeContentTypeChangeListener(IContentTypeManager.IContentTypeChangeListener)
,
IContentTypeManager.IContentTypeChangeListener
getAllContentTypes
IContentType[] getAllContentTypes()
- Returns all content types known by the platform.
Returns an empty array if there are no content types available.
-
-
-
Returns:
- all content types known by the platform.
getContentType
IContentType getContentType(
String contentTypeIdentifier)
- Returns the content type with the given identifier, or
null
if no such content type is known by the platform.
-
-
-
Parameters:
-
contentTypeIdentifier
- the identifier for the content type
-
Returns:
- the content type, or
null
getMatcher
IContentTypeMatcher getMatcher(
IContentTypeManager.ISelectionPolicy customPolicy,
IScopeContext context)
- Returns a newly created content type matcher using the given content type selection policy
and preference scope. If the preference scope is
null
, the default scope
is used.
-
-
-
Parameters:
-
customPolicy
- a selection policy -
context
- a user preference context to be used by the matcher, or null
-
Returns:
- a content type matcher that uses the given policy
-
Since:
- 3.1
removeContentTypeChangeListener
void removeContentTypeChangeListener(
IContentTypeManager.IContentTypeChangeListener listener)
- De-register the given listener from receiving notification of content type changes.
Calling this method multiple times with the same listener has no
effect. The given listener argument must not be
null
.
-
-
-
Parameters:
-
listener
- the content type change listener to remove -
See Also:
-
addContentTypeChangeListener(IContentTypeManager.IContentTypeChangeListener)
,
IContentTypeManager.IContentTypeChangeListener
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.