|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.compare.patch.ApplyPatchOperation
An operation that provides an interface to the Apply Patch Wizard. Users specify
the input in terms of an IStorage
(note: input must be in unified diff
format), an IResource
target to apply the patch to and can provide CompareConfiguration
elements to supply the label and images used on the preview page and hunk merge page. Finally, the
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.
Constructor Summary | |
---|---|
ApplyPatchOperation(IWorkbenchPart targetPart,
IResource resource)
Create an operation for the given part and resource. |
|
ApplyPatchOperation(IWorkbenchPart part,
IStorage patch,
IResource target,
CompareConfiguration configuration)
Creates a new ApplyPatchOperation with the supplied compare configuration, patch and target. |
Method Summary | |
---|---|
protected Shell |
getShell()
Return the parent shell to be used when the wizard is opened. |
static boolean |
isPatch(IStorage storage)
Return whether the given storage contains a patch. |
void |
openWizard()
Open the Apply Patch wizard using the values associated with this operation. |
static IFilePatch[] |
parsePatch(IStorage storage)
Parse the given patch and return the set of file patches that it contains. |
void |
run()
|
protected void |
saveAllEditors()
This method will save all dirty editors. |
void |
setPatchWizardImageDescriptor(ImageDescriptor descriptor)
Sets the image descriptor to use in the patch wizard. |
void |
setPatchWizardTitle(String title)
Sets the title of the patch wizard. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ApplyPatchOperation(IWorkbenchPart part, IStorage patch, IResource target, CompareConfiguration configuration)
part
- an IWorkbenchPart or null
patch
- an IStorage containing a patch in unified diff format or null
target
- an IResource which the patch is to be applied to or null
configuration
- a CompareConfiguration supplying the labels and images for the preview patch pagepublic ApplyPatchOperation(IWorkbenchPart targetPart, IResource resource)
ApplyPatchOperation(IWorkbenchPart, IStorage, IResource, CompareConfiguration)
with appropriate defaults for the other parameters.
targetPart
- an IResource which the patch is to be applied to or null
resource
- an IResource which the patch is to be applied to or null
ApplyPatchOperation(IWorkbenchPart, IStorage, IResource, CompareConfiguration)
Method Detail |
public static boolean isPatch(IStorage storage) throws CoreException
storage
- the storage
CoreException
- if an error occurs reading the contents from the storagepublic static IFilePatch[] parsePatch(IStorage storage) throws CoreException
storage
- the storage that contains the patch
CoreException
- if an error occurs reading the contents from the storagepublic void openWizard()
protected Shell getShell()
protected void saveAllEditors()
false
. Clients can use this or provide their own
implementation.
public void setPatchWizardTitle(String title)
openWizard()
is called.
title
- a string to display in the title barpublic void setPatchWizardImageDescriptor(ImageDescriptor descriptor)
openWizard()
is called.
descriptor
- an image descriptorpublic void run()
run
in interface Runnable
|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.