View | Details | Raw Unified | Return to bug 227155
Collapse All | Expand All

(-)src/org/eclipse/team/internal/ui/synchronize/actions/ShowSynchronizeParticipantAction.java (-3 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 68-81 Link Here
68
	}
68
	}
69
69
70
    
70
    
71
	private static final class ParticipantOverlay extends CompositeImageDescriptor {
71
	public static final class ParticipantOverlay extends CompositeImageDescriptor {
72
72
73
		private ImageData pinnedData = TeamUIPlugin.getImageDescriptor("ovr/pinned_ovr.gif").getImageData(); //$NON-NLS-1$
73
		private ImageData pinnedData = TeamUIPlugin.getImageDescriptor("ovr/pinned_ovr.gif").getImageData(); //$NON-NLS-1$
74
		private ImageData scheduledData = TeamUIPlugin.getImageDescriptor("ovr/waiting_ovr.gif").getImageData(); //$NON-NLS-1$
74
		private ImageData scheduledData = TeamUIPlugin.getImageDescriptor("ovr/waiting_ovr.gif").getImageData(); //$NON-NLS-1$
75
		private ImageData imageData;
75
		private ImageData imageData;
76
		private ISynchronizeParticipant participant;
76
		private ISynchronizeParticipant participant;
77
77
78
		private ParticipantOverlay(ISynchronizeParticipantReference ref) {
78
		public ParticipantOverlay(ISynchronizeParticipantReference ref) {
79
			try {
79
			try {
80
				this.participant = ref.getParticipant();
80
				this.participant = ref.getParticipant();
81
				this.imageData = ref.getDescriptor().getImageDescriptor().getImageData();
81
				this.imageData = ref.getDescriptor().getImageDescriptor().getImageData();
(-)src/org/eclipse/team/internal/ui/history/GenericHistoryView.java (-4 / +44 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2006, 2007 IBM Corporation and others.
2
 * Copyright (c) 2006, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 17-22 Link Here
17
import org.eclipse.core.resources.IFile;
17
import org.eclipse.core.resources.IFile;
18
import org.eclipse.core.resources.IResource;
18
import org.eclipse.core.resources.IResource;
19
import org.eclipse.jface.action.*;
19
import org.eclipse.jface.action.*;
20
import org.eclipse.jface.commands.ActionHandler;
21
import org.eclipse.jface.resource.ImageDescriptor;
20
import org.eclipse.jface.util.IPropertyChangeListener;
22
import org.eclipse.jface.util.IPropertyChangeListener;
21
import org.eclipse.jface.util.PropertyChangeEvent;
23
import org.eclipse.jface.util.PropertyChangeEvent;
22
import org.eclipse.jface.viewers.ISelection;
24
import org.eclipse.jface.viewers.ISelection;
Lines 32-37 Link Here
32
import org.eclipse.team.ui.history.*;
34
import org.eclipse.team.ui.history.*;
33
import org.eclipse.ui.*;
35
import org.eclipse.ui.*;
34
import org.eclipse.ui.actions.ActionFactory;
36
import org.eclipse.ui.actions.ActionFactory;
37
import org.eclipse.ui.handlers.IHandlerService;
35
import org.eclipse.ui.ide.ResourceUtil;
38
import org.eclipse.ui.ide.ResourceUtil;
36
import org.eclipse.ui.part.*;
39
import org.eclipse.ui.part.*;
37
40
Lines 477-486 Link Here
477
		defaultPageContainer = createDefaultPage(book);
480
		defaultPageContainer = createDefaultPage(book);
478
		
481
		
479
		//Contribute toolbars
482
		//Contribute toolbars
480
		configureToolbars(getViewSite().getActionBars());
483
		IActionBars actionBars= getViewSite().getActionBars();
484
		configureToolbars(actionBars);
481
485
482
		//add global action handler
486
		//add global action handler
483
		getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.REFRESH.getId(), refreshAction);
487
		actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), refreshAction);
488
		IHandlerService handlerService= (IHandlerService) getViewSite().getService(IHandlerService.class);
489
		handlerService.activateHandler("org.eclipse.ui.navigate.linkWithEditor", new ActionHandler(linkWithEditorAction)); //$NON-NLS-1$
490
		
491
		//initialize the page switcher
492
		initPageSwitcher();
484
		
493
		
485
		//initialize the drag and drop
494
		//initialize the drag and drop
486
		initDragAndDrop();
495
		initDragAndDrop();
Lines 519-525 Link Here
519
		};
528
		};
520
		refreshAction.setToolTipText(TeamUIMessages.GenericHistoryView_RefreshTooltip);
529
		refreshAction.setToolTipText(TeamUIMessages.GenericHistoryView_RefreshTooltip);
521
		refreshAction.setEnabled(true);
530
		refreshAction.setEnabled(true);
522
		
531
		refreshAction.setActionDefinitionId("org.eclipse.ui.file.refresh"); //$NON-NLS-1$
523
		
532
		
524
		linkWithEditorAction = new Action(TeamUIMessages.GenericHistoryView_LinkWithEditor, TeamUIPlugin.getImageDescriptor(ITeamUIImages.IMG_LINK_WITH)) {
533
		linkWithEditorAction = new Action(TeamUIMessages.GenericHistoryView_LinkWithEditor, TeamUIPlugin.getImageDescriptor(ITeamUIImages.IMG_LINK_WITH)) {
525
			public void run() {
534
			public void run() {
Lines 533-538 Link Here
533
		};
542
		};
534
		linkWithEditorAction.setChecked(isLinkingEnabled());
543
		linkWithEditorAction.setChecked(isLinkingEnabled());
535
		linkWithEditorAction.setToolTipText(TeamUIMessages.GenericHistoryView_LinkWithTooltip);
544
		linkWithEditorAction.setToolTipText(TeamUIMessages.GenericHistoryView_LinkWithTooltip);
545
		linkWithEditorAction.setActionDefinitionId("org.eclipse.ui.navigate.linkWithEditor"); //$NON-NLS-1$
536
		
546
		
537
		navigateAction = new NavigationHistoryAction();
547
		navigateAction = new NavigationHistoryAction();
538
		Utils.initAction(navigateAction, "action.previousHistory."); //$NON-NLS-1$
548
		Utils.initAction(navigateAction, "action.previousHistory."); //$NON-NLS-1$
Lines 589-594 Link Here
589
		dropTarget.addDropListener(dropAdapter);
599
		dropTarget.addDropListener(dropAdapter);
590
	}
600
	}
591
	
601
	
602
	/**
603
	 * Adds the page switcher to the history view.
604
	 */
605
	void initPageSwitcher() {
606
		new PageSwitcher(this) {
607
			public void activatePage(Object page) {
608
				navigationHistory.gotoEntry((NavigationHistoryEntry) page);
609
				navigateAction.updateCheckState();
610
			}
611
612
			public ImageDescriptor getImageDescriptor(Object page) {
613
				return null;
614
			}
615
616
			public String getName(Object page) {
617
				return ((NavigationHistoryEntry) page).name;
618
			}
619
620
			public Object[] getPages() {
621
				NavigationHistoryEntry[] entries= navigationHistory.getEntries();
622
				Collections.reverse(Arrays.asList(entries));
623
				return entries;
624
			}
625
			
626
			public int getCurrentPageIndex() {
627
				return navigationHistory.history.size() - 1 - navigationHistory.position;
628
			}
629
		};
630
	}
631
	
592
	public void setFocus() {
632
	public void setFocus() {
593
		if (isLinkingEnabled()){
633
		if (isLinkingEnabled()){
594
			if (lastSelectedElement != null){
634
			if (lastSelectedElement != null){
(-)src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java (-9 / +55 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2007 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 10-28 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.team.internal.ui.synchronize;
11
package org.eclipse.team.internal.ui.synchronize;
12
12
13
import java.util.ArrayList;
13
import java.util.*;
14
import java.util.Arrays;
15
import java.util.HashMap;
16
import java.util.HashSet;
17
import java.util.Iterator;
18
import java.util.List;
19
import java.util.Map;
20
import java.util.Set;
21
14
22
import org.eclipse.core.runtime.*;
15
import org.eclipse.core.runtime.*;
23
import org.eclipse.jface.action.IMenuManager;
16
import org.eclipse.jface.action.IMenuManager;
24
import org.eclipse.jface.action.IToolBarManager;
17
import org.eclipse.jface.action.IToolBarManager;
25
import org.eclipse.jface.dialogs.*;
18
import org.eclipse.jface.dialogs.*;
19
import org.eclipse.jface.resource.ImageDescriptor;
26
import org.eclipse.jface.util.IPropertyChangeListener;
20
import org.eclipse.jface.util.IPropertyChangeListener;
27
import org.eclipse.jface.util.PropertyChangeEvent;
21
import org.eclipse.jface.util.PropertyChangeEvent;
28
import org.eclipse.jface.viewers.IBasicPropertyConstants;
22
import org.eclipse.jface.viewers.IBasicPropertyConstants;
Lines 448-457 Link Here
448
			progress.showBusyForFamily(ISynchronizeManager.FAMILY_SYNCHRONIZE_OPERATION);
442
			progress.showBusyForFamily(ISynchronizeManager.FAMILY_SYNCHRONIZE_OPERATION);
449
		}
443
		}
450
		
444
		
445
		initPageSwitcher();
446
		
451
		PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.SYNC_VIEW);
447
		PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.SYNC_VIEW);
452
	}
448
	}
453
	
449
	
454
	/**
450
	/**
451
	 * Initializes the page switcher.
452
	 */
453
	private void initPageSwitcher() {
454
		new PageSwitcher(this) {
455
			public void activatePage(Object page) {
456
				ISynchronizeParticipantReference participantRef = (ISynchronizeParticipantReference) page;
457
				try {
458
					ISynchronizeParticipant participant = participantRef.getParticipant();
459
					if (participant != null)
460
						display(participant);
461
				} catch (TeamException e) {
462
					Utils.handle(e);
463
				}
464
			}
465
466
			public ImageDescriptor getImageDescriptor(Object page) {
467
//				return participantRef.getDescriptor().getImageDescriptor(); // without overlays
468
				ISynchronizeParticipantReference participantRef = (ISynchronizeParticipantReference) page;
469
				return new ShowSynchronizeParticipantAction.ParticipantOverlay(participantRef);
470
			}
471
472
			public String getName(Object page) {
473
				return ((ISynchronizeParticipantReference) page).getDisplayName();
474
			}
475
476
			public Object[] getPages() {
477
				return TeamUI.getSynchronizeManager().getSynchronizeParticipants();
478
			}
479
			
480
			public int getCurrentPageIndex() {
481
				ISynchronizeParticipant currentParticipant = getParticipant();
482
				if (currentParticipant == null)
483
					return super.getCurrentPageIndex();
484
					
485
				ISynchronizeParticipantReference[] participants = TeamUI.getSynchronizeManager().getSynchronizeParticipants();
486
				for (int i = 0; i < participants.length; i++) {
487
					try {
488
						if (currentParticipant.equals(participants[i].getParticipant()))
489
							return i;
490
					} catch (TeamException e) {
491
						Utils.handle(e);
492
					}
493
				}
494
				return super.getCurrentPageIndex();
495
			}
496
		};
497
		
498
	}
499
500
	/**
455
	 * Initialize for existing participants
501
	 * Initialize for existing participants
456
	 */
502
	 */
457
	private void updateForExistingParticipants() {
503
	private void updateForExistingParticipants() {
(-)META-INF/MANIFEST.MF (-2 / +3 lines)
Lines 30-37 Link Here
30
 org.eclipse.ui.navigator;bundle-version="[3.3.0,4.0.0)",
30
 org.eclipse.ui.navigator;bundle-version="[3.3.0,4.0.0)",
31
 org.eclipse.jface.text;bundle-version="[3.3.0,4.0.0)",
31
 org.eclipse.jface.text;bundle-version="[3.3.0,4.0.0)",
32
 org.eclipse.ui.navigator.resources;bundle-version="[3.2.0,4.0.0)",
32
 org.eclipse.ui.navigator.resources;bundle-version="[3.2.0,4.0.0)",
33
 org.eclipse.ui.editors;bundle-version="[3.3.0,4.0.0)"
33
 org.eclipse.ui.editors;bundle-version="[3.3.0,4.0.0)",
34
Eclipse-LazyStart: true
34
 org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)"
35
Bundle-ActivationPolicy: lazy
35
Import-Package: com.ibm.icu.text,
36
Import-Package: com.ibm.icu.text,
36
 com.ibm.icu.util
37
 com.ibm.icu.util
37
Bundle-RequiredExecutionEnvironment: J2SE-1.4
38
Bundle-RequiredExecutionEnvironment: J2SE-1.4

Return to bug 227155