KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ltk > internal > ui > refactoring > RefactoringPreferencePage


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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  *******************************************************************************/

11
12 package org.eclipse.ltk.internal.ui.refactoring;
13
14
15 public class RefactoringPreferencePage /* extends FieldEditorPreferencePage implements IWorkbenchPreferencePage */ {
16
17     /*
18     private static final String FATAL_SEVERITY= PreferenceConstants.REFACTOR_FATAL_SEVERITY;
19     private static final String ERROR_SEVERITY= PreferenceConstants.REFACTOR_ERROR_SEVERITY;
20     private static final String WARNING_SEVERITY= PreferenceConstants.REFACTOR_WARNING_SEVERITY;
21     private static final String INFO_SEVERITY= PreferenceConstants.REFACTOR_INFO_SEVERITY;
22         
23     public RefactoringPreferencePage() {
24         super(GRID);
25         setDescription(RefactoringMessages.getString("RefactoringPreferencePage.description")); //$NON-NLS-1$
26         setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore());
27     }
28             
29     public void createControl(Composite parent) {
30         // added for 1GEUGE6: ITPJUI:WIN2000 - Help is the same on all preference pages
31         super.createControl(parent);
32         PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.REFACTORING_PREFERENCE_PAGE);
33     }
34
35     public void createFieldEditors() {
36         addField(createSeverityLevelField(getFieldEditorParent()));
37         addField(createSaveAllField(getFieldEditorParent()));
38     }
39     
40     private FieldEditor createSeverityLevelField(Composite parent) {
41         RadioGroupFieldEditor editor= new RadioGroupFieldEditor(
42             RefactoringPreferences.PREF_ERROR_PAGE_SEVERITY_THRESHOLD,
43             RefactoringMessages.getString("RefactoringPreferencePage.show_error_page"), //$NON-NLS-1$
44             1,
45             new String[] [] {
46                 { RefactoringMessages.getString("RefactoringPreferencePage.fatal_error"), FATAL_SEVERITY }, //$NON-NLS-1$
47                 { RefactoringMessages.getString("RefactoringPreferencePage.error"), ERROR_SEVERITY }, //$NON-NLS-1$
48                 { RefactoringMessages.getString("RefactoringPreferencePage.warning"), WARNING_SEVERITY }, //$NON-NLS-1$
49                 { RefactoringMessages.getString("RefactoringPreferencePage.info"), INFO_SEVERITY } //$NON-NLS-1$
50             },
51             parent, true
52             );
53         return editor;
54     }
55     
56     private FieldEditor createSaveAllField(Composite parent) {
57         BooleanFieldEditor editor= new BooleanFieldEditor(
58         RefactoringPreferences.PREF_SAVE_ALL_EDITORS,
59             RefactoringMessages.getString("RefactoringPreferencePage.auto_save"), //$NON-NLS-1$
60             BooleanFieldEditor.DEFAULT,
61             parent);
62         return editor;
63     }
64     
65     public void init(IWorkbench workbench) {
66     }
67     
68     public boolean performOk() {
69         JavaPlugin.getDefault().savePluginPreferences();
70         return super.performOk();
71     }
72     */

73 }
74
Popular Tags