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.monitor.ui.internal;
13 import net.sourceforge.phpdt.monitor.core.IMonitorWorkingCopy;
15 import org.eclipse.jface.dialogs.Dialog;
16 import org.eclipse.jface.dialogs.IDialogConstants;
17 import org.eclipse.swt.SWT;
18 import org.eclipse.swt.layout.GridData;
19 import org.eclipse.swt.layout.GridLayout;
20 import org.eclipse.swt.widgets.Composite;
21 import org.eclipse.swt.widgets.Control;
22 import org.eclipse.swt.widgets.Shell;
23 import org.eclipse.ui.help.WorkbenchHelp;
27 public class MonitorPrefrencesDialog extends Dialog {
28 protected IMonitorWorkingCopy monitor;
29 protected boolean isEdit;
34 public MonitorPrefrencesDialog(Shell parentShell, IMonitorWorkingCopy monitor) {
36 this.monitor = monitor;
40 public MonitorPrefrencesDialog(Shell composite) {
45 protected void configureShell(Shell shell) {
46 super.configureShell(shell);
47 shell.setText(MonitorUIPlugin.getResource("%preferenceTitle"));
51 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
53 protected Control createDialogArea(Composite parent) {
54 Composite compositeParent = (Composite) super.createDialogArea(parent);
56 Composite composite = new Composite(compositeParent, SWT.NONE);
57 GridLayout layout = new GridLayout();
58 layout.marginHeight = convertHorizontalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
59 layout.marginWidth = convertVerticalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
60 layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
61 composite.setLayout(layout);
62 GridData data = new GridData(GridData.FILL_BOTH);
63 composite.setLayoutData(data);
64 WorkbenchHelp.setHelp(composite, ContextIds.PREF);
66 MonitorComposite monitorComp = new MonitorComposite(composite, SWT.NONE);
67 data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
68 monitorComp.setLayoutData(data);
70 Dialog.applyDialogFont(composite);
76 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
78 protected void okPressed() {
79 MonitorUIPlugin.getInstance().savePluginPreferences();