Package org.eclipse.core.runtime.content
Interface IContentTypeSettings
-
- All Known Subinterfaces:
IContentType
public interface IContentTypeSettings
Gives access to the user settings for a content type.This interface is not intended to be implemented by clients.
- Since:
- 3.1
- See Also:
IContentType
,IContentType.getSettings(IScopeContext)
- Restriction:
- This interface is not intended to be implemented by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static int
FILE_EXTENSION_SPEC
File spec type constant, indicating a file extension specification.static int
FILE_NAME_SPEC
File spec type constant, indicating a file name specification.static int
FILE_PATTERN_SPEC
File spec type constant, indicating a file pattern specification
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addFileSpec(String fileSpec, int type)
Adds a user-defined file specification to the corresponding content type.String
getDefaultCharset()
Returns the default charset for the corresponding content type if it has been set, ornull
otherwise.String[]
getFileSpecs(int type)
Returns the file specifications for the corresponding content type.String
getId()
Returns the corresponding content type's unique identifier.boolean
isUserDefined()
void
removeFileSpec(String fileSpec, int type)
Removes a user-defined file specification from the corresponding content type.void
setDefaultCharset(String userCharset)
Sets the default charset for the corresponding content type.
-
-
-
Field Detail
-
FILE_EXTENSION_SPEC
static final int FILE_EXTENSION_SPEC
File spec type constant, indicating a file extension specification.- See Also:
- Constant Field Values
-
FILE_NAME_SPEC
static final int FILE_NAME_SPEC
File spec type constant, indicating a file name specification.- See Also:
- Constant Field Values
-
FILE_PATTERN_SPEC
static final int FILE_PATTERN_SPEC
File spec type constant, indicating a file pattern specification- Since:
- 3.7
- See Also:
- Constant Field Values
-
-
Method Detail
-
addFileSpec
void addFileSpec(String fileSpec, int type) throws CoreException
Adds a user-defined file specification to the corresponding content type. Has no effect if the given file specification is already defined.- Parameters:
fileSpec
- the file specificationtype
- the type of the file specification. One ofFILE_NAME_SPEC
,FILE_EXTENSION_SPEC
,FILE_PATTERN_SPEC
.- Throws:
IllegalArgumentException
- if the type bit mask is incorrectCoreException
- if this method fails. Reasons include:- An error occurred persisting this setting.
- See Also:
FILE_NAME_SPEC
,FILE_EXTENSION_SPEC
,FILE_PATTERN_SPEC
-
getDefaultCharset
String getDefaultCharset()
Returns the default charset for the corresponding content type if it has been set, ornull
otherwise.- Returns:
- the default charset, or
null
-
getFileSpecs
String[] getFileSpecs(int type)
Returns the file specifications for the corresponding content type. The type mask is a bit-wise or of file specification type constants indicating the file specification types of interest.- Parameters:
type
- a bit-wise or of file specification type constants. Valid flags are one ofFILE_EXTENSION_SPEC
orFILE_NAME_SPEC
- Returns:
- the file specification
- See Also:
FILE_NAME_SPEC
,FILE_EXTENSION_SPEC
-
getId
String getId()
Returns the corresponding content type's unique identifier. Each content type has an identifier by which they can be retrieved from the content type catalog.- Returns:
- the content type unique identifier
-
removeFileSpec
void removeFileSpec(String fileSpec, int type) throws CoreException
Removes a user-defined file specification from the corresponding content type. Has no effect if the given file specification was not defined by the user.- Parameters:
fileSpec
- the file specificationtype
- the type of the file specification. One ofFILE_NAME_SPEC
,FILE_EXTENSION_SPEC
.- Throws:
IllegalArgumentException
- if the type bit mask is incorrectCoreException
- if this method fails. Reasons include:- An error occurred persisting this setting.
- See Also:
FILE_NAME_SPEC
,FILE_EXTENSION_SPEC
-
setDefaultCharset
void setDefaultCharset(String userCharset) throws CoreException
Sets the default charset for the corresponding content type. Ifnull
is provided, restores the pre-defined default charset.- Parameters:
userCharset
- the new charset for the content type, ornull
- Throws:
CoreException
- if this method fails. Reasons include:- An error occurred persisting this setting.
-
isUserDefined
boolean isUserDefined()
- Returns:
- whether the content-type was defined via user action, using
IContentTypeManager.addContentType(String, String, IContentType)
- Since:
- 3.6
-
-