View | Details | Raw Unified | Return to bug 188278 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/team/internal/ui/Policy.java (+17 lines)
Lines 12-17 Link Here
12
12
13
13
14
14
15
import java.util.Date;
15
import java.util.ResourceBundle;
16
import java.util.ResourceBundle;
16
17
17
import org.eclipse.core.runtime.*;
18
import org.eclipse.core.runtime.*;
Lines 72-75 Link Here
72
			return new NullProgressMonitor();
73
			return new NullProgressMonitor();
73
		return monitor;
74
		return monitor;
74
	}
75
	}
76
	
77
	/**
78
	 * Print a debug message to the console. Pre-pend the message with the
79
	 * current date and the name of the current thread.
80
	 * 
81
	 * @param message
82
	 */
83
	public static void debug(String message) {
84
		StringBuffer buffer = new StringBuffer();
85
		buffer.append(new Date(System.currentTimeMillis()));
86
		buffer.append(" - ["); //$NON-NLS-1$
87
		buffer.append(Thread.currentThread().getName());
88
		buffer.append("] "); //$NON-NLS-1$
89
		buffer.append(message);
90
		System.out.println(buffer.toString());
91
	}
75
}
92
}
(-)src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java (-3 / +3 lines)
Lines 68-76 Link Here
68
		setLayoutData(data);
68
		setLayoutData(data);
69
		
69
		
70
		forms = new FormToolkit(parent.getDisplay());
70
		forms = new FormToolkit(parent.getDisplay());
71
		forms.setBackground(getBackgroundColor());
71
		forms.setBackground(getColorBackground());
72
		HyperlinkGroup group = forms.getHyperlinkGroup();
72
		HyperlinkGroup group = forms.getHyperlinkGroup();
73
		group.setBackground(getBackgroundColor());
73
		group.setBackground(getColorBackground());
74
		
74
		
75
		changesSectionContainer = new PageBook(this, SWT.NONE);
75
		changesSectionContainer = new PageBook(this, SWT.NONE);
76
		data = new GridData(GridData.FILL_BOTH);
76
		data = new GridData(GridData.FILL_BOTH);
Lines 79-85 Link Here
79
		changesSectionContainer.setLayoutData(data);
79
		changesSectionContainer.setLayoutData(data);
80
	}
80
	}
81
	
81
	
82
	protected Color getBackgroundColor() {
82
	protected Color getColorBackground() {
83
		return getShell().getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
83
		return getShell().getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
84
	}
84
	}
85
	
85
	
(-)src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java (-7 / +3 lines)
Lines 53-59 Link Here
53
import org.eclipse.ui.part.IPageSite;
53
import org.eclipse.ui.part.IPageSite;
54
import org.eclipse.ui.progress.IProgressConstants;
54
import org.eclipse.ui.progress.IProgressConstants;
55
55
56
import com.ibm.icu.text.SimpleDateFormat;
57
import com.ibm.icu.util.Calendar;
56
import com.ibm.icu.util.Calendar;
58
57
59
public class LocalHistoryPage extends HistoryPage implements IHistoryCompareAdapter {
58
public class LocalHistoryPage extends HistoryPage implements IHistoryCompareAdapter {
Lines 205-212 Link Here
205
				}
204
				}
206
				
205
				
207
				if (Policy.DEBUG_HISTORY) {
206
				if (Policy.DEBUG_HISTORY) {
208
					String time = new SimpleDateFormat("m:ss.SSS").format(new Date(System.currentTimeMillis())); //$NON-NLS-1$
207
					Policy.debug("RefreshFileHistoryJob#run finished, status: " + status); //$NON-NLS-1$
209
					System.out.println(time + ": RefreshFileHistoryJob#run finished, status: " + status); //$NON-NLS-1$
210
				}
208
				}
211
				
209
				
212
				return status;
210
				return status;
