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.phpeclipse.wiki.ui.internal;
13 import net.sourceforge.phpeclipse.webbrowser.internal.ContextIds;
14 import net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin;
15 import net.sourceforge.phpeclipse.wiki.internal.IConfigurationWorkingCopy;
17 import org.eclipse.jface.dialogs.Dialog;
18 import org.eclipse.jface.dialogs.IDialogConstants;
19 import org.eclipse.swt.SWT;
20 import org.eclipse.swt.layout.GridData;
21 import org.eclipse.swt.layout.GridLayout;
22 import org.eclipse.swt.widgets.Composite;
23 import org.eclipse.swt.widgets.Control;
24 import org.eclipse.swt.widgets.Shell;
25 import org.eclipse.ui.help.WorkbenchHelp;
30 public class ConfigurationPrefrencesDialog extends Dialog {
31 protected IConfigurationWorkingCopy monitor;
33 protected boolean isEdit;
38 public ConfigurationPrefrencesDialog(Shell parentShell, IConfigurationWorkingCopy monitor) {
40 this.monitor = monitor;
44 public ConfigurationPrefrencesDialog(Shell composite) {
49 protected void configureShell(Shell shell) {
50 super.configureShell(shell);
51 shell.setText(WikiEditorPlugin.getResource("%preferenceTitle"));
57 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
59 protected Control createDialogArea(Composite parent) {
60 Composite compositeParent = (Composite) super.createDialogArea(parent);
62 Composite composite = new Composite(compositeParent, SWT.NONE);
63 GridLayout layout = new GridLayout();
64 layout.marginHeight = convertHorizontalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
65 layout.marginWidth = convertVerticalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
66 layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
67 composite.setLayout(layout);
68 GridData data = new GridData(GridData.FILL_BOTH);
69 composite.setLayoutData(data);
70 // WorkbenchHelp.setHelp(composite, ContextIds.PREF);
72 ConfigurationComposite monitorComp = new ConfigurationComposite(composite, SWT.NONE);
73 data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
74 monitorComp.setLayoutData(data);
76 Dialog.applyDialogFont(composite);
84 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
86 protected void okPressed() {
87 WikiEditorPlugin.getDefault().savePluginPreferences();