Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.compare/compare/org/eclipse/compare/patch/ApplyPatchOperation.java')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/patch/ApplyPatchOperation.java42
1 files changed, 21 insertions, 21 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/patch/ApplyPatchOperation.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/patch/ApplyPatchOperation.java
index 6623f007d..3d7bf3751 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/patch/ApplyPatchOperation.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/patch/ApplyPatchOperation.java
@@ -43,42 +43,42 @@ import org.eclipse.ui.ide.IDE;
* user can also supply a title and image to override the default ones provided by the Apply Patch Wizard.
* Note that the Apply Patch Wizard does not require any particular set of inputs, and in the absence of
* any user supplied values, it will work in default mode.
- *
+ *
* @since 3.3
*
*/
public class ApplyPatchOperation implements Runnable {
private IWorkbenchPart part;
-
+
/**
* Used for the Preview Patch page.
*/
private CompareConfiguration configuration;
-
+
/**
* The patch to use as an input into the Apply Patch wizard
*/
private IStorage patch;
-
+
/**
* Specific <code>IResource</code> target to patch.
*/
private IResource target;
-
+
/**
* An optional image for the patch wizard
*/
private ImageDescriptor patchWizardImage;
-
-
+
+
/**
* An optional title for the patchWizard
*/
private String patchWizardTitle;
private boolean saveAllEditors = true;
-
+
/**
* Return whether the given storage contains a patch.
* @param storage the storage
@@ -88,7 +88,7 @@ public class ApplyPatchOperation implements Runnable {
public static boolean isPatch(IStorage storage) throws CoreException {
return internalParsePatch(storage).length > 0;
}
-
+
/**
* Parse the given patch and return the set of file patches that it contains.
* @param storage the storage that contains the patch
@@ -98,19 +98,19 @@ public class ApplyPatchOperation implements Runnable {
public static IFilePatch[] parsePatch(IStorage storage) throws CoreException {
return internalParsePatch(storage);
}
-
+
/**
* Creates a new ApplyPatchOperation with the supplied compare configuration, patch and target.
* The behaviour of the Apply Patch wizard is controlled by the number of parameters supplied:
* <ul>
* <li>If a patch is supplied, the initial input page is skipped. If a patch is not supplied the wizard
* will open on the input page.</li>
- * <li>If the patch is a workspace patch, the target selection page is skipped and the preview page is
+ * <li>If the patch is a workspace patch, the target selection page is skipped and the preview page is
* displayed.</li>
* <li>If the patch is not a workspace patch and the target is specified, the target page is still
* shown with the target selected.</li>
- * </ul>
- *
+ * </ul>
+ *
* @param part an IWorkbenchPart or <code>null</code>
* @param patch an IStorage containing a patch in unified diff format or <code>null</code>
* @param target an IResource which the patch is to be applied to or <code>null</code>
@@ -123,7 +123,7 @@ public class ApplyPatchOperation implements Runnable {
this.target = target;
this.configuration = configuration;
}
-
+
/**
* Create an operation for the given part and resource. This method is a convenience
* method that calls {@link #ApplyPatchOperation(IWorkbenchPart, IStorage, IResource, CompareConfiguration)}
@@ -142,7 +142,7 @@ public class ApplyPatchOperation implements Runnable {
*/
public void openWizard() {
saveAllEditors();
-
+
if (saveAllEditors) {
PatchWizard wizard = new PatchWizard(patch, target, configuration);
if (patchWizardImage != null)
@@ -166,7 +166,7 @@ public class ApplyPatchOperation implements Runnable {
return CompareUIPlugin.getShell();
return part.getSite().getShell();
}
-
+
/**
* This method will save all dirty editors. It will prompt the user if the Compare preference to save
* dirty editors before viewing a patch is <code>false</code>. Clients can use this or provide their own
@@ -175,7 +175,7 @@ public class ApplyPatchOperation implements Runnable {
protected void saveAllEditors(){
saveAllEditors = IDE.saveAllEditors(new IResource[]{ResourcesPlugin.getWorkspace().getRoot()}, !ComparePreferencePage.getSaveAllEditors());
}
-
+
/**
* Sets the title of the patch wizard. Needs to be set before {@link #openWizard()} is called.
* @param title a string to display in the title bar
@@ -183,7 +183,7 @@ public class ApplyPatchOperation implements Runnable {
public void setPatchWizardTitle(String title){
this.patchWizardTitle = title;
}
-
+
/**
* Sets the image descriptor to use in the patch wizard. Needs to be set before {@link #openWizard()} is called.
* @param descriptor an image descriptor
@@ -191,14 +191,14 @@ public class ApplyPatchOperation implements Runnable {
public void setPatchWizardImageDescriptor(ImageDescriptor descriptor){
this.patchWizardImage = descriptor;
}
-
+
/* (non-Javadoc)
* @see java.lang.Runnable#run()
*/
public void run() {
openWizard();
}
-
+
private static IFilePatch[] internalParsePatch(IStorage storage)
throws CoreException {
BufferedReader reader = Utilities.createReader(storage);
@@ -230,5 +230,5 @@ public class ApplyPatchOperation implements Runnable {
}
}
-
+
}

Back to the top