KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > visualcontent > repository > remoterep > preferences > Model3JCRPreferencePage


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.repository.remoterep.preferences;
19
20 import org.eclipse.jface.preference.*;
21 import org.eclipse.ui.IWorkbenchPreferencePage;
22 import org.eclipse.ui.IWorkbench;
23 import org.visualcontent.repository.remoterep.Model3JackrabbitRepositoryPlugin;
24
25 /**
26  * This class represents a preference page that
27  * is contributed to the Preferences dialog. By
28  * subclassing <samp>FieldEditorPreferencePage</samp>, we
29  * can use the field support built into JFace that allows
30  * us to create a page that is small and knows how to
31  * save, restore and apply itself.
32  * <p>
33  * This page is used to modify preferences only. They
34  * are stored in the preference store that belongs to
35  * the main plug-in class. That way, preferences can
36  * be accessed directly via the preference store.
37  */

38
39 public class Model3JCRPreferencePage
40     extends FieldEditorPreferencePage
41     implements IWorkbenchPreferencePage {
42
43     public Model3JCRPreferencePage() {
44         super(GRID);
45         setPreferenceStore(Model3JackrabbitRepositoryPlugin.getDefault().getPreferenceStore());
46         setDescription("The preferences to connect to a remote JCR server per RMI.");
47     }
48     
49     /**
50      * Creates the field editors. Field editors are abstractions of
51      * the common GUI blocks needed to manipulate various types
52      * of preferences. Each field editor knows how to save and
53      * restore itself.
54      */

55     public void createFieldEditors() {
56         addField(
57                 new StringFieldEditor(PreferenceConstants.P_HOST, "&Host:", getFieldEditorParent()));
58         addField(
59                 new StringFieldEditor(PreferenceConstants.P_PORT, "&Post:", getFieldEditorParent()));
60         addField(
61                 new StringFieldEditor(PreferenceConstants.P_REPOSITORY_NAME, "&Repository Name:", getFieldEditorParent()));
62     }
63
64     /* (non-Javadoc)
65      * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
66      */

67     public void init(IWorkbench workbench) {
68     }
69     
70 }
Popular Tags