1 /**********************************************************************
2 * Copyright (c) 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM - Initial API and implementation
10 **********************************************************************/
11 package net.sourceforge.phpdt.httpquery.preferences;
14 import net.sourceforge.phpdt.phphelp.PHPHelpPlugin;
16 import org.eclipse.jface.dialogs.Dialog;
17 import org.eclipse.jface.preference.PreferencePage;
18 import org.eclipse.swt.SWT;
19 import org.eclipse.swt.layout.GridData;
20 import org.eclipse.swt.layout.GridLayout;
21 import org.eclipse.swt.widgets.Composite;
22 import org.eclipse.swt.widgets.Control;
23 import org.eclipse.swt.widgets.Label;
24 import org.eclipse.ui.IWorkbench;
25 import org.eclipse.ui.IWorkbenchPreferencePage;
27 * The preference page that holds monitor properties.
29 public class ConfigurationPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
32 * ConfigurationPreferencePage constructor comment.
34 public ConfigurationPreferencePage() {
36 noDefaultAndApplyButton();
40 * Create the preference options.
42 * @param parent org.eclipse.swt.widgets.Composite
43 * @return org.eclipse.swt.widgets.Control
45 protected Control createContents(Composite parent) {
46 initializeDialogUnits(parent);
48 Composite composite = new Composite(parent, SWT.NONE);
49 GridLayout layout = new GridLayout();
50 layout.numColumns = 1;
51 layout.horizontalSpacing = convertHorizontalDLUsToPixels(4);
52 layout.verticalSpacing = convertVerticalDLUsToPixels(4);
53 layout.marginWidth = 0;
54 layout.marginHeight = 0;
55 composite.setLayout(layout);
56 GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
57 composite.setLayoutData(data);
58 // WorkbenchHelp.setHelp(composite, ContextIds.PREF);
60 Label label = new Label(composite, SWT.WRAP);
61 label.setText(PHPHelpPlugin.getResource("%preferenceDescription"));
62 data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
63 label.setLayoutData(data);
65 label = new Label(composite, SWT.NONE);
68 ConfigurationComposite monitorComp = new ConfigurationComposite(composite, SWT.NONE);
69 data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
70 monitorComp.setLayoutData(data);
72 Dialog.applyDialogFont(composite);
78 * Initializes this preference page using the passed desktop.
80 * @param desktop the current desktop
82 public void init(IWorkbench workbench) {
86 * Performs special processing when this page's Defaults button has been pressed.
88 * This is a framework hook method for sublcasses to do special things when
89 * the Defaults button has been pressed.
90 * Subclasses may override, but should call <code>super.performDefaults</code>.
93 protected void performDefaults() {
94 // displayButton.setSelection(WikiEditorPlugin.getDefaultShowOnActivityPreference());
95 super.performDefaults();
99 * Method declared on IPreferencePage.
100 * Subclasses should override
102 public boolean performOk() {
103 // WikiEditorPlugin.setShowOnActivityPreference(displayButton.getSelection());
104 PHPHelpPlugin.getDefault().savePluginPreferences();