]> git.uio.no Git - ifi-stolz-refaktor.git/blame - case-study/jdt-before/ui/org/eclipse/jdt/internal/ui/preferences/JavaPreferencesSettings.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-before / ui / org / eclipse / jdt / internal / ui / preferences / JavaPreferencesSettings.java
CommitLineData
1b2798f6
EK
1/*******************************************************************************
2 * Copyright (c) 2000, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11package org.eclipse.jdt.internal.ui.preferences;
12
13import org.eclipse.jdt.core.IJavaProject;
14
15import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
16import org.eclipse.jdt.internal.corext.util.CodeFormatterUtil;
17
18import org.eclipse.jdt.ui.PreferenceConstants;
19
20public class JavaPreferencesSettings {
21
22 public static CodeGenerationSettings getCodeGenerationSettings(IJavaProject project) {
23 CodeGenerationSettings res= new CodeGenerationSettings();
24 res.createComments= Boolean.valueOf(PreferenceConstants.getPreference(PreferenceConstants.CODEGEN_ADD_COMMENTS, project)).booleanValue();
25 res.useKeywordThis= Boolean.valueOf(PreferenceConstants.getPreference(PreferenceConstants.CODEGEN_KEYWORD_THIS, project)).booleanValue();
26 res.overrideAnnotation= Boolean.valueOf(PreferenceConstants.getPreference(PreferenceConstants.CODEGEN_USE_OVERRIDE_ANNOTATION, project)).booleanValue();
27 res.importIgnoreLowercase= Boolean.valueOf(PreferenceConstants.getPreference(PreferenceConstants.ORGIMPORTS_IGNORELOWERCASE, project)).booleanValue();
28 res.tabWidth= CodeFormatterUtil.getTabWidth(project);
29 res.indentWidth= CodeFormatterUtil.getIndentWidth(project);
30 return res;
31 }
32
33}
34