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, IConfigurationWorkingCopy monitor) {
35 this.monitor = monitor;
39 public ConfigurationPreferencesDialog(Shell composite) {
44 protected void configureShell(Shell shell) {
45 super.configureShell(shell);
46 shell.setText(PHPHelpPlugin.getResource("%preferenceTitle"));
49 protected Control createDialogArea(Composite parent) {
50 Composite compositeParent = (Composite) super.createDialogArea(parent);
52 Composite composite = new Composite(compositeParent, SWT.NONE);
53 GridLayout layout = new GridLayout();
54 layout.marginHeight = convertHorizontalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
55 layout.marginWidth = convertVerticalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
56 layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
57 composite.setLayout(layout);
58 GridData data = new GridData(GridData.FILL_BOTH);
59 composite.setLayoutData(data);
60 // WorkbenchHelp.setHelp(composite, ContextIds.PREF);
62 ConfigurationComposite monitorComp = new ConfigurationComposite(composite, SWT.NONE);
63 data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
64 monitorComp.setLayoutData(data);
66 Dialog.applyDialogFont(composite);
71 protected void okPressed() {
72 PHPHelpPlugin.getDefault().savePluginPreferences();