KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > preferences > cleanup > MissingCodeTabPage


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 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 package org.eclipse.jdt.internal.ui.preferences.cleanup;
12
13 import java.util.Map JavaDoc;
14
15 import org.eclipse.swt.widgets.Composite;
16 import org.eclipse.swt.widgets.Group;
17
18 import org.eclipse.jdt.internal.corext.fix.CleanUpConstants;
19
20 import org.eclipse.jdt.internal.ui.fix.ICleanUp;
21 import org.eclipse.jdt.internal.ui.fix.Java50CleanUp;
22 import org.eclipse.jdt.internal.ui.fix.PotentialProgrammingProblemsCleanUp;
23 import org.eclipse.jdt.internal.ui.preferences.formatter.ModifyDialog;
24
25 public final class MissingCodeTabPage extends CleanUpTabPage {
26
27     public MissingCodeTabPage(ModifyDialog dialog, Map JavaDoc values) {
28         this(dialog, values, false);
29     }
30
31     public MissingCodeTabPage(IModificationListener listener, Map JavaDoc values, boolean isSaveParticipantConfiguration) {
32         super(listener, values, isSaveParticipantConfiguration);
33     }
34     
35     protected ICleanUp[] createPreviewCleanUps(Map JavaDoc values) {
36         return new ICleanUp[] {
37                 new Java50CleanUp(values),
38                 new PotentialProgrammingProblemsCleanUp(values)
39         };
40     }
41
42     protected void doCreatePreferences(Composite composite, int numColumns) {
43         
44         Group annotationsGroup= createGroup(numColumns, composite, CleanUpMessages.MissingCodeTabPage_GroupName_Annotations);
45         
46         final CheckboxPreference annotationsPref= createCheckboxPref(annotationsGroup, numColumns, CleanUpMessages.MissingCodeTabPage_CheckboxName_AddMissingAnnotations, CleanUpConstants.ADD_MISSING_ANNOTATIONS, CleanUpModifyDialog.FALSE_TRUE);
47         intent(annotationsGroup);
48         final CheckboxPreference overridePref= createCheckboxPref(annotationsGroup, numColumns - 1, CleanUpMessages.MissingCodeTabPage_CheckboxName_AddMissingOverrideAnnotations, CleanUpConstants.ADD_MISSING_ANNOTATIONS_OVERRIDE, CleanUpModifyDialog.FALSE_TRUE);
49         intent(annotationsGroup);
50         final CheckboxPreference deprecatedPref= createCheckboxPref(annotationsGroup, numColumns - 1, CleanUpMessages.MissingCodeTabPage_CheckboxName_AddMissingDeprecatedAnnotations, CleanUpConstants.ADD_MISSING_ANNOTATIONS_DEPRECATED, CleanUpModifyDialog.FALSE_TRUE);
51         registerSlavePreference(annotationsPref, new CheckboxPreference[] {overridePref, deprecatedPref});
52         
53         if (!isSaveAction()) {
54             Group pppGroup= createGroup(numColumns, composite, CleanUpMessages.MissingCodeTabPage_GroupName_PotentialProgrammingProblems);
55             
56             final CheckboxPreference addSUIDPref= createCheckboxPref(pppGroup, numColumns, CleanUpMessages.MissingCodeTabPage_CheckboxName_AddSUID, CleanUpConstants.ADD_MISSING_SERIAL_VERSION_ID, CleanUpModifyDialog.FALSE_TRUE);
57             intent(pppGroup);
58             final RadioPreference generatedPref= createRadioPref(pppGroup, 1, CleanUpMessages.MissingCodeTabPage_RadioName_AddGeneratedSUID, CleanUpConstants.ADD_MISSING_SERIAL_VERSION_ID_GENERATED, CleanUpModifyDialog.FALSE_TRUE);
59             final RadioPreference defaultPref= createRadioPref(pppGroup, 1, CleanUpMessages.MissingCodeTabPage_RadioName_AddDefaultSUID, CleanUpConstants.ADD_MISSING_SERIAL_VERSION_ID_DEFAULT, CleanUpModifyDialog.FALSE_TRUE);
60             registerSlavePreference(addSUIDPref, new RadioPreference[] {generatedPref, defaultPref});
61         }
62     }
63 }
64
Popular Tags