Lines 32-38
Link Here
|
32 |
import org.eclipse.jface.preference.IPreferenceStore; |
32 |
import org.eclipse.jface.preference.IPreferenceStore; |
33 |
import org.eclipse.jface.text.*; |
33 |
import org.eclipse.jface.text.*; |
34 |
import org.eclipse.jface.text.revisions.Revision; |
34 |
import org.eclipse.jface.text.revisions.Revision; |
35 |
import org.eclipse.jface.text.source.*; |
35 |
import org.eclipse.jface.text.source.ISourceViewer; |
|
|
36 |
import org.eclipse.jface.text.source.SourceViewer; |
36 |
import org.eclipse.jface.util.IOpenEventListener; |
37 |
import org.eclipse.jface.util.IOpenEventListener; |
37 |
import org.eclipse.jface.util.OpenStrategy; |
38 |
import org.eclipse.jface.util.OpenStrategy; |
38 |
import org.eclipse.jface.viewers.*; |
39 |
import org.eclipse.jface.viewers.*; |
Lines 75-84
Link Here
|
75 |
import org.eclipse.ui.ide.IDE; |
76 |
import org.eclipse.ui.ide.IDE; |
76 |
import org.eclipse.ui.part.IPageSite; |
77 |
import org.eclipse.ui.part.IPageSite; |
77 |
import org.eclipse.ui.progress.IProgressConstants; |
78 |
import org.eclipse.ui.progress.IProgressConstants; |
78 |
import org.eclipse.ui.texteditor.*; |
79 |
import org.eclipse.ui.texteditor.ITextEditorActionConstants; |
79 |
|
80 |
|
80 |
import com.ibm.icu.text.DateFormat; |
81 |
import com.ibm.icu.text.DateFormat; |
81 |
import com.ibm.icu.text.SimpleDateFormat; |
|
|
82 |
import com.ibm.icu.util.Calendar; |
82 |
import com.ibm.icu.util.Calendar; |
83 |
|
83 |
|
84 |
public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryCompareAdapter { |
84 |
public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryCompareAdapter { |
Lines 1041-1048
Link Here
|
1041 |
refreshCVSFileHistoryJob.setRefreshFlags(refreshFlags); |
1041 |
refreshCVSFileHistoryJob.setRefreshFlags(refreshFlags); |
1042 |
IHistoryPageSite parentSite = getHistoryPageSite(); |
1042 |
IHistoryPageSite parentSite = getHistoryPageSite(); |
1043 |
if (Policy.DEBUG_HISTORY) { |
1043 |
if (Policy.DEBUG_HISTORY) { |
1044 |
String time = new SimpleDateFormat("m:ss.SSS").format(new Date(System.currentTimeMillis())); //$NON-NLS-1$ |
1044 |
Policy.debug("CVSHistoryPage#refreshHistory, about to schedule RefreshCVSFileHistoryJob"); //$NON-NLS-1$ |
1045 |
System.out.println(time + ": CVSHistoryPage#refreshHistory, about to schedule RefreshCVSFileHistoryJob"); //$NON-NLS-1$ |
|
|
1046 |
} |
1045 |
} |
1047 |
Utils.schedule(refreshCVSFileHistoryJob, getWorkbenchSite(parentSite)); |
1046 |
Utils.schedule(refreshCVSFileHistoryJob, getWorkbenchSite(parentSite)); |
1048 |
} |
1047 |
} |
Lines 1421-1428
Link Here
|
1421 |
} catch (TeamException e) { |
1420 |
} catch (TeamException e) { |
1422 |
// Ignore and try the full refresh |
1421 |
// Ignore and try the full refresh |
1423 |
if (Policy.DEBUG_HISTORY) { |
1422 |
if (Policy.DEBUG_HISTORY) { |
1424 |
String time = new SimpleDateFormat("m:ss.SSS").format(new Date(System.currentTimeMillis())); //$NON-NLS-1$ |
1423 |
Policy.debug("RefreshCVSFileHistory#run encountered an exception"); //$NON-NLS-1$ |
1425 |
System.out.println(time + ": RefreshCVSFileHistory#run encountered an exception"); //$NON-NLS-1$ |
|
|
1426 |
e.printStackTrace(); |
1424 |
e.printStackTrace(); |
1427 |
} |
1425 |
} |
1428 |
} |
1426 |
} |
Lines 1432-1439
Link Here
|
1432 |
needsUpdate = true; |
1430 |
needsUpdate = true; |
1433 |
} catch (TeamException ex) { |
1431 |
} catch (TeamException ex) { |
1434 |
if (Policy.DEBUG_HISTORY) { |
1432 |
if (Policy.DEBUG_HISTORY) { |
1435 |
String time = new SimpleDateFormat("m:ss.SSS").format(new Date(System.currentTimeMillis())); //$NON-NLS-1$ |
1433 |
Policy.debug("RefreshCVSFileHistory#run encountered an exception"); //$NON-NLS-1$ |
1436 |
System.out.println(time + ": RefreshCVSFileHistory#run encountered an exception"); //$NON-NLS-1$ |
|
|
1437 |
ex.printStackTrace(); |
1434 |
ex.printStackTrace(); |
1438 |
} |
1435 |
} |
1439 |
if (!localFetched) { |
1436 |
if (!localFetched) { |
Lines 1443-1458
Link Here
|
1443 |
} catch (TeamException e) { |
1440 |
} catch (TeamException e) { |
1444 |
// Ignore and allow the original exception to go through |
1441 |
// Ignore and allow the original exception to go through |
1445 |
if (Policy.DEBUG_HISTORY) { |
1442 |
if (Policy.DEBUG_HISTORY) { |
1446 |
String time = new SimpleDateFormat("m:ss.SSS").format(new Date(System.currentTimeMillis())); //$NON-NLS-1$ |
1443 |
Policy.debug("RefreshCVSFileHistory#run encountered an exception"); //$NON-NLS-1$ |
1447 |
System.out.println(time + ": RefreshCVSFileHistory#run encountered an exception"); //$NON-NLS-1$ |
|
|
1448 |
e.printStackTrace(); |
1444 |
e.printStackTrace(); |
1449 |
} |
1445 |
} |
1450 |
} |
1446 |
} |
1451 |
} |
1447 |
} |
1452 |
status = new CVSStatus(ex.getStatus().getSeverity(), ex.getStatus().getCode(), ex.getMessage(), ex); |
1448 |
status = new CVSStatus(ex.getStatus().getSeverity(), ex.getStatus().getCode(), ex.getMessage(), ex); |
1453 |
} |
1449 |
} |
1454 |
if (needsUpdate) |
1450 |
if (needsUpdate) { |
|
|
1451 |
if (Policy.DEBUG_HISTORY) |
1452 |
Policy.debug("RefreshCVSFileHistory#run: about to call updateTable"); //$NON-NLS-1$ |
1455 |
updateTable(); |
1453 |
updateTable(); |
|
|
1454 |
} |
1456 |
} |
1455 |
} |
1457 |
|
1456 |
|
1458 |
if (status != Status.OK_STATUS ) { |
1457 |
if (status != Status.OK_STATUS ) { |
Lines 1461-1479
Link Here
|
1461 |
} |
1460 |
} |
1462 |
|
1461 |
|
1463 |
if (Policy.DEBUG_HISTORY) { |
1462 |
if (Policy.DEBUG_HISTORY) { |
1464 |
String time = new SimpleDateFormat("m:ss.SSS").format(new Date(System.currentTimeMillis())); //$NON-NLS-1$ |
1463 |
Policy.debug("RefreshCVSFileHistory#run finished, status: " + status); //$NON-NLS-1$ |
1465 |
System.out.println(time + ": RefreshCVSFileHistory#run finished, status: " + status); //$NON-NLS-1$ |
|
|
1466 |
} |
1464 |
} |
1467 |
|
1465 |
|
1468 |
return status; |
1466 |
return status; |
1469 |
} |
1467 |
} |
1470 |
|
1468 |
|
1471 |
private void updateTable() { |
1469 |
private void updateTable() { |
|
|
1470 |
if (Policy.DEBUG_HISTORY) |
1471 |
Policy.debug("RefreshCVSFileHistory#updateTable: about to run async'd table update"); //$NON-NLS-1$ |
1472 |
if (grouping) |
1472 |
if (grouping) |
1473 |
revisionsFound = sortRevisions(); |
1473 |
revisionsFound = sortRevisions(); |
1474 |
|
|
|
1475 |
Utils.asyncExec(new Runnable() { |
1474 |
Utils.asyncExec(new Runnable() { |
1476 |
public void run() { |
1475 |
public void run() { |
|
|
1476 |
if (Policy.DEBUG_HISTORY) |
1477 |
Policy.debug("Updating table"); //$NON-NLS-1$ |
1477 |
historyTableProvider.setLocalRevisionsDisplayed(fileHistory.isIncludeLocal()); |
1478 |
historyTableProvider.setLocalRevisionsDisplayed(fileHistory.isIncludeLocal()); |
1478 |
historyTableProvider.setFile(fileHistory, workspaceFile); |
1479 |
historyTableProvider.setFile(fileHistory, workspaceFile); |
1479 |
//historyTableProvider.setWorkspaceFile(workspaceFile); |
1480 |
//historyTableProvider.setWorkspaceFile(workspaceFile); |
Lines 1855-1877
Link Here
|
1855 |
boolean needRefresh = checkPreviousInput(); |
1856 |
boolean needRefresh = checkPreviousInput(); |
1856 |
|
1857 |
|
1857 |
if (Policy.DEBUG_HISTORY) { |
1858 |
if (Policy.DEBUG_HISTORY) { |
1858 |
String time = new SimpleDateFormat("m:ss.SSS").format(new Date(System.currentTimeMillis())); //$NON-NLS-1$ |
1859 |
Policy.debug("CVSHistoryPage#inputSet, needRefresh = " + needRefresh); //$NON-NLS-1$ |
1859 |
System.out.println(time + ": CVSHistoryPage#inputSet, needRefresh = " + needRefresh); //$NON-NLS-1$ |
|
|
1860 |
} |
1860 |
} |
1861 |
|
1861 |
|
1862 |
if (refreshCVSFileHistoryJob != null) { |
1862 |
if (refreshCVSFileHistoryJob != null) { |
1863 |
if (!needRefresh && refreshCVSFileHistoryJob.getState() != Job.NONE) { |
1863 |
if (!needRefresh && refreshCVSFileHistoryJob.getState() != Job.NONE) { |
1864 |
// let the old job finish |
1864 |
// let the old job finish |
1865 |
if (Policy.DEBUG_HISTORY) { |
1865 |
if (Policy.DEBUG_HISTORY) { |
1866 |
String time = new SimpleDateFormat("m:ss.SSS").format(new Date(System.currentTimeMillis())); //$NON-NLS-1$ |
1866 |
Policy.debug("CVSHistoryPage#inputSet, the old job is still running"); //$NON-NLS-1$ |
1867 |
System.out.println(time + ": CVSHistoryPage#inputSet, the old job is still running"); //$NON-NLS-1$ |
|
|
1868 |
} |
1867 |
} |
1869 |
return true; |
1868 |
return true; |
1870 |
} else { |
1869 |
} else { |
1871 |
// cancel the old job and continue |
1870 |
// cancel the old job and continue |
1872 |
if (Policy.DEBUG_HISTORY) { |
1871 |
if (Policy.DEBUG_HISTORY) { |
1873 |
String time = new SimpleDateFormat("m:ss.SSS").format(new Date(System.currentTimeMillis())); //$NON-NLS-1$ |
1872 |
Policy.debug("CVSHistoryPage#inputSet, cancel the old job"); //$NON-NLS-1$ |
1874 |
System.out.println(time + ": CVSHistoryPage#inputSet, cancel the old job"); //$NON-NLS-1$ |
|
|
1875 |
} |
1873 |
} |
1876 |
refreshCVSFileHistoryJob.cancel(); |
1874 |
refreshCVSFileHistoryJob.cancel(); |
1877 |
} |
1875 |
} |