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 129861 Details for
Bug 247628
[changeset] Having 2 edit actions in context menu is confusing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fix v01
247628_20090325.txt (text/plain), 28.76 KB, created by
Szymon Brandys
on 2009-03-25 12:57:13 EDT
(
hide
)
Description:
Fix v01
Filename:
MIME Type:
Creator:
Szymon Brandys
Created:
2009-03-25 12:57:13 EDT
Size:
28.76 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.team.cvs.ui >Index: src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetContentProvider.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetContentProvider.java,v >retrieving revision 1.31 >diff -u -r1.31 ChangeSetContentProvider.java >--- src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetContentProvider.java 13 Nov 2008 10:31:15 -0000 1.31 >+++ src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetContentProvider.java 25 Mar 2009 16:57:00 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006, 2008 IBM Corporation and others. >+ * Copyright (c) 2006, 2009 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 >@@ -357,10 +357,12 @@ > return result.toArray(); > } > >- private synchronized DiffChangeSet getUnassignedSet() { >+ synchronized DiffChangeSet getUnassignedSet() { > if (unassignedDiffs == null) { >- unassignedDiffs = new UnassignedDiffChangeSet(CVSUIMessages.ChangeSetContentProvider_0); >- unassignedDiffs.getDiffTree().addDiffChangeListener(diffTreeListener); >+ unassignedDiffs = new UnassignedDiffChangeSet( >+ CVSUIMessages.ChangeSetContentProvider_0); >+ unassignedDiffs.getDiffTree().addDiffChangeListener( >+ diffTreeListener); > addAllUnassignedToUnassignedSet(); > } > return unassignedDiffs; >Index: src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetActionProvider.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetActionProvider.java,v >retrieving revision 1.20 >diff -u -r1.20 ChangeSetActionProvider.java >--- src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetActionProvider.java 13 Nov 2008 10:31:15 -0000 1.20 >+++ src/org/eclipse/team/internal/ccvs/ui/mappings/ChangeSetActionProvider.java 25 Mar 2009 16:57:00 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006, 2008 IBM Corporation and others. >+ * Copyright (c) 2006, 2009 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,9 +17,7 @@ > import org.eclipse.core.resources.mapping.ResourceTraversal; > import org.eclipse.jface.action.*; > import org.eclipse.jface.dialogs.IDialogSettings; >-import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.jface.viewers.*; >-import org.eclipse.osgi.util.NLS; > import org.eclipse.swt.widgets.Control; > import org.eclipse.team.core.diff.*; > import org.eclipse.team.core.mapping.IResourceDiffTree; >@@ -40,59 +38,59 @@ > public class ChangeSetActionProvider extends ResourceModelActionProvider { > > /** >- * Menu group that can be added to the context menu >- */ >- public final static String CHANGE_SET_GROUP = "changeSetActions"; //$NON-NLS-1$ >- >+ * Menu group that can be added to the context menu >+ */ >+ public final static String CHANGE_SET_GROUP = "changeSetActions"; //$NON-NLS-1$ >+ > // Constants for persisting sorting options > private static final String P_LAST_COMMENTSORT = TeamUIPlugin.ID + ".P_LAST_COMMENT_SORT"; //$NON-NLS-1$ >- >+ > private MenuManager sortByComment; >- private CreateChangeSetAction createChangeSet; > private MenuManager addToChangeSet; >- private EditChangeSetAction editChangeSet; >- private RemoveChangeSetAction removeChangeSet; >- private MakeDefaultChangeSetAction makeDefault; >- >+ private CreateChangeSetAction createChangeSet; >+ private EditChangeSetAction editChangeSet; >+ private RemoveChangeSetAction removeChangeSet; >+ private MakeDefaultChangeSetAction makeDefault; > private OpenChangeSetAction openCommitSet; >- >+ > private class CreateChangeSetAction extends ModelParticipantAction { >- >- public CreateChangeSetAction(ISynchronizePageConfiguration configuration) { >- super(TeamUIMessages.ChangeLogModelProvider_0, configuration); >- } >- >- public void run() { >- final IDiff[] diffs = getLocalChanges(getStructuredSelection()); >- syncExec(new Runnable() { >+ >+ public CreateChangeSetAction(ISynchronizePageConfiguration configuration) { >+ super(TeamUIMessages.ChangeLogModelProvider_0, configuration); >+ } >+ >+ public void run() { >+ final IDiff[] diffs = getLocalChanges(getStructuredSelection()); >+ syncExec(new Runnable() { > public void run() { > createChangeSet(diffs); > } > }); >- } >- >- /* package */ void createChangeSet(IDiff[] diffs) { >+ } >+ >+ /* package */void createChangeSet(IDiff[] diffs) { > ActiveChangeSet set = getChangeSetCapability().createChangeSet(getConfiguration(), diffs); >- if (set != null) { >- getActiveChangeSetManager().add(set); >- } >- } >- >+ if (set != null) { >+ getActiveChangeSetManager().add(set); >+ } >+ } >+ > protected boolean isEnabledForSelection(IStructuredSelection selection) { >- return isContentProviderEnabled() && containsLocalChanges(selection); >+ return isContentProviderEnabled() >+ && containsOnlyLocalChanges(selection); > } > } >- >+ > /** > * Escape a string so it can be used as an action text without '&' > * being interpreted as a mnemonic. Specifically, turn each '&' into '&&'. > */ >- /* package */ static String escapeActionText(String x) { >+ /* package */static String escapeActionText(String x) { > // Loosely based on org.eclipse.jface.action.LegacyActionTools#removeMnemonics > int ampersandIndex = x.indexOf('&'); > if (ampersandIndex == -1) > return x; >- >+ > int len = x.length(); > StringBuffer sb = new StringBuffer(2 * len + 1); > int doneIndex = 0; >@@ -108,122 +106,119 @@ > } > > private class AddToChangeSetAction extends ModelParticipantAction { >- >- private final ActiveChangeSet set; >- >+ >+ private final ActiveChangeSet set; >+ > public AddToChangeSetAction(ISynchronizePageConfiguration configuration, ActiveChangeSet set, ISelection selection) { > super(set == null ? TeamUIMessages.ChangeSetActionGroup_2 : escapeActionText(set.getTitle()), configuration); >- this.set = set; >- selectionChanged(selection); >- } >- >- public void run() { >- IDiff[] diffArray = getLocalChanges(getStructuredSelection()); >- if (set != null) { >+ this.set = set; >+ selectionChanged(selection); >+ } >+ >+ public void run() { >+ IDiff[] diffArray = getLocalChanges(getStructuredSelection()); >+ if (set != null) { > set.add(diffArray); >- } else { >- ChangeSet[] sets = getActiveChangeSetManager().getSets(); >- IResource[] resources = getResources(diffArray); >- for (int i = 0; i < sets.length; i++) { >- ActiveChangeSet activeSet = (ActiveChangeSet)sets[i]; >+ } else { >+ ChangeSet[] sets = getActiveChangeSetManager().getSets(); >+ IResource[] resources = getResources(diffArray); >+ for (int i = 0; i < sets.length; i++) { >+ ActiveChangeSet activeSet = (ActiveChangeSet) sets[i]; > activeSet.remove(resources); >- } >- } >- } >- >- private IResource[] getResources(IDiff[] diffArray) { >- List result = new ArrayList(); >- for (int i = 0; i < diffArray.length; i++) { >- IDiff diff = diffArray[i]; >- IResource resource = ResourceDiffTree.getResourceFor(diff); >- if (resource != null) { >- result.add(resource); > } > } >- return (IResource[]) result.toArray(new IResource[result.size()]); > } > > protected boolean isEnabledForSelection(IStructuredSelection selection) { >- return isContentProviderEnabled() && containsLocalChanges(selection); >+ return isContentProviderEnabled() >+ && containsOnlyLocalChanges(selection); > } > } > > private abstract class ChangeSetAction extends BaseSelectionListenerAction { > > public ChangeSetAction(String title, ISynchronizePageConfiguration configuration) { >- super(title); >- } >- >+ super(title); >+ } >+ > /* (non-Javadoc) > * @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection) >- */ >- protected boolean updateSelection(IStructuredSelection selection) { >- return getSelectedSet() != null; >- } >- >- protected ActiveChangeSet getSelectedSet() { >- IStructuredSelection selection = getStructuredSelection(); >- if (selection.size() == 1) { >- Object first = selection.getFirstElement(); >- if (first instanceof ActiveChangeSet) { >+ */ >+ protected boolean updateSelection(IStructuredSelection selection) { >+ return getSelectedSet() != null; >+ } >+ >+ protected ActiveChangeSet getSelectedSet() { >+ IStructuredSelection selection = getStructuredSelection(); >+ if (selection.size() == 1) { >+ Object first = selection.getFirstElement(); >+ if (first instanceof ActiveChangeSet) { > ActiveChangeSet activeChangeSet = (ActiveChangeSet) first; > if (activeChangeSet.isUserCreated()) > return activeChangeSet; > } >- } >- return null; >- } >+ } >+ return null; >+ } > } >- >+ > private class EditChangeSetAction extends ChangeSetAction { > >- public EditChangeSetAction(ISynchronizePageConfiguration configuration) { >- super(TeamUIMessages.ChangeLogModelProvider_6, configuration); >- } >- >- public void run() { >- ActiveChangeSet set = getSelectedSet(); >+ public EditChangeSetAction(ISynchronizePageConfiguration configuration) { >+ super(TeamUIMessages.ChangeLogModelProvider_6, configuration); >+ } >+ >+ public void run() { >+ ActiveChangeSet set = getSelectedSet(); > if (set == null) return; > getChangeSetCapability().editChangeSet(internalGetSynchronizePageConfiguration(), set); >- } >+ } > } >- >- private class RemoveChangeSetAction extends ChangeSetAction { > >- public RemoveChangeSetAction(ISynchronizePageConfiguration configuration) { >- super(TeamUIMessages.ChangeLogModelProvider_7, configuration); >- } >- >- public void run() { >- ActiveChangeSet set = getSelectedSet(); >- if (set == null) return; >- if (MessageDialog.openConfirm(internalGetSynchronizePageConfiguration().getSite().getShell(), TeamUIMessages.ChangeSetActionGroup_0, NLS.bind(TeamUIMessages.ChangeSetActionGroup_1, new String[] { set.getTitle() }))) { // >- getActiveChangeSetManager().remove(set); >- } >- } >+ private class RemoveChangeSetAction extends ModelParticipantAction { >+ >+ public RemoveChangeSetAction(ISynchronizePageConfiguration configuration) { >+ super(TeamUIMessages.ChangeLogModelProvider_7, configuration); >+ } >+ >+ public void run() { >+ IDiff[] diffArray = getLocalChanges(getStructuredSelection()); >+ ChangeSet[] sets = getActiveChangeSetManager().getSets(); >+ IResource[] resources = getResources(diffArray); >+ for (int i = 0; i < sets.length; i++) { >+ ActiveChangeSet activeSet = (ActiveChangeSet) sets[i]; >+ activeSet.remove(resources); >+ } >+ } >+ >+ protected boolean isEnabledForSelection(IStructuredSelection selection) { >+ return isContentProviderEnabled() >+ && containsOnlyLocalChanges(selection); >+ } > } >- >+ > private class MakeDefaultChangeSetAction extends ChangeSetAction { > public MakeDefaultChangeSetAction(ISynchronizePageConfiguration configuration) { >- super(TeamUIMessages.ChangeLogModelProvider_9, configuration); >- } >- >- public void run() { >- ActiveChangeSet set = getSelectedSet(); >+ super(TeamUIMessages.ChangeLogModelProvider_9, configuration); >+ } >+ >+ public void run() { >+ ActiveChangeSet set = getSelectedSet(); > if (set == null) return; >- getActiveChangeSetManager().makeDefault(set); >- } >+ getActiveChangeSetManager().makeDefault(set); >+ } > } >- >+ > /* ***************************************************************************** > * Action that allows changing the model providers sort order. > */ > private class ToggleSortOrderAction extends Action { > private int criteria; >+ > protected ToggleSortOrderAction(String name, int criteria) { > super(name, IAction.AS_RADIO_BUTTON); > this.criteria = criteria; >- update(); >+ update(); > } > > public void run() { >@@ -234,50 +229,50 @@ > ((SynchronizePageConfiguration)internalGetSynchronizePageConfiguration()).getPage().getViewer().refresh(); > } > } >- >+ > public void update() { >- setChecked(criteria == getSortCriteria(internalGetSynchronizePageConfiguration())); >+ setChecked(criteria == getSortCriteria(internalGetSynchronizePageConfiguration())); > } > } >- >+ > public static int getSortCriteria(ISynchronizePageConfiguration configuration) { >- int sortCriteria = ChangeSetSorter.DATE; >- if (configuration != null) { >- Object o = configuration.getProperty(P_LAST_COMMENTSORT); >- if (o instanceof Integer) { >+ int sortCriteria = ChangeSetSorter.DATE; >+ if (configuration != null) { >+ Object o = configuration.getProperty(P_LAST_COMMENTSORT); >+ if (o instanceof Integer) { > Integer wrapper = (Integer) o; > sortCriteria = wrapper.intValue(); > } else { > try { > IDialogSettings pageSettings = configuration.getSite().getPageSettings(); >- if(pageSettings != null) { >+ if (pageSettings != null) { > sortCriteria = pageSettings.getInt(P_LAST_COMMENTSORT); > } >- } catch(NumberFormatException e) { >+ } catch (NumberFormatException e) { > // ignore and use the defaults. > } > } > } > switch (sortCriteria) { >- case ChangeSetSorter.COMMENT: >- case ChangeSetSorter.DATE: >- case ChangeSetSorter.USER: >- break; >- default: >- sortCriteria = ChangeSetSorter.DATE; >- break; >- } >+ case ChangeSetSorter.COMMENT: >+ case ChangeSetSorter.DATE: >+ case ChangeSetSorter.USER: >+ break; >+ default: >+ sortCriteria = ChangeSetSorter.DATE; >+ break; >+ } > return sortCriteria; >- } >- >+ } >+ > public static void setSortCriteria(ISynchronizePageConfiguration configuration, int criteria) { > configuration.setProperty(P_LAST_COMMENTSORT, new Integer(criteria)); > IDialogSettings pageSettings = configuration.getSite().getPageSettings(); >- if(pageSettings != null) { >+ if (pageSettings != null) { > pageSettings.put(P_LAST_COMMENTSORT, criteria); > } > } >- >+ > public ChangeSetActionProvider() { > super(); > } >@@ -292,82 +287,120 @@ > openCommitSet = new OpenChangeSetAction(getSynchronizePageConfiguration()); > } > if (getChangeSetCapability().supportsActiveChangeSets()) { >- addToChangeSet = new MenuManager(TeamUIMessages.ChangeLogModelProvider_12); >- addToChangeSet.setRemoveAllWhenShown(true); >- addToChangeSet.addMenuListener(new IMenuListener() { >- public void menuAboutToShow(IMenuManager manager) { >- addChangeSets(manager); >- } >- }); >- createChangeSet = new CreateChangeSetAction(getSynchronizePageConfiguration()); >- addToChangeSet.add(createChangeSet); >- addToChangeSet.add(new Separator()); >- editChangeSet = new EditChangeSetAction(getSynchronizePageConfiguration()); >- makeDefault = new MakeDefaultChangeSetAction(getSynchronizePageConfiguration()); >- removeChangeSet = new RemoveChangeSetAction(getSynchronizePageConfiguration()); >+ createChangeSet = new CreateChangeSetAction( >+ getSynchronizePageConfiguration()); >+ editChangeSet = new EditChangeSetAction( >+ getSynchronizePageConfiguration()); >+ makeDefault = new MakeDefaultChangeSetAction( >+ getSynchronizePageConfiguration()); >+ removeChangeSet = new RemoveChangeSetAction( >+ getSynchronizePageConfiguration()); >+ } >+ } >+ >+ protected ActiveChangeSet getSelectedActiveChangeSet( >+ IStructuredSelection selection) { >+ if (selection.size() == 1) { >+ Object first = selection.getFirstElement(); >+ if (first instanceof ActiveChangeSet) { >+ ActiveChangeSet activeChangeSet = (ActiveChangeSet) first; >+ if (activeChangeSet.isUserCreated()) >+ return activeChangeSet; >+ } >+ } >+ return null; >+ } >+ >+ private boolean onlyUnassingedChanges(IStructuredSelection selection) { >+ IDiff[] diffArray = getLocalChanges(selection); >+ DiffChangeSet unass = getContentProvider().getUnassignedSet(); >+ IResource[] resources = getResources(diffArray); >+ for (int i = 0; i < resources.length; i++) { >+ if (!unass.contains(resources[i])) >+ return false; > } >+ return true; >+ } >+ >+ private IResource[] getResources(IDiff[] diffArray) { >+ List result = new ArrayList(); >+ for (int i = 0; i < diffArray.length; i++) { >+ IDiff diff = diffArray[i]; >+ IResource resource = ResourceDiffTree.getResourceFor(diff); >+ if (resource != null) { >+ result.add(resource); >+ } >+ } >+ return (IResource[]) result.toArray(new IResource[result.size()]); > } > > public void fillContextMenu(IMenuManager menu) { > if (isContentProviderEnabled()) { > super.fillContextMenu(menu); >- if (getChangeSetCapability().enableCheckedInChangeSetsFor(getSynchronizePageConfiguration())) { >- appendToGroup( >- menu, >- "file-bottom", //$NON-NLS-1$ >+ if (getChangeSetCapability().enableCheckedInChangeSetsFor( >+ getSynchronizePageConfiguration())) { >+ appendToGroup(menu, "file-bottom", //$NON-NLS-1$ > openCommitSet); >- appendToGroup(menu, ISynchronizePageConfiguration.SORT_GROUP, sortByComment); >+ appendToGroup(menu, ISynchronizePageConfiguration.SORT_GROUP, >+ sortByComment); > } >- if (getChangeSetCapability().enableActiveChangeSetsFor(getSynchronizePageConfiguration())) { >- appendToGroup( >- menu, >- CHANGE_SET_GROUP, >- addToChangeSet); >- appendToGroup( >- menu, >- CHANGE_SET_GROUP, >- editChangeSet); >- appendToGroup( >- menu, >- CHANGE_SET_GROUP, >- removeChangeSet); >- appendToGroup( >- menu, >- CHANGE_SET_GROUP, >- makeDefault); >+ IStructuredSelection selection = (IStructuredSelection) getContext() >+ .getSelection(); >+ if (getChangeSetCapability().enableActiveChangeSetsFor( >+ getSynchronizePageConfiguration()) >+ && containsOnlyLocalChanges(selection)) { >+ >+ // only local changes, but not unassigned >+ if (!onlyUnassingedChanges(selection)) { >+ addToChangeSet = new MenuManager( >+ TeamUIMessages.ChangeLogModelProvider_12); >+ appendToGroup(menu, CHANGE_SET_GROUP, addToChangeSet); >+ appendToGroup(menu, CHANGE_SET_GROUP, removeChangeSet); >+ >+ } else { >+ addToChangeSet = new MenuManager( >+ TeamUIMessages.ChangeLogModelProvider_13); >+ appendToGroup(menu, CHANGE_SET_GROUP, addToChangeSet); >+ } >+ >+ addChangeSets(addToChangeSet); >+ >+ if (getSelectedActiveChangeSet(selection) == null) >+ return; >+ appendToGroup(menu, CHANGE_SET_GROUP, editChangeSet); >+ appendToGroup(menu, CHANGE_SET_GROUP, makeDefault); > } > } > } > >+ protected void addChangeSets(IMenuManager manager) { >+ ChangeSet[] sets = getActiveChangeSetManager().getSets(); >+ Arrays.sort(sets, new ChangeSetComparator()); >+ ISelection selection = getContext().getSelection(); >+ createChangeSet.selectionChanged(selection); >+ manager.add(createChangeSet); >+ manager.add(new Separator()); >+ for (int i = 0; i < sets.length; i++) { >+ ActiveChangeSet set = (ActiveChangeSet) sets[i]; >+ AddToChangeSetAction action = new AddToChangeSetAction( >+ getSynchronizePageConfiguration(), set, selection); >+ manager.add(action); >+ } >+ manager.add(new Separator()); >+ } >+ > public void dispose() { >- if (addToChangeSet != null) { >+ if (addToChangeSet != null) { > addToChangeSet.dispose(); > addToChangeSet.removeAll(); >- } >- if (sortByComment != null) { >+ } >+ if (sortByComment != null) { > sortByComment.dispose(); > sortByComment.removeAll(); >- } >+ } > super.dispose(); > } >- >- protected void addChangeSets(IMenuManager manager) { >- ChangeSet[] sets = getActiveChangeSetManager().getSets(); >- Arrays.sort(sets, new ChangeSetComparator()); >- ISelection selection = getContext().getSelection(); >- createChangeSet.selectionChanged(selection); >- addToChangeSet.add(createChangeSet); >- addToChangeSet.add(new Separator()); >- for (int i = 0; i < sets.length; i++) { >- ActiveChangeSet set = (ActiveChangeSet)sets[i]; >- AddToChangeSetAction action = new AddToChangeSetAction(getSynchronizePageConfiguration(), set, selection); >- manager.add(action); >- } >- addToChangeSet.add(new Separator()); >- // Action that removes change set resources >- addToChangeSet.add(new AddToChangeSetAction(getSynchronizePageConfiguration(), null, selection)); >- } >- >+ > private boolean appendToGroup(IContributionManager manager, String groupId, IContributionItem item) { > if (manager == null || item == null) return false; > IContributionItem group = manager.find(groupId); >@@ -377,38 +410,37 @@ > } > return false; > } >- >+ > private boolean appendToGroup(IContributionManager manager, String groupId, IAction action) { > if (manager == null || action == null) return false; > IContributionItem group = manager.find(groupId); > if (group != null) { > manager.appendToGroup(group.getId(), action); >- //registerActionWithWorkbench(action); >+ // registerActionWithWorkbench(action); > return true; > } > return false; > } >- >- public ChangeSetCapability getChangeSetCapability() { >+ >+ public ChangeSetCapability getChangeSetCapability() { > ISynchronizeParticipant participant = getSynchronizePageConfiguration().getParticipant(); >- if (participant instanceof IChangeSetProvider) { >- IChangeSetProvider provider = (IChangeSetProvider) participant; >- return provider.getChangeSetCapability(); >- } >- return null; >- } >- >- /* package */ void syncExec(final Runnable runnable) { >+ if (participant instanceof IChangeSetProvider) { >+ IChangeSetProvider provider = (IChangeSetProvider) participant; >+ return provider.getChangeSetCapability(); >+ } >+ return null; >+ } >+ >+ /* package */void syncExec(final Runnable runnable) { > final Control ctrl = getSynchronizePageConfiguration().getPage().getViewer().getControl(); > Utils.syncExec(runnable, ctrl); >- } >+ } > >- /* package */ ActiveChangeSetManager getActiveChangeSetManager() { >+ /* package */ActiveChangeSetManager getActiveChangeSetManager() { > return CVSUIPlugin.getPlugin().getChangeSetManager(); > } > >- >- public IDiff[] getLocalChanges(IStructuredSelection selection) { >+ public IDiff[] getLocalChanges(IStructuredSelection selection) { > if (selection instanceof ITreeSelection) { > ITreeSelection ts = (ITreeSelection) selection; > TreePath[] paths = ts.getPaths(); >@@ -429,7 +461,7 @@ > private IDiff[] getLocalChanges(TreePath path) { > IResourceDiffTree tree = getDiffTree(path); > if (path.getSegmentCount() == 1 && path.getLastSegment() instanceof IDiffTree) { >- return ((ResourceDiffTree)tree).getDiffs(); >+ return ((ResourceDiffTree) tree).getDiffs(); > } > ResourceTraversal[] traversals = getTraversals(path.getLastSegment()); > return tree.getDiffs(traversals); >@@ -439,18 +471,18 @@ > return getContentProvider().getDiffTree(path); > } > >- public boolean containsLocalChanges(IStructuredSelection selection) { >+ public boolean containsOnlyLocalChanges(IStructuredSelection selection) { > if (selection instanceof ITreeSelection) { > ITreeSelection ts = (ITreeSelection) selection; > TreePath[] paths = ts.getPaths(); > for (int i = 0; i < paths.length; i++) { > TreePath path = paths[i]; >- if (containsLocalChanges(path)) { >- return true; >+ if (!containsLocalChanges(path)) { >+ return false; > } > } > } >- return false; >+ return true; > } > > private boolean containsLocalChanges(TreePath path) { >@@ -484,9 +516,9 @@ > } > return new ResourceTraversal[0]; > } >- >+ > private FastDiffFilter getVisibleLocalChangesFilter() { >- return new FastDiffFilter() { >+ return new FastDiffFilter() { > public boolean select(IDiff diff) { > if (diff instanceof IThreeWayDiff && isVisible(diff)) { > IThreeWayDiff twd = (IThreeWayDiff) diff; >@@ -499,14 +531,14 @@ > }; > } > >- /* package */ boolean isVisible(IDiff diff) { >+ /* package */boolean isVisible(IDiff diff) { > return ((SynchronizePageConfiguration)getSynchronizePageConfiguration()).isVisible(diff); > } >- >+ > protected ResourceModelTraversalCalculator getTraversalCalculator() { > return ResourceModelTraversalCalculator.getTraversalCalculator(getSynchronizePageConfiguration()); > } >- >+ > private ChangeSetContentProvider getContentProvider() { > INavigatorContentExtension extension = getExtension(); > if (extension != null) { >@@ -535,15 +567,15 @@ > private String getLayout() { > return TeamUIPlugin.getPlugin().getPreferenceStore().getString(IPreferenceIds.SYNCVIEW_DEFAULT_LAYOUT); > } >- >+ > public void setContext(ActionContext context) { > super.setContext(context); > if (context != null) { >- if (editChangeSet != null) >+ if (editChangeSet != null) > editChangeSet.selectionChanged((IStructuredSelection)getContext().getSelection()); >- if (removeChangeSet != null) >+ if (removeChangeSet != null) > removeChangeSet.selectionChanged((IStructuredSelection)getContext().getSelection()); >- if (makeDefault != null) >+ if (makeDefault != null) > makeDefault.selectionChanged((IStructuredSelection)getContext().getSelection()); > } > } >@@ -556,7 +588,7 @@ > return false; > } > >- /* package */ ISynchronizePageConfiguration internalGetSynchronizePageConfiguration() { >+ /* package */ISynchronizePageConfiguration internalGetSynchronizePageConfiguration() { > return getSynchronizePageConfiguration(); > } > } >#P org.eclipse.team.ui >Index: src/org/eclipse/team/internal/ui/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties,v >retrieving revision 1.250 >diff -u -r1.250 messages.properties >--- src/org/eclipse/team/internal/ui/messages.properties 25 Mar 2009 09:37:57 -0000 1.250 >+++ src/org/eclipse/team/internal/ui/messages.properties 25 Mar 2009 16:57:03 -0000 >@@ -380,16 +380,17 @@ > FlatModelProvider_9=&Parent Name > FlatModelProvider_0=Flat > >-ChangeLogModelProvider_0a=Sort &Comments By >+ChangeLogModelProvider_0a=Sort Incoming &Change Sets By > ChangeLogModelProvider_1a=&Comment > ChangeLogModelProvider_2a=&Date > ChangeLogModelProvider_3a=&User > ChangeLogModelProvider_0=&New Change Set... >-ChangeLogModelProvider_12=Add &To >+ChangeLogModelProvider_12=Reassign Changes &To >+ChangeLogModelProvider_13=Assign Changes &To > ChangeLogModelProvider_5=Commit &Sets > ChangeLogModelProvider_6=Ed&it Change Set... >-ChangeLogModelProvider_7=Remove Change Set >-ChangeLogModelProvider_9=Make De&fault >+ChangeLogModelProvider_7=Make Changes Unassigned >+ChangeLogModelProvider_9=Mark Change Set As De&fault > ChangeLogModelManager_0=Show Change Sets > ChangeSetActionGroup_0=Confirm Remove > ChangeSetActionGroup_1=Are you sure you want to remove {0} >Index: src/org/eclipse/team/internal/ui/TeamUIMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIMessages.java,v >retrieving revision 1.82 >diff -u -r1.82 TeamUIMessages.java >--- src/org/eclipse/team/internal/ui/TeamUIMessages.java 25 Mar 2009 09:37:57 -0000 1.82 >+++ src/org/eclipse/team/internal/ui/TeamUIMessages.java 25 Mar 2009 16:57:03 -0000 >@@ -547,6 +547,7 @@ > public static String ChangeLogModelProvider_3a; > public static String ChangeLogModelProvider_0; > public static String ChangeLogModelProvider_12; >+ public static String ChangeLogModelProvider_13; > public static String ChangeLogModelProvider_5; > public static String ChangeLogModelProvider_6; > public static String ChangeLogModelProvider_7;
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 247628
:
129713
|
129714
| 129861