KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ui > preferences > ResourceModelPreferencePage


1 /*******************************************************************************
2  * Copyright (c) 2006 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.team.internal.ui.preferences;
12
13 import org.eclipse.jface.preference.FieldEditorPreferencePage;
14 import org.eclipse.jface.preference.RadioGroupFieldEditor;
15 import org.eclipse.team.internal.ui.*;
16 import org.eclipse.ui.IWorkbench;
17 import org.eclipse.ui.IWorkbenchPreferencePage;
18
19 public class ResourceModelPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage, IPreferenceIds {
20
21     private RadioGroupFieldEditor defaultLayout;
22
23     public ResourceModelPreferencePage() {
24         super(GRID);
25         setTitle(TeamUIMessages.SynchronizationCompareAdapter_0);
26         setDescription(TeamUIMessages.ResourceModelPreferencePage_0);
27         setPreferenceStore(TeamUIPlugin.getPlugin().getPreferenceStore());
28     }
29
30     /* (non-Javadoc)
31      * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
32      */

33     protected void createFieldEditors() {
34         defaultLayout = new RadioGroupFieldEditor(SYNCVIEW_DEFAULT_LAYOUT,
35                 TeamUIMessages.SyncViewerPreferencePage_0, 3,
36                 new String JavaDoc[][] {
37                     {TeamUIMessages.SyncViewerPreferencePage_1, FLAT_LAYOUT},
38                     {TeamUIMessages.SyncViewerPreferencePage_2, TREE_LAYOUT},
39                     {TeamUIMessages.SyncViewerPreferencePage_3, COMPRESSED_LAYOUT}
40                 },
41                 getFieldEditorParent(), true /* use a group */);
42         addField(defaultLayout);
43     }
44
45     /* (non-Javadoc)
46      * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
47      */

48     public void init(IWorkbench workbench) {
49         // Nothing to do
50
}
51
52     /* (non-Javadoc)
53      * @see org.eclipse.jface.preference.IPreferencePage#performOk()
54      */

55     public boolean performOk() {
56         TeamUIPlugin.getPlugin().savePluginPreferences();
57         return super.performOk();
58     }
59     
60 }
61
Popular Tags