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

Collapse All | Expand All

(-)compare/org/eclipse/compare/patch/ApplyPatchOperation.java (-15 / +18 lines)
Lines 139-157 Link Here
139
	 * This method must be called from the UI thread.
139
	 * This method must be called from the UI thread.
140
	 */
140
	 */
141
	public void openWizard() {
141
	public void openWizard() {
142
		
142
		if(saveAllEditors()) {
143
		saveAllEditors();
143
			PatchWizard wizard = new PatchWizard(patch, target, configuration);
144
		
144
			if (patchWizardImage != null)
145
		PatchWizard wizard = new PatchWizard(patch, target, configuration);
145
				wizard.setDefaultPageImageDescriptor(patchWizardImage);
146
		if (patchWizardImage != null)
146
			if (patchWizardTitle != null)
147
			wizard.setDefaultPageImageDescriptor(patchWizardImage);
147
				wizard.setWindowTitle(patchWizardTitle);
148
		if (patchWizardTitle != null)
148
			wizard.setNeedsProgressMonitor(true);
149
			wizard.setWindowTitle(patchWizardTitle);
149
150
		wizard.setNeedsProgressMonitor(true);
150
			PatchWizardDialog dialog = new PatchWizardDialog(getShell(), wizard);
151
		
151
			wizard.setDialog(dialog);
152
		PatchWizardDialog dialog = new PatchWizardDialog(getShell(), wizard);
152
			dialog.open();
153
		wizard.setDialog(dialog);
153
		}
154
		dialog.open();
155
	}
154
	}
156
155
157
	/**
156
	/**
Lines 170-178 Link Here
170
	 * This method will save all dirty editors. It will prompt the user if the Compare preference to save
169
	 * This method will save all dirty editors. It will prompt the user if the Compare preference to save
171
	 * dirty editors before viewing a patch is <code>false</code>. Clients can use this or provide their own
170
	 * dirty editors before viewing a patch is <code>false</code>. Clients can use this or provide their own
172
	 * implementation.
171
	 * implementation.
172
	 * 
173
	  * @return <code>true</code> if the command succeeded, and
174
	 *         <code>false</code> if the operation was canceled by the user or
175
	 *         an error occurred while saving
173
	 */
176
	 */
174
	protected void saveAllEditors(){
177
	protected boolean saveAllEditors(){
175
		IDE.saveAllEditors(new IResource[]{ResourcesPlugin.getWorkspace().getRoot()}, !ComparePreferencePage.getSaveAllEditors());
178
		return IDE.saveAllEditors(new IResource[]{ResourcesPlugin.getWorkspace().getRoot()}, !ComparePreferencePage.getSaveAllEditors());
176
	}
179
	}
177
	
180
	
178
	/**
181
	/**

Return to bug 208022