Eclipse Platform
Release 3.1

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)

Field Summary
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.
 
Method Summary
 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, or null otherwise.
 String[] getFileSpecs(int type)
          Returns the file specifications for the corresponding content type.
 String getId()
          Returns the corresponding content type's unique identifier.
 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

public static final int FILE_EXTENSION_SPEC
File spec type constant, indicating a file extension specification.

See Also:
Constant Field Values

FILE_NAME_SPEC

public static final int FILE_NAME_SPEC
File spec type constant, indicating a file name specification.

See Also:
Constant Field Values
Method Detail

addFileSpec

public 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 specification
type - the type of the file specification. One of FILE_NAME_SPEC, FILE_EXTENSION_SPEC.
Throws:
IllegalArgumentException - if the type bit mask is incorrect
CoreException - if this method fails. Reasons include:
  • An error occurred persisting this setting.
See Also:
FILE_NAME_SPEC, FILE_EXTENSION_SPEC

getDefaultCharset

public String getDefaultCharset()
Returns the default charset for the corresponding content type if it has been set, or null otherwise.

Returns:
the default charset, or null

getFileSpecs

public 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 of FILE_EXTENSION_SPEC or FILE_NAME_SPEC
Returns:
the file specification
See Also:
FILE_NAME_SPEC, FILE_EXTENSION_SPEC

getId

public 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

public 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 specification
type - the type of the file specification. One of FILE_NAME_SPEC, FILE_EXTENSION_SPEC.
Throws:
IllegalArgumentException - if the type bit mask is incorrect
CoreException - if this method fails. Reasons include:
  • An error occurred persisting this setting.
See Also:
FILE_NAME_SPEC, FILE_EXTENSION_SPEC

setDefaultCharset

public void setDefaultCharset(String userCharset)
                       throws CoreException
Sets the default charset for the corresponding content type. If null is provided, restores the pre-defined default charset.

Parameters:
userCharset - the new charset for the content type, or null
Throws:
CoreException - if this method fails. Reasons include:
  • An error occurred persisting this setting.

Eclipse Platform
Release 3.1

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.