Package org.eclipse.cdt.core
Class CCorePlugin
java.lang.Object
org.eclipse.core.runtime.Plugin
org.eclipse.cdt.core.CCorePlugin
- All Implemented Interfaces:
org.osgi.framework.BundleActivator
public class CCorePlugin
extends org.eclipse.core.runtime.Plugin
CCorePlugin is the life-cycle owner of the core plug-in, and starting point
for access to many core APIs.
- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final int
org.eclipse.cdt.internal.core.CDTLogWriter
static final String
Name of the extension point for contributing a Command Launcher factorystatic final String
Full unique name of the extension point for contributing a Command Launcher factorystatic final String
IContentType id for ASM Unitstatic final String
IContentType id for Binary Filesstatic final String
IContentType id for C Header Unitstatic final String
IContentType id for C Source Unitstatic final String
IContentType id for C++ Header Unitstatic final String
IContentType id for C++ Source Unitstatic final String
Possible configurable option ID.static final String
static final String
static final String
static final String
static final String
static final String
Possible configurable option value.static final String
Name of the extension point for contributing an error parserstatic final String
Full unique name of the extension point for contributing an error parserstatic final String
Name of the extension point for contributing a source code formatterstatic final String
static final String
static final String
static final String
static final String
Possible configurable option value.static final String
static final String
static final String
static final String
static final String
Possible configurable option value.static final int
Toolchain not found when inflating a build configuration.static final int
static final int
static final int
Status code for core exception that is thrown if a pdom grew larger than the supported limit.static final String
Possible configurable option value.Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Configure the plug-in with respect to option settings defined in ".options" filevoid
convertProjectFromCtoCC
(org.eclipse.core.resources.IProject projectHandle, org.eclipse.core.runtime.IProgressMonitor monitor) Method convertProjectFromCtoCC converts a C Project to a C++ Project The newProject MUST, not be null, already have a C Nature && must NOT already have a C++ Naturevoid
convertProjectToC
(org.eclipse.core.resources.IProject projectHandle, org.eclipse.core.runtime.IProgressMonitor monitor, String projectID) Method to convert a project to a C nature All checks should have been done externally (as in the Conversion Wizards).void
convertProjectToCC
(org.eclipse.core.resources.IProject projectHandle, org.eclipse.core.runtime.IProgressMonitor monitor, String projectID) Method to convert a project to a C++ naturevoid
convertProjectToNewC
(org.eclipse.core.resources.IProject projectHandle, String bsId, org.eclipse.core.runtime.IProgressMonitor monitor) void
convertProjectToNewCC
(org.eclipse.core.resources.IProject projectHandle, String bsId, org.eclipse.core.runtime.IProgressMonitor monitor) org.eclipse.core.resources.IProject
createCDTProject
(org.eclipse.core.resources.IProjectDescription description, org.eclipse.core.resources.IProject projectHandle, String bsId, org.eclipse.core.runtime.IProgressMonitor monitor) org.eclipse.core.resources.IProject
createCDTProject
(org.eclipse.core.resources.IProjectDescription description, org.eclipse.core.resources.IProject projectHandle, org.eclipse.core.runtime.IProgressMonitor monitor) org.eclipse.core.resources.IProject
createCProject
(org.eclipse.core.resources.IProjectDescription description, org.eclipse.core.resources.IProject projectHandle, org.eclipse.core.runtime.IProgressMonitor monitor, String projectID) Creates a C project resource given the project handle and description.createProjectDescription
(org.eclipse.core.resources.IProject project, boolean loadIfExists) Equivalent tocreateProjectDescription(IProject, boolean, false)
.createProjectDescription
(org.eclipse.core.resources.IProject project, boolean loadIfExists, boolean creating) Creates and returns a writable project description.static org.eclipse.core.runtime.IStatus
createStatus
(String msg) static org.eclipse.core.runtime.IStatus
createStatus
(String msg, Throwable e) String[]
Deprecated.since CDT 6.1.Returns the binary parser with the given id.getBinaryParser
(org.eclipse.core.resources.IProject project) Deprecated.- use getBinaryParserExtensions(IProject project)getBinaryParserExtensions
(org.eclipse.core.resources.IProject project) Deprecated.UsegetDefaultBinaryParserExtensions(IProject)
instead.getBuildConsole
(String contextId, String name, URL iconUrl) Create CDT console adapter for build console.Deprecated.Settings should be set per ICConfigurationDescription rather than global to the project.static org.osgi.framework.Version
Return the version of the CDT feature in this Eclipse installation, if any.Create CDT console adapter connected to the default build console.getConsole
(String id) Create CDT console adapter.getConsole
(String extConsoleId, String contextId, String name, URL iconUrl) Create CDT console adapter for build console defined as an extension.static org.eclipse.core.runtime.content.IContentType
getContentType
(String filename) Helper function, returning the content type for a filename Same as:static org.eclipse.core.runtime.content.IContentType
getContentType
(org.eclipse.core.resources.IProject project, String filename) Returns the content type for a filename.getCProjectDescription
(org.eclipse.core.resources.IProject project) Deprecated.usegetProjectDescription(IProject, boolean)
insteadgetCProjectDescription
(org.eclipse.core.resources.IProject project, boolean create) Deprecated.static CCorePlugin
getDefaultBinaryParserExtensions
(org.eclipse.core.resources.IProject project) Returns the binary parser extensions for the default settings configuration.TODO: Add all options here Returns a table of all known configurable options with their default values.getDOM()
Deprecated.useITranslationUnit
orILanguage
to construct ASTs, instead.getErrorParser
(String id) Deprecated.since CDT 6.1.static String
getFormattedString
(String key, String arg) static String
getFormattedString
(String key, String[] args) static IIndexManager
static String
Helper method for returning one option value only.Returns the table of the current options.static IPDOMManager
Deprecated.use getIndexManager().static IPositionTrackerManager
getPreferenceConfiguration
(String buildSystemId) getPreferenceConfiguration
(String buildSystemId, boolean write) Get the IProcessList contributed interface for the platform.getProjectDescription
(org.eclipse.core.resources.IProject project) Returns the project description associated with this project or null if the project does not contain the CDT data associated with it.getProjectDescription
(org.eclipse.core.resources.IProject project, boolean write) Returns the project description associated with this project or null if the project does not contain the CDT data associated with it.static ResourceBundle
static String
getResourceString
(String key) getScannerInfoProvider
(org.eclipse.core.resources.IProject project) static <T> T
getService
(Class<T> service) Return the given OSGi service.static IWorkingCopy[]
Returns the shared working copies currently registered for the default buffer factory.static ITagService
static IUserVarSupplier
static org.eclipse.core.resources.IWorkspace
boolean
Answers whether the given project is a new-style project, i.e.boolean
isNewStyleProject
(org.eclipse.core.resources.IProject project) Answers whether the given project is a new-style project, i.e.static void
Prints a message in the logstatic void
static void
static void
static void
log
(org.eclipse.core.runtime.IStatus status) static void
logStackTrace
(int severity, String msg) Prints a message in the log accompanied by stack tracevoid
mapCProjectOwner
(org.eclipse.core.resources.IProject project, String id, boolean override) void
resetCachedScannerInfoProvider
(org.eclipse.core.resources.IProject project) Clears cached scanner info provider for the given project so that the next call togetScannerInfoProvider(IProject)
would return an up to date scanner info provider.static void
setOptions
(HashMap<String, String> newOptions) Sets the current table of options.void
setPreferenceConfiguration
(String buildSystemId, ICConfigurationDescription des) void
setProjectDescription
(org.eclipse.core.resources.IProject project, ICProjectDescription des) Called to save/apply the project description.void
setProjectDescription
(org.eclipse.core.resources.IProject project, ICProjectDescription des, boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) void
setStructuralParseMode
(boolean useNewParser) static void
setUseProjectSpecificContentTypes
(org.eclipse.core.resources.IProject project, boolean val) Enables or disables the project specific content types.static boolean
Returns the preference controlling whether source roots are shown at the top of projects or embedded within the resource tree of projects when they are not top level folders.void
start
(org.osgi.framework.BundleContext context) void
stop
(org.osgi.framework.BundleContext context) void
updateProjectDescriptions
(org.eclipse.core.resources.IProject[] projects, org.eclipse.core.runtime.IProgressMonitor monitor) Forces the cached data of the specified projects to be re-calculated.static boolean
usesProjectSpecificContentTypes
(org.eclipse.core.resources.IProject project) Tests whether the given project uses its project specific content types.boolean
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getLog, getPluginPreferences, getStateLocation, initializeDefaultPluginPreferences, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, shutdown, startup, toString
-
Field Details
-
STATUS_CDTPROJECT_EXISTS
public static final int STATUS_CDTPROJECT_EXISTS- See Also:
-
STATUS_CDTPROJECT_MISMATCH
public static final int STATUS_CDTPROJECT_MISMATCH- See Also:
-
CDT_PROJECT_NATURE_ID_MISMATCH
public static final int CDT_PROJECT_NATURE_ID_MISMATCH- See Also:
-
STATUS_PDOM_TOO_LARGE
public static final int STATUS_PDOM_TOO_LARGEStatus code for core exception that is thrown if a pdom grew larger than the supported limit.- Since:
- 5.2
- See Also:
-
STATUS_BUILD_CONFIG_NOT_VALID
public static final int STATUS_BUILD_CONFIG_NOT_VALIDToolchain not found when inflating a build configuration.- Since:
- 6.4
- See Also:
-
PLUGIN_ID
- See Also:
-
BUILDER_MODEL_ID
- See Also:
-
BINARY_PARSER_SIMPLE_ID
- See Also:
-
BINARY_PARSER_UNIQ_ID
- See Also:
-
PREF_BINARY_PARSER
- See Also:
-
DEFAULT_BINARY_PARSER_SIMPLE_ID
- See Also:
-
DEFAULT_BINARY_PARSER_UNIQ_ID
- See Also:
-
PREF_USE_STRUCTURAL_PARSE_MODE
- See Also:
-
INDEX_SIMPLE_ID
- See Also:
-
INDEX_UNIQ_ID
- See Also:
-
INDEXER_SIMPLE_ID
- See Also:
-
INDEXER_UNIQ_ID
- See Also:
-
PREF_INDEXER
- See Also:
-
DEFAULT_INDEXER
- See Also:
-
ERROR_PARSER_SIMPLE_ID
Name of the extension point for contributing an error parser- See Also:
-
ERROR_PARSER_UNIQ_ID
Full unique name of the extension point for contributing an error parser- See Also:
-
COMMAND_LAUNCHER_FACTORY_SIMPLE_ID
Name of the extension point for contributing a Command Launcher factory- Since:
- 6.4
- See Also:
-
COMMAND_LAUNCHER_FACTORY_UNIQ_ID
Full unique name of the extension point for contributing a Command Launcher factory- Since:
- 6.4
- See Also:
-
DEFAULT_PATHENTRY_STORE_ID
- See Also:
-
BUILD_SCANNER_INFO_SIMPLE_ID
- See Also:
-
BUILD_SCANNER_INFO_UNIQ_ID
- See Also:
-
DEFAULT_PROVIDER_ID
- See Also:
-
FORMATTER_EXTPOINT_ID
Name of the extension point for contributing a source code formatter- See Also:
-
CORE_ENCODING
Possible configurable option ID.- See Also:
-
CONTENT_TYPE_CSOURCE
IContentType id for C Source Unit- See Also:
-
CONTENT_TYPE_CHEADER
IContentType id for C Header Unit- See Also:
-
CONTENT_TYPE_CXXSOURCE
IContentType id for C++ Source Unit- See Also:
-
CONTENT_TYPE_CXXHEADER
IContentType id for C++ Header Unit- See Also:
-
CONTENT_TYPE_ASMSOURCE
IContentType id for ASM Unit- See Also:
-
CONTENT_TYPE_BINARYFILE
IContentType id for Binary Files- See Also:
-
INSERT
Possible configurable option value.- See Also:
-
DO_NOT_INSERT
Possible configurable option value.- See Also:
-
TAB
Possible configurable option value.- See Also:
-
SPACE
Possible configurable option value.- See Also:
-
cdtLog
public org.eclipse.cdt.internal.core.CDTLogWriter cdtLog- Restriction:
- This field is not intended to be referenced by clients.
-
-
Constructor Details
-
CCorePlugin
public CCorePlugin()- Restriction:
- This constructor is not intended to be referenced by clients.
-
-
Method Details
-
getResourceString
-
getWorkspace
public static org.eclipse.core.resources.IWorkspace getWorkspace() -
getFormattedString
-
getFormattedString
-
getResourceBundle
-
getPositionTrackerManager
-
getDefault
-
stop
- Specified by:
stop
in interfaceorg.osgi.framework.BundleActivator
- Overrides:
stop
in classorg.eclipse.core.runtime.Plugin
- Throws:
Exception
- See Also:
-
Plugin.shutdown()
-
start
- Specified by:
start
in interfaceorg.osgi.framework.BundleActivator
- Overrides:
start
in classorg.eclipse.core.runtime.Plugin
- Throws:
Exception
- See Also:
-
Plugin.startup()
-
getDefaultOptions
TODO: Add all options here Returns a table of all known configurable options with their default values. These options allow to configure the behavior of the underlying components. The client may safely use the result as a template that they can modify and then pass tosetOptions
. Helper constants have been defined on CCorePlugin for each of the option ID and their possible constant values. Note: more options might be added in further releases.RECOGNIZED OPTIONS: CORE / Specify Default Source Encoding Format Get the encoding format for translated sources. This setting is read-only, it is equivalent to 'ResourcesPlugin.getEncoding()'. - option id: "org.eclipse.cdt.core.encoding" - possible values: { any of the supported encoding names}. - default:
- Returns:
- a mutable map containing the default settings of all known
options (key type:
String
; value type:String
) - See Also:
-
getOption
Helper method for returning one option value only. Equivalent to(String)CCorePlugin.getOptions().get(optionName)
Note that it may answernull
if this option does not exist.For a complete description of the configurable options, see
getDefaultOptions
.- Parameters:
optionName
- the name of an option- Returns:
- the String value of a given option
- See Also:
-
getOptions
Returns the table of the current options. Initially, all options have their default values, and this method returns a table that includes all known options.For a complete description of the configurable options, see
getDefaultOptions
.- Returns:
- table of current settings of all options (key type:
String
; value type:String
) - See Also:
-
setOptions
Sets the current table of options. All and only the options explicitly included in the given table are remembered; all previous option settings are forgotten, including ones not explicitly mentioned.For a complete description of the configurable options, see
getDefaultOptions
.- Parameters:
newOptions
- the new options (key type:String
; value type:String
), ornull
to reset all options to their default values- See Also:
-
getConsole
Create CDT console adapter for build console defined as an extension. Seeorg.eclipse.cdt.core.CBuildConsole
extension point. If the console class is instance ofICConsole
it is initialized with context id, name and icon to be shown in the list of consoles in the Console view.- Parameters:
extConsoleId
- - console id defined in the extension point.contextId
- - context menu id in the Console view. A caller needs to define a distinct one for own use.name
- - name of console to appear in the list of consoles in context menu in the Console view.iconUrl
- - aURL
of the icon for the context menu of the Console view. The url is expected to point to an image in eclipse OSGi bundle. Here is an example how to retrieve URL:
URL iconUrl = CUIPlugin.getDefault().getBundle().getEntry("icons/obj16/flask.png");
- Returns:
- CDT console adapter.
- Since:
- 5.4
-
getConsole
Create CDT console adapter. The adapter serves as a bridge between core plugin and UI console API in a way that a user can create a UI console from plugins having no dependencies to UI.- Parameters:
id
- - id of the console specified in extension point to instantiate console adapter.- Returns:
- CDT console adapter.
-
getBuildConsole
Create CDT console adapter for build console. A new instance of classorg.eclipse.cdt.internal.ui.buildconsole.CBuildConsole
is created and initialized with the parameters.- Parameters:
contextId
- - context menu id in the Console view. A caller needs to define a distinct one for own use.name
- - name of console to appear in the list of consoles in context menu in the Console view.iconUrl
- - aURL
of the icon for the context menu of the Console view. The url is expected to point to an image in eclipse OSGi bundle. Here is an example how to retrieve URL:
URL iconUrl = CUIPlugin.getDefault().getBundle().getResource("icons/obj16/flask.png");
iconUrl
can be null, in that case the default image is used. Seeorg.eclipse.cdt.internal.ui.buildconsole.BuildConsole(IBuildConsoleManager, String, String, URL)
- Returns:
- CDT console adapter.
- Since:
- 5.3
-
getConsole
Create CDT console adapter connected to the default build console. -
getBinaryParserExtensions
@Deprecated public ICExtensionReference[] getBinaryParserExtensions(org.eclipse.core.resources.IProject project) throws org.eclipse.core.runtime.CoreException Deprecated.UsegetDefaultBinaryParserExtensions(IProject)
instead.- Throws:
org.eclipse.core.runtime.CoreException
-
getDefaultBinaryParserExtensions
public ICConfigExtensionReference[] getDefaultBinaryParserExtensions(org.eclipse.core.resources.IProject project) throws org.eclipse.core.runtime.CoreException Returns the binary parser extensions for the default settings configuration.- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 5.2
-
getBinaryParser
@Deprecated public IBinaryParser[] getBinaryParser(org.eclipse.core.resources.IProject project) throws org.eclipse.core.runtime.CoreException Deprecated.- use getBinaryParserExtensions(IProject project)- Throws:
org.eclipse.core.runtime.CoreException
-
getDefaultBinaryParser
- Throws:
org.eclipse.core.runtime.CoreException
-
getBinaryParser
Returns the binary parser with the given id.- Parameters:
id
- id of binary parser- Returns:
- binary parser
- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 6.0
-
getCoreModel
-
getIndexManager
-
getTagService
- Since:
- 5.5
-
getPathEntryVariableManager
-
getCProjectDescription
@Deprecated public ICDescriptor getCProjectDescription(org.eclipse.core.resources.IProject project) throws org.eclipse.core.runtime.CoreException Deprecated.usegetProjectDescription(IProject, boolean)
instead- Throws:
org.eclipse.core.runtime.CoreException
-
getCProjectDescription
@Deprecated public ICDescriptor getCProjectDescription(org.eclipse.core.resources.IProject project, boolean create) throws org.eclipse.core.runtime.CoreException Deprecated.Please usegetProjectDescription(IProject, boolean)
to fetch the ICProjectDescription for the project. And useICProjectDescription.getConfigurations()
to get an array of ICConfigurationDescriptions, which have similar API to ICDescriptor, allowing you to store settings and configure extensions at the Configuration level rather than at the project level.- Parameters:
project
-create
-- Returns:
- ICDescriptor or null if create is false and no .cdtproject file exists on disk.
- Throws:
org.eclipse.core.runtime.CoreException
-
mapCProjectOwner
public void mapCProjectOwner(org.eclipse.core.resources.IProject project, String id, boolean override) throws org.eclipse.core.runtime.CoreException - Throws:
org.eclipse.core.runtime.CoreException
-
getCDescriptorManager
Deprecated.Settings should be set per ICConfigurationDescription rather than global to the project. Please usegetProjectDescription(IProject, boolean)
to fetch the ICProjectDescription for the project. And useICProjectDescription.getConfigurations()
to get an array of ICConfigurationDescriptions, which have similar API to ICDescriptor, allowing you to store settings and configure extensions at the Configuration level rather than at the project level. -
createCProject
public org.eclipse.core.resources.IProject createCProject(org.eclipse.core.resources.IProjectDescription description, org.eclipse.core.resources.IProject projectHandle, org.eclipse.core.runtime.IProgressMonitor monitor, String projectID) throws org.eclipse.core.runtime.CoreException, org.eclipse.core.runtime.OperationCanceledException Creates a C project resource given the project handle and description.- Parameters:
description
- the project description to create a project resource forprojectHandle
- the project handle to create a project resource formonitor
- the progress monitor to show visual progress withprojectID
- required for mapping the project to an owner- Throws:
org.eclipse.core.runtime.CoreException
- if the operation failsorg.eclipse.core.runtime.OperationCanceledException
- if the operation is canceled
-
createCDTProject
public org.eclipse.core.resources.IProject createCDTProject(org.eclipse.core.resources.IProjectDescription description, org.eclipse.core.resources.IProject projectHandle, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException, org.eclipse.core.runtime.OperationCanceledException - Throws:
org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.OperationCanceledException
-
createCDTProject
public org.eclipse.core.resources.IProject createCDTProject(org.eclipse.core.resources.IProjectDescription description, org.eclipse.core.resources.IProject projectHandle, String bsId, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException, org.eclipse.core.runtime.OperationCanceledException - Throws:
org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.OperationCanceledException
-
convertProjectFromCtoCC
public void convertProjectFromCtoCC(org.eclipse.core.resources.IProject projectHandle, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Method convertProjectFromCtoCC converts a C Project to a C++ Project The newProject MUST, not be null, already have a C Nature && must NOT already have a C++ Nature- Parameters:
projectHandle
-monitor
-- Throws:
org.eclipse.core.runtime.CoreException
-
convertProjectToC
public void convertProjectToC(org.eclipse.core.resources.IProject projectHandle, org.eclipse.core.runtime.IProgressMonitor monitor, String projectID) throws org.eclipse.core.runtime.CoreException Method to convert a project to a C nature All checks should have been done externally (as in the Conversion Wizards). This method blindly does the conversion.- Throws:
org.eclipse.core.runtime.CoreException
-
convertProjectToNewC
public void convertProjectToNewC(org.eclipse.core.resources.IProject projectHandle, String bsId, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException - Throws:
org.eclipse.core.runtime.CoreException
-
convertProjectToCC
public void convertProjectToCC(org.eclipse.core.resources.IProject projectHandle, org.eclipse.core.runtime.IProgressMonitor monitor, String projectID) throws org.eclipse.core.runtime.CoreException Method to convert a project to a C++ nature- Throws:
org.eclipse.core.runtime.CoreException
-
convertProjectToNewCC
public void convertProjectToNewCC(org.eclipse.core.resources.IProject projectHandle, String bsId, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException - Throws:
org.eclipse.core.runtime.CoreException
-
getProcessList
Get the IProcessList contributed interface for the platform.- Returns:
- IProcessList
- Throws:
org.eclipse.core.runtime.CoreException
-
getAllErrorParsersIDs
Deprecated.since CDT 6.1. UseErrorParserManager.getErrorParserAvailableIds()
instead -
getErrorParser
Deprecated.since CDT 6.1. UseErrorParserManager.getErrorParserCopy(String)
instead -
getScannerInfoProvider
-
resetCachedScannerInfoProvider
public void resetCachedScannerInfoProvider(org.eclipse.core.resources.IProject project) Clears cached scanner info provider for the given project so that the next call togetScannerInfoProvider(IProject)
would return an up to date scanner info provider.- Restriction:
- This method is not intended to be referenced by clients.
-
getContentType
Helper function, returning the content type for a filename Same as:getContentType(null, filename)
- Parameters:
filename
-- Returns:
- the content type found, or
null
-
getContentType
public static org.eclipse.core.runtime.content.IContentType getContentType(org.eclipse.core.resources.IProject project, String filename) Returns the content type for a filename. The method respects project specific content type definitions. The lookup prefers case- sensitive matches over the others.- Parameters:
project
- a project with possible project specific settings. Can benull
filename
- a filename to compute the content type for- Returns:
- the content type found or
null
-
usesProjectSpecificContentTypes
public static boolean usesProjectSpecificContentTypes(org.eclipse.core.resources.IProject project) Tests whether the given project uses its project specific content types. -
setUseProjectSpecificContentTypes
public static void setUseProjectSpecificContentTypes(org.eclipse.core.resources.IProject project, boolean val) Enables or disables the project specific content types. -
configurePluginDebugOptions
public void configurePluginDebugOptions()Configure the plug-in with respect to option settings defined in ".options" file -
setStructuralParseMode
public void setStructuralParseMode(boolean useNewParser) -
useStructuralParseMode
public boolean useStructuralParseMode() -
getDOM
Deprecated.useITranslationUnit
orILanguage
to construct ASTs, instead.- Restriction:
- This method is not intended to be referenced by clients.
-
getCdtVariableManager
-
getBuildEnvironmentManager
-
getPreferenceConfiguration
public ICConfigurationDescription getPreferenceConfiguration(String buildSystemId) throws org.eclipse.core.runtime.CoreException - Throws:
org.eclipse.core.runtime.CoreException
-
getPreferenceConfiguration
public ICConfigurationDescription getPreferenceConfiguration(String buildSystemId, boolean write) throws org.eclipse.core.runtime.CoreException - Throws:
org.eclipse.core.runtime.CoreException
-
setPreferenceConfiguration
public void setPreferenceConfiguration(String buildSystemId, ICConfigurationDescription des) throws org.eclipse.core.runtime.CoreException - Throws:
org.eclipse.core.runtime.CoreException
-
createProjectDescription
public ICProjectDescription createProjectDescription(org.eclipse.core.resources.IProject project, boolean loadIfExists) throws org.eclipse.core.runtime.CoreException Equivalent tocreateProjectDescription(IProject, boolean, false)
.- Throws:
org.eclipse.core.runtime.CoreException
- See Also:
-
createProjectDescription
public ICProjectDescription createProjectDescription(org.eclipse.core.resources.IProject project, boolean loadIfExists, boolean creating) throws org.eclipse.core.runtime.CoreException Creates and returns a writable project description.- Parameters:
project
- project for which the project description is requestedloadIfExists
- if true the method first tries to load and return the project description from the settings file (.cproject), if false, the stored settings are ignored and the new (empty) project description is createdcreating
- if true the created project description will be contain the true "isCdtProjectCreating" state.
NOTE: in case the project already contains the project description AND its "isCdtProjectCreating" is false the resulting description will be created with the false "isCdtProjectCreating" state.
NOTE: changes made to the returned project description will not be applied until thesetProjectDescription(IProject, ICProjectDescription)
is called.- Returns:
ICProjectDescription
- Throws:
org.eclipse.core.runtime.CoreException
-
getProjectDescription
Returns the project description associated with this project or null if the project does not contain the CDT data associated with it. This is a convenience method fully equivalent to getProjectDescription(project, true) seegetProjectDescription(IProject, boolean)
for more detail.- Parameters:
project
-- Returns:
- a writable copy of the ICProjectDescription or null if the
project does not contain the CDT data associated with it.
Note: changes to the project description will not be reflected/used by the core until thesetProjectDescription(IProject, ICProjectDescription)
is called. - See Also:
-
setProjectDescription
public void setProjectDescription(org.eclipse.core.resources.IProject project, ICProjectDescription des) throws org.eclipse.core.runtime.CoreException Called to save/apply the project description. The method should be called to apply changes made to the project description returned by thegetProjectDescription(IProject, boolean)
orcreateProjectDescription(IProject, boolean)
- Parameters:
project
-des
-- Throws:
org.eclipse.core.runtime.CoreException
- See Also:
-
setProjectDescription
public void setProjectDescription(org.eclipse.core.resources.IProject project, ICProjectDescription des, boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException - Throws:
org.eclipse.core.runtime.CoreException
-
getProjectDescription
public ICProjectDescription getProjectDescription(org.eclipse.core.resources.IProject project, boolean write) Returns the project description associated with this project or null if the project does not contain the CDT data associated with it.- Parameters:
project
- project for which the description is requestedwrite
- if true, the writable description copy is returned. If false the cached read-only description is returned.
CDT core maintains the cached project description settings. If only read access is needed to description, then the read-only project description should be obtained. This description always operates with cached data and thus it is better to use it for performance reasons. All set* calls to the read-only description result in theWriteAccessException
. When the writable description is requested, the description copy is created. Changes to this description will not be reflected/used by the core and the Build System until thesetProjectDescription(IProject, ICProjectDescription)
is called. Each getProjectDescription(project, true) returns a new copy of the project description. The writable description uses the cached data until the first set call after that the description communicates directly to the Build System i.e. the implementer of the org.eclipse.cdt.core.CConfigurationDataProvider extension This ensures the Core<->Build System settings integrity.- Returns:
ICProjectDescription
or null if the project does not contain the CDT data associated with it.
-
updateProjectDescriptions
public void updateProjectDescriptions(org.eclipse.core.resources.IProject[] projects, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Forces the cached data of the specified projects to be re-calculated.- Parameters:
projects
- ifnull
, all projects within the workspace are updatedmonitor
-- Throws:
org.eclipse.core.runtime.CoreException
-
isNewStyleProject
public boolean isNewStyleProject(org.eclipse.core.resources.IProject project) Answers whether the given project is a new-style project, i.e. CConfigurationDataProvider-driven. -
isNewStyleProject
Answers whether the given project is a new-style project, i.e. CConfigurationDataProvider-driven -
getProjectDescriptionManager
-
getUserVarSupplier
- Returns:
- editable User-variable's supplier
-
log
- Restriction:
- This method is not intended to be referenced by clients.
-
log
Prints a message in the log- Parameters:
severity
- - desired severity of the message in the log, one ofIStatus.INFO
,IStatus.WARNING
orIStatus.ERROR
msg
- - message- Since:
- 5.5
- Restriction:
- This method is not intended to be referenced by clients.
-
logStackTrace
Prints a message in the log accompanied by stack trace- Parameters:
severity
- - desired severity of the message in the log, one ofIStatus.INFO
,IStatus.WARNING
orIStatus.ERROR
msg
- - message- Since:
- 5.5
- Restriction:
- This method is not intended to be referenced by clients.
-
log
- Restriction:
- This method is not intended to be referenced by clients.
-
log
- Restriction:
- This method is not intended to be referenced by clients.
-
createStatus
- Restriction:
- This method is not intended to be referenced by clients.
-
createStatus
- Restriction:
- This method is not intended to be referenced by clients.
-
log
public static void log(org.eclipse.core.runtime.IStatus status) - Restriction:
- This method is not intended to be referenced by clients.
-
getPDOMManager
Deprecated.use getIndexManager().- Restriction:
- This method is not intended to be referenced by clients.
-
showSourceRootsAtTopOfProject
public static boolean showSourceRootsAtTopOfProject()Returns the preference controlling whether source roots are shown at the top of projects or embedded within the resource tree of projects when they are not top level folders.- Returns:
- boolean preference value
- Since:
- 5.2
-
getService
Return the given OSGi service.- Parameters:
service
- service class- Returns:
- service
- Since:
- 6.0
-
getCDTFeatureVersion
public static org.osgi.framework.Version getCDTFeatureVersion()Return the version of the CDT feature in this Eclipse installation, if any. Note that, while this is a method in CCorePlugin, it's not specific to the org.eclipse.cdt.core plugin; it returns the version of the entire org.eclipse.cdt feature.- Since:
- 6.3