KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > visualcontent > authentication > simplecredentials > preferences > SimpleCredentialsPreferencePage


1 /**
2  * VC Browser - Visualizes the content of a JSR 170 compatible repository
3  * Copyright (C) 2006 Sandro Böhme
4  *
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.visualcontent.authentication.simplecredentials.preferences;
19
20 import org.eclipse.jface.preference.FieldEditorPreferencePage;
21 import org.eclipse.jface.preference.FileFieldEditor;
22 import org.eclipse.jface.preference.StringFieldEditor;
23 import org.eclipse.ui.IWorkbench;
24 import org.eclipse.ui.IWorkbenchPreferencePage;
25 import org.visualcontent.authentication.simplecredentials.SimplecredentialsPlugin;
26
27
28 public class SimpleCredentialsPreferencePage
29     extends FieldEditorPreferencePage
30     implements IWorkbenchPreferencePage {
31
32     public SimpleCredentialsPreferencePage() {
33         super(GRID);
34         setPreferenceStore(SimplecredentialsPlugin.getDefault().getPreferenceStore());
35         setDescription("Configuration for the session of a repository");
36     }
37     
38     /**
39      * Creates the field editors. Field editors are abstractions of
40      * the common GUI blocks needed to manipulate various types
41      * of preferences. Each field editor knows how to save and
42      * restore itself.
43      */

44     public void createFieldEditors() {
45         addField(new FileFieldEditor(PreferenceConstants.P_REP_AUTH_CONFIG,
46                 "Repository &authorization configuration file:", getFieldEditorParent()));
47         addField(new StringFieldEditor(PreferenceConstants.P_REP_USER_NAME,
48                         "&User Name:", getFieldEditorParent()));
49         addField(new StringFieldEditor(PreferenceConstants.P_REP_PASSWORD,
50                 "&Password:", getFieldEditorParent()));
51         addField(new StringFieldEditor(PreferenceConstants.P_REP_WORKSPACE,
52                 "&Workspace (empty for using the default workspace):", getFieldEditorParent()));
53     }
54
55     /* (non-Javadoc)
56      * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
57      */

58     public void init(IWorkbench workbench) {
59     }
60     
61 }
Popular Tags