Example usage for org.eclipse.jdt.apt.core.util AptPreferenceConstants APT_STRING_BASE

List of usage examples for org.eclipse.jdt.apt.core.util AptPreferenceConstants APT_STRING_BASE

Introduction

In this page you can find the example usage for org.eclipse.jdt.apt.core.util AptPreferenceConstants APT_STRING_BASE.

Prototype

String APT_STRING_BASE

To view the source code for org.eclipse.jdt.apt.core.util AptPreferenceConstants APT_STRING_BASE.

Click Source Link

Usage

From source file:org.eclipse.gmt.mod.infra.common.core.internal.utils.ProjectUtils.java

License:Open Source License

public static void enableAPT(final IProject project) {
    IJavaProject javaProject = JavaCore.create(project);
    if (javaProject != null) {
        try {/*from   w  ww  . j  a v a 2s  .c om*/
            IScopeContext context = new ProjectScope(project);
            IEclipsePreferences node = context.getNode(AptPreferenceConstants.APT_STRING_BASE + ".core"); //$NON-NLS-1$
            node.put(AptPreferenceConstants.APT_ENABLED, "true"); //$NON-NLS-1$
            node.sync();
            IEclipsePreferences javaNode = context.getNode(JavaCore.PLUGIN_ID);
            javaNode.put(AptPreferenceConstants.APT_PROCESSANNOTATIONS, "enabled"); //$NON-NLS-1$
            javaNode.sync();
        } catch (Exception e) {
            log.error(e.getMessage() + "  --  Error enabling apt processing");
        }
    }
}