1 12 package org.eclipse.ui.internal.progress; 13 14 import org.eclipse.jface.dialogs.Dialog; 15 import org.eclipse.jface.preference.BooleanFieldEditor; 16 import org.eclipse.swt.SWT; 17 import org.eclipse.swt.layout.GridData; 18 import org.eclipse.swt.layout.GridLayout; 19 import org.eclipse.swt.widgets.Composite; 20 import org.eclipse.swt.widgets.Control; 21 import org.eclipse.swt.widgets.Shell; 22 import org.eclipse.ui.IWorkbenchPreferenceConstants; 23 import org.eclipse.ui.internal.util.PrefUtil; 24 import org.eclipse.ui.preferences.ViewSettingsDialog; 25 26 30 public class JobsViewPreferenceDialog extends ViewSettingsDialog { 31 32 private BooleanFieldEditor verboseEditor; 33 34 38 public JobsViewPreferenceDialog(Shell parentShell) { 39 super(parentShell); 40 } 41 42 45 protected void configureShell(Shell newShell) { 46 super.configureShell(newShell); 47 newShell.setText(ProgressMessages.JobsViewPreferenceDialog_Title); 48 } 49 50 53 protected Control createDialogArea(Composite parent) { 54 Composite top = (Composite) super.createDialogArea(parent); 55 56 Composite editArea = new Composite(top, SWT.NONE); 57 editArea.setLayout(new GridLayout()); 58 editArea.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL)); 59 60 verboseEditor = new BooleanFieldEditor("verbose", ProgressMessages.JobsViewPreferenceDialog_Note, editArea); verboseEditor.setPreferenceName(IWorkbenchPreferenceConstants.SHOW_SYSTEM_JOBS); 62 verboseEditor.setPreferenceStore(PrefUtil.getAPIPreferenceStore()); 63 verboseEditor.load(); 64 65 Dialog.applyDialogFont(top); 66 67 return top; 68 } 69 70 73 protected void okPressed() { 74 verboseEditor.store(); 75 super.okPressed(); 76 } 77 78 81 protected void performDefaults() { 82 verboseEditor.loadDefault(); 83 } 84 } 85 | Popular Tags |