diff options
author | Jean Michel-Lemieux | 2004-02-21 01:46:02 +0000 |
---|---|---|
committer | Jean Michel-Lemieux | 2004-02-21 01:46:02 +0000 |
commit | a5f8f6dbcb156471e5b7f7c94a438bc854d17bb7 (patch) | |
tree | 35c0354d2d09b22c1b9dcaa240a4ba9495f152c3 | |
parent | 4e1e66ac0f661349eb645a4a5c1938cff18c8011 (diff) | |
download | eclipse.platform.team-a5f8f6dbcb156471e5b7f7c94a438bc854d17bb7.tar.gz eclipse.platform.team-a5f8f6dbcb156471e5b7f7c94a438bc854d17bb7.tar.xz eclipse.platform.team-a5f8f6dbcb156471e5b7f7c94a438bc854d17bb7.zip |
compare participant created
29 files changed, 500 insertions, 214 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java index 24b236b94..e26e172a7 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java @@ -16,6 +16,7 @@ import java.util.List; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.*; import org.eclipse.team.core.TeamException; +import org.eclipse.team.core.synchronize.IResourceVariantComparator; import org.eclipse.team.core.synchronize.SyncInfo; /** @@ -134,6 +135,12 @@ abstract public class Subscriber { abstract public SyncInfo getSyncInfo(IResource resource) throws TeamException; /** + * Returns the comparison criteria that will be used by the sync info + * created by this subscriber. + */ + abstract public IResourceVariantComparator getResourceComparator(); + + /** * Refreshes the resource hierarchy from the given resources and their * children (to the specified depth) from the corresponding resources in * the remote location. Resources are ignored in the following cases: diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/caches/SyncTreeSubscriber.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/caches/SyncTreeSubscriber.java index 0546ec94a..6b68087d9 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/caches/SyncTreeSubscriber.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/caches/SyncTreeSubscriber.java @@ -16,7 +16,7 @@ import java.util.List; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.CoreException; import org.eclipse.team.core.TeamException; -import org.eclipse.team.core.subscribers.*; +import org.eclipse.team.core.subscribers.Subscriber; import org.eclipse.team.core.synchronize.*; /** diff --git a/bundles/org.eclipse.team.cvs.ui/icons/full/cview16/compare_view.gif b/bundles/org.eclipse.team.cvs.ui/icons/full/cview16/compare_view.gif Binary files differnew file mode 100644 index 000000000..41800a0c9 --- /dev/null +++ b/bundles/org.eclipse.team.cvs.ui/icons/full/cview16/compare_view.gif diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.properties b/bundles/org.eclipse.team.cvs.ui/plugin.properties index 0b090f018..3f2b971cb 100644 --- a/bundles/org.eclipse.team.cvs.ui/plugin.properties +++ b/bundles/org.eclipse.team.cvs.ui/plugin.properties @@ -21,6 +21,7 @@ SharingWizard.name=CVS CVSWorkspaceParticipant=CVS Workspace CVSMergeParticipant=CVS Merge +CVSCompareParticipant=CVS Compare PreferencePage.name=CVS ConsolePreferencePage.name=Console diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml index 6f8cbfc89..b1bd8d7e1 100644 --- a/bundles/org.eclipse.team.cvs.ui/plugin.xml +++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml @@ -47,6 +47,13 @@ type="dynamic" id="org.eclipse.team.cvs.ui.cvsmerge-participant"> </participant> + <participant + name="%CVSCompareParticipant" + icon="icons/full/cview16/compare_view.gif" + class="org.eclipse.team.internal.ccvs.ui.subscriber.CompareSynchronizeParticipant" + type="dynamic" + id="org.eclipse.team.cvs.ui.compare-participant"> + </participant> </extension> <!-- *************** Authenticator **************** --> @@ -262,14 +269,6 @@ menubarPath="compareWithMenu/compareWithGroup" helpContextId="org.eclipse.team.cvs.ui.compare_with_tag_action_context" id="org.eclipse.team.ccvs.ui.compareWithTag"> - </action> - <action - label="%CompareWithRemoteAction.label" - tooltip="%CompareWithRemoteAction.tooltip" - class="org.eclipse.team.internal.ccvs.ui.actions.SyncAction" - menubarPath="compareWithMenu/compareWithGroup" - helpContextId="org.eclipse.team.cvs.ui.compare_with_latest_action_context" - id="org.eclipse.team.ccvs.ui.compareWithRemote"> </action> <action label="%ReplaceWithTagAction.label" 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 d8a933ad5..db33ba4d6 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 @@ -68,8 +68,6 @@ public class ReleaseCommentDialog extends DetailsDialog { if (resourcesToCommit.length > 0) commitCommentArea.setProject(resourcesToCommit[0].getProject()); - set = createResourcesToCommitSyncInfoSet(resourcesToCommit); - IDialogSettings workbenchSettings = CVSUIPlugin.getPlugin().getDialogSettings(); this.settings = workbenchSettings.getSection("ReleaseCommentDialog");//$NON-NLS-1$ if (settings == null) { @@ -77,6 +75,13 @@ public class ReleaseCommentDialog extends DetailsDialog { } } + /* (non-Javadoc) + * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#includeDetailsButton() + */ + protected boolean includeDetailsButton() { + return false; + } + /* * @see Dialog#createDialogArea(Composite) */ diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java index f55e3aee9..74078750f 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java @@ -12,52 +12,42 @@ package org.eclipse.team.internal.ccvs.ui.actions; import java.lang.reflect.InvocationTargetException; -import org.eclipse.compare.CompareConfiguration; -import org.eclipse.compare.CompareUI; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.ToolBarManager; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.team.core.TeamException; +import org.eclipse.team.internal.ccvs.core.CVSCompareSubscriber; import org.eclipse.team.internal.ccvs.core.CVSTag; -import org.eclipse.team.internal.ccvs.ui.TagSelectionDialog; -import org.eclipse.team.internal.ccvs.ui.subscriber.CVSLocalCompareConfiguration; -import org.eclipse.team.ui.synchronize.viewers.SyncInfoSetCompareInput; +import org.eclipse.team.internal.ccvs.ui.*; +import org.eclipse.team.internal.ccvs.ui.subscriber.CompareParticipant; +import org.eclipse.team.ui.TeamUI; +import org.eclipse.team.ui.synchronize.*; +import org.eclipse.ui.*; public class CompareWithTagAction extends WorkspaceAction { public void execute(IAction action) throws InvocationTargetException, InterruptedException { IResource[] resources = getSelectedResources(); CVSTag tag = promptForTag(resources); - if (tag == null) return; - final SyncInfoSetCompareInput input = createCompareInput(resources, tag); - - // Show the compare viewer - run(new IRunnableWithProgress() { - public void run(IProgressMonitor monitor) throws InvocationTargetException { - CompareUI.openCompareEditorOnPage(input, getTargetPage()); - } - }, false /* cancelable */, PROGRESS_BUSYCURSOR); - } - - private SyncInfoSetCompareInput createCompareInput(IResource[] resources, CVSTag tag) { - final CVSLocalCompareConfiguration viewerConfig = CVSLocalCompareConfiguration.create(resources, tag); - final SyncInfoSetCompareInput input = new SyncInfoSetCompareInput(new CompareConfiguration(), viewerConfig) { - protected Object prepareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - try { - return viewerConfig.prepareInput(monitor); - } catch (TeamException e) { - throw new InvocationTargetException(e); - } - } - public void contributeToToolBar(ToolBarManager tbm) { - viewerConfig.contributeToToolBar(tbm); - super.contributeToToolBar(tbm); - } - }; - return input; + if (tag == null) + return; + IWorkbenchWindow wWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + IWorkbenchPage activePage = null; + if (wWindow != null) { + activePage = wWindow.getActivePage(); + } + // Create the synchronize view participant + CVSCompareSubscriber s = new CVSCompareSubscriber(resources, tag); + CompareParticipant participant = new CompareParticipant(s); + // Show the participant in the view + ISynchronizeManager manager = TeamUI.getSynchronizeManager(); + manager.addSynchronizeParticipants(new ISynchronizeParticipant[]{participant}); + ISynchronizeView view = manager.showSynchronizeViewInActivePage(null); + if (view != null) { + view.display(participant); + participant.refreshWithRemote(s.roots()); + } else { + CVSUIPlugin.openError(getShell(), Policy.bind("error"), Policy.bind("Error.unableToShowSyncView"), null); //$NON-NLS-1$ //$NON-NLS-2$ + } } private CVSTag promptForTag(IResource[] resources) { @@ -75,6 +65,4 @@ public class CompareWithTagAction extends WorkspaceAction { protected boolean isEnabledForNonExistantResources() { return true; } - - } diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java index 7143f2b96..7a46c3bee 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java @@ -71,7 +71,7 @@ public class CVSLocalCompareConfiguration extends DiffTreeViewerConfiguration { public Object prepareInput(IProgressMonitor monitor) throws TeamException { subscriber.refresh(subscriber.roots(), IResource.DEPTH_INFINITE, monitor); collector.waitForCollector(monitor); - return prepareInput(monitor); + return super.prepareInput(monitor); } /* (non-Javadoc) diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java new file mode 100644 index 000000000..bb9659150 --- /dev/null +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java @@ -0,0 +1,84 @@ +/******************************************************************************* + * 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.ccvs.ui.subscriber; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.team.core.subscribers.Subscriber; +import org.eclipse.team.core.synchronize.SyncInfo; +import org.eclipse.team.core.synchronize.SyncInfoFilter; +import org.eclipse.team.internal.ccvs.core.CVSCompareSubscriber; +import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; +import org.eclipse.team.ui.TeamUI; +import org.eclipse.team.ui.synchronize.ISynchronizeParticipantDescriptor; +import org.eclipse.team.ui.synchronize.ISynchronizeView; +import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant; +import org.eclipse.ui.part.IPageBookViewPage; + +public class CompareParticipant extends SubscriberParticipant { + + public final static String ID = "org.eclipse.team.cvs.ui.compare-participant"; //$NON-NLS-1$ + + private SyncInfoFilter contentComparison = new SyncInfoFilter() { + private SyncInfoFilter contentCompare = new SyncInfoFilter.ContentComparisonSyncInfoFilter(); + public boolean select(SyncInfo info, IProgressMonitor monitor) { + // Want to select infos whose contents do not match + return !contentCompare.select(info, monitor); + } + }; + + public CompareParticipant(CVSCompareSubscriber subscriber) { + super(); + setMode(BOTH_MODE); + setSubscriber(subscriber); + } + + /* (non-Javadoc) + * @see org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant#setSubscriber(org.eclipse.team.core.subscribers.Subscriber) + */ + protected void setSubscriber(Subscriber subscriber) { + super.setSubscriber(subscriber); + try { + ISynchronizeParticipantDescriptor descriptor = TeamUI.getSynchronizeManager().getParticipantDescriptor(ID); + setInitializationData(descriptor); + } catch (CoreException e) { + CVSUIPlugin.log(e); + } + } + + /* (non-Javadoc) + * @see org.eclipse.team.ui.synchronize.AbstractSynchronizeParticipant#getName() + */ + public String getName() { + return getSubscriber().getName(); + } + + /* (non-Javadoc) + * @see org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant#doCreatePage(org.eclipse.team.ui.synchronize.ISynchronizeView) + */ + protected IPageBookViewPage doCreatePage(ISynchronizeView view) { + return new CompareParticipantPage(this, view); + } + + /* (non-Javadoc) + * @see org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant#updateMode(int) + */ + protected void updateMode(int mode) { + // Don't allow modes to be used with this participant + } + + /* (non-Javadoc) + * @see org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant#preCollectingChanges() + */ + protected void preCollectingChanges() { + getSubscriberSyncInfoCollector().setFilter(contentComparison); + } +} diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipantPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipantPage.java new file mode 100644 index 000000000..30ef265d1 --- /dev/null +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipantPage.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * 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.ccvs.ui.subscriber; + +import org.eclipse.jface.action.*; +import org.eclipse.team.internal.ui.synchronize.actions.RemoveSynchronizeParticipantAction; +import org.eclipse.team.ui.synchronize.ISynchronizeView; +import org.eclipse.team.ui.synchronize.subscriber.DirectionFilterActionGroup; +import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant; +import org.eclipse.ui.IActionBars; + +public class CompareParticipantPage extends CVSSynchronizeViewPage { + + private RemoveSynchronizeParticipantAction removeAction; + private DirectionFilterActionGroup modes; + private Action updateAdapter; + + public CompareParticipantPage(SubscriberParticipant participant, ISynchronizeView view) { + super(participant, view); + removeAction = new RemoveSynchronizeParticipantAction(getParticipant()); + } + + /* (non-Javadoc) + * @see org.eclipse.ui.part.IPage#setActionBars(org.eclipse.ui.IActionBars) + */ + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + if (actionBars != null) { + IToolBarManager toolbar = actionBars.getToolBarManager(); + toolbar.add(new Separator()); + toolbar.add(removeAction); + } + } +} diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DetailsDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DetailsDialog.java index 98d778032..53069ba25 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DetailsDialog.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DetailsDialog.java @@ -114,11 +114,19 @@ abstract public class DetailsDialog extends Dialog { createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); } if(includeDetailsButton()) { - detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL, false); + detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, getDetailsButtonLabelShow(), false); } updateEnablements(); } + protected String getDetailsButtonLabelShow() { + return IDialogConstants.SHOW_DETAILS_LABEL; + } + + protected String getDetailsButtonLabelHide() { + return IDialogConstants.HIDE_DETAILS_LABEL; + } + /* (non-Javadoc) * Method declared on Dialog. * Creates and returns the contents of the upper part @@ -202,11 +210,11 @@ abstract public class DetailsDialog extends Dialog { if (detailsCreated) { detailsComposite.dispose(); detailsCreated = false; - detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL); + detailsButton.setText(getDetailsButtonLabelShow()); } else { detailsComposite = createDropDownDialogArea((Composite)getContents()); detailsCreated = true; - detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL); + detailsButton.setText(getDetailsButtonLabelHide()); } Dialog.applyDialogFont(getContents()); Point newSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT); diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshChangeListener.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshChangeListener.java index c3ed34c77..e65392c1f 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshChangeListener.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshChangeListener.java @@ -24,7 +24,7 @@ class RefreshChangeListener implements ISubscriberChangeListener { public SyncInfo[] getChanges() { collector.waitForCollector(new NullProgressMonitor()); List changedSyncInfos = new ArrayList(); - SyncInfoSet set = collector.getSyncInfoTree(); + SyncInfoSet set = collector.getSubscriberSyncInfoSet(); for (Iterator it = changes.iterator(); it.hasNext();) { ISubscriberChangeEvent delta = (ISubscriberChangeEvent) it.next(); SyncInfo info = set.getSyncInfo(delta.getResource()); diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties index 1f0277fae..9ff6341f3 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties @@ -287,6 +287,7 @@ StatisticsPanel.noWorkingSet=<No Working Set> StatisticsPanel.workingSetTooltip=Double-click to change the working set applied to the Synchronize View. StatisticsPanel.numbersTooltip=The number of ''{0}'' changes in the entire workspace. StatisticsPanel.numbersWorkingSetTooltip=The number of ''{0}'' changes in working set ''{1}'' versus those in the entire workspace. +StatisticsPanel.numberTotal={0} changes SyncViewerPreferencePage.6=General Synchronize Settings SyncViewerPreferencePage.7=General Team Settings: @@ -340,17 +341,20 @@ Utils.23=Outgoing Utils.24=Incoming/Outgoing Utils.25=Conflicting Utils.26=unknown mode -RefreshCompleteDialog.4=Synchronization Complete - {0} -RefreshCompleteDialog.5={0} changes found -RefreshCompleteDialog.6=No changes found -RefreshCompleteDialog.7=Refreshing {0} resource(s). +RefreshCompleteDialog.4=Team Resfresh Complete - {0} +RefreshCompleteDialog.5={0} new changes found +RefreshCompleteDialog.6=No new changes found +RefreshCompleteDialog.7=refreshing the following {0} resource(s): RefreshCompleteDialog.13=SyncViewerPreferencePage.16 RefreshCompleteDialog.14=SyncViewerPreferencePage.17 RefreshCompleteDialog.15=SyncViewerPreferencePage.31 RefreshCompleteDialog.16=SyncViewerPreferencePage.32 +RefreshCompleteDialog.17=Preview Changes >> +RefreshCompleteDialog.18=<< Preview Changes RefreshUserNotificationPolicy.0=Refresh of ''{0}'' Complete. ConfigureRefreshScheduleDialog.0=Configure Refresh Schedule - {0} -ConfigureRefreshScheduleDialog.1=You can allow ''{0}'' to periodically refresh it's synchronization state in the background.\n\nThe last refresh occured at: {1} +ConfigureRefreshScheduleDialog.1=You can allow ''{0}'' to periodically refresh it's synchronization state in the background. +ConfigureRefreshScheduleDialog.1a=The last refresh occured at: {0} ConfigureRefreshScheduleDialog.2=Don't schedule the refresh operation to run periodically. ConfigureRefreshScheduleDialog.3=Using the following schedule: ConfigureRefreshScheduleDialog.4=Every: @@ -366,4 +370,4 @@ RefreshSchedule.10=minutes RefreshSchedule.11=hour RefreshSchedule.12=minute RefreshSchedule.13=Every {0} {1} -RefreshSchedule.14=Refreshing ''{0}''. {1} +RefreshSchedule.14=Scheduled refresh of ''{0}'' diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java index 775158154..e28056994 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java @@ -142,6 +142,10 @@ public class ChangesSection extends Composite { } } + private boolean isThreeWay() { + return page.getParticipant().getSubscriber().getResourceComparator().isThreeWay(); + } + private Composite getEmptyChangesComposite(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE)); @@ -152,6 +156,11 @@ public class ChangesSection extends Composite { data.grabExcessVerticalSpace = true; composite.setLayoutData(data); + if(! isThreeWay()) { + createDescriptionLabel(composite,Policy.bind("ChangesSection.noChanges", participant.getName())); //$NON-NLS-1$ + return composite; + } + SyncInfoSet workspace = participant.getSubscriberSyncInfoCollector().getSubscriberSyncInfoSet(); SyncInfoSet workingSet = participant.getSubscriberSyncInfoCollector().getWorkingSetSyncInfoSet(); SyncInfoSet filteredSet = participant.getSubscriberSyncInfoCollector().getSyncInfoTree(); diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java index 6a1c4ca38..c4c62f649 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java @@ -63,9 +63,17 @@ public class ConfigureRefreshScheduleDialog extends DetailsDialog { final Label label = new Label(area, SWT.WRAP); final GridData gridData = new GridData(GridData.FILL_BOTH); gridData.horizontalSpan = 2; - gridData.widthHint = 250; + gridData.widthHint = 325; label.setLayoutData(gridData); - label.setText(Policy.bind("ConfigureRefreshScheduleDialog.1", schedule.getParticipant().getName(), SubscriberRefreshSchedule.refreshEventAsString(schedule.getLastRefreshEvent()))); //$NON-NLS-1$ + label.setText(Policy.bind("ConfigureRefreshScheduleDialog.1", schedule.getParticipant().getName())); //$NON-NLS-1$ + } + { + final Label label = new Label(area, SWT.WRAP); + final GridData gridData = new GridData(GridData.FILL_BOTH); + gridData.horizontalSpan = 2; + gridData.widthHint = 325; + label.setLayoutData(gridData); + label.setText(Policy.bind("ConfigureRefreshScheduleDialog.1a", SubscriberRefreshSchedule.refreshEventAsString(schedule.getLastRefreshEvent()))); //$NON-NLS-1$ } { userRefreshOnly = new Button(area, SWT.RADIO); diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java index 76f021993..9b8ad4dad 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java @@ -11,7 +11,6 @@ package org.eclipse.team.internal.ui.synchronize; import java.lang.reflect.InvocationTargetException; - import org.eclipse.compare.CompareConfiguration; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IProgressMonitor; @@ -35,22 +34,18 @@ import org.eclipse.team.ui.synchronize.viewers.SyncInfoSetCompareInput; import org.eclipse.ui.model.WorkbenchLabelProvider; public class RefreshCompleteDialog extends DetailsDialog { + private static final String HEIGHT_KEY = "width-key"; //$NON-NLS-1$ + private final static int RESOURCE_LIST_SIZE = 10; + private static final String WIDTH_KEY = "height-key"; //$NON-NLS-1$ + private FilteredSyncInfoCollector collector; + private SyncInfoSetCompareInput compareEditorInput; + private IRefreshEvent event; + private SubscriberParticipant participant; private Button promptWhenNoChanges; private Button promptWithChanges; - private SyncInfoSetCompareInput compareEditorInput; - private FilteredSyncInfoCollector collector; - private IRefreshEvent event; - private final static int RESOURCE_LIST_SIZE = 10; private IDialogSettings settings; - private static final String HEIGHT_KEY = "width-key"; //$NON-NLS-1$ - private static final String WIDTH_KEY = "height-key"; //$NON-NLS-1$ - private SubscriberParticipant participant; - private SyncInfoTree syncInfoSet = new SyncInfoTree(); - - /** - * Create the dialog. The <code>initialize</code> methdo must be called to populate the dialog. - */ + public RefreshCompleteDialog(Shell parentShell, IRefreshEvent event, SubscriberParticipant participant) { super(parentShell, Policy.bind("RefreshCompleteDialog.4", participant.getName())); //$NON-NLS-1$ this.participant = participant; @@ -58,10 +53,10 @@ public class RefreshCompleteDialog extends DetailsDialog { setShellStyle(shellStyle | SWT.RESIZE | SWT.MAX); this.event = event; setImageKey(DLG_IMG_INFO); - // Set-up a sync info set that contains the resources that where found // when the refresh occured. SyncInfoFilter filter = new SyncInfoFilter() { + public boolean select(SyncInfo info, IProgressMonitor monitor) { IResource[] resources = getResources(); for (int i = 0; i < resources.length; i++) { @@ -76,8 +71,7 @@ public class RefreshCompleteDialog extends DetailsDialog { this.collector = new FilteredSyncInfoCollector( participant.getSubscriberSyncInfoCollector().getSubscriberSyncInfoSet(), syncInfoSet, - filter); - + filter); IDialogSettings workbenchSettings = TeamUIPlugin.getPlugin().getDialogSettings(); this.settings = workbenchSettings.getSection("RefreshCompleteDialog");//$NON-NLS-1$ if (settings == null) { @@ -93,23 +87,6 @@ public class RefreshCompleteDialog extends DetailsDialog { } /* (non-Javadoc) - * @see org.eclipse.jface.window.Window#getInitialSize() - */ - protected Point getInitialSize() { - int width, height; - try { - height = settings.getInt(HEIGHT_KEY); - width = settings.getInt(WIDTH_KEY); - } catch(NumberFormatException e) { - return super.getInitialSize(); - } - Point p = super.getInitialSize(); - return new Point(width, p.y); - } - - - - /* (non-Javadoc) * @see org.eclipse.jface.window.Window#close() */ public boolean close() { @@ -119,7 +96,63 @@ public class RefreshCompleteDialog extends DetailsDialog { settings.put(WIDTH_KEY, bounds.width); return super.close(); } - + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) + */ + protected void createButtonsForButtonBar(Composite parent) { + super.createButtonsForButtonBar(parent); + } + + protected Combo createCombo(Composite parent, int widthChars) { + Combo combo = new Combo(parent, SWT.READ_ONLY); + GridData data = new GridData(GridData.FILL_HORIZONTAL); + GC gc = new GC(combo); + gc.setFont(combo.getFont()); + FontMetrics fontMetrics = gc.getFontMetrics(); + data.widthHint = Dialog.convertWidthInCharsToPixels(fontMetrics, widthChars); + gc.dispose(); + combo.setLayoutData(data); + return combo; + } + + /* (non-Javadoc) + * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#createDropDownDialogArea(org.eclipse.swt.widgets.Composite) + */ + protected Composite createDropDownDialogArea(Composite parent) { + try { + CompareConfiguration compareConfig = new CompareConfiguration(); + DiffTreeViewerConfiguration viewerAdvisor = new DiffTreeViewerConfiguration(participant.getId(), syncInfoSet); + compareEditorInput = new SyncInfoSetCompareInput(compareConfig, viewerAdvisor) { + + public String getTitle() { + return "Resources found during last refresh"; + } + }; + // Preparing the input should be fast since we haven't started the collector + compareEditorInput.run(new NullProgressMonitor()); + // Starting the collector will populate the dialog in the background + initialize(); + } catch (InterruptedException e) { + Utils.handle(e); + } catch (InvocationTargetException e) { + Utils.handle(e); + } + Composite result = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + result.setLayout(layout); + GridData data = new GridData(GridData.FILL_BOTH); + data.grabExcessHorizontalSpace = true; + data.grabExcessVerticalSpace = true; + data.heightHint = 350; + //data.widthHint = 700; + result.setLayoutData(data); + Control c = compareEditorInput.createContents(result); + data = new GridData(GridData.FILL_BOTH); + c.setLayoutData(data); + return result; + } + /* (non-Javadoc) * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#createMainDialogArea(org.eclipse.swt.widgets.Composite) */ @@ -127,174 +160,137 @@ public class RefreshCompleteDialog extends DetailsDialog { StringBuffer text = new StringBuffer(); SyncInfo[] changes = event.getChanges(); IResource[] resources = event.getResources(); - - if(changes.length != 0) { + if (changes.length != 0) { text.append(Policy.bind("RefreshCompleteDialog.5", Integer.toString(changes.length))); //$NON-NLS-1$ } else { text.append(Policy.bind("RefreshCompleteDialog.6")); //$NON-NLS-1$ } - text.append(Policy.bind("RefreshCompleteDialog.7", Integer.toString(resources.length))); //$NON-NLS-1$ //$NON-NLS-2$ + text.append(Policy.bind("RefreshCompleteDialog.7", Integer.toString(resources.length))); //$NON-NLS-1$ //$NON-NLS-2$ createLabel(parent, text.toString(), 2); - Table table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); GridData data = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL); data.horizontalSpan = 2; data.widthHint = 200; table.setLayoutData(data); /*TableLayout layout = new TableLayout(); - layout.addColumnData(new ColumnWeightData(100, true)); - table.setLayout(layout); - TableColumn col = new TableColumn(table, SWT.NONE); - col.setResizable(true); */ + layout.addColumnData(new ColumnWeightData(100, true)); + table.setLayout(layout); + TableColumn col = new TableColumn(table, SWT.NONE); + col.setResizable(true); */ TableViewer resourceList = new TableViewer(table); resourceList.setContentProvider(new ArrayContentProvider()); resourceList.setLabelProvider(new WorkbenchLabelProvider()); resourceList.setInput(resources); - createLabel(parent, "", 2); //$NON-NLS-1$ promptWhenNoChanges = new Button(parent, SWT.CHECK); data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING); data.horizontalSpan = 2; promptWhenNoChanges.setLayoutData(data); - promptWithChanges = new Button(parent, SWT.CHECK); - data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING); data.horizontalSpan = 2; promptWithChanges.setLayoutData(data); - - if(event.getRefreshType() == IRefreshEvent.USER_REFRESH) { + if (event.getRefreshType() == IRefreshEvent.USER_REFRESH) { promptWhenNoChanges.setText(Policy.bind(Policy.bind("RefreshCompleteDialog.13"))); //$NON-NLS-1$ promptWhenNoChanges.setSelection(TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_VIEW_PROMPT_WHEN_NO_CHANGES)); promptWithChanges.setText(Policy.bind(Policy.bind("RefreshCompleteDialog.14"))); //$NON-NLS-1$ promptWithChanges.setSelection(TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_VIEW_PROMPT_WITH_CHANGES)); - } else { promptWhenNoChanges.setText(Policy.bind(Policy.bind("RefreshCompleteDialog.15"))); //$NON-NLS-1$ promptWhenNoChanges.setSelection(TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_VIEW_BKG_PROMPT_WHEN_NO_CHANGES)); promptWithChanges.setText(Policy.bind(Policy.bind("RefreshCompleteDialog.16"))); //$NON-NLS-1$ promptWithChanges.setSelection(TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_VIEW_BKG_PROMPT_WITH_CHANGES)); } - Dialog.applyDialogFont(parent); } /* (non-Javadoc) - * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#createDropDownDialogArea(org.eclipse.swt.widgets.Composite) + * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#getDetailsButtonLabelHide() */ - protected Composite createDropDownDialogArea(Composite parent) { - try { - CompareConfiguration compareConfig = new CompareConfiguration(); - DiffTreeViewerConfiguration viewerAdvisor = new DiffTreeViewerConfiguration(participant.getId(), syncInfoSet); - compareEditorInput = new SyncInfoSetCompareInput(compareConfig, viewerAdvisor) { - public String getTitle() { - return "Resources found during last refresh"; - } - }; - // Preparing the input should be fast since we haven't started the collector - compareEditorInput.run(new NullProgressMonitor()); - // Starting the collector will populate the dialog in the background - initialize(); - } catch (InterruptedException e) { - Utils.handle(e); - } catch (InvocationTargetException e) { - Utils.handle(e); - } - - Composite result= new Composite(parent, SWT.NONE); - GridLayout layout= new GridLayout(); - result.setLayout(layout); - GridData data = new GridData(GridData.FILL_BOTH); - data.grabExcessHorizontalSpace = true; - data.grabExcessVerticalSpace = true; - data.heightHint = 350; - //data.widthHint = 700; - result.setLayoutData(data); - - Control c = compareEditorInput.createContents(result); - data = new GridData(GridData.FILL_BOTH); - c.setLayoutData(data); - return result; + protected String getDetailsButtonLabelHide() { + return Policy.bind("RefreshCompleteDialog.18"); } /* (non-Javadoc) - * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#updateEnablements() + * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#getDetailsButtonLabelShow() */ - protected void updateEnablements() { + protected String getDetailsButtonLabelShow() { + return Policy.bind("RefreshCompleteDialog.17"); } - + /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) + * @see org.eclipse.jface.window.Window#getInitialSize() */ - protected void createButtonsForButtonBar(Composite parent) { - super.createButtonsForButtonBar(parent); + protected Point getInitialSize() { + int width, height; + try { + height = settings.getInt(HEIGHT_KEY); + width = settings.getInt(WIDTH_KEY); + } catch (NumberFormatException e) { + return super.getInitialSize(); + } + Point p = super.getInitialSize(); + return new Point(width, p.y); } - + /* (non-Javadoc) * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#includeCancelButton() */ protected boolean includeCancelButton() { return false; } - - private Label createLabel(Composite parent, String text, int columns) { - Label label = new Label(parent, SWT.WRAP); - label.setText(text); - GridData data = new GridData(); - data.horizontalSpan = columns; - label.setLayoutData(data); - return label; - } - - protected Combo createCombo(Composite parent, int widthChars) { - Combo combo = new Combo(parent, SWT.READ_ONLY); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - GC gc = new GC(combo); - gc.setFont(combo.getFont()); - FontMetrics fontMetrics = gc.getFontMetrics(); - data.widthHint = Dialog.convertWidthInCharsToPixels(fontMetrics, widthChars); - gc.dispose(); - combo.setLayoutData(data); - return combo; - } - - private IResource[] getResources() { - SyncInfo[] changes = event.getChanges(); - IResource[] resources = new IResource[changes.length]; - for (int i = 0; i < changes.length; i++) { - SyncInfo info = changes[i]; - resources[i] = info.getLocal(); - } - return resources; + + /* (non-Javadoc) + * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#includeDetailsButton() + */ + protected boolean includeDetailsButton() { + return event.getChanges().length != 0; } - + /* (non-Javadoc) * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#includeErrorMessage() */ protected boolean includeErrorMessage() { return false; } - - - /* (non-Javadoc) - * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#includeDetailsButton() - */ - protected boolean includeDetailsButton() { - return event.getChanges().length != 0; - } - + /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#okPressed() */ - protected void okPressed() { - if(event.getRefreshType() == IRefreshEvent.USER_REFRESH) { + protected void okPressed() { + if (event.getRefreshType() == IRefreshEvent.USER_REFRESH) { TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCVIEW_VIEW_PROMPT_WHEN_NO_CHANGES, promptWhenNoChanges.getSelection()); - TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCVIEW_VIEW_PROMPT_WITH_CHANGES, promptWithChanges.getSelection()); + TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCVIEW_VIEW_PROMPT_WITH_CHANGES, promptWithChanges.getSelection()); } else { TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCVIEW_VIEW_BKG_PROMPT_WHEN_NO_CHANGES, promptWhenNoChanges.getSelection()); TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCVIEW_VIEW_BKG_PROMPT_WITH_CHANGES, promptWithChanges.getSelection()); } TeamUIPlugin.getPlugin().savePluginPreferences(); - super.okPressed(); + super.okPressed(); + } + + /* (non-Javadoc) + * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#updateEnablements() + */ + protected void updateEnablements() { + } + + private Label createLabel(Composite parent, String text, int columns) { + Label label = new Label(parent, SWT.WRAP); + label.setText(text); + GridData data = new GridData(); + data.horizontalSpan = columns; + label.setLayoutData(data); + return label; + } + + private IResource[] getResources() { + SyncInfo[] changes = event.getChanges(); + IResource[] resources = new IResource[changes.length]; + for (int i = 0; i < changes.length; i++) { + SyncInfo info = changes[i]; + resources[i] = info.getLocal(); + } + return resources; } }
\ No newline at end of file diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/StatusLineContributionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/StatusLineContributionGroup.java index dd488a746..6d55cf6b2 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/StatusLineContributionGroup.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/StatusLineContributionGroup.java @@ -34,12 +34,14 @@ public class StatusLineContributionGroup extends ActionGroup implements ISyncInf private static final String OUTGOING_ID = TeamUIPlugin.ID + "org.eclipse.team.iu.statusline.outgoing"; //$NON-NLS-1$ private static final String CONFLICTING_ID = TeamUIPlugin.ID + "org.eclipse.team.iu.statusline.conflicting"; //$NON-NLS-1$ private static final String WORKINGSET_ID = TeamUIPlugin.ID + "org.eclipse.team.iu.statusline.workingset"; //$NON-NLS-1$ - private final static int WORKING_SET_FIELD_SIZE = 25; + private static final String TOTALS_ID = TeamUIPlugin.ID + "org.eclipse.team.iu.statusline.totals"; //$NON-NLS-1$ + private final static int TEXT_FIELD_MAX_SIZE = 25; private StatusLineCLabelContribution incoming; private StatusLineCLabelContribution outgoing; private StatusLineCLabelContribution conflicting; private StatusLineCLabelContribution workingSet; + private StatusLineCLabelContribution totalChanges; private Image incomingImage = TeamUIPlugin.getImageDescriptor(ISharedImages.IMG_DLG_SYNC_INCOMING).createImage(); private Image outgoingImage = TeamUIPlugin.getImageDescriptor(ISharedImages.IMG_DLG_SYNC_OUTGOING).createImage(); @@ -56,7 +58,8 @@ public class StatusLineContributionGroup extends ActionGroup implements ISyncInf this.outgoing = createStatusLineContribution(OUTGOING_ID, SubscriberParticipant.OUTGOING_MODE, "0", outgoingImage); //$NON-NLS-1$ this.conflicting = createStatusLineContribution(CONFLICTING_ID, SubscriberParticipant.CONFLICTING_MODE, "0", conflictingImage); //$NON-NLS-1$ - this.workingSet = new StatusLineCLabelContribution(WORKINGSET_ID, 25); + this.totalChanges = new StatusLineCLabelContribution(TOTALS_ID, TEXT_FIELD_MAX_SIZE); + this.workingSet = new StatusLineCLabelContribution(WORKINGSET_ID, TEXT_FIELD_MAX_SIZE); this.workingSet.setTooltip(Policy.bind("StatisticsPanel.workingSetTooltip")); //$NON-NLS-1$ updateWorkingSetText(); @@ -73,14 +76,18 @@ public class StatusLineContributionGroup extends ActionGroup implements ISyncInf collector.getSyncInfoTree().addSyncSetChangedListener(this); } + private boolean isThreeWay() { + return participant.getSubscriber().getResourceComparator().isThreeWay(); + } + private void updateWorkingSetText() { IWorkingSet set = participant.getWorkingSet(); if (set == null) { workingSet.setText(Policy.bind("StatisticsPanel.noWorkingSet")); //$NON-NLS-1$ } else { String name = set.getName(); - if (name.length() > WORKING_SET_FIELD_SIZE) { - name = name.substring(0, WORKING_SET_FIELD_SIZE - 3) + "..."; //$NON-NLS-1$ + if (name.length() > TEXT_FIELD_MAX_SIZE) { + name = name.substring(0, TEXT_FIELD_MAX_SIZE - 3) + "..."; //$NON-NLS-1$ } workingSet.setText(name); } @@ -127,6 +134,7 @@ public class StatusLineContributionGroup extends ActionGroup implements ISyncInf SyncInfoSet workspaceSetStats = collector.getSubscriberSyncInfoSet(); SyncInfoSet workingSetSetStats = collector.getWorkingSetSyncInfoSet(); + final int total = workspaceSetStats.size(); final int workspaceConflicting = (int) workspaceSetStats.countFor(SyncInfo.CONFLICTING, SyncInfo.DIRECTION_MASK); final int workspaceOutgoing = (int) workspaceSetStats.countFor(SyncInfo.OUTGOING, SyncInfo.DIRECTION_MASK); final int workspaceIncoming = (int) workspaceSetStats.countFor(SyncInfo.INCOMING, SyncInfo.DIRECTION_MASK); @@ -155,6 +163,7 @@ public class StatusLineContributionGroup extends ActionGroup implements ISyncInf outgoing.setTooltip(Policy.bind("StatisticsPanel.numbersTooltip", Policy.bind("StatisticsPanel.outgoing"))); //$NON-NLS-1$ //$NON-NLS-2$ incoming.setTooltip(Policy.bind("StatisticsPanel.numbersTooltip", Policy.bind("StatisticsPanel.incoming"))); //$NON-NLS-1$ //$NON-NLS-2$ } + totalChanges.setText(Policy.bind("StatisticsPanel.numberTotal", Integer.toString(total))); } }); } @@ -168,9 +177,13 @@ public class StatusLineContributionGroup extends ActionGroup implements ISyncInf public void fillActionBars(IActionBars actionBars) { IStatusLineManager mgr = actionBars.getStatusLineManager(); mgr.add(workingSet); - mgr.add(incoming); - mgr.add(outgoing); - mgr.add(conflicting); + if (isThreeWay()) { + mgr.add(incoming); + mgr.add(outgoing); + mgr.add(conflicting); + } else { + mgr.add(totalChanges); + } } /* (non-Javadoc) diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java index e384ec2ca..7da095d8d 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java @@ -110,7 +110,14 @@ public abstract class AbstractSynchronizeParticipant implements ISynchronizePart public String getId() { return fId; } - + + /* (non-Javadoc) + * @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#isPersistent() + */ + public boolean isPersistent() { + return true; + } + /* * (non-Javadoc) * diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java index e07c3e4fa..4daa0e83f 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java @@ -66,6 +66,15 @@ public interface ISynchronizeParticipant extends IExecutableExtension { public String getName(); /** + * Returns <code>true</code> if this participant should be persisted between + * workbench sessions and <code>false</code> otherwise. + * + * @return <code>true</code> if this participant should be persisted between + * workbench sessions and <code>false</code> otherwise. + */ + public boolean isPersistent(); + + /** * Returns an image descriptor for this synchronize participant, or <code>null</code> * if none. * diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java index 91e6004f4..a688a3d1a 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java @@ -170,15 +170,19 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa } updateMode(getMode()); + preCollectingChanges(); collector.start(); - // start the refresh how that a subscriber has been added + // start the refresh now that a subscriber has been added SubscriberRefreshSchedule schedule = getRefreshSchedule(); if(schedule.isEnabled()) { getRefreshSchedule().startJob(); } } + protected void preCollectingChanges() { + } + /** * Get the <code>Subscriber</code> for this participant * @return a <code>TamSubscriber</code> diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberRefreshSchedule.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberRefreshSchedule.java index 8be08311d..1b8a8c7f8 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberRefreshSchedule.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberRefreshSchedule.java @@ -100,7 +100,7 @@ public class SubscriberRefreshSchedule { return; } if(job == null) { - job = new RefreshSubscriberJob(Policy.bind("SubscriberRefreshSchedule.14", participant.getName(), getRefreshIntervalAsString()), participant.getSubscriberSyncInfoCollector()); //$NON-NLS-1$ + job = new RefreshSubscriberJob(Policy.bind("RefreshSchedule.14", participant.getName(), getRefreshIntervalAsString()), participant.getSubscriberSyncInfoCollector()); //$NON-NLS-1$ } else if(job.getState() != Job.NONE){ stopJob(); } @@ -155,16 +155,16 @@ public class SubscriberRefreshSchedule { } SyncInfo[] changes = event.getChanges(); if (changes.length != 0) { - text.append(Policy.bind("SubscriberRefreshSchedule.6", Integer.toString(changes.length))); //$NON-NLS-1$ + text.append(Policy.bind("RefreshSchedule.6", Integer.toString(changes.length))); //$NON-NLS-1$ } else { - text.append(Policy.bind("SubscriberRefreshSchedule.7")); //$NON-NLS-1$ + text.append(Policy.bind("RefreshSchedule.7")); //$NON-NLS-1$ } return text.toString(); } public String getScheduleAsString() { if(! isEnabled()) { - return Policy.bind("SubscriberRefreshSchedule.8"); //$NON-NLS-1$ + return Policy.bind("RefreshSchedule.8"); //$NON-NLS-1$ } return getRefreshIntervalAsString(); } @@ -186,10 +186,10 @@ public class SubscriberRefreshSchedule { } String unit; if(minutes >= 1) { - unit = (hours ? Policy.bind("SubscriberRefreshSchedule.9") : Policy.bind("SubscriberRefreshSchedule.10")); //$NON-NLS-1$ //$NON-NLS-2$ + unit = (hours ? Policy.bind("RefreshSchedule.9") : Policy.bind("RefreshSchedule.10")); //$NON-NLS-1$ //$NON-NLS-2$ } else { - unit = (hours ? Policy.bind("SubscriberRefreshSchedule.11") : Policy.bind("SubscriberRefreshSchedule.12")); //$NON-NLS-1$ //$NON-NLS-2$ + unit = (hours ? Policy.bind("RefreshSchedule.11") : Policy.bind("RefreshSchedule.12")); //$NON-NLS-1$ //$NON-NLS-2$ } - return Policy.bind("SubscriberRefreshSchedule.13", Long.toString(minutes), unit); //$NON-NLS-1$ + return Policy.bind("RefreshSchedule.13", Long.toString(minutes), unit); //$NON-NLS-1$ } }
\ No newline at end of file diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoSetCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoSetCompareInput.java index 705455ca8..5f0ac9009 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoSetCompareInput.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoSetCompareInput.java @@ -18,12 +18,15 @@ import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.action.Separator; import org.eclipse.jface.action.ToolBarManager; +import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.*; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ui.Utils; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.progress.IProgressService; /** * A <code>CompareEditorInput</code> whose diff viewer shows the resources contained @@ -116,12 +119,33 @@ public class SyncInfoSetCompareInput extends CompareEditorInput { ((StructuredViewer) viewer).addOpenListener(new IOpenListener() { public void open(OpenEvent event) { ISelection s = event.getSelection(); - SyncInfoDiffNode node = getElement(s); + final SyncInfoDiffNode node = getElement(s); if (node != null) { IResource resource = node.getResource(); int kind = node.getKind(); if (resource != null && resource.getType() == IResource.FILE) { - Utils.updateLabels(node.getSyncInfo(), getCompareConfiguration()); + // Cache the contents because compare doesn't show progress + // when calling getContents on a diff node. + IProgressService manager = PlatformUI.getWorkbench().getProgressService(); + try { + manager.busyCursorWhile(new IRunnableWithProgress() { + public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { + try { + node.cacheContents(monitor); + } catch (TeamException e) { + throw new InvocationTargetException(e); + } + } + }); + } catch (InvocationTargetException e) { + Utils.handle(e); + } catch (InterruptedException e) { + Utils.handle(e); + } finally { + // Update the labels even if the content wasn't fetched correctly. This is + // required because the selection would still of changed. + Utils.updateLabels(node.getSyncInfo(), getCompareConfiguration()); + } } } } diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00033.html b/tests/org.eclipse.team.tests.cvs.core/html/00033.html new file mode 100644 index 000000000..6580d819c --- /dev/null +++ b/tests/org.eclipse.team.tests.cvs.core/html/00033.html @@ -0,0 +1,11 @@ +<html><head><title>Annotate</title> +<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css> +<meta NAME="keywords" content=""> +<meta NAME="since" content=""> +</head><h2>Annotate</h2> +<p>Since: <br> +Last Modified: $Date: 2003/11/27 22:04:58 $</p><body> + +Answer comes here. + +</body></html>
\ No newline at end of file diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00034.html b/tests/org.eclipse.team.tests.cvs.core/html/00034.html new file mode 100644 index 000000000..b7ffb01f6 --- /dev/null +++ b/tests/org.eclipse.team.tests.cvs.core/html/00034.html @@ -0,0 +1,11 @@ +<html><head><title>Show Annotation Action</title> +<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css> +<meta NAME="keywords" content=""> +<meta NAME="since" content=""> +</head><h2>Show Annotation Action</h2> +<p>Since: <br> +Last Modified: $Date: 2003/11/27 22:04:58 $</p><body> + +Answer comes here. + +</body></html>
\ No newline at end of file diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00035.html b/tests/org.eclipse.team.tests.cvs.core/html/00035.html new file mode 100644 index 000000000..7f0cc62ab --- /dev/null +++ b/tests/org.eclipse.team.tests.cvs.core/html/00035.html @@ -0,0 +1,11 @@ +<html><head><title>Label Decorations</title> +<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css> +<meta NAME="keywords" content=""> +<meta NAME="since" content=""> +</head><h2>Label Decorations</h2> +<p>Since: <br> +Last Modified: $Date: 2003/11/27 22:04:58 $</p><body> + +Answer comes here. + +</body></html>
\ No newline at end of file diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00036.html b/tests/org.eclipse.team.tests.cvs.core/html/00036.html new file mode 100644 index 000000000..b292f3c21 --- /dev/null +++ b/tests/org.eclipse.team.tests.cvs.core/html/00036.html @@ -0,0 +1,11 @@ +<html><head><title>Enablement at startup</title> +<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css> +<meta NAME="keywords" content=""> +<meta NAME="since" content=""> +</head><h2>Enablement at startup</h2> +<p>Since: <br> +Last Modified: $Date: 2003/11/27 22:04:58 $</p><body> + +Answer comes here. + +</body></html>
\ No newline at end of file diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00037.html b/tests/org.eclipse.team.tests.cvs.core/html/00037.html new file mode 100644 index 000000000..7df4da966 --- /dev/null +++ b/tests/org.eclipse.team.tests.cvs.core/html/00037.html @@ -0,0 +1,11 @@ +<html><head><title>Customizations</title> +<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css> +<meta NAME="keywords" content=""> +<meta NAME="since" content=""> +</head><h2>Customizations</h2> +<p>Since: <br> +Last Modified: $Date: 2003/11/27 22:04:58 $</p><body> + +Answer comes here. + +</body></html>
\ No newline at end of file diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00038.html b/tests/org.eclipse.team.tests.cvs.core/html/00038.html new file mode 100644 index 000000000..66bee4dc4 --- /dev/null +++ b/tests/org.eclipse.team.tests.cvs.core/html/00038.html @@ -0,0 +1,11 @@ +<html><head><title>Decorations in the Synchronize pages</title> +<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css> +<meta NAME="keywords" content=""> +<meta NAME="since" content=""> +</head><h2>Decorations in the Synchronize pages</h2> +<p>Since: <br> +Last Modified: $Date: 2003/11/27 22:04:58 $</p><body> + +Answer comes here. + +</body></html>
\ No newline at end of file diff --git a/tests/org.eclipse.team.tests.cvs.core/toc.xml b/tests/org.eclipse.team.tests.cvs.core/toc.xml index c7dbb75e7..83848af71 100644 --- a/tests/org.eclipse.team.tests.cvs.core/toc.xml +++ b/tests/org.eclipse.team.tests.cvs.core/toc.xml @@ -60,5 +60,17 @@ <topic label="General use" href="html/00032.html"> </topic> </topic> + <topic label="Annotate" href="html/00033.html"> + <topic label="Show Annotation Action" href="html/00034.html"> + </topic> + </topic> + <topic label="Label Decorations" href="html/00035.html"> + <topic label="Enablement at startup" href="html/00036.html"> + </topic> + <topic label="Customizations" href="html/00037.html"> + </topic> + <topic label="Decorations in the Synchronize pages" href="html/00038.html"> + </topic> + </topic> </topic> </toc> |