Lines 270-277 Link Here
270
268
271
	private void refreshHistory(boolean refetch) {
269
	private void refreshHistory(boolean refetch) {
272
		if (Policy.DEBUG_HISTORY) {
270
		if (Policy.DEBUG_HISTORY) {
273
			String time = new SimpleDateFormat("m:ss.SSS").format(new Date(System.currentTimeMillis())); //$NON-NLS-1$
271
			Policy.debug("LocalHistoryPage#refreshHistory, refetch = " + refetch); //$NON-NLS-1$
274
			System.out.println(time + ": LocalHistoryPage#refreshHistory, refetch = " + refetch); //$NON-NLS-1$
275
		}
272
		}
276
		
273
		
277
		if (refreshFileHistoryJob.getState() != Job.NONE){
274
		if (refreshFileHistoryJob.getState() != Job.NONE){
Lines 723-730 Link Here
723
		Utils.asyncExec(new Runnable() {
720
		Utils.asyncExec(new Runnable() {
724
			public void run() {
721
			public void run() {
725
				if (Policy.DEBUG_HISTORY) {
722
				if (Policy.DEBUG_HISTORY) {
726
					String time = new SimpleDateFormat("m:ss.SSS").format(new Date(System.currentTimeMillis())); //$NON-NLS-1$
723
					Policy.debug("LocalHistoryPage#update, the tree is being updated in the UI thread"); //$NON-NLS-1$
727
					System.out.println(time + ": LocalHistoryPage#update, the tree is being updated in the UI thread"); //$NON-NLS-1$
728
				}
724
				}
729
				if (categories != null) {
725
				if (categories != null) {
730
					Object[] elementsToExpand = mapExpandedElements(categories, treeViewer.getExpandedElements());
726
					Object[] elementsToExpand = mapExpandedElements(categories, treeViewer.getExpandedElements());
(-)src/org/eclipse/team/internal/ui/history/GenericHistoryView.java (-4 / +12 lines)
Lines 693-700 Link Here
693
	
693
	
694
	public IHistoryPage showHistoryPageFor(Object object, boolean refresh, boolean force, IHistoryPageSource pageSource) {
694
	public IHistoryPage showHistoryPageFor(Object object, boolean refresh, boolean force, IHistoryPageSource pageSource) {
695
		if (Policy.DEBUG_HISTORY) {
695
		if (Policy.DEBUG_HISTORY) {
696
			String time = new SimpleDateFormat("m:ss.SSS").format(new Date(System.currentTimeMillis())); //$NON-NLS-1$
696
			Policy.debug("GenericHistoryView#showHistoryPageFor, the object to show is: " + object); //$NON-NLS-1$
697
			System.out.println(time + ": GenericHistoryView#showHistoryPageFor, the object to show is: " + object); //$NON-NLS-1$
698
		}
697
		}
699
		
698
		
700
		// Check to see if history view is visible - if it's not, don't bother
699
		// Check to see if history view is visible - if it's not, don't bother
Lines 720-730 Link Here
720
		
719
		
721
		// If a current page exists, see if it can handle the dropped item.
720
		// If a current page exists, see if it can handle the dropped item.
722
		// Otherwise, create a new page
721
		// Otherwise, create a new page
722
		
723
		PageContainer tempPageContainer = null;
723
		PageContainer tempPageContainer = null;
724
		if (currentPageContainer!= null && currentPageContainer.canShow(object, pageSource)) {
724
		if (currentPageContainer != null
725
				&& currentPageContainer.canShow(object, pageSource)) {
725
			tempPageContainer = currentPageContainer;
726
			tempPageContainer = currentPageContainer;
726
		} else {
727
		} else {
727
			tempPageContainer = createPage(pageSource, object);
728
			synchronized (this) {
729
				if (currentPageContainer != null
730
						&& currentPageContainer.canShow(object, pageSource)) {
731
					tempPageContainer = currentPageContainer;
732
				} else {
733
					tempPageContainer = createPage(pageSource, object);
734
				}
735
			}
728
		}
736
		}
729
		
737
		
730
		// Set the new page to the current page for the view
738
		// Set the new page to the current page for the view
(-)src/org/eclipse/team/internal/ccvs/ui/Policy.java (+17 lines)
Lines 11-16 Link Here
11
package org.eclipse.team.internal.ccvs.ui;
11
package org.eclipse.team.internal.ccvs.ui;
12
12
13
13
14
import java.util.Date;
14
import java.util.ResourceBundle;
15
import java.util.ResourceBundle;
15
16
16
import org.eclipse.core.runtime.IProgressMonitor;
17
import org.eclipse.core.runtime.IProgressMonitor;
Lines 73-76 Link Here
73
            return tmpBundle;
74
            return tmpBundle;
74
        return actionBundle = ResourceBundle.getBundle(ACTION_BUNDLE);
75
        return actionBundle = ResourceBundle.getBundle(ACTION_BUNDLE);
75
	}
76
	}
77
	
78
	/**
79
	 * Print a debug message to the console. Pre-pend the message with the
80
	 * current date and the name of the current thread.
81
	 * 
82
	 * @param message
83
	 */
84
	public static void debug(String message) {
85
		StringBuffer buffer = new StringBuffer();
86
		buffer.append(new Date(System.currentTimeMillis()));
87
		buffer.append(" - ["); //$NON-NLS-1$
88
		buffer.append(Thread.currentThread().getName());
89
		buffer.append("] "); //$NON-NLS-1$
90
		buffer.append(message);
91
		System.out.println(buffer.toString());
92
	}
76
}
93
}
(-)src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java (-22 / +20 lines)
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
			}

Return to bug 188278