diff options
author | Andrey Loskutov | 2016-11-04 17:37:48 +0000 |
---|---|---|
committer | Andrey Loskutov | 2016-11-04 20:18:45 +0000 |
commit | bf7292ed40eab1e600437a7521a99864c98299ad (patch) | |
tree | f44347b408186df22740428859a2bbb4e29588a1 /bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java | |
parent | f60954ba88fb4b106af2fd6056f69c93a54110b6 (diff) | |
download | eclipse.platform.team-bf7292ed40eab1e600437a7521a99864c98299ad.tar.gz eclipse.platform.team-bf7292ed40eab1e600437a7521a99864c98299ad.tar.xz eclipse.platform.team-bf7292ed40eab1e600437a7521a99864c98299ad.zip |
Bug 506732 - cleanup trailing spaces in compare pluginsY20161117-1000Y20161110-1000I20161122-2000I20161121-2000I20161120-2000I20161119-2000I20161118-2000I20161117-2000I20161116-2000I20161115-2000I20161114-2000I20161114-0355I20161113-2000I20161112-2000I20161112-0405I20161111-2000I20161111-1220I20161111-0900I20161111-0740I20161111-0510I20161110-2030I20161110-1630I20161110-1225I20161110-1130I20161110-0710I20161110-0510I20161109-2000I20161108-1015I20161108-0800
Change-Id: I2ed3512c294b06e85a63fab90a0934e611339e31
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java')
-rw-r--r-- | bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java index 1ee887caa..3215be92f 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java @@ -25,33 +25,33 @@ import org.eclipse.core.runtime.*; public class AddFromHistoryAction extends BaseCompareAction { - + private static final String BUNDLE_NAME= "org.eclipse.compare.internal.AddFromHistoryAction"; //$NON-NLS-1$ public AddFromHistoryAction() { // empty default implementation } - + protected boolean isEnabled(ISelection selection) { return Utilities.getResources(selection).length == 1; } protected void run(ISelection selection) { - + ResourceBundle bundle= ResourceBundle.getBundle(BUNDLE_NAME); String title= Utilities.getString(bundle, "title"); //$NON-NLS-1$ - + Shell parentShell= CompareUIPlugin.getShell(); AddFromHistoryDialog dialog= null; Object[] s= Utilities.getResources(selection); - + for (int i= 0; i < s.length; i++) { Object o= s[i]; if (o instanceof IContainer) { IContainer container= (IContainer) o; - - ProgressMonitorDialog pmdialog= new ProgressMonitorDialog(parentShell); + + ProgressMonitorDialog pmdialog= new ProgressMonitorDialog(parentShell); IProgressMonitor pm= pmdialog.getProgressMonitor(); IFile[] states= null; try { @@ -59,24 +59,24 @@ public class AddFromHistoryAction extends BaseCompareAction { } catch (CoreException ex) { pm.done(); } - + // There could be a recently deleted file at the same path as // the container. If such a file is the only one to restore, we // should not suggest to restore it, so set states to null. if (states.length == 1 && states[0].getFullPath().equals(container.getFullPath())) states = null; - + if (states == null || states.length <= 0) { String msg= Utilities.getString(bundle, "noLocalHistoryError"); //$NON-NLS-1$ MessageDialog.openInformation(parentShell, title, msg); return; } - + if (dialog == null) { dialog= new AddFromHistoryDialog(parentShell, bundle); dialog.setHelpContextId(ICompareContextIds.ADD_FROM_HISTORY_DIALOG); } - + if (dialog.select(container, states)) { AddFromHistoryDialog.HistoryInput[] selected = dialog .getSelected(); @@ -96,7 +96,7 @@ public class AddFromHistoryAction extends BaseCompareAction { } } } - + void createContainers(IResource resource) throws CoreException { IContainer container= resource.getParent(); if (container instanceof IFolder) { @@ -107,22 +107,22 @@ public class AddFromHistoryAction extends BaseCompareAction { } } } - + private void updateWorkspace(final ResourceBundle bundle, Shell shell, final AddFromHistoryDialog.HistoryInput[] selected) throws InvocationTargetException, InterruptedException { - + WorkspaceModifyOperation operation= new WorkspaceModifyOperation() { public void execute(IProgressMonitor pm) throws InvocationTargetException { try { String taskName= Utilities.getString(bundle, "taskName"); //$NON-NLS-1$ pm.beginTask(taskName, selected.length); - + for (int i= 0; i < selected.length; i++) { IFile file= selected[i].fFile; IFileState fileState= selected[i].fFileState; createContainers(file); - + SubProgressMonitor subMonitor= new SubProgressMonitor(pm, 1); try { file.create(fileState.getContents(), false, subMonitor); @@ -137,8 +137,8 @@ public class AddFromHistoryAction extends BaseCompareAction { } } }; - - ProgressMonitorDialog pmdialog= new ProgressMonitorDialog(shell); - pmdialog.run(false, true, operation); + + ProgressMonitorDialog pmdialog= new ProgressMonitorDialog(shell); + pmdialog.run(false, true, operation); } } |