1 11 12 package org.eclipse.ui.internal.keys; 13 14 import org.eclipse.swt.SWT; 15 import org.eclipse.swt.layout.GridData; 16 import org.eclipse.swt.layout.GridLayout; 17 import org.eclipse.swt.widgets.Button; 18 import org.eclipse.swt.widgets.Composite; 19 import org.eclipse.swt.widgets.Control; 20 import org.eclipse.swt.widgets.Shell; 21 import org.eclipse.ui.preferences.ViewSettingsDialog; 22 23 30 public class KeysPreferenceFiltersDialog extends ViewSettingsDialog { 31 32 private Button actionSetFilterCheckBox; 33 private Button internalFilterCheckBox; 34 private Button uncategorizedFilterCheckBox; 35 36 private boolean filterActionSet; 37 private boolean filterInternal; 38 private boolean filterUncategorized; 39 40 void setFilterActionSet(boolean b) { 41 filterActionSet = b; 42 } 43 44 void setFilterInternal(boolean b) { 45 filterInternal = b; 46 } 47 48 void setFilterUncategorized(boolean b) { 49 filterUncategorized = b; 50 } 51 52 boolean getFilterActionSet() { 53 return filterActionSet; 54 } 55 56 boolean getFilterInternal() { 57 return filterInternal; 58 } 59 60 boolean getFilterUncategorized() { 61 return filterUncategorized; 62 } 63 64 67 public KeysPreferenceFiltersDialog(Shell parentShell) { 68 super(parentShell); 69 } 70 71 76 protected void performDefaults() { 77 actionSetFilterCheckBox.setSelection(true); 78 internalFilterCheckBox.setSelection(true); 79 uncategorizedFilterCheckBox.setSelection(true); 80 super.performDefaults(); 81 } 82 83 88 protected Control createDialogArea(Composite parent) { 89 Composite topComposite = (Composite) super.createDialogArea(parent); 90 GridLayout layout = new GridLayout(1, false); 91 topComposite.setLayout(layout); 92 topComposite.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL)); 93 actionSetFilterCheckBox = new Button(topComposite, SWT.CHECK); 94 actionSetFilterCheckBox 95 .setText(NewKeysPreferenceMessages.ActionSetFilterCheckBox_Text); 96 internalFilterCheckBox = new Button(topComposite, SWT.CHECK); 97 internalFilterCheckBox 98 .setText(NewKeysPreferenceMessages.InternalFilterCheckBox_Text); 99 uncategorizedFilterCheckBox = new Button(topComposite, SWT.CHECK); 100 uncategorizedFilterCheckBox 101 .setText(NewKeysPreferenceMessages.UncategorizedFilterCheckBox_Text); 102 103 actionSetFilterCheckBox.setSelection(filterActionSet); 104 internalFilterCheckBox.setSelection(filterInternal); 105 uncategorizedFilterCheckBox.setSelection(filterUncategorized); 106 applyDialogFont(topComposite); 107 108 return topComposite; 109 } 110 111 116 protected void okPressed() { 117 filterActionSet = actionSetFilterCheckBox.getSelection(); 118 filterInternal = internalFilterCheckBox.getSelection(); 119 filterUncategorized = uncategorizedFilterCheckBox.getSelection(); 120 super.okPressed(); 121 } 122 123 128 protected void configureShell(Shell newShell) { 129 super.configureShell(newShell); 130 newShell 131 .setText(NewKeysPreferenceMessages.KeysPreferenceFilterDialog_Title); 132 } 133 134 } 135 | Popular Tags |