diff options
author | Michael Valenta | 2002-10-14 00:02:49 +0000 |
---|---|---|
committer | Michael Valenta | 2002-10-14 00:02:49 +0000 |
commit | a729cc6dc950125862682849e7ae19bc3a5a2879 (patch) | |
tree | 9c6817a5830fc7f307de3e4cd5257cdacbaa7f06 | |
parent | 7cb2184ad7eb2298e95a2d38122c1974eb847967 (diff) | |
download | eclipse.platform.team-branch_5782.tar.gz eclipse.platform.team-branch_5782.tar.xz eclipse.platform.team-branch_5782.zip |
Finishing touchesbranch_5782
4 files changed, 37 insertions, 18 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RestoreFromRepositoryAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RestoreFromRepositoryAction.java index 91034648c..cdd560990 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RestoreFromRepositoryAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RestoreFromRepositoryAction.java @@ -62,9 +62,9 @@ public class RestoreFromRepositoryAction extends CVSAction { * contains files that exist on a branch but not in HEAD */ class AtticLogListener extends CommandOutputAdapter { - private static final String ATTIC = "Attic"; - private static final String RCS_FILE_POSTFIX = ",v"; - private static final String LOGGING_PREFIX = "Logging "; + private static final String ATTIC = "Attic"; //$NON-NLS-1$ + private static final String RCS_FILE_POSTFIX = ",v"; //$NON-NLS-1$ + private static final String LOGGING_PREFIX = "Logging "; //$NON-NLS-1$ ICVSFolder currentFolder; List atticFiles = new ArrayList(); @@ -127,7 +127,7 @@ public class RestoreFromRepositoryAction extends CVSAction { ICVSFile[] files = fetchDeletedFiles(resource); if (files == null) return; if (files.length == 0) { - MessageDialog.openInformation(getShell(), Policy.bind("RestoreFromRepositoryAction.noFilesTitle"), Policy.bind("RestoreFromRepositoryAction.noFilesMessage", resource.getName())); + MessageDialog.openInformation(getShell(), Policy.bind("RestoreFromRepositoryAction.noFilesTitle"), Policy.bind("RestoreFromRepositoryAction.noFilesMessage", resource.getName())); //$NON-NLS-1$ //$NON-NLS-2$ return; } RestoreFromRepositoryWizard wizard = new RestoreFromRepositoryWizard(resource, files); diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties index 8ad8fc052..8c0c46ef1 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties @@ -787,7 +787,7 @@ RestoreFromRepositoryWizard.fileSelectionPageDescription=Select the revision of RestoreFromRepositoryFileSelectionPage.fileSelectionPaneTitle={0} - Select file to be restored: RestoreFromRepositoryFileSelectionPage.revisionSelectionPaneTitle={0} - Check revision to be restored: RestoreFromRepositoryFileSelectionPage.fileToRestore={0} ({1} to be restored) -RestoreFromRepositoryFileSelectionPage.fileContentPaneTitle={0} {1} (restore to ''{2}'') +RestoreFromRepositoryFileSelectionPage.fileContentPaneTitle={0} {1} in ''{2}'' RestoreFromRepositoryFileSelectionPage.emptyRevisionPane=Remote revisions of selected file: RestoreFromRepositoryFileSelectionPage.fileExists=File ''{0}'' already exists locally. RestoreFromRepositoryAction.noFilesTitle=No Deleted Files Found diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryFileSelectionPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryFileSelectionPage.java index 39075f28e..c66ed6e52 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryFileSelectionPage.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryFileSelectionPage.java @@ -188,7 +188,7 @@ public class RestoreFromRepositoryFileSelectionPage extends CVSWizardPage { revisionSelectionPane.setLayoutData(data); historyTableProvider = new HistoryTableProvider(); revisionsTable = createRevisionSelectionTable(revisionSelectionPane, historyTableProvider); - revisionSelectionPane.setText(Policy.bind("RestoreFromRepositoryFileSelectionPage.emptyRevisionPane")); + revisionSelectionPane.setText(Policy.bind("RestoreFromRepositoryFileSelectionPage.emptyRevisionPane")); //$NON-NLS-1$ // Bottom: File content viewer fileContentPane = new CompareViewerSwitchingPane(vsplitter, SWT.BORDER | SWT.FLAT) { @@ -199,7 +199,6 @@ public class RestoreFromRepositoryFileSelectionPage extends CVSWizardPage { initializeValues(); updateWidgetEnablements(); - //fileTree.getControl().setFocus(); } protected CheckboxTableViewer createRevisionSelectionTable(CompareViewerPane composite, HistoryTableProvider tableProvider) { @@ -242,10 +241,15 @@ public class RestoreFromRepositoryFileSelectionPage extends CVSWizardPage { new DecoratingLabelProvider( new WorkbenchLabelProvider() { protected String decorateText(String input, Object element) { - ILogEntry entry = (ILogEntry)filesToRestore.get(element); - String text = super.decorateText(input, element); - if (entry != null) { - text = Policy.bind("RestoreFromRepositoryFileSelectionPage.fileToRestore", text, entry.getRevision()); + String text; + if (element instanceof IFolder && element.equals(folder)) { + text = super.decorateText(folder.getProjectRelativePath().toString(), element); + } else { + ILogEntry entry = (ILogEntry)filesToRestore.get(element); + text = super.decorateText(input, element); + if (entry != null) { + text = Policy.bind("RestoreFromRepositoryFileSelectionPage.fileToRestore", text, entry.getRevision()); //$NON-NLS-1$ + } } return text; } @@ -278,7 +282,7 @@ public class RestoreFromRepositoryFileSelectionPage extends CVSWizardPage { IFile file = (IFile) iter.next(); if (file.exists()) { setPageComplete(false); - setErrorMessage(Policy.bind("RestoreFromRepositoryFileSelectionPage.fileExists", file.getName())); + setErrorMessage(Policy.bind("RestoreFromRepositoryFileSelectionPage.fileExists", file.getName())); //$NON-NLS-1$ return; } } @@ -344,10 +348,17 @@ public class RestoreFromRepositoryFileSelectionPage extends CVSWizardPage { if (folder == null) return; if (fileSelectionPane != null && !fileSelectionPane.isDisposed()) { - fileSelectionPane.setText(Policy.bind("RestoreFromRepositoryFileSelectionPage.fileSelectionPaneTitle", folder.getProject().getName())); + fileSelectionPane.setText(Policy.bind("RestoreFromRepositoryFileSelectionPage.fileSelectionPaneTitle", folder.getProject().getName())); //$NON-NLS-1$ fileSelectionPane.setImage(CompareUI.getImage(folder.getProject())); } + if (revisionSelectionPane != null && !revisionSelectionPane.isDisposed()) { + if (selectedFile == null) { + revisionSelectionPane.setText(Policy.bind("RestoreFromRepositoryFileSelectionPage.emptyRevisionPane")); //$NON-NLS-1$ + revisionSelectionPane.setImage(null); + } + } + // Empty the file content viewer if (fileContentPane != null && !fileContentPane.isDisposed()) { fileContentPane.setInput(null); @@ -368,6 +379,7 @@ public class RestoreFromRepositoryFileSelectionPage extends CVSWizardPage { * Set the log entry table input to the fetched entries in response to a file selection */ private void setLogEntryTableInput(ILogEntry[] entries) { + this.selectedRevision = null; // Refresh the table so it picks up the selected entries through its content provider revisionsTable.refresh(); // Check the previously checked entry if one exists @@ -383,7 +395,7 @@ public class RestoreFromRepositoryFileSelectionPage extends CVSWizardPage { } } // Set the titlebar text for the revisions table - revisionSelectionPane.setText(Policy.bind("RestoreFromRepositoryFileSelectionPage.revisionSelectionPaneTitle", selectedFile.getName())); + revisionSelectionPane.setText(Policy.bind("RestoreFromRepositoryFileSelectionPage.revisionSelectionPaneTitle", selectedFile.getName())); //$NON-NLS-1$ revisionSelectionPane.setImage(CompareUI.getImage(selectedFile)); // Clear the file content pane fileContentPane.setInput(null); @@ -394,13 +406,15 @@ public class RestoreFromRepositoryFileSelectionPage extends CVSWizardPage { private void handleFileSelection(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection == null || selection.isEmpty()) { - // XXX clear entries table? + clearSelection(); } else { if (selection instanceof StructuredSelection) { StructuredSelection structuredSelection = (StructuredSelection) selection; IResource resource = (IResource)structuredSelection.getFirstElement(); if (resource instanceof IFile) { handleFileSelection((IFile) resource); + } else { + clearSelection(); } } } @@ -538,8 +552,8 @@ public class RestoreFromRepositoryFileSelectionPage extends CVSWizardPage { * @return String */ private String getEditionLabel(IFile selectedFile, ILogEntry selected) { - return Policy.bind("RestoreFromRepositoryFileSelectionPage.fileContentPaneTitle", - new Object[] { selectedFile.getName(), selected.getRevision(), selectedFile.getFullPath().removeLastSegments(1).toString() }); + return Policy.bind("RestoreFromRepositoryFileSelectionPage.fileContentPaneTitle", //$NON-NLS-1$ + new Object[] { selectedFile.getName(), selected.getRevision(), selectedFile.getFullPath().makeRelative().removeLastSegments(1).toString() }); } public boolean restoreSelectedFiles() { @@ -586,4 +600,9 @@ public class RestoreFromRepositoryFileSelectionPage extends CVSWizardPage { } } + private void clearSelection() { + this.selectedFile = null; + this.selectedRevision = null; + refresh(); + } } diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryWizard.java index 1a9c04ddf..36c357e59 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryWizard.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RestoreFromRepositoryWizard.java @@ -49,7 +49,7 @@ public class RestoreFromRepositoryWizard extends Wizard { setNeedsProgressMonitor(true); ImageDescriptor substImage = CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_WIZBAN_CHECKOUT); - fileSelectionPage = new RestoreFromRepositoryFileSelectionPage("FileSelectionPage", Policy.bind("RestoreFromRepositoryWizard.fileSelectionPageTitle"), substImage, Policy.bind("RestoreFromRepositoryWizard.fileSelectionPageDescription")); + fileSelectionPage = new RestoreFromRepositoryFileSelectionPage("FileSelectionPage", Policy.bind("RestoreFromRepositoryWizard.fileSelectionPageTitle"), substImage, Policy.bind("RestoreFromRepositoryWizard.fileSelectionPageDescription")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ fileSelectionPage.setInput(parent, files); addPage(fileSelectionPage); } |