Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 96102 Details for
Bug 227155
Support PageSwitcher commands
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Fix
Team_PageSwitcher_patch.txt (text/plain), 8.79 KB, created by
Markus Keller
on 2008-04-15 11:46:44 EDT
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2008-04-15 11:46:44 EDT
Size:
8.79 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.team.ui >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 15 Apr 2008 15:40:58 -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 15 Apr 2008 15:40:58 -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 15 Apr 2008 15:40:58 -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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 227155
:
96102
|
96241