1 11 package org.eclipse.jdt.internal.core; 12 13 import java.util.*; 14 15 import org.eclipse.core.runtime.preferences.*; 16 import org.eclipse.jdt.core.JavaCore; 17 import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants; 18 import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; 19 20 25 public class JavaCorePreferenceInitializer extends AbstractPreferenceInitializer { 26 27 30 public void initializeDefaultPreferences() { 31 HashSet optionNames = JavaModelManager.getJavaModelManager().optionNames; 34 35 Map defaultOptionsMap = new CompilerOptions().getMap(); 38 defaultOptionsMap.put(JavaCore.COMPILER_LOCAL_VARIABLE_ATTR, JavaCore.GENERATE); 40 defaultOptionsMap.put(JavaCore.COMPILER_CODEGEN_UNUSED_LOCAL, JavaCore.PRESERVE); 41 defaultOptionsMap.put(JavaCore.COMPILER_TASK_TAGS, JavaCore.DEFAULT_TASK_TAGS); 42 defaultOptionsMap.put(JavaCore.COMPILER_TASK_PRIORITIES, JavaCore.DEFAULT_TASK_PRIORITIES); 43 defaultOptionsMap.put(JavaCore.COMPILER_TASK_CASE_SENSITIVE, JavaCore.ENABLED); 44 defaultOptionsMap.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED); 45 defaultOptionsMap.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR); 46 47 defaultOptionsMap.put(JavaCore.CORE_JAVA_BUILD_RESOURCE_COPY_FILTER, ""); defaultOptionsMap.put(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, JavaCore.ABORT); 50 defaultOptionsMap.put(JavaCore.CORE_JAVA_BUILD_DUPLICATE_RESOURCE, JavaCore.WARNING); 51 defaultOptionsMap.put(JavaCore.CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER, JavaCore.CLEAN); 52 defaultOptionsMap.put(JavaCore.CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER, JavaCore.IGNORE); 53 54 defaultOptionsMap.put(JavaCore.CORE_JAVA_BUILD_ORDER, JavaCore.IGNORE); 56 defaultOptionsMap.put(JavaCore.CORE_INCOMPLETE_CLASSPATH, JavaCore.ERROR); 57 defaultOptionsMap.put(JavaCore.CORE_CIRCULAR_CLASSPATH, JavaCore.ERROR); 58 defaultOptionsMap.put(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, JavaCore.IGNORE); 59 defaultOptionsMap.put(JavaCore.CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS, JavaCore.ENABLED); 60 defaultOptionsMap.put(JavaCore.CORE_ENABLE_CLASSPATH_MULTIPLE_OUTPUT_LOCATIONS, JavaCore.ENABLED); 61 62 optionNames.add(JavaCore.CORE_ENCODING); 64 65 Map codeFormatterOptionsMap = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); for (Iterator iter = codeFormatterOptionsMap.entrySet().iterator(); iter.hasNext();) { 68 Map.Entry entry = (Map.Entry) iter.next(); 69 String optionName = (String ) entry.getKey(); 70 defaultOptionsMap.put(optionName, entry.getValue()); 71 optionNames.add(optionName); 72 } 73 74 defaultOptionsMap.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.DISABLED); 76 defaultOptionsMap.put(JavaCore.CODEASSIST_DEPRECATION_CHECK, JavaCore.DISABLED); 77 defaultOptionsMap.put(JavaCore.CODEASSIST_IMPLICIT_QUALIFICATION, JavaCore.DISABLED); 78 defaultOptionsMap.put(JavaCore.CODEASSIST_FIELD_PREFIXES, ""); defaultOptionsMap.put(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, ""); defaultOptionsMap.put(JavaCore.CODEASSIST_LOCAL_PREFIXES, ""); defaultOptionsMap.put(JavaCore.CODEASSIST_ARGUMENT_PREFIXES, ""); defaultOptionsMap.put(JavaCore.CODEASSIST_FIELD_SUFFIXES, ""); defaultOptionsMap.put(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, ""); defaultOptionsMap.put(JavaCore.CODEASSIST_LOCAL_SUFFIXES, ""); defaultOptionsMap.put(JavaCore.CODEASSIST_ARGUMENT_SUFFIXES, ""); defaultOptionsMap.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED); 87 defaultOptionsMap.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED); 88 defaultOptionsMap.put(JavaCore.CODEASSIST_CAMEL_CASE_MATCH, JavaCore.ENABLED); 89 defaultOptionsMap.put(JavaCore.CODEASSIST_SUGGEST_STATIC_IMPORTS, JavaCore.ENABLED); 90 91 defaultOptionsMap.put(JavaCore.TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC, "50"); 94 IEclipsePreferences defaultPreferences = ((IScopeContext) new DefaultScope()).getNode(JavaCore.PLUGIN_ID); 96 for (Iterator iter = defaultOptionsMap.entrySet().iterator(); iter.hasNext();) { 97 Map.Entry entry = (Map.Entry) iter.next(); 98 String optionName = (String ) entry.getKey(); 99 defaultPreferences.put(optionName, (String )entry.getValue()); 100 optionNames.add(optionName); 101 } 102 } 103 } 104 | Popular Tags |