1 11 package org.eclipse.compare.internal; 12 13 import org.eclipse.jface.dialogs.*; 14 import org.eclipse.jface.preference.RadioGroupFieldEditor; 15 import org.eclipse.swt.graphics.Image; 16 import org.eclipse.swt.widgets.*; 17 18 public class NavigationEndDialog extends MessageDialogWithToggle { 19 20 private final String [][] labelsAndValues; 21 private RadioGroupFieldEditor editor; 22 23 public NavigationEndDialog(Shell parentShell, String dialogTitle, 24 Image dialogTitleImage, String dialogMessage, String [][] labelsAndValues) { 25 super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, 26 QUESTION, new String [] { IDialogConstants.OK_LABEL , IDialogConstants.CANCEL_LABEL}, 0, 27 CompareMessages.NavigationEndDialog_0, false); 28 this.labelsAndValues = labelsAndValues; 29 } 30 31 protected Control createCustomArea(Composite parent) { 32 editor = new RadioGroupFieldEditor(ICompareUIConstants.PREF_NAVIGATION_END_ACTION_LOCAL, CompareMessages.NavigationEndDialog_1, 1, 33 labelsAndValues, 34 parent, true); 35 editor.setPreferenceStore(CompareUIPlugin.getDefault().getPreferenceStore()); 36 editor.fillIntoGrid(parent, 1); 37 editor.load(); 38 return parent; 39 } 40 41 protected void buttonPressed(int buttonId) { 42 if (buttonId == IDialogConstants.OK_ID) { 43 editor.store(); 44 } 45 super.buttonPressed(buttonId); 46 } 47 48 } 49 | Popular Tags |