Search in sources :

Example 1 with ICConfigExtensionReference

use of org.eclipse.cdt.core.settings.model.ICConfigExtensionReference in project linuxtools by eclipse.

the class CProjectHelper method addDefaultBinaryParser.

/**
 * Add the default binary parser if no binary parser configured.
 *
 * @param project
 * @throws CoreException
 */
private static boolean addDefaultBinaryParser(IProject project) throws CoreException {
    ICConfigExtensionReference[] binaryParsers = CCorePlugin.getDefault().getDefaultBinaryParserExtensions(project);
    if (binaryParsers == null || binaryParsers.length == 0) {
        ICProjectDescription desc = CCorePlugin.getDefault().getProjectDescription(project);
        if (desc == null) {
            return false;
        }
        desc.getDefaultSettingConfiguration().create(CCorePlugin.BINARY_PARSER_UNIQ_ID, CCorePlugin.DEFAULT_BINARY_PARSER_UNIQ_ID);
        CCorePlugin.getDefault().setProjectDescription(project, desc);
    }
    return true;
}
Also used : ICProjectDescription(org.eclipse.cdt.core.settings.model.ICProjectDescription) ICConfigExtensionReference(org.eclipse.cdt.core.settings.model.ICConfigExtensionReference)

Example 2 with ICConfigExtensionReference

use of org.eclipse.cdt.core.settings.model.ICConfigExtensionReference in project linuxtools by eclipse.

the class CProjectHelper method addDefaultBinaryParser.

/**
 * Add the default binary parser if no binary parser configured.
 *
 * @param project
 * @throws CoreException
 */
private static boolean addDefaultBinaryParser(IProject project) throws CoreException {
    ICConfigExtensionReference[] binaryParsers = CCorePlugin.getDefault().getDefaultBinaryParserExtensions(project);
    if (binaryParsers == null || binaryParsers.length == 0) {
        ICProjectDescription desc = CCorePlugin.getDefault().getProjectDescription(project);
        if (desc == null) {
            return false;
        }
        desc.getDefaultSettingConfiguration().create(CCorePlugin.BINARY_PARSER_UNIQ_ID, CCorePlugin.DEFAULT_BINARY_PARSER_UNIQ_ID);
        CCorePlugin.getDefault().setProjectDescription(project, desc);
    }
    return true;
}
Also used : ICProjectDescription(org.eclipse.cdt.core.settings.model.ICProjectDescription) ICConfigExtensionReference(org.eclipse.cdt.core.settings.model.ICConfigExtensionReference)

Aggregations

ICConfigExtensionReference (org.eclipse.cdt.core.settings.model.ICConfigExtensionReference)2 ICProjectDescription (org.eclipse.cdt.core.settings.model.ICProjectDescription)2