1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 package org.openoffice.test.assistant.preferences; 25 26 import org.eclipse.jface.preference.*; 27 import org.eclipse.ui.IWorkbenchPreferencePage; 28 import org.eclipse.ui.IWorkbench; 29 import org.openoffice.test.assistant.Activator; 30 31 /** 32 * This class represents a preference page that 33 * is contributed to the Preferences dialog. By 34 * subclassing <samp>FieldEditorPreferencePage</samp>, we 35 * can use the field support built into JFace that allows 36 * us to create a page that is small and knows how to 37 * save, restore and apply itself. 38 * <p> 39 * This page is used to modify preferences only. They 40 * are stored in the preference store that belongs to 41 * the main plug-in class. That way, preferences can 42 * be accessed directly via the preference store. 43 */ 44 45 public class PreferencePage 46 extends FieldEditorPreferencePage 47 implements IWorkbenchPreferencePage { 48 PreferencePage()49 public PreferencePage() { 50 super(GRID); 51 setPreferenceStore(Activator.getDefault().getPreferenceStore()); 52 setDescription("VCL Test Assistant Setting"); 53 } 54 55 /** 56 * Creates the field editors. Field editors are abstractions of 57 * the common GUI blocks needed to manipulate various types 58 * of preferences. Each field editor knows how to save and 59 * restore itself. 60 */ createFieldEditors()61 public void createFieldEditors() { 62 addField(new DirectoryFieldEditor(PreferenceConstants.P_OPENOFFICE_HOME, 63 "&OpenOffice Home (the directory containing soffice.bin):", getFieldEditorParent())); 64 } 65 66 /* (non-Javadoc) 67 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) 68 */ init(IWorkbench workbench)69 public void init(IWorkbench workbench) { 70 } 71 72 }