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
Fields Modifier and Type Field Description static String
BINARY_PARSER_SIMPLE_ID
static String
BINARY_PARSER_UNIQ_ID
static String
BUILD_SCANNER_INFO_SIMPLE_ID
static String
BUILD_SCANNER_INFO_UNIQ_ID
static String
BUILDER_MODEL_ID
static int
CDT_PROJECT_NATURE_ID_MISMATCH
org.eclipse.cdt.internal.core.CDTLogWriter
cdtLog
static String
COMMAND_LAUNCHER_FACTORY_SIMPLE_ID
Name of the extension point for contributing a Command Launcher factorystatic String
COMMAND_LAUNCHER_FACTORY_UNIQ_ID
Full unique name of the extension point for contributing a Command Launcher factorystatic String
CONTENT_TYPE_ASMSOURCE
IContentType id for ASM Unitstatic String
CONTENT_TYPE_BINARYFILE
IContentType id for Binary Filesstatic String
CONTENT_TYPE_CHEADER
IContentType id for C Header Unitstatic String
CONTENT_TYPE_CSOURCE
IContentType id for C Source Unitstatic String
CONTENT_TYPE_CXXHEADER
IContentType id for C++ Header Unitstatic String
CONTENT_TYPE_CXXSOURCE
IContentType id for C++ Source Unitstatic String
CORE_ENCODING
Possible configurable option ID.static String
DEFAULT_BINARY_PARSER_SIMPLE_ID
static String
DEFAULT_BINARY_PARSER_UNIQ_ID
static String
DEFAULT_INDEXER
static String
DEFAULT_PATHENTRY_STORE_ID
static String
DEFAULT_PROVIDER_ID
static String
DO_NOT_INSERT
Possible configurable option value.static String
ERROR_PARSER_SIMPLE_ID
Name of the extension point for contributing an error parserstatic String
ERROR_PARSER_UNIQ_ID
Full unique name of the extension point for contributing an error parserstatic String
FORMATTER_EXTPOINT_ID
Name of the extension point for contributing a source code formatterstatic String
INDEX_SIMPLE_ID
static String
INDEX_UNIQ_ID
static String
INDEXER_SIMPLE_ID
static String
INDEXER_UNIQ_ID
static String
INSERT
Possible configurable option value.static String
PLUGIN_ID
static String
PREF_BINARY_PARSER
static String
PREF_INDEXER
static String
PREF_USE_STRUCTURAL_PARSE_MODE
static String
SPACE
Possible configurable option value.static int
STATUS_BUILD_CONFIG_NOT_VALID
Toolchain not found when inflating a build configuration.static int
STATUS_CDTPROJECT_EXISTS
static int
STATUS_CDTPROJECT_MISMATCH
static int
STATUS_PDOM_TOO_LARGE
Status code for core exception that is thrown if a pdom grew larger than the supported limit.static String
TAB
Possible configurable option value.
-
Constructor Summary
Constructors Constructor Description CCorePlugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
configurePluginDebugOptions()
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.ICProjectDescription
createProjectDescription(org.eclipse.core.resources.IProject project, boolean loadIfExists)
Equivalent tocreateProjectDescription(IProject, boolean, false)
.ICProjectDescription
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[]
getAllErrorParsersIDs()
Deprecated.since CDT 6.1.IBinaryParser
getBinaryParser(String id)
Returns the binary parser with the given id.IBinaryParser[]
getBinaryParser(org.eclipse.core.resources.IProject project)
Deprecated.- use getBinaryParserExtensions(IProject project)ICExtensionReference[]
getBinaryParserExtensions(org.eclipse.core.resources.IProject project)
Deprecated.UsegetDefaultBinaryParserExtensions(IProject)
instead.IConsole
getBuildConsole(String contextId, String name, URL iconUrl)
Create CDT console adapter for build console.IEnvironmentVariableManager
getBuildEnvironmentManager()
ICDescriptorManager
getCDescriptorManager()
Deprecated.Settings should be set per ICConfigurationDescription rather than global to the project.static org.osgi.framework.Version
getCDTFeatureVersion()
Return the version of the CDT feature in this Eclipse installation, if any.ICdtVariableManager
getCdtVariableManager()
IConsole
getConsole()
Create CDT console adapter connected to the default build console.IConsole
getConsole(String id)
Create CDT console adapter.IConsole
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.CoreModel
getCoreModel()
ICDescriptor
getCProjectDescription(org.eclipse.core.resources.IProject project)
Deprecated.usegetProjectDescription(IProject, boolean)
insteadICDescriptor
getCProjectDescription(org.eclipse.core.resources.IProject project, boolean create)
Deprecated.static CCorePlugin
getDefault()
IBinaryParser
getDefaultBinaryParser()
ICConfigExtensionReference[]
getDefaultBinaryParserExtensions(org.eclipse.core.resources.IProject project)
Returns the binary parser extensions for the default settings configuration.static HashMap<String,String>
getDefaultOptions()
TODO: Add all options here Returns a table of all known configurable options with their default values.CDOM
getDOM()
Deprecated.useITranslationUnit
orILanguage
to construct ASTs, instead.IErrorParser[]
getErrorParser(String id)
Deprecated.since CDT 6.1.static String
getFormattedString(String key, String arg)
static String
getFormattedString(String key, String[] args)
static IIndexManager
getIndexManager()
static String
getOption(String optionName)
Helper method for returning one option value only.static HashMap<String,String>
getOptions()
Returns the table of the current options.IPathEntryVariableManager
getPathEntryVariableManager()
static IPDOMManager
getPDOMManager()
Deprecated.use getIndexManager().static IPositionTrackerManager
getPositionTrackerManager()
ICConfigurationDescription
getPreferenceConfiguration(String buildSystemId)
ICConfigurationDescription
getPreferenceConfiguration(String buildSystemId, boolean write)
IProcessList
getProcessList()
Get the IProcessList contributed interface for the platform.ICProjectDescription
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.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.ICProjectDescriptionManager
getProjectDescriptionManager()
static ResourceBundle
getResourceBundle()
static String
getResourceString(String key)
IScannerInfoProvider
getScannerInfoProvider(org.eclipse.core.resources.IProject project)
static <T> T
getService(Class<T> service)
Return the given OSGi service.static IWorkingCopy[]
getSharedWorkingCopies()
Returns the shared working copies currently registered for the default buffer factory.static ITagService
getTagService()
static IUserVarSupplier
getUserVarSupplier()
static org.eclipse.core.resources.IWorkspace
getWorkspace()
boolean
isNewStyleProject(ICProjectDescription des)
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
log(int severity, String msg)
Prints a message in the logstatic void
log(String e)
static void
log(String message, Throwable e)
static void
log(Throwable e)
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
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.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
useStructuralParseMode()
-
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 Detail
-
STATUS_CDTPROJECT_EXISTS
public static final int STATUS_CDTPROJECT_EXISTS
- See Also:
- Constant Field Values
-
STATUS_CDTPROJECT_MISMATCH
public static final int STATUS_CDTPROJECT_MISMATCH
- See Also:
- Constant Field Values
-
CDT_PROJECT_NATURE_ID_MISMATCH
public static final int CDT_PROJECT_NATURE_ID_MISMATCH
- See Also:
- Constant Field Values
-
STATUS_PDOM_TOO_LARGE
public static final int STATUS_PDOM_TOO_LARGE
Status code for core exception that is thrown if a pdom grew larger than the supported limit.- Since:
- 5.2
- See Also:
- Constant Field Values
-
STATUS_BUILD_CONFIG_NOT_VALID
public static final int STATUS_BUILD_CONFIG_NOT_VALID
Toolchain not found when inflating a build configuration.- Since:
- 6.4
- See Also:
- Constant Field Values
-
PLUGIN_ID
public static final String PLUGIN_ID
- See Also:
- Constant Field Values
-
BUILDER_MODEL_ID
public static final String BUILDER_MODEL_ID
- See Also:
- Constant Field Values
-
BINARY_PARSER_SIMPLE_ID
public static final String BINARY_PARSER_SIMPLE_ID
- See Also:
- Constant Field Values
-
BINARY_PARSER_UNIQ_ID
public static final String BINARY_PARSER_UNIQ_ID
- See Also:
- Constant Field Values
-
PREF_BINARY_PARSER
public static final String PREF_BINARY_PARSER
- See Also:
- Constant Field Values
-
DEFAULT_BINARY_PARSER_SIMPLE_ID
public static final String DEFAULT_BINARY_PARSER_SIMPLE_ID
- See Also:
- Constant Field Values
-
DEFAULT_BINARY_PARSER_UNIQ_ID
public static final String DEFAULT_BINARY_PARSER_UNIQ_ID
- See Also:
- Constant Field Values
-
PREF_USE_STRUCTURAL_PARSE_MODE
public static final String PREF_USE_STRUCTURAL_PARSE_MODE
- See Also:
- Constant Field Values
-
INDEX_SIMPLE_ID
public static final String INDEX_SIMPLE_ID
- See Also:
- Constant Field Values
-
INDEX_UNIQ_ID
public static final String INDEX_UNIQ_ID
- See Also:
- Constant Field Values
-
INDEXER_SIMPLE_ID
public static final String INDEXER_SIMPLE_ID
- See Also:
- Constant Field Values
-
INDEXER_UNIQ_ID
public static final String INDEXER_UNIQ_ID
- See Also:
- Constant Field Values
-
PREF_INDEXER
public static final String PREF_INDEXER
- See Also:
- Constant Field Values
-
DEFAULT_INDEXER
public static final String DEFAULT_INDEXER
- See Also:
- Constant Field Values
-
ERROR_PARSER_SIMPLE_ID
public static final String ERROR_PARSER_SIMPLE_ID
Name of the extension point for contributing an error parser- See Also:
- Constant Field Values
-
ERROR_PARSER_UNIQ_ID
public static final String ERROR_PARSER_UNIQ_ID
Full unique name of the extension point for contributing an error parser- See Also:
- Constant Field Values
-
COMMAND_LAUNCHER_FACTORY_SIMPLE_ID
public static final String COMMAND_LAUNCHER_FACTORY_SIMPLE_ID
Name of the extension point for contributing a Command Launcher factory- Since:
- 6.4
- See Also:
- Constant Field Values
-
COMMAND_LAUNCHER_FACTORY_UNIQ_ID
public static final String COMMAND_LAUNCHER_FACTORY_UNIQ_ID
Full unique name of the extension point for contributing a Command Launcher factory- Since:
- 6.4
- See Also:
- Constant Field Values
-
DEFAULT_PATHENTRY_STORE_ID
public static final String DEFAULT_PATHENTRY_STORE_ID
- See Also:
- Constant Field Values
-
BUILD_SCANNER_INFO_SIMPLE_ID
public static final String BUILD_SCANNER_INFO_SIMPLE_ID
- See Also:
- Constant Field Values
-
BUILD_SCANNER_INFO_UNIQ_ID
public static final String BUILD_SCANNER_INFO_UNIQ_ID
- See Also:
- Constant Field Values
-
DEFAULT_PROVIDER_ID
public static final String DEFAULT_PROVIDER_ID
- See Also:
- Constant Field Values
-
FORMATTER_EXTPOINT_ID
public static final String FORMATTER_EXTPOINT_ID
Name of the extension point for contributing a source code formatter- See Also:
- Constant Field Values
-
CORE_ENCODING
public static final String CORE_ENCODING
Possible configurable option ID.- See Also:
getDefaultOptions()
, Constant Field Values
-
CONTENT_TYPE_CSOURCE
public static final String CONTENT_TYPE_CSOURCE
IContentType id for C Source Unit- See Also:
- Constant Field Values
-
CONTENT_TYPE_CHEADER
public static final String CONTENT_TYPE_CHEADER
IContentType id for C Header Unit- See Also:
- Constant Field Values
-
CONTENT_TYPE_CXXSOURCE
public static final String CONTENT_TYPE_CXXSOURCE
IContentType id for C++ Source Unit- See Also:
- Constant Field Values
-
CONTENT_TYPE_CXXHEADER
public static final String CONTENT_TYPE_CXXHEADER
IContentType id for C++ Header Unit- See Also:
- Constant Field Values
-
CONTENT_TYPE_ASMSOURCE
public static final String CONTENT_TYPE_ASMSOURCE
IContentType id for ASM Unit- See Also:
- Constant Field Values
-
CONTENT_TYPE_BINARYFILE
public static final String CONTENT_TYPE_BINARYFILE
IContentType id for Binary Files- See Also:
- Constant Field Values
-
INSERT
public static final String INSERT
Possible configurable option value.- See Also:
getDefaultOptions()
, Constant Field Values
-
DO_NOT_INSERT
public static final String DO_NOT_INSERT
Possible configurable option value.- See Also:
getDefaultOptions()
, Constant Field Values
-
TAB
public static final String TAB
Possible configurable option value.- See Also:
getDefaultOptions()
, Constant Field Values
-
SPACE
public static final String SPACE
Possible configurable option value.- See Also:
getDefaultOptions()
, Constant Field Values
-
cdtLog
public org.eclipse.cdt.internal.core.CDTLogWriter cdtLog
- Restriction:
- This field is not intended to be referenced by clients.
-
-
Method Detail
-
getSharedWorkingCopies
public static IWorkingCopy[] getSharedWorkingCopies()
Returns the shared working copies currently registered for the default buffer factory.- Since:
- 5.1
-
getWorkspace
public static org.eclipse.core.resources.IWorkspace getWorkspace()
-
getResourceBundle
public static ResourceBundle getResourceBundle()
-
getPositionTrackerManager
public static IPositionTrackerManager getPositionTrackerManager()
-
getDefault
public static CCorePlugin getDefault()
-
stop
public void stop(org.osgi.framework.BundleContext context) throws Exception
- Specified by:
stop
in interfaceorg.osgi.framework.BundleActivator
- Overrides:
stop
in classorg.eclipse.core.runtime.Plugin
- Throws:
Exception
- See Also:
Plugin.shutdown()
-
start
public void start(org.osgi.framework.BundleContext context) throws Exception
- Specified by:
start
in interfaceorg.osgi.framework.BundleActivator
- Overrides:
start
in classorg.eclipse.core.runtime.Plugin
- Throws:
Exception
- See Also:
Plugin.startup()
-
getDefaultOptions
public static HashMap<String,String> 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:
setOptions(java.util.HashMap<java.lang.String, java.lang.String>)
-
getOption
public static String getOption(String optionName)
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:
getDefaultOptions()
-
getOptions
public static HashMap<String,String> 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:
getDefaultOptions()
-
setOptions
public static void setOptions(HashMap<String,String> newOptions)
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:
getDefaultOptions()
-
getConsole
public IConsole getConsole(String extConsoleId, String contextId, String name, URL iconUrl)
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
public IConsole getConsole(String id)
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
public IConsole getBuildConsole(String contextId, String name, URL iconUrl)
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
public IConsole 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
public IBinaryParser getDefaultBinaryParser() throws org.eclipse.core.runtime.CoreException
- Throws:
org.eclipse.core.runtime.CoreException
-
getBinaryParser
public IBinaryParser getBinaryParser(String id) throws org.eclipse.core.runtime.CoreException
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
public CoreModel getCoreModel()
-
getIndexManager
public static IIndexManager getIndexManager()
-
getTagService
public static ITagService getTagService()
- Since:
- 5.5
-
getPathEntryVariableManager
public IPathEntryVariableManager 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 public ICDescriptorManager 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
public IProcessList getProcessList() throws org.eclipse.core.runtime.CoreException
Get the IProcessList contributed interface for the platform.- Returns:
- IProcessList
- Throws:
org.eclipse.core.runtime.CoreException
-
getAllErrorParsersIDs
@Deprecated public String[] getAllErrorParsersIDs()
Deprecated.since CDT 6.1. UseErrorParserManager.getErrorParserAvailableIds()
instead
-
getErrorParser
@Deprecated public IErrorParser[] getErrorParser(String id)
Deprecated.since CDT 6.1. UseErrorParserManager.getErrorParserCopy(String)
instead
-
getScannerInfoProvider
public IScannerInfoProvider getScannerInfoProvider(org.eclipse.core.resources.IProject project)
-
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
public static org.eclipse.core.runtime.content.IContentType getContentType(String filename)
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 public CDOM getDOM()
Deprecated.useITranslationUnit
orILanguage
to construct ASTs, instead.- Restriction:
- This method is not intended to be referenced by clients.
-
getCdtVariableManager
public ICdtVariableManager getCdtVariableManager()
-
getBuildEnvironmentManager
public IEnvironmentVariableManager 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(IProject, boolean, boolean)
-
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
public ICProjectDescription 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. 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:
getProjectDescription(IProject, boolean)
-
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:
getProjectDescription(IProject, boolean)
,createProjectDescription(IProject, boolean)
-
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
public boolean isNewStyleProject(ICProjectDescription des)
Answers whether the given project is a new-style project, i.e. CConfigurationDataProvider-driven
-
getProjectDescriptionManager
public ICProjectDescriptionManager getProjectDescriptionManager()
-
getUserVarSupplier
public static IUserVarSupplier getUserVarSupplier()
- Returns:
- editable User-variable's supplier
-
log
public static void log(String e)
- Restriction:
- This method is not intended to be referenced by clients.
-
log
public static void log(int severity, String msg)
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
public static void logStackTrace(int severity, String msg)
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
public static void log(Throwable e)
- Restriction:
- This method is not intended to be referenced by clients.
-
log
public static void log(String message, Throwable e)
- Restriction:
- This method is not intended to be referenced by clients.
-
createStatus
public static org.eclipse.core.runtime.IStatus createStatus(String msg)
- Restriction:
- This method is not intended to be referenced by clients.
-
createStatus
public static org.eclipse.core.runtime.IStatus createStatus(String msg, Throwable e)
- 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 public static IPDOMManager 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
public static <T> T getService(Class<T> service)
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
-
-