diff options
9 files changed, 26 insertions, 113 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java index 33b53248f..91425e880 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java @@ -26,12 +26,10 @@ import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.*; -import org.eclipse.team.core.subscribers.SyncInfo; -import org.eclipse.team.core.subscribers.FastSyncInfoFilter; +import org.eclipse.team.core.subscribers.*; import org.eclipse.team.internal.ui.dialogs.DetailsDialog; import org.eclipse.team.ui.synchronize.*; import org.eclipse.ui.help.WorkbenchHelp; -import org.eclipse.team.internal.ccvs.ui.Policy; /** * Prompts the user for a multi-line comment for releasing to CVS. @@ -88,10 +86,18 @@ public class ReleaseCommentDialog extends DetailsDialog { CompareConfiguration cc = new CompareConfiguration(); cc.setLeftEditable(false); + // Create a sync set containing only the resources that will be committed. TeamSubscriberParticipant participant = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant(); - FastSyncInfoFilter.SyncInfoDirectionFilter filter = new FastSyncInfoFilter.SyncInfoDirectionFilter(SyncInfo.OUTGOING); - compareEditorInput = new SyncInfoSetCompareInput(cc, - new DiffTreeViewerConfiguration(null, participant.getTeamSubscriberSyncInfoCollector().getSyncInfoSet())); + SyncInfoSet currentSet = participant.getTeamSubscriberSyncInfoCollector().getSyncInfoSet(); + MutableSyncInfoSet set = new MutableSyncInfoSet(); + for (int i = 0; i < resourcesToCommit.length; i++) { + IResource resource = resourcesToCommit[i]; + SyncInfo info = currentSet.getSyncInfo(resource); + if(info != null) { + set.add(info); + } + } + compareEditorInput = new SyncInfoSetCompareInput(cc, new DiffTreeViewerConfiguration(set)); // set F1 help WorkbenchHelp.setHelp(composite, IHelpContextIds.RELEASE_COMMENT_DIALOG); diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java index 2140f368f..7075a365b 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java @@ -13,8 +13,7 @@ package org.eclipse.team.internal.ccvs.ui.subscriber; import java.util.*; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.*; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.jface.viewers.*; import org.eclipse.swt.widgets.Composite; @@ -39,8 +38,7 @@ public class CVSSynchronizeViewPage extends TeamSubscriberParticipantPage implem } public void run() { - IStructuredContentProvider cp = (IStructuredContentProvider) ((StructuredViewer)getChangesViewer()).getContentProvider(); - StructuredSelection selection = new StructuredSelection(cp.getElements(getSyncInfoSet())); + ISelection selection = new StructuredSelection(getSyncInfoSet().members()); if (!selection.isEmpty()) { delegate.selectionChanged(this, selection); delegate.run(this); @@ -54,7 +52,7 @@ public class CVSSynchronizeViewPage extends TeamSubscriberParticipantPage implem public CVSSynchronizeViewPage(TeamSubscriberParticipant participant, ISynchronizeView view) { super(participant, view); - groupByComment = new Action("Group By Comment", Action.AS_CHECK_BOX) { + groupByComment = new Action("Show incoming grouped by comment", Action.AS_CHECK_BOX) { public void run() { config.setGroupIncomingByComment(!config.isGroupIncomingByComment()); setChecked(config.isGroupIncomingByComment()); @@ -79,7 +77,8 @@ public class CVSSynchronizeViewPage extends TeamSubscriberParticipantPage implem public void setActionBars(IActionBars actionBars) { super.setActionBars(actionBars); IMenuManager mgr = actionBars.getMenuManager(); - mgr.appendToGroup("others", groupByComment); + mgr.add(new Separator()); + mgr.add(groupByComment); } /* @@ -90,8 +89,7 @@ public class CVSSynchronizeViewPage extends TeamSubscriberParticipantPage implem public void syncSetChanged(ISyncInfoSetChangeEvent event, IProgressMonitor monitor) { StructuredViewer viewer = (StructuredViewer)getChangesViewer(); if (viewer != null && getSyncInfoSet() != null) { - IStructuredContentProvider cp = (IStructuredContentProvider) viewer.getContentProvider(); - StructuredSelection selection = new StructuredSelection(cp.getElements(getSyncInfoSet())); + ISelection selection = new StructuredSelection(getSyncInfoSet().members()); for (Iterator it = delegates.iterator(); it.hasNext(); ) { CVSActionDelegate delegate = (CVSActionDelegate) it.next(); delegate.getDelegate().selectionChanged(delegate, selection); diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeBuilder.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeBuilder.java index e2c3048e2..71ddf0754 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeBuilder.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeBuilder.java @@ -17,8 +17,6 @@ import org.eclipse.compare.structuremergeviewer.DiffNode; import org.eclipse.compare.structuremergeviewer.IDiffElement; import org.eclipse.team.core.TeamException; import org.eclipse.team.core.subscribers.*; -import org.eclipse.team.core.subscribers.SyncInfo; -import org.eclipse.team.core.subscribers.SyncInfoSet; import org.eclipse.team.internal.ccvs.core.CVSSyncInfo; import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource; import org.eclipse.team.ui.synchronize.SyncInfoDiffNodeRoot; @@ -48,6 +46,7 @@ public class ChangeLogDiffNodeBuilder extends SyncInfoDiffNodeBuilder { } private DiffNode[] calculateRoots(SyncInfoSet set) { + commentRoots.clear(); SyncInfo[] infos = set.members(); for (int i = 0; i < infos.length; i++) { String comment = getSyncInfoComment((CVSSyncInfo) infos[i]); @@ -69,12 +68,11 @@ public class ChangeLogDiffNodeBuilder extends SyncInfoDiffNodeBuilder { return e.getMessage(); } } - + /* (non-Javadoc) * @see org.eclipse.team.ui.synchronize.views.SyncInfoDiffNodeBuilder#syncSetChanged(org.eclipse.team.core.subscribers.ISyncInfoSetChangeEvent) */ protected void syncSetChanged(ISyncInfoSetChangeEvent event) { - commentRoots.clear(); - reset(); + reset(); } } diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/compare/SyncInfoDiffNode.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/compare/SyncInfoDiffNode.java deleted file mode 100644 index 9095b457a..000000000 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/compare/SyncInfoDiffNode.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.team.internal.ui.synchronize.compare; - -import org.eclipse.compare.ITypedElement; -import org.eclipse.compare.structuremergeviewer.DiffNode; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.team.core.TeamException; -import org.eclipse.team.core.subscribers.ISubscriberResource; -import org.eclipse.team.core.subscribers.SyncInfo; -import org.eclipse.team.internal.ui.Policy; - -public class SyncInfoDiffNode extends DiffNode { - - /** - * Create an ITypedElement for the given local resource. The returned ITypedElement - * will prevent edited of outgoing deletions. - */ - public static ITypedElement createTypeElement(IResource resource, final int kind) { - if(resource != null && resource.exists()) { - return new LocalResourceTypedElement(resource) { - public boolean isEditable() { - if(SyncInfo.getDirection(kind) == SyncInfo.OUTGOING && SyncInfo.getChange(kind) == SyncInfo.DELETION) { - return false; - } - return super.isEditable(); - } - }; - } - return null; - } - - /** - * Create an ITypedElement for the given remote resource. The contents for the remote resource - * will be retrieved from the given IStorage which is a local cache used to buffer the remote contents - */ - public static ITypedElement createTypeElement(ISubscriberResource remoteResource) { - return new RemoteResourceTypedElement(remoteResource); - } - - /** - * Creates a new diff node. - */ - public SyncInfoDiffNode(ITypedElement base, ITypedElement local, ITypedElement remote, int syncKind) { - super(syncKind, base, local, remote); - } - - /** - * Cache the contents for the base and remote. - * @param monitor - */ - public void cacheContents(IProgressMonitor monitor) throws TeamException { - ITypedElement base = getAncestor(); - ITypedElement remote = getRight(); - int work = Math.min((remote== null ? 0 : 50) + (base == null ? 0 : 50), 10); - monitor.beginTask(null, work); - try { - if (base != null && base instanceof RemoteResourceTypedElement) { - ((RemoteResourceTypedElement)base).cacheContents(Policy.subMonitorFor(monitor, 50)); - } - if (remote != null && remote instanceof RemoteResourceTypedElement) { - ((RemoteResourceTypedElement)remote).cacheContents(Policy.subMonitorFor(monitor, 50)); - } - } finally { - monitor.done(); - } - } -} diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java index bed6d297f..9aa1814ff 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java @@ -19,19 +19,6 @@ import org.eclipse.team.core.subscribers.SyncInfo; import org.eclipse.team.ui.synchronize.SyncInfoDiffNode; public class TreeViewerUtils { - - /** - * Selects the next (or previous) node of the current selection. - * If there is no current selection the first (last) node in the tree is selected. - * Wraps around at end or beginning. - * Clients may override. - * - * @param next if <code>true</code> the next node is selected, otherwise the previous node - */ - public static boolean gotoDifference(TreeViewer viewer, boolean next, boolean fireOpen) { - return navigate(viewer, next, fireOpen); - } - /** * Selects the next (or previous) node of the current selection. * If there is no current selection the first (last) node in the tree is selected. diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffCheckboxTreeViewer.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffCheckboxTreeViewer.java index 74a81f4ad..5d5ceec14 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffCheckboxTreeViewer.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffCheckboxTreeViewer.java @@ -50,7 +50,7 @@ public class SyncInfoDiffCheckboxTreeViewer extends ContainerCheckedTreeViewer i * @see org.eclipse.team.ui.synchronize.actions.INavigableControl#gotoDifference(int) */ public boolean gotoDifference(boolean next) { - return TreeViewerUtils.gotoDifference(this, next, true); + return TreeViewerUtils.navigate(this, next, true); } /* (non-Javadoc) diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffTreeViewer.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffTreeViewer.java index 3c1c36ce7..5469dbb42 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffTreeViewer.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffTreeViewer.java @@ -40,7 +40,7 @@ public class SyncInfoDiffTreeViewer extends TreeViewer implements INavigatable, protected void inputChanged(Object in, Object oldInput) { super.inputChanged(in, oldInput); if (in != oldInput) { - gotoDifference(true); + TreeViewerUtils.navigate(this, true /*next*/, false /*don't fire open event*/); } } @@ -48,7 +48,7 @@ public class SyncInfoDiffTreeViewer extends TreeViewer implements INavigatable, * @see org.eclipse.team.ui.synchronize.actions.INavigableControl#gotoDifference(int) */ public boolean gotoDifference(boolean direction) { - return TreeViewerUtils.gotoDifference(this, direction, true); + return TreeViewerUtils.navigate(this, direction, false); } /* (non-Javadoc) diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/SubscriberAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/SubscriberAction.java index 2b45bbd00..9db872526 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/SubscriberAction.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/SubscriberAction.java @@ -50,6 +50,8 @@ public abstract class SubscriberAction extends TeamAction implements IViewAction SyncInfoDiffNode syncResource = (SyncInfoDiffNode) object; SyncInfo[] infos = syncResource.getDescendantSyncInfos(); result.addAll(Arrays.asList(infos)); + } else if(object instanceof SyncInfo) { + result.add(object); } } return (SyncInfo[]) result.toArray(new SyncInfo[result.size()]); diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoSetContentProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoSetContentProvider.java index 24b9792ca..39deed15f 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoSetContentProvider.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoSetContentProvider.java @@ -52,5 +52,4 @@ public class SyncInfoSetContentProvider extends BaseWorkbenchContentProvider { ((SyncInfoDiffNodeRoot)input).dispose(); } } - }
\ No newline at end of file |