Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 36282 Details for
Bug 114108
[Patch] Apply patch does nothing if Finish is selected on first page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Apply Patch patch
114108.patch (text/plain), 9.37 KB, created by
Bogdan Gheorghe
on 2006-03-14 16:16:05 EST
(
hide
)
Description:
Apply Patch patch
Filename:
MIME Type:
Creator:
Bogdan Gheorghe
Created:
2006-03-14 16:16:05 EST
Size:
9.37 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.compare >Index: compare/org/eclipse/compare/internal/patch/PatchTargetPage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchTargetPage.java,v >retrieving revision 1.2 >diff -u -r1.2 PatchTargetPage.java >--- compare/org/eclipse/compare/internal/patch/PatchTargetPage.java 21 Oct 2005 19:51:59 -0000 1.2 >+++ compare/org/eclipse/compare/internal/patch/PatchTargetPage.java 14 Mar 2006 21:17:12 -0000 >@@ -22,6 +22,8 @@ > import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.jface.viewers.CheckboxTreeViewer; >+import org.eclipse.jface.viewers.DoubleClickEvent; >+import org.eclipse.jface.viewers.IDoubleClickListener; > import org.eclipse.jface.viewers.ISelection; > import org.eclipse.jface.viewers.ISelectionChangedListener; > import org.eclipse.jface.viewers.SelectionChangedEvent; >@@ -158,6 +160,12 @@ > updateWidgetEnablements(); > } > }); >+ >+ fPatchTargets.addDoubleClickListener(new IDoubleClickListener() { >+ public void doubleClick(DoubleClickEvent event) { >+ fPatchWizard.showPage(getNextPage()); >+ } >+ }); > } > > /** >Index: compare/org/eclipse/compare/internal/patch/PatchWizard.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java,v >retrieving revision 1.26 >diff -u -r1.26 PatchWizard.java >--- compare/org/eclipse/compare/internal/patch/PatchWizard.java 27 Feb 2006 11:26:50 -0000 1.26 >+++ compare/org/eclipse/compare/internal/patch/PatchWizard.java 14 Mar 2006 21:17:12 -0000 >@@ -15,6 +15,7 @@ > import org.eclipse.compare.internal.CompareUIPlugin; > import org.eclipse.compare.internal.ExceptionHandler; > import org.eclipse.compare.internal.Utilities; >+import org.eclipse.compare.internal.patch.CompareWithPatchAction.PatchWizardDialog; > import org.eclipse.core.resources.IResource; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IProgressMonitor; >@@ -22,6 +23,7 @@ > import org.eclipse.core.runtime.jobs.MultiRule; > import org.eclipse.jface.dialogs.IDialogSettings; > import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.wizard.IWizardPage; > import org.eclipse.jface.wizard.Wizard; > import org.eclipse.ui.actions.WorkspaceModifyOperation; > >@@ -36,6 +38,8 @@ > > private WorkspacePatcher fPatcher; > >+ private PatchWizardDialog dialog; >+ > /* > * Creates a wizard for applying a patch file to the workspace. > */ >@@ -93,7 +97,11 @@ > public boolean performFinish() { > > fPatcher.setName(fPatchWizardPage.getPatchName()); >- >+ >+ //Make sure that the patch has been read >+ if (!fPatchWizardPage.isPatchRead()) >+ fPatchWizardPage.readInPatch(); >+ > try { > //Create scheduling rule based on the type of patch - single or workspace > ISchedulingRule scheduleRule= null; >@@ -138,5 +146,13 @@ > > return true; > } >+ >+ public void setDialog(PatchWizardDialog dialog) { >+ this.dialog = dialog; >+ } >+ >+ public void showPage(IWizardPage page){ >+ dialog.showPage(page); >+ } > } > >Index: compare/org/eclipse/compare/internal/patch/CompareWithPatchAction.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/CompareWithPatchAction.java,v >retrieving revision 1.18 >diff -u -r1.18 CompareWithPatchAction.java >--- compare/org/eclipse/compare/internal/patch/CompareWithPatchAction.java 21 Oct 2005 19:52:00 -0000 1.18 >+++ compare/org/eclipse/compare/internal/patch/CompareWithPatchAction.java 14 Mar 2006 21:17:12 -0000 >@@ -82,6 +82,7 @@ > > if (areAllEditorsSaved()) { > PatchWizardDialog dialog= new PatchWizardDialog(CompareUIPlugin.getShell(), wizard); >+ wizard.setDialog(dialog); > dialog.open(); > } > } >Index: compare/org/eclipse/compare/internal/patch/InputPatchPage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java,v >retrieving revision 1.28 >diff -u -r1.28 InputPatchPage.java >--- compare/org/eclipse/compare/internal/patch/InputPatchPage.java 21 Oct 2005 19:51:59 -0000 1.28 >+++ compare/org/eclipse/compare/internal/patch/InputPatchPage.java 14 Mar 2006 21:17:12 -0000 >@@ -29,6 +29,8 @@ > import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.jface.dialogs.IDialogSettings; > import org.eclipse.jface.dialogs.MessageDialog; >+import org.eclipse.jface.viewers.DoubleClickEvent; >+import org.eclipse.jface.viewers.IDoubleClickListener; > import org.eclipse.jface.viewers.ISelectionChangedListener; > import org.eclipse.jface.viewers.SelectionChangedEvent; > import org.eclipse.jface.viewers.StructuredSelection; >@@ -97,6 +99,10 @@ > > protected final static String INPUTPATCHPAGE_NAME= "InputPatchPage"; //$NON-NLS-1$ > >+ private String patchSource = null; >+ >+ private boolean patchRead = false; >+ > class ActivationListener extends ShellAdapter { > public void shellActivated(ShellEvent e) { > //Allow error messages if the selected input actually has something selected in it >@@ -173,9 +179,38 @@ > public IWizardPage getNextPage() { > > WorkspacePatcher patcher= ((PatchWizard) getWizard()).getPatcher(); >+ >+ //Read in the patch >+ readInPatch(); >+ >+ Diff[] diffs= patcher.getDiffs(); >+ if (diffs == null || diffs.length == 0) { >+ String format= PatchMessages.InputPatchPage_NoDiffsFound_format; >+ String message= MessageFormat.format(format, new String[] { patchSource }); >+ MessageDialog.openInformation(null, >+ PatchMessages.InputPatchPage_PatchErrorDialog_title, message); >+ return this; >+ } >+ >+ // guess prefix count >+ int guess= 0; // guessPrefix(diffs); >+ patcher.setStripPrefixSegments(guess); >+ >+ //If this is a workspace patch we don't need to set a target as the targets will be figured out from >+ //all of the projects that make up the patch and continue on to final preview page >+ //else go on to target selection page >+ if (patcher.isWorkspacePatch()) { >+ return fPatchWizard.getPage(PreviewPatchPage.PREVIEWPATCHPAGE_NAME); >+ } > >- String source= ""; //$NON-NLS-1$ >+ return super.getNextPage(); >+ } > >+ /* >+ * Reads in the patch contents >+ */ >+ public void readInPatch(){ >+ WorkspacePatcher patcher= ((PatchWizard) getWizard()).getPatcher(); > // Create a reader for the input > Reader reader= null; > try { >@@ -189,7 +224,7 @@ > if (o instanceof String) > reader= new StringReader((String)o); > } >- source= PatchMessages.InputPatchPage_Clipboard_title; >+ patchSource= PatchMessages.InputPatchPage_Clipboard_title; > } else if (inputMethod==FILE) { > String patchFilePath= getPatchFilePath(); > if (patchFilePath != null) { >@@ -201,7 +236,7 @@ > PatchMessages.InputPatchPage_PatchFileNotFound_message); > } > } >- source= PatchMessages.InputPatchPage_PatchFile_title; >+ patchSource= PatchMessages.InputPatchPage_PatchFile_title; > } else if (inputMethod==WORKSPACE) { > //Get the selected patch file (tree will only allow for one selection) > IResource[] resources= Utilities.getResources(fTreeViewer.getSelection()); >@@ -216,13 +251,14 @@ > MessageDialog.openError(null, PatchMessages.InputPatchPage_PatchErrorDialog_title, PatchMessages.InputPatchPage_PatchFileNotFound_message); > } > } >- source= PatchMessages.InputPatchPage_WorkspacePatch_title; >+ patchSource= PatchMessages.InputPatchPage_WorkspacePatch_title; > } > > // parse the input > if (reader != null) { > try { > patcher.parse(new BufferedReader(reader)); >+ patchRead=true; > } catch (IOException ex) { > MessageDialog.openError(null, > PatchMessages.InputPatchPage_PatchErrorDialog_title, >@@ -238,30 +274,8 @@ > } > } > } >- >- Diff[] diffs= patcher.getDiffs(); >- if (diffs == null || diffs.length == 0) { >- String format= PatchMessages.InputPatchPage_NoDiffsFound_format; >- String message= MessageFormat.format(format, new String[] { source }); >- MessageDialog.openInformation(null, >- PatchMessages.InputPatchPage_PatchErrorDialog_title, message); >- return this; >- } >- >- // guess prefix count >- int guess= 0; // guessPrefix(diffs); >- patcher.setStripPrefixSegments(guess); >- >- //If this is a workspace patch we don't need to set a target as the targets will be figured out from >- //all of the projects that make up the patch and continue on to final preview page >- //else go on to target selection page >- if (patcher.isWorkspacePatch()) { >- return fPatchWizard.getPage(PreviewPatchPage.PREVIEWPATCHPAGE_NAME); >- } >- >- return super.getNextPage(); > } >- >+ > /* (non-JavaDoc) > * Method declared in IWizardPage. > */ >@@ -386,6 +400,12 @@ > updateWidgetEnablements(); > } > }); >+ >+ fTreeViewer.addDoubleClickListener(new IDoubleClickListener() { >+ public void doubleClick(DoubleClickEvent event) { >+ fPatchWizard.showPage(getNextPage()); >+ } >+ }); > } > > private void addWorkspaceControls(Composite composite) { >@@ -812,5 +832,9 @@ > > return (String[]) l.toArray(new String[l.size()]); > } >+ >+ public boolean isPatchRead() { >+ return patchRead; >+ } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 114108
: 36282