1 11 package org.eclipse.team.internal.ccvs.ui.subscriber; 12 13 import org.eclipse.jface.dialogs.IDialogConstants; 14 import org.eclipse.swt.SWT; 15 import org.eclipse.swt.layout.GridLayout; 16 import org.eclipse.swt.widgets.Composite; 17 import org.eclipse.swt.widgets.Shell; 18 import org.eclipse.team.core.synchronize.SyncInfoSet; 19 import org.eclipse.team.internal.ccvs.ui.CVSUIMessages; 20 21 26 public class UpdateDialog extends SyncInfoSetDetailsDialog { 27 28 public static final int YES = IDialogConstants.YES_ID; 29 30 public UpdateDialog(Shell parentShell, SyncInfoSet syncSet) { 31 super(parentShell, CVSUIMessages.UpdateDialog_overwriteTitle, syncSet); } 33 34 37 protected void createMainDialogArea(Composite parent) { 38 Composite composite = new Composite(parent, SWT.NONE); 39 composite.setLayout(new GridLayout()); 40 41 44 createWrappingLabel(composite, CVSUIMessages.UpdateDialog_overwriteMessage); 45 } 46 47 protected void createButtonsForButtonBar(Composite parent) { 48 createButton(parent, YES, IDialogConstants.YES_LABEL, false); 49 createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, true); 50 super.createButtonsForButtonBar(parent); 51 } 52 53 protected boolean includeOkButton() { 54 return false; 55 } 56 57 protected boolean includeCancelButton() { 58 return false; 59 } 60 61 protected void buttonPressed(int id) { 62 if(id == YES || id == IDialogConstants.NO_ID) { 65 setReturnCode(id); 66 filterSyncSet(); 67 close(); 68 } else { 69 super.buttonPressed(id); 70 } 71 } 72 } 73 | Popular Tags |