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;
13 import net.sourceforge.phpdt.httpquery.config.IConfigurationWorkingCopy;
14 import net.sourceforge.phpdt.phphelp.PHPHelpPlugin;
16 import org.eclipse.jface.dialogs.Dialog;
17 import org.eclipse.jface.dialogs.IDialogConstants;
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.Shell;
25 public class ConfigurationPreferencesDialog extends Dialog {
26 protected IConfigurationWorkingCopy monitor;
28 protected boolean isEdit;
33 public ConfigurationPreferencesDialog(Shell parentShell,
34 IConfigurationWorkingCopy monitor) {
36 this.monitor = monitor;
40 public ConfigurationPreferencesDialog(Shell composite) {
45 protected void configureShell(Shell shell) {
46 super.configureShell(shell);
47 shell.setText(PHPHelpPlugin.getResource("%preferenceTitle"));
50 protected Control createDialogArea(Composite parent) {
51 Composite compositeParent = (Composite) super.createDialogArea(parent);
53 Composite composite = new Composite(compositeParent, SWT.NONE);
54 GridLayout layout = new GridLayout();
55 layout.marginHeight = convertHorizontalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
56 layout.marginWidth = convertVerticalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
57 layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
58 composite.setLayout(layout);
59 GridData data = new GridData(GridData.FILL_BOTH);
60 composite.setLayoutData(data);
61 // WorkbenchHelp.setHelp(composite, ContextIds.PREF);
63 ConfigurationComposite monitorComp = new ConfigurationComposite(
65 data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
66 monitorComp.setLayoutData(data);
68 Dialog.applyDialogFont(composite);
73 protected void okPressed() {
74 PHPHelpPlugin.getDefault().savePluginPreferences();