View | Details | Raw Unified | Return to bug 270569 | Differences between
and this patch

Collapse All | Expand All

(-)compare/org/eclipse/compare/internal/GenerateDiffFileWizard.java (-93 / +108 lines)
Lines 81-88 Link Here
81
public class GenerateDiffFileWizard extends Wizard {
81
public class GenerateDiffFileWizard extends Wizard {
82
82
83
	//The initial size of this wizard.
83
	//The initial size of this wizard.
84
	protected final static int INITIAL_WIDTH = 300;
84
	private final static int INITIAL_WIDTH = 300;
85
	protected final static int INITIAL_HEIGHT = 350;
85
	private final static int INITIAL_HEIGHT = 350;
86
86
87
	public static void run(DocumentMerger merger, Shell shell, boolean rightToLeft) {
87
	public static void run(DocumentMerger merger, Shell shell, boolean rightToLeft) {
88
		final String title = CompareMessages.GenerateLocalDiff_title;
88
		final String title = CompareMessages.GenerateLocalDiff_title;
Lines 93-99 Link Here
93
		dialog.open();
93
		dialog.open();
94
	}
94
	}
95
95
96
	protected class DirectionSelectionPage extends WizardPage {
96
	public class DirectionSelectionPage extends WizardPage {
97
97
98
		public final static int LEFT_OPTION = 1;
98
		public final static int LEFT_OPTION = 1;
99
		public final static int RIGHT_OPTION = 2;
99
		public final static int RIGHT_OPTION = 2;
Lines 184-190 Link Here
184
	 * Page to select a patch file. Overriding validatePage was necessary to
184
	 * Page to select a patch file. Overriding validatePage was necessary to
185
	 * allow entering a file name that already exists.
185
	 * allow entering a file name that already exists.
186
	 */
186
	 */
187
	protected class LocationPage extends WizardPage {
187
	public class LocationPage extends WizardPage {
188
188
189
		/**
189
		/**
190
		 * The possible locations to save a patch.
190
		 * The possible locations to save a patch.
Lines 266-272 Link Here
266
				return control;
266
				return control;
267
			}
267
			}
268
268
269
			protected Control createDialogArea(Composite parent) {
269
			protected Control createDialogArea(Composite parent){
270
				Composite parentComposite = (Composite) super.createDialogArea(parent);
270
				Composite parentComposite = (Composite) super.createDialogArea(parent);
271
271
272
				// create a composite with standard margins and spacing
272
				// create a composite with standard margins and spacing
Lines 598-603 Link Here
598
		 * selected to save the patch in the clipboard or file system.
598
		 * selected to save the patch in the clipboard or file system.
599
		 */
599
		 */
600
		public String getWorkspaceLocation() {
600
		public String getWorkspaceLocation() {
601
601
			if (pageValid && selectedLocation == WORKSPACE) {
602
			if (pageValid && selectedLocation == WORKSPACE) {
602
				final String filename= wsPathText.getText().trim();
603
				final String filename= wsPathText.getText().trim();
603
				return filename;
604
				return filename;
Lines 640-645 Link Here
640
641
641
			Dialog.applyDialogFont(parent);
642
			Dialog.applyDialogFont(parent);
642
643
644
			/**
645
			 * Ensure the page is in a valid state.
646
			 */
647
			/*if (!validatePage()) {
648
                store.storeRadioSelection(CLIPBOARD);
649
                initializeDefaultValues();
650
                validatePage();
651
            }
652
            pageValid= true;*/
643
			validatePage();
653
			validatePage();
644
654
645
			updateEnablements();
655
			updateEnablements();
Lines 857-885 Link Here
857
		public final static int ROOT_WORKSPACE = 1;
867
		public final static int ROOT_WORKSPACE = 1;
858
		public final static int ROOT_PROJECT = 2;
868
		public final static int ROOT_PROJECT = 2;
859
		public final static int ROOT_SELECTION = 3;
869
		public final static int ROOT_SELECTION = 3;
860
		public final static int ROOT_CUSTOM = 4;
861
862
		protected boolean initialized = false;
863
864
		protected Button unifiedDiffOption;
865
		protected Button unified_workspaceRelativeOption; //multi-patch format
866
		protected Button unified_projectRelativeOption; //full project path
867
		protected Button unified_selectionRelativeOption; //use path of whatever is selected
868
		protected Button contextDiffOption;
869
		protected Button regularDiffOption;
870
871
		protected Group unifiedGroup;
872
		protected Group diffTypeGroup;
873
870
871
		private Button unifiedDiffOption;
872
		private Button unified_workspaceRelativeOption; //multi-patch format
873
		private Button unified_projectRelativeOption; //full project path
874
		private Button unified_selectionRelativeOption; //use path of whatever is selected
875
		private Button contextDiffOption;
876
		private Button regularDiffOption;
874
		protected final RadioButtonGroup diffTypeRadioGroup = new RadioButtonGroup();
877
		protected final RadioButtonGroup diffTypeRadioGroup = new RadioButtonGroup();
875
		protected final RadioButtonGroup unifiedRadioGroup = new RadioButtonGroup();
878
		protected final RadioButtonGroup unifiedRadioGroup = new RadioButtonGroup();
879
		protected Group unifiedGroup;
880
		protected Group diffTypeGroup;
881
		
882
		private boolean patchHasCommonRoot=true;
876
883
877
		private final DefaultValuesStore store;
884
		private final DefaultValuesStore store;
878
885
879
		/**
886
		/**
880
		 * Constructor for PatchFileCreationOptionsPage.
887
		 * Constructor for PatchFileCreationOptionsPage.
888
		 * 
889
		 * @param pageName
890
		 *            the name of the page
891
		 * 
892
		 * @param title
893
		 *            the title for this wizard page, or <code>null</code> if
894
		 *            none
895
		 * @param titleImage
896
		 *            the image descriptor for the title of this wizard page, or
897
		 *            <code>null</code> if none
898
		 * @param store
899
		 *            the value store where the page stores it's data
881
		 */
900
		 */
882
		protected OptionsPage(String pageName, String title, ImageDescriptor titleImage, DefaultValuesStore store) {
901
		protected OptionsPage(String pageName, String title,
902
				ImageDescriptor titleImage, DefaultValuesStore store) {
883
			super(pageName, title, titleImage);
903
			super(pageName, title, titleImage);
884
			this.store = store;
904
			this.store = store;
885
		}
905
		}
Lines 917-923 Link Here
917
			diffTypeRadioGroup.add(FORMAT_CONTEXT, contextDiffOption);
937
			diffTypeRadioGroup.add(FORMAT_CONTEXT, contextDiffOption);
918
			diffTypeRadioGroup.add(FORMAT_STANDARD, regularDiffOption);
938
			diffTypeRadioGroup.add(FORMAT_STANDARD, regularDiffOption);
919
939
920
			// Unified Format Options
940
			//Unified Format Options
921
			unifiedGroup = new Group(composite, SWT.None);
941
			unifiedGroup = new Group(composite, SWT.None);
922
			layout = new GridLayout();
942
			layout = new GridLayout();
923
			layout.numColumns = 2;
943
			layout.numColumns = 2;
Lines 928-945 Link Here
928
948
929
			unified_workspaceRelativeOption = new Button(unifiedGroup, SWT.RADIO);
949
			unified_workspaceRelativeOption = new Button(unifiedGroup, SWT.RADIO);
930
			unified_workspaceRelativeOption.setText(CompareMessages.GenerateDiffFileWizard_6);
950
			unified_workspaceRelativeOption.setText(CompareMessages.GenerateDiffFileWizard_6);
931
			unified_workspaceRelativeOption.setLayoutData(new GridData(
932
					SWT.BEGINNING, SWT.CENTER, false, false, 2, 1));
933
951
934
			unified_projectRelativeOption = new Button(unifiedGroup, SWT.RADIO);
952
			unified_projectRelativeOption = new Button(unifiedGroup, SWT.RADIO);
935
			unified_projectRelativeOption.setText(CompareMessages.GenerateDiffFileWizard_7);
953
			unified_projectRelativeOption.setText(CompareMessages.GenerateDiffFileWizard_7);
936
			unified_projectRelativeOption.setLayoutData(new GridData(
937
					SWT.BEGINNING, SWT.CENTER, false, false, 2, 1));
938
954
939
			unified_selectionRelativeOption = new Button(unifiedGroup, SWT.RADIO);
955
			unified_selectionRelativeOption = new Button(unifiedGroup, SWT.RADIO);
940
			unified_selectionRelativeOption.setText(CompareMessages.GenerateDiffFileWizard_8);
956
			unified_selectionRelativeOption.setText(CompareMessages.GenerateDiffFileWizard_8);
941
			unified_selectionRelativeOption.setLayoutData(new GridData(
942
					SWT.BEGINNING, SWT.CENTER, false, true, 2, 1));
943
957
944
			unifiedRadioGroup.add(ROOT_WORKSPACE, unified_workspaceRelativeOption);
958
			unifiedRadioGroup.add(ROOT_WORKSPACE, unified_workspaceRelativeOption);
945
			unifiedRadioGroup.add(ROOT_PROJECT, unified_projectRelativeOption);
959
			unifiedRadioGroup.add(ROOT_PROJECT, unified_projectRelativeOption);
Lines 997-1013 Link Here
997
1011
998
			updateEnablements();
1012
			updateEnablements();
999
1013
1000
			performSpecificActions();
1001
1002
			// update selection
1014
			// update selection
1003
			diffTypeRadioGroup.selectEnabledOnly();
1015
			diffTypeRadioGroup.selectEnabledOnly();
1004
			unifiedRadioGroup.selectEnabledOnly();
1016
			unifiedRadioGroup.selectEnabledOnly();
1005
		}
1017
		}
1006
1018
1007
		protected void performSpecificActions() {
1008
			return;
1009
		}
1010
1011
		public int getFormatSelection() {
1019
		public int getFormatSelection() {
1012
			return diffTypeRadioGroup.getSelected();
1020
			return diffTypeRadioGroup.getSelected();
1013
		}
1021
		}
Lines 1016-1063 Link Here
1016
			return unifiedRadioGroup.getSelected();
1024
			return unifiedRadioGroup.getSelected();
1017
		}
1025
		}
1018
1026
1019
		public String getPath() {
1020
			return unified_customRelativeText.getText();
1021
		}
1022
1023
		private void initializeDefaultValues() {
1027
		private void initializeDefaultValues() {
1024
			// Radio buttons for format
1028
			// Radio buttons for format
1025
			diffTypeRadioGroup.setSelection(store.getFormatSelection(), true);
1029
			diffTypeRadioGroup.setSelection(store.getFormatSelection(), true);
1026
			// Radio buttons for patch root
1030
			// Radio buttons for patch root
1027
			unifiedRadioGroup.setSelection(store.getRootSelection(), true);
1031
			unifiedRadioGroup.setSelection(store.getRootSelection(), true);
1028
		}
1029
1032
1030
		protected void updateEnablements() {
1033
			if (store.getFormatSelection() != FORMAT_UNIFIED) {
1031
			if(diffTypeRadioGroup.selected != FORMAT_UNIFIED)
1032
				setEnableUnifiedGroup(false);
1034
				setEnableUnifiedGroup(false);
1035
			}
1033
		}
1036
		}
1034
1037
1035
		public void updateDiffTypeEnablements(int[] disabled, int enabled) {
1036
			diffTypeRadioGroup.setEnablement(false, disabled, enabled);
1037
		}
1038
1038
1039
		public void updateUnifiedEnablements(int[] disabled, int enabled) {
1039
		protected void updateEnablements() {
1040
			unifiedRadioGroup.setEnablement(false, disabled, enabled);
1040
			if (!patchHasCommonRoot){
1041
		}
1041
				diffTypeRadioGroup.setEnablement(false, new int[] {
1042
						FORMAT_CONTEXT, FORMAT_STANDARD }, FORMAT_UNIFIED);
1043
				unifiedRadioGroup.setEnablement(false, new int[] {
1044
						ROOT_PROJECT, ROOT_SELECTION }, ROOT_WORKSPACE);
1045
			}
1042
1046
1043
		protected void setEnableUnifiedGroup(boolean enabled) {
1047
			// temporary until we figure out best way to fix synchronize view
1048
			// selection
1049
			if (!unifiedSelectionEnabled)
1050
				unifiedRadioGroup.setEnablement(false, new int[] {ROOT_SELECTION});
1051
		}
1052
		
1053
		protected void setEnableUnifiedGroup(boolean enabled){
1044
			unifiedRadioGroup.setEnablement(enabled, new int[] {
1054
			unifiedRadioGroup.setEnablement(enabled, new int[] {
1045
					ROOT_WORKSPACE, ROOT_PROJECT, ROOT_SELECTION });
1055
					ROOT_WORKSPACE, ROOT_PROJECT, ROOT_SELECTION });
1046
		}
1047
1056
1057
			//temporary until we figure out best way to fix synchronize view selection
1058
			if (!unifiedSelectionEnabled)
1059
				unifiedRadioGroup.setEnablement(false, new int[] {ROOT_SELECTION});
1060
		}
1048
	}
1061
	}
1049
1062
1050
	/**
1063
	/**
1051
	 * Class to retrieve and store the default selected values.
1064
	 * Class to retrieve and store the default selected values.
1052
	 */
1065
	 */
1053
	protected final class DefaultValuesStore {
1066
	private final class DefaultValuesStore {
1054
1067
1055
		private static final String PREF_LAST_SELECTION = "org.eclipse.compare.internal.GenerateDiffFileWizard.PatchFileSelectionPage.lastselection"; //$NON-NLS-1$
1068
		private static final String PREF_LAST_SELECTION= "org.eclipse.compare.internal.GenerateDiffFileWizard.PatchFileSelectionPage.lastselection"; //$NON-NLS-1$
1056
		private static final String PREF_LAST_FS_PATH = "org.eclipse.compare.internal.GenerateDiffFileWizard.PatchFileSelectionPage.filesystem.path"; //$NON-NLS-1$
1069
		private static final String PREF_LAST_FS_PATH= "org.eclipse.compare.internal.GenerateDiffFileWizard.PatchFileSelectionPage.filesystem.path"; //$NON-NLS-1$
1057
		private static final String PREF_LAST_WS_PATH = "org.eclipse.compare.internal.GenerateDiffFileWizard.PatchFileSelectionPage.workspace.path"; //$NON-NLS-1$
1070
		private static final String PREF_LAST_WS_PATH= "org.eclipse.compare.internal.GenerateDiffFileWizard.PatchFileSelectionPage.workspace.path"; //$NON-NLS-1$
1058
		private static final String PREF_LAST_AO_FORMAT = "org.eclipse.compare.internal.GenerateDiffFileWizard.OptionsPage.diff.format"; //$NON-NLS-1$
1071
		private static final String PREF_LAST_AO_FORMAT = "org.eclipse.compare.internal.GenerateDiffFileWizard.OptionsPage.diff.format"; //$NON-NLS-1$
1059
		private static final String PREF_LAST_AO_ROOT = "org.eclipse.compare.internal.GenerateDiffFileWizard.OptionsPage.patch.root"; //$NON-NLS-1$
1072
		private static final String PREF_LAST_AO_ROOT = "org.eclipse.compare.internal.GenerateDiffFileWizard.OptionsPage.patch.root"; //$NON-NLS-1$
1060
1073
1074
1061
		private final IDialogSettings dialogSettings;
1075
		private final IDialogSettings dialogSettings;
1062
1076
1063
		public DefaultValuesStore() {
1077
		public DefaultValuesStore() {
Lines 1069-1075 Link Here
1069
			try {
1083
			try {
1070
				value= dialogSettings.getInt(PREF_LAST_SELECTION);
1084
				value= dialogSettings.getInt(PREF_LAST_SELECTION);
1071
			} catch (NumberFormatException e) {
1085
			} catch (NumberFormatException e) {
1072
				// do nothing
1086
				// ignore
1073
			}
1087
			}
1074
1088
1075
			switch (value) {
1089
			switch (value) {
Lines 1151-1157 Link Here
1151
	private DirectionSelectionPage directionSelectionPage;
1165
	private DirectionSelectionPage directionSelectionPage;
1152
	private LocationPage locationPage;
1166
	private LocationPage locationPage;
1153
	private OptionsPage optionsPage;
1167
	private OptionsPage optionsPage;
1154
1168
	
1155
	private final DefaultValuesStore defaultValuesStore;
1169
	private final DefaultValuesStore defaultValuesStore;
1156
1170
1157
	private DocumentMerger merger;
1171
	private DocumentMerger merger;
Lines 1163-1176 Link Here
1163
1177
1164
	private boolean targetFileEdited = false;
1178
	private boolean targetFileEdited = false;
1165
1179
1166
	private Text unified_customRelativeText;
1180
	//temporary until we figure out best way to fix synchronize view selection
1167
	private Button unified_customRelativeOption;
1181
	protected boolean unifiedSelectionEnabled = true;
1168
1182
1169
	public GenerateDiffFileWizard() {
1183
	public GenerateDiffFileWizard() {
1170
		super();
1184
		super();
1171
		setWindowTitle(CompareMessages.GenerateLocalDiff_title);
1185
		setWindowTitle(CompareMessages.GenerateLocalDiff_title);
1172
		initializeDefaultPageImageDescriptor();
1186
		initializeDefaultPageImageDescriptor();
1173
		defaultValuesStore = new DefaultValuesStore();
1187
		defaultValuesStore= new DefaultValuesStore();
1174
	}
1188
	}
1175
1189
1176
	public GenerateDiffFileWizard(DocumentMerger merger, boolean rightToLeft) {
1190
	public GenerateDiffFileWizard(DocumentMerger merger, boolean rightToLeft) {
Lines 1206-1211 Link Here
1206
				.getImageDescriptor(ICompareUIConstants.IMG_WIZBAN_DIFF),
1220
				.getImageDescriptor(ICompareUIConstants.IMG_WIZBAN_DIFF),
1207
				defaultValuesStore) {
1221
				defaultValuesStore) {
1208
1222
1223
			private Text unified_customRelativeText;
1224
			private Button unified_customRelativeOption;
1225
			public final static int ROOT_CUSTOM = 4;
1226
			protected boolean initialized = false;
1227
			
1209
			public void setVisible(boolean visible) {
1228
			public void setVisible(boolean visible) {
1210
				super.setVisible(visible);
1229
				super.setVisible(visible);
1211
				if (!initialized && visible) {
1230
				if (!initialized && visible) {
Lines 1218-1226 Link Here
1218
				}
1237
				}
1219
				validateCustomPatchRoot(this.getPath());
1238
				validateCustomPatchRoot(this.getPath());
1220
			}
1239
			}
1240
			
1241
			private String getPath() {
1242
				return unified_customRelativeText.getText();
1243
			}
1221
1244
1222
			private void validateCustomPatchRoot(String path) {
1245
			private void validateCustomPatchRoot(String path) {
1223
				if (this.getRootSelection() == OptionsPage.ROOT_CUSTOM
1246
				if (this.getRootSelection() == ROOT_CUSTOM
1224
						&& !ResourcesPlugin.getWorkspace().validatePath(path,
1247
						&& !ResourcesPlugin.getWorkspace().validatePath(path,
1225
								IResource.FILE).isOK()) {
1248
								IResource.FILE).isOK()) {
1226
					this.setMessage(CompareMessages.GenerateLocalDiff_4,
1249
					this.setMessage(CompareMessages.GenerateLocalDiff_4,
Lines 1230-1239 Link Here
1230
				this.setMessage(null);
1253
				this.setMessage(null);
1231
			}
1254
			}
1232
1255
1233
			protected void performSpecificActions() {
1234
				createCustomRelativeControl();
1235
			}
1236
1237
			protected void updateEnablements() {
1256
			protected void updateEnablements() {
1238
				diffTypeRadioGroup.setEnablement(false, new int[] { FORMAT_CONTEXT,
1257
				diffTypeRadioGroup.setEnablement(false, new int[] { FORMAT_CONTEXT,
1239
						FORMAT_STANDARD }, FORMAT_UNIFIED);
1258
						FORMAT_STANDARD }, FORMAT_UNIFIED);
Lines 1246-1251 Link Here
1246
						ROOT_WORKSPACE, ROOT_PROJECT, ROOT_SELECTION });
1265
						ROOT_WORKSPACE, ROOT_PROJECT, ROOT_SELECTION });
1247
			}
1266
			}
1248
			
1267
			
1268
			public void createControl(Composite parent) {
1269
				super.createControl(parent);
1270
				createCustomRelativeControl();
1271
				updateEnablements();
1272
				diffTypeRadioGroup.selectEnabledOnly();
1273
				unifiedRadioGroup.selectEnabledOnly();
1274
			}
1275
			
1276
			public void updateDiffTypeEnablements(int[] disabled, int enabled) {
1277
				diffTypeRadioGroup.setEnablement(false, disabled, enabled);
1278
			}
1279
			
1280
			public void updateUnifiedEnablements(int[] disabled, int enabled) {
1281
				unifiedRadioGroup.setEnablement(false, disabled, enabled);
1282
			}
1283
			
1249
			private void createCustomRelativeControl() {
1284
			private void createCustomRelativeControl() {
1250
				unified_customRelativeOption = new Button(unifiedGroup, SWT.RADIO);
1285
				unified_customRelativeOption = new Button(unifiedGroup, SWT.RADIO);
1251
				unified_customRelativeOption.setText(CompareMessages.GenerateDiffFileWizard_13);
1286
				unified_customRelativeOption.setText(CompareMessages.GenerateDiffFileWizard_13);
Lines 1266-1279 Link Here
1266
					}
1301
					}
1267
				});
1302
				});
1268
				
1303
				
1269
				unifiedRadioGroup.add(OptionsPage.ROOT_CUSTOM, unified_customRelativeOption);
1304
				unifiedRadioGroup.add(ROOT_CUSTOM, unified_customRelativeOption);
1270
				unified_customRelativeOption.addSelectionListener(new SelectionAdapter() {
1305
				unified_customRelativeOption.addSelectionListener(new SelectionAdapter() {
1271
					public void widgetSelected(SelectionEvent e) {
1306
					public void widgetSelected(SelectionEvent e) {
1272
						unifiedRadioGroup.setSelection(OptionsPage.ROOT_CUSTOM, false);
1307
						unifiedRadioGroup.setSelection(ROOT_CUSTOM, false);
1273
					}
1308
					}
1274
				});
1309
				});
1275
				optionsPage.updateDiffTypeEnablements(new int[] {OptionsPage.FORMAT_CONTEXT, OptionsPage.FORMAT_STANDARD}, OptionsPage.FORMAT_UNIFIED);
1310
				updateDiffTypeEnablements(new int[] {OptionsPage.FORMAT_CONTEXT, OptionsPage.FORMAT_STANDARD}, OptionsPage.FORMAT_UNIFIED);
1276
				optionsPage.updateUnifiedEnablements(new int[] {OptionsPage.ROOT_PROJECT, OptionsPage.ROOT_WORKSPACE, OptionsPage.ROOT_SELECTION}, OptionsPage.ROOT_CUSTOM);
1311
				updateUnifiedEnablements(new int[] {OptionsPage.ROOT_PROJECT, OptionsPage.ROOT_WORKSPACE, OptionsPage.ROOT_SELECTION}, ROOT_CUSTOM);
1277
			}
1312
			}
1278
		};
1313
		};
1279
		optionsPage.setDescription(pageDescription);
1314
		optionsPage.setDescription(pageDescription);
Lines 1281-1287 Link Here
1281
	}
1316
	}
1282
1317
1283
	/**
1318
	/**
1284
	 * Declares the wizard banner image descriptor
1319
	 * Declares the wizard banner iamge descriptor
1285
	 */
1320
	 */
1286
	protected void initializeDefaultPageImageDescriptor() {
1321
	protected void initializeDefaultPageImageDescriptor() {
1287
		final String iconPath= "icons/full/"; //$NON-NLS-1$
1322
		final String iconPath= "icons/full/"; //$NON-NLS-1$
Lines 1295-1316 Link Here
1295
		}
1330
		}
1296
	}
1331
	}
1297
1332
1298
	/*
1333
	/* (Non-javadoc)
1299
	 * (non-Javadoc)
1334
	 * Method declared on IWizard.
1300
	 * 
1301
	 * @see org.eclipse.jface.wizard.Wizard#needsProgressMonitor()
1302
	 */
1335
	 */
1303
	public boolean needsProgressMonitor() {
1336
	public boolean needsProgressMonitor() {
1304
		return true;
1337
		return true;
1305
	}
1338
	}
1306
1339
1307
	/*
1340
	/**
1308
	 * (non-Javadoc)
1341
	 * Completes processing of the wizard. If this method returns <code>
1309
	 * 
1342
	 * true</code>, the wizard will close; otherwise, it will stay active.
1310
	 * @see org.eclipse.jface.wizard.Wizard#performFinish()
1311
	 */
1343
	 */
1312
	public boolean performFinish() {
1344
	public boolean performFinish() {
1313
		final int location = locationPage.getSelectedLocation();
1345
1346
		final int location= locationPage.getSelectedLocation();
1314
1347
1315
		final File file= location != LocationPage.CLIPBOARD? locationPage.getFile() : null;
1348
		final File file= location != LocationPage.CLIPBOARD? locationPage.getFile() : null;
1316
1349
Lines 1431-1454 Link Here
1431
		return true;
1464
		return true;
1432
	}
1465
	}
1433
1466
1434
	public boolean validateFile2(IFile file) {
1435
		if (file == null)
1436
			return false;
1437
1438
		// Consider file invalid if it doesn't exist.
1439
		if (!file.exists()) {
1440
			final String title = CompareMessages.GenerateLocalDiff_3;
1441
			final String msg = CompareMessages.GenerateLocalDiff_4;
1442
			final MessageDialog dialog = new MessageDialog(getShell(), title,
1443
					null, msg, MessageDialog.ERROR,
1444
					new String[] { IDialogConstants.OK_LABEL }, 0);
1445
			dialog.open();
1446
			return false;
1447
		}
1448
1449
		return true;
1450
	}
1451
1452
	public LocationPage getLocationPage() {
1467
	public LocationPage getLocationPage() {
1453
		return locationPage;
1468
		return locationPage;
1454
	}
1469
	}

Return to bug 270569