1 11 package org.eclipse.ui.preferences; 12 13 import org.eclipse.jface.dialogs.Dialog; 14 import org.eclipse.jface.resource.JFaceResources; 15 import org.eclipse.swt.SWT; 16 import org.eclipse.swt.layout.GridData; 17 import org.eclipse.swt.layout.GridLayout; 18 import org.eclipse.swt.widgets.Composite; 19 import org.eclipse.swt.widgets.Label; 20 import org.eclipse.swt.widgets.Shell; 21 22 28 public class ViewSettingsDialog extends Dialog { 29 30 private static int DEFAULTS_BUTTON_ID = 25; 31 32 36 public ViewSettingsDialog(Shell parentShell) { 37 super(parentShell); 38 } 39 40 43 protected void buttonPressed(int buttonId) { 44 if (buttonId == DEFAULTS_BUTTON_ID) { 45 performDefaults(); 46 } 47 super.buttonPressed(buttonId); 48 } 49 50 58 protected void performDefaults() { 59 61 } 62 63 66 protected void createButtonsForButtonBar(Composite parent) { 67 parent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); 68 69 createButton(parent, DEFAULTS_BUTTON_ID, JFaceResources.getString("defaults"), false); 71 Label l = new Label(parent, SWT.NONE); 72 l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); 73 74 l = new Label(parent, SWT.NONE); 75 l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); 76 77 GridLayout layout = (GridLayout) parent.getLayout(); 78 layout.numColumns += 2; 79 layout.makeColumnsEqualWidth = false; 80 81 super.createButtonsForButtonBar(parent); 82 } 83 84 } 85 | Popular Tags |