Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-04-04 15:55:03 -0500
committerjames2002-04-04 15:55:03 -0500
commit35a1f2a4c1fd81f8396ef1f67a1f005125e4c359 (patch)
tree561effba39fc48bb30e49907a36e380c7399cd3e
parent862b6291506f82aa6ca43d60e733c8f7f4e92fbc (diff)
downloadeclipse.platform.team-35a1f2a4c1fd81f8396ef1f67a1f005125e4c359.tar.gz
eclipse.platform.team-35a1f2a4c1fd81f8396ef1f67a1f005125e4c359.tar.xz
eclipse.platform.team-35a1f2a4c1fd81f8396ef1f67a1f005125e4c359.zip
11460: Contacting server to sort in history view
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
index d86316e76..8ef645895 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
@@ -86,6 +86,8 @@ import org.eclipse.ui.texteditor.ITextEditorActionConstants;
*/
public class HistoryView extends ViewPart implements ISelectionListener {
private IFile file;
+ // cached for efficiency
+ private ILogEntry[] entries;
private CVSTeamProvider provider;
private TableViewer tableViewer;
@@ -400,6 +402,9 @@ public class HistoryView extends ViewPart implements ISelectionListener {
TableViewer viewer = new TableViewer(table);
viewer.setContentProvider(new IStructuredContentProvider() {
public Object[] getElements(Object inputElement) {
+ // Short-circuit to optimize
+ if (entries != null) return entries;
+
if (!(inputElement instanceof ICVSRemoteFile)) return null;
final ICVSRemoteFile remoteFile = (ICVSRemoteFile)inputElement;
final Object[][] result = new Object[1][];
@@ -407,7 +412,8 @@ public class HistoryView extends ViewPart implements ISelectionListener {
new ProgressMonitorDialog(getViewSite().getShell()).run(true, true, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
- result[0] = remoteFile.getLogEntries(monitor);
+ entries = remoteFile.getLogEntries(monitor);
+ result[0] = entries;
} catch (TeamException e) {
throw new InvocationTargetException(e);
}
@@ -428,6 +434,7 @@ public class HistoryView extends ViewPart implements ISelectionListener {
public void dispose() {
}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ entries = null;
}
});
viewer.setLabelProvider(new HistoryLabelProvider());

Back to the top