### Eclipse Workspace Patch 1.0 #P org.eclipse.team.ui Index: src/org/eclipse/team/internal/ui/synchronize/actions/ShowSynchronizeParticipantAction.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ShowSynchronizeParticipantAction.java,v retrieving revision 1.13 diff -u -r1.13 ShowSynchronizeParticipantAction.java --- src/org/eclipse/team/internal/ui/synchronize/actions/ShowSynchronizeParticipantAction.java 26 Oct 2006 14:36:26 -0000 1.13 +++ src/org/eclipse/team/internal/ui/synchronize/actions/ShowSynchronizeParticipantAction.java 16 Apr 2008 10:45:16 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -68,14 +68,14 @@ } - private static final class ParticipantOverlay extends CompositeImageDescriptor { + public static final class ParticipantOverlay extends CompositeImageDescriptor { private ImageData pinnedData = TeamUIPlugin.getImageDescriptor("ovr/pinned_ovr.gif").getImageData(); //$NON-NLS-1$ private ImageData scheduledData = TeamUIPlugin.getImageDescriptor("ovr/waiting_ovr.gif").getImageData(); //$NON-NLS-1$ private ImageData imageData; private ISynchronizeParticipant participant; - private ParticipantOverlay(ISynchronizeParticipantReference ref) { + public ParticipantOverlay(ISynchronizeParticipantReference ref) { try { this.participant = ref.getParticipant(); this.imageData = ref.getDescriptor().getImageDescriptor().getImageData(); Index: src/org/eclipse/team/internal/ui/history/GenericHistoryView.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java,v retrieving revision 1.61 diff -u -r1.61 GenericHistoryView.java --- src/org/eclipse/team/internal/ui/history/GenericHistoryView.java 21 Jun 2007 13:44:24 -0000 1.61 +++ src/org/eclipse/team/internal/ui/history/GenericHistoryView.java 16 Apr 2008 10:45:16 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2007 IBM Corporation and others. + * Copyright (c) 2006, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -17,6 +17,8 @@ import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.jface.action.*; +import org.eclipse.jface.commands.ActionHandler; +import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.jface.viewers.ISelection; @@ -32,6 +34,7 @@ import org.eclipse.team.ui.history.*; import org.eclipse.ui.*; import org.eclipse.ui.actions.ActionFactory; +import org.eclipse.ui.handlers.IHandlerService; import org.eclipse.ui.ide.ResourceUtil; import org.eclipse.ui.part.*; @@ -477,10 +480,16 @@ defaultPageContainer = createDefaultPage(book); //Contribute toolbars - configureToolbars(getViewSite().getActionBars()); + IActionBars actionBars= getViewSite().getActionBars(); + configureToolbars(actionBars); //add global action handler - getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.REFRESH.getId(), refreshAction); + actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), refreshAction); + IHandlerService handlerService= (IHandlerService) getViewSite().getService(IHandlerService.class); + handlerService.activateHandler("org.eclipse.ui.navigate.linkWithEditor", new ActionHandler(linkWithEditorAction)); //$NON-NLS-1$ + + //initialize the page switcher + initPageSwitcher(); //initialize the drag and drop initDragAndDrop(); @@ -519,7 +528,7 @@ }; refreshAction.setToolTipText(TeamUIMessages.GenericHistoryView_RefreshTooltip); refreshAction.setEnabled(true); - + refreshAction.setActionDefinitionId("org.eclipse.ui.file.refresh"); //$NON-NLS-1$ linkWithEditorAction = new Action(TeamUIMessages.GenericHistoryView_LinkWithEditor, TeamUIPlugin.getImageDescriptor(ITeamUIImages.IMG_LINK_WITH)) { public void run() { @@ -533,6 +542,7 @@ }; linkWithEditorAction.setChecked(isLinkingEnabled()); linkWithEditorAction.setToolTipText(TeamUIMessages.GenericHistoryView_LinkWithTooltip); + linkWithEditorAction.setActionDefinitionId("org.eclipse.ui.navigate.linkWithEditor"); //$NON-NLS-1$ navigateAction = new NavigationHistoryAction(); Utils.initAction(navigateAction, "action.previousHistory."); //$NON-NLS-1$ @@ -589,6 +599,36 @@ dropTarget.addDropListener(dropAdapter); } + /** + * Adds the page switcher to the history view. + */ + void initPageSwitcher() { + new PageSwitcher(this) { + public void activatePage(Object page) { + navigationHistory.gotoEntry((NavigationHistoryEntry) page); + navigateAction.updateCheckState(); + } + + public ImageDescriptor getImageDescriptor(Object page) { + return null; + } + + public String getName(Object page) { + return ((NavigationHistoryEntry) page).name; + } + + public Object[] getPages() { + NavigationHistoryEntry[] entries= navigationHistory.getEntries(); + Collections.reverse(Arrays.asList(entries)); + return entries; + } + + public int getCurrentPageIndex() { + return navigationHistory.history.size() - 1 - navigationHistory.position; + } + }; + } + public void setFocus() { if (isLinkingEnabled()){ if (lastSelectedElement != null){ Index: src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java,v retrieving revision 1.44 diff -u -r1.44 SynchronizeView.java --- src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java 23 May 2007 14:16:05 -0000 1.44 +++ src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java 16 Apr 2008 10:45:16 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,19 +10,13 @@ *******************************************************************************/ package org.eclipse.team.internal.ui.synchronize; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.dialogs.*; +import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.jface.viewers.IBasicPropertyConstants; @@ -448,10 +442,62 @@ progress.showBusyForFamily(ISynchronizeManager.FAMILY_SYNCHRONIZE_OPERATION); } + initPageSwitcher(); + PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.SYNC_VIEW); } /** + * Initializes the page switcher. + */ + private void initPageSwitcher() { + new PageSwitcher(this) { + public void activatePage(Object page) { + ISynchronizeParticipantReference participantRef = (ISynchronizeParticipantReference) page; + try { + ISynchronizeParticipant participant = participantRef.getParticipant(); + if (participant != null) + display(participant); + } catch (TeamException e) { + Utils.handle(e); + } + } + + public ImageDescriptor getImageDescriptor(Object page) { +// return participantRef.getDescriptor().getImageDescriptor(); // without overlays + ISynchronizeParticipantReference participantRef = (ISynchronizeParticipantReference) page; + return new ShowSynchronizeParticipantAction.ParticipantOverlay(participantRef); + } + + public String getName(Object page) { + return ((ISynchronizeParticipantReference) page).getDisplayName(); + } + + public Object[] getPages() { + return TeamUI.getSynchronizeManager().getSynchronizeParticipants(); + } + + public int getCurrentPageIndex() { + ISynchronizeParticipant currentParticipant = getParticipant(); + if (currentParticipant == null) + return super.getCurrentPageIndex(); + + ISynchronizeParticipantReference[] participants = TeamUI.getSynchronizeManager().getSynchronizeParticipants(); + for (int i = 0; i < participants.length; i++) { + try { + if (currentParticipant.equals(participants[i].getParticipant())) + return i; + } catch (TeamException e) { + Utils.handle(e); + } + } + return super.getCurrentPageIndex(); + } + }; + + } + + /** * Initialize for existing participants */ private void updateForExistingParticipants() { Index: META-INF/MANIFEST.MF =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.team.ui/META-INF/MANIFEST.MF,v retrieving revision 1.24 diff -u -r1.24 MANIFEST.MF --- META-INF/MANIFEST.MF 30 Jul 2007 19:18:13 -0000 1.24 +++ META-INF/MANIFEST.MF 16 Apr 2008 10:45:16 -0000 @@ -30,8 +30,9 @@ org.eclipse.ui.navigator;bundle-version="[3.3.0,4.0.0)", org.eclipse.jface.text;bundle-version="[3.3.0,4.0.0)", org.eclipse.ui.navigator.resources;bundle-version="[3.2.0,4.0.0)", - org.eclipse.ui.editors;bundle-version="[3.3.0,4.0.0)" -Eclipse-LazyStart: true + org.eclipse.ui.editors;bundle-version="[3.3.0,4.0.0)", + org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)" +Bundle-ActivationPolicy: lazy Import-Package: com.ibm.icu.text, com.ibm.icu.util Bundle-RequiredExecutionEnvironment: J2SE-1.4