Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2006-01-17 02:41:53 +0000
committerMichael Valenta2006-01-17 02:41:53 +0000
commit3aba4326724621cf45241c662aa63cb4c94c3815 (patch)
treec30d47850d42a272751dea18299d38a8c36f1810
parentc32cf37373f2940ed64a3ba742d8864fae8a7ce0 (diff)
downloadeclipse.platform.team-3aba4326724621cf45241c662aa63cb4c94c3815.tar.gz
eclipse.platform.team-3aba4326724621cf45241c662aa63cb4c94c3815.tar.xz
eclipse.platform.team-3aba4326724621cf45241c662aa63cb4c94c3815.zip
Latest history view changesI20060116a
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java174
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryTableProvider.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties2
-rw-r--r--bundles/org.eclipse.team.ui/plugin.properties2
-rw-r--r--bundles/org.eclipse.team.ui/plugin.xml2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIMessages.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryTableProvider.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/OpenLocalFileAction.java38
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties3
12 files changed, 156 insertions, 101 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java
index 788e219fa..d94c850a8 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java
@@ -91,6 +91,8 @@ public class CVSHistoryPage extends Page implements IHistoryPage {
/* private */boolean shutdown = false;
+ private HistoryResourceListener resourceListener;
+
// preferences
public final static String PREF_GENERIC_HISTORYVIEW_SHOW_COMMENTS = "pref_generichistory_show_comments"; //$NON-NLS-1$
@@ -114,6 +116,9 @@ public class CVSHistoryPage extends Page implements IHistoryPage {
contributeActions();
setViewerVisibility();
+
+ resourceListener = new HistoryResourceListener();
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceListener, IResourceChangeEvent.POST_CHANGE);
}
private TextViewer createText(SashForm parent) {
@@ -398,18 +403,20 @@ public class CVSHistoryPage extends Page implements IHistoryPage {
/* private */ void fillTableMenu(IMenuManager manager) {
// file actions go first (view file)
- // file actions go first (view file)
manager.add(new Separator(IWorkbenchActionConstants.GROUP_FILE));
if (file != null) {
// Add the "Add to Workspace" action if 1 revision is selected.
ISelection sel = tableViewer.getSelection();
if (!sel.isEmpty()) {
if (sel instanceof IStructuredSelection) {
- if (((IStructuredSelection)sel).size() == 1) {
+ IStructuredSelection tempSelection = (IStructuredSelection) sel;
+ if (tempSelection.size() == 1) {
manager.add(getContentsAction);
- manager.add(getRevisionAction);
- manager.add(new Separator());
- manager.add(tagWithExistingAction);
+ if (!(tempSelection.getFirstElement() instanceof LocalFileRevision)) {
+ manager.add(getRevisionAction);
+ manager.add(new Separator());
+ manager.add(tagWithExistingAction);
+ }
}
}
}
@@ -509,72 +516,72 @@ public class CVSHistoryPage extends Page implements IHistoryPage {
private Action getContextMenuAction(String title, final boolean needsProgressDialog, final IWorkspaceRunnable action) {
return new Action(title) {
- public void run() {
- try {
- if (file == null) return;
- ISelection selection = tableViewer.getSelection();
- if (!(selection instanceof IStructuredSelection)) return;
- IStructuredSelection ss = (IStructuredSelection)selection;
- Object o = ss.getFirstElement();
- currentSelection = (IFileRevision)o;
- if(needsProgressDialog) {
- PlatformUI.getWorkbench().getProgressService().run(true, true, new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- action.run(monitor);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
+ public void run() {
+ try {
+ if (file == null) return;
+ ISelection selection = tableViewer.getSelection();
+ if (!(selection instanceof IStructuredSelection)) return;
+ IStructuredSelection ss = (IStructuredSelection)selection;
+ Object o = ss.getFirstElement();
+ currentSelection = (IFileRevision)o;
+ if(needsProgressDialog) {
+ PlatformUI.getWorkbench().getProgressService().run(true, true, new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ action.run(monitor);
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
+ }
}
+ });
+ } else {
+ try {
+ action.run(null);
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
}
- });
- } else {
- try {
- action.run(null);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- }
- } catch (InvocationTargetException e) {
- CVSUIPlugin.openError(parentSite.getShell(), null, null, e, CVSUIPlugin.LOG_NONTEAM_EXCEPTIONS);
- } catch (InterruptedException e) {
- // Do nothing
+ }
+ } catch (InvocationTargetException e) {
+ CVSUIPlugin.openError(parentSite.getShell(), null, null, e, CVSUIPlugin.LOG_NONTEAM_EXCEPTIONS);
+ } catch (InterruptedException e) {
+ // Do nothing
+ }
}
- }
-
- public boolean isEnabled() {
- ISelection selection = tableViewer.getSelection();
- if (!(selection instanceof IStructuredSelection)) return false;
- IStructuredSelection ss = (IStructuredSelection)selection;
- if(ss.size() != 1) return false;
- return true;
- }
- };
-}
+
+ public boolean isEnabled() {
+ ISelection selection = tableViewer.getSelection();
+ if (!(selection instanceof IStructuredSelection)) return false;
+ IStructuredSelection ss = (IStructuredSelection)selection;
+ if(ss.size() != 1) return false;
+ return true;
+ }
+ };
+ }
-private boolean confirmOverwrite() {
- if (file!=null && file.exists()) {
- ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor(file);
- try {
- if(cvsFile.isModified(null)) {
- String title = CVSUIMessages.HistoryView_overwriteTitle;
- String msg = CVSUIMessages.HistoryView_overwriteMsg;
- final MessageDialog dialog = new MessageDialog(parentSite.getShell(), title, null, msg, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.CANCEL_LABEL }, 0);
- final int[] result = new int[1];
- parentSite.getShell().getDisplay().syncExec(new Runnable() {
- public void run() {
- result[0] = dialog.open();
- }});
- if (result[0] != 0) {
- // cancel
- return false;
+ private boolean confirmOverwrite() {
+ if (file!=null && file.exists()) {
+ ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor(file);
+ try {
+ if(cvsFile.isModified(null)) {
+ String title = CVSUIMessages.HistoryView_overwriteTitle;
+ String msg = CVSUIMessages.HistoryView_overwriteMsg;
+ final MessageDialog dialog = new MessageDialog(parentSite.getShell(), title, null, msg, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.CANCEL_LABEL }, 0);
+ final int[] result = new int[1];
+ parentSite.getShell().getDisplay().syncExec(new Runnable() {
+ public void run() {
+ result[0] = dialog.open();
+ }});
+ if (result[0] != 0) {
+ // cancel
+ return false;
+ }
}
+ } catch(CVSException e) {
+ CVSUIPlugin.log(e);
}
- } catch(CVSException e) {
- CVSUIPlugin.log(e);
}
+ return true;
}
- return true;
-}
/*
* Refresh the view by refetching the log entries for the remote file
@@ -583,9 +590,14 @@ private boolean confirmOverwrite() {
entries = null;
BusyIndicator.showWhile(tableViewer.getTable().getDisplay(), new Runnable() {
public void run() {
- // if a local file was fed to the history view then we
- // will have to refetch the handle
- // to properly display the current revision marker.
+ // if a local file was fed to the history view then we will have to refetch the handle
+ // to properly display the current revision marker.
+ if(file != null) {
+ RepositoryProvider teamProvider = RepositoryProvider.getProvider(file.getProject());
+ IFileHistory fileHistory = teamProvider.getFileHistoryProvider().getFileHistoryFor(file, new NullProgressMonitor());
+ currentFileRevision = teamProvider.getFileHistoryProvider().getWorkspaceFileRevision(file);
+ historyTableProvider.setFile(fileHistory, file, currentFileRevision.getContentIdentifier());
+ }
tableViewer.refresh();
}
});
@@ -647,6 +659,11 @@ private boolean confirmOverwrite() {
public void dispose() {
shutdown = true;
+ if (resourceListener != null){
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceListener);
+ resourceListener = null;
+ }
+
if (branchImage != null) {
branchImage.dispose();
branchImage = null;
@@ -783,6 +800,31 @@ private boolean confirmOverwrite() {
}
}
+ private class HistoryResourceListener implements IResourceChangeListener {
+ /**
+ * @see IResourceChangeListener#resourceChanged(IResourceChangeEvent)
+ */
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta root = event.getDelta();
+ IResourceDelta[] projectDeltas = root.getAffectedChildren();
+ processDelta(projectDeltas);
+ }
+
+ private void processDelta(IResourceDelta[] deltas) {
+ for (int i = 0; i < deltas.length; i++) {
+ IResourceDelta[] children = deltas[i].getAffectedChildren(IResourceDelta.CHANGED, IResource.FILE);
+ if (children.length == 0) {
+ //leaf
+ IResource tempResource = deltas[i].getResource();
+ if (tempResource.equals(file)) {
+ //need to refresh
+ showHistory(file, true);
+ }
+ }
+ processDelta(children);
+ }
+ }
+ }
public Control getControl() {
return sashForm;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryTableProvider.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryTableProvider.java
index ca65c817a..4e8df563a 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryTableProvider.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryTableProvider.java
@@ -62,7 +62,7 @@ public class CVSHistoryTableProvider {
String currentRevision = getCurrentRevision();
if (currentRevision != null && currentRevision.equals(revision)) {
if (baseModified)
- revision = NLS.bind(CVSUIMessages.nameAndRevision, new String[] { revision, "<base>"}); //NLS.bind(CVSUIMessages.currentRevision, new String[] { revision });
+ revision = NLS.bind(CVSUIMessages.nameAndRevision, new String[] { revision, CVSUIMessages.CVSHistoryTableProvider_base}); //NLS.bind(CVSUIMessages.currentRevision, new String[] { revision });
else
revision = NLS.bind(CVSUIMessages.currentRevision, new String[] {revision}); //NLS.bind(CVSUIMessages.currentRevision, new String[] { revision });
}
@@ -129,7 +129,7 @@ public class CVSHistoryTableProvider {
String comment = entry.getComment();
String tempCurrentRevision = getCurrentRevision();
if (tempCurrentRevision != null && tempCurrentRevision.equals(revision) ||
- comment.equals("<current version>")) {
+ comment.equals(CVSUIMessages.CVSHistoryTableProvider_currentVersion)) {
if (currentRevisionFont == null) {
Font defaultFont = JFaceResources.getDefaultFont();
FontData[] data = defaultFont.getFontData();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java
index 904f33818..bd2d725f0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java
@@ -1045,5 +1045,7 @@ public class CVSUIMessages extends NLS {
public static String ModelReplaceOperation_3;
public static String MergeWizardPage_14;
public static String CVSHistoryFilterDialog_showLocalRevisions;
+ public static String CVSHistoryTableProvider_base;
+ public static String CVSHistoryTableProvider_currentVersion;
}
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 1bc0b6ce2..0f8abf8fa 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
@@ -667,6 +667,7 @@ CVSRepositoryPropertiesPage_Confirm_Project_Sharing_Changes_1=Confirm Project Sh
CVSRepositoryPropertiesPage_There_are_projects_in_the_workspace_shared_with_this_repository_2=There are projects in the workspace shared with this repository. The projects will be updated with the new information that you have entered
CVSRepositoryPropertiesPage_sharedProject=The projects that are shared with {0} are:
CVSHistoryFilterDialog_showLocalRevisions=Show local revisions
+CVSHistoryTableProvider_currentVersion=<current version>
CVSRepositoryPropertiesPage_useLocationAsLabel=Use the &repository identification string as the label
CVSRepositoryPropertiesPage_useCustomLabel=Use a custom &label:
@@ -1015,6 +1016,7 @@ CheckoutAsWizard_3=Select Tag
CheckoutAsWizard_4=Choose the tag to check out from
CheckoutAsMainPage_10=(Only available when the .project file does not exist in the repository)
CVSTeamProvider_updatingFile=Updating {0}
+CVSHistoryTableProvider_base=<base>
CVSTeamProvider_makeBranch=Creating branch
CVSTeamProvider_folderInfo=Updating folder synchronization information for project {0}
CVSTeamProvider_updatingFolder=Updating {0}
diff --git a/bundles/org.eclipse.team.ui/plugin.properties b/bundles/org.eclipse.team.ui/plugin.properties
index 8c3c3a69c..a6210c2ae 100644
--- a/bundles/org.eclipse.team.ui/plugin.properties
+++ b/bundles/org.eclipse.team.ui/plugin.properties
@@ -57,3 +57,5 @@ CompressFolderView.description=Compress in-sync folders paths
FileRevision.OpenAction.name=&Open Revision
FileRevision.Compare.name=&Compare
+
+ShowLocalHistory.label=&Show Local History
diff --git a/bundles/org.eclipse.team.ui/plugin.xml b/bundles/org.eclipse.team.ui/plugin.xml
index 5e4a356b0..6462c3868 100644
--- a/bundles/org.eclipse.team.ui/plugin.xml
+++ b/bundles/org.eclipse.team.ui/plugin.xml
@@ -123,7 +123,7 @@
class="org.eclipse.team.internal.ui.history.ShowLocalHistory"
enablesFor="1"
id="org.eclipse.team.ui.showlocalhistory"
- label="&amp;Show Local History"
+ label="%ShowLocalHistory.label"
menubarPath="local"/>
</objectContribution>
</extension>
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIMessages.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIMessages.java
index efae8918f..60838714e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIMessages.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIMessages.java
@@ -369,4 +369,10 @@ public class TeamUIMessages extends NLS {
public static String GenericHistoryView_0;
+ public static String LocalHistoryTableProvider_localRevision;
+
+ public static String LocalHistoryPage_openRevision;
+
+ public static String LocalHistoryPage_fetchingLocalHistory;
+
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java
index dec018d0e..37b87b3fa 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java
@@ -58,9 +58,9 @@ public class FileRevisionEditorInput implements IWorkbenchAdapter,IStorageEditor
return NLS.bind(TeamUIMessages.nameAndRevision, new String[] { file.getName(), file.getContentIdentifier()});
if (storage != null){
- return storage.getName() + " " + DateFormat.getInstance().format(new Date(((IFileState) storage).getModificationTime())) ;
+ return storage.getName() + " " + DateFormat.getInstance().format(new Date(((IFileState) storage).getModificationTime())) ; //$NON-NLS-1$
}
- return "";
+ return ""; //$NON-NLS-1$
}
@@ -73,7 +73,7 @@ public class FileRevisionEditorInput implements IWorkbenchAdapter,IStorageEditor
if (file != null)
return file.getContentIdentifier();
- return "";
+ return ""; //$NON-NLS-1$
}
public Object getAdapter(Class adapter) {
@@ -99,7 +99,7 @@ public class FileRevisionEditorInput implements IWorkbenchAdapter,IStorageEditor
if (storage != null){
return storage.getName();
}
- return "";
+ return ""; //$NON-NLS-1$
}
public Object getParent(Object o) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java
index adc715160..4ca0ce2cf 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java
@@ -40,7 +40,7 @@ public class LocalHistoryPage extends Page implements IHistoryPage {
private IViewSite parentSite;
private OpenLocalFileAction openAction;
- private CompareLocalFileAction compareAction;
+ //private CompareLocalFileAction compareAction;
public void showHistory(IResource resource, boolean refetch) {
@@ -85,7 +85,7 @@ public class LocalHistoryPage extends Page implements IHistoryPage {
private void contributeActions() {
// Double click open action
- openAction = new OpenLocalFileAction("Open Local File");
+ openAction = new OpenLocalFileAction(TeamUIMessages.LocalHistoryPage_openRevision);
tableViewer.getTable().addListener(SWT.DefaultSelection, new Listener() {
public void handleEvent(Event e) {
openAction.selectionChanged((IStructuredSelection) tableViewer.getSelection());
@@ -93,7 +93,7 @@ public class LocalHistoryPage extends Page implements IHistoryPage {
}
});
- compareAction = new CompareLocalFileAction("Compare File");
+ //compareAction = new CompareLocalFileAction("Compare");
//Contribute actions to popup menu
MenuManager menuMgr = new MenuManager();
@@ -115,9 +115,9 @@ public class LocalHistoryPage extends Page implements IHistoryPage {
IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
openAction.selectionChanged(selection);
menuMgr.add(openAction);
- compareAction.setEnabled(selection.size() == 2);
+ /*compareAction.setEnabled(selection.size() == 2);
compareAction.selectionChanged(selection);
- menuMgr.add(compareAction);
+ menuMgr.add(compareAction);*/
menuMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
@@ -189,7 +189,7 @@ public class LocalHistoryPage extends Page implements IHistoryPage {
public IFile localFile;
public FetchLocalHistoryJob() {
- super("Fetching Local History");
+ super(TeamUIMessages.LocalHistoryPage_fetchingLocalHistory);
}
public IFile getFile() {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryTableProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryTableProvider.java
index 1f8c1e380..4b981f9dc 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryTableProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryTableProvider.java
@@ -42,10 +42,10 @@ public class LocalHistoryTableProvider {
String revision = DateFormat.getInstance().format(new Date(entry.getModificationTime()));
return revision;
case COL_AUTHOR:
- return "local user";
+ return ""; //$NON-NLS-1$
case COL_COMMENT:
- return "local revision";
+ return TeamUIMessages.LocalHistoryTableProvider_localRevision;
}
return ""; //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/OpenLocalFileAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/OpenLocalFileAction.java
index 32adc6454..55a14fab3 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/OpenLocalFileAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/OpenLocalFileAction.java
@@ -23,7 +23,7 @@ import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.ui.*;
import org.eclipse.ui.actions.BaseSelectionListenerAction;
-public class OpenLocalFileAction extends BaseSelectionListenerAction {
+public class OpenLocalFileAction extends BaseSelectionListenerAction {
protected OpenLocalFileAction(String text) {
super(text);
@@ -31,33 +31,32 @@ public class OpenLocalFileAction extends BaseSelectionListenerAction {
public void run() {
try {
- IStructuredSelection structSel = getStructuredSelection();
+ IStructuredSelection structSel = getStructuredSelection();
- Object[] objArray = structSel.toArray();
-
- for (int i = 0; i < objArray.length; i++) {
- IFileState state = (IFileState) objArray[i];
- if (!state.exists()) {
- MessageDialog.openError(TeamUIPlugin.getActivePage().getActivePart().getSite().getShell(), TeamUIMessages.OpenRevisionAction_DeletedRevisionTitle, TeamUIMessages.OpenRevisionAction_DeletedRevisionMessage);
- } else {
- String id = getEditorID(state.getName(), state.getContents());
- IWorkbenchPage page = TeamUIPlugin.getActivePage();
- if (page != null){
- page.openEditor(new FileRevisionEditorInput(state), id);
- }
- }
+ Object[] objArray = structSel.toArray();
+ for (int i = 0; i < objArray.length; i++) {
+ IFileState state = (IFileState) objArray[i];
+ if (!state.exists()) {
+ MessageDialog.openError(TeamUIPlugin.getActivePage().getActivePart().getSite().getShell(), TeamUIMessages.OpenRevisionAction_DeletedRevisionTitle, TeamUIMessages.OpenRevisionAction_DeletedRevisionMessage);
+ } else {
+ String id = getEditorID(state.getName(), state.getContents());
+ IWorkbenchPage page = TeamUIPlugin.getActivePage();
+ if (page != null) {
+ page.openEditor(new FileRevisionEditorInput(state), id);
}
-
- } catch (Exception e) {
-
}
+
+ }
+
+ } catch (Exception e) {
+
+ }
}
/* private */String getEditorID(String fileName, InputStream contents) {
IWorkbench workbench = TeamUIPlugin.getPlugin().getWorkbench();
IEditorRegistry registry = workbench.getEditorRegistry();
- IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
IContentType type = null;
if (contents != null) {
@@ -80,6 +79,5 @@ public class OpenLocalFileAction extends BaseSelectionListenerAction {
return id;
}
-
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
index 2afb477f2..b7095a3bf 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
@@ -364,3 +364,6 @@ TextAutoMerge_inputEncodingError= Unsupported encoding for input stream
TextAutoMerge_outputEncodingError= Unsupported encoding for output stream
TextAutoMerge_outputIOError= I/O error on writing
TextAutoMerge_conflict= Conflict: cannot auto-merge
+LocalHistoryTableProvider_localRevision=<local revision>
+LocalHistoryPage_openRevision=Open Revision
+LocalHistoryPage_fetchingLocalHistory=Fetching Local History

Back to the top