diff options
author | Dani Megert | 2012-06-14 14:47:49 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2012-06-14 14:47:49 +0000 |
commit | 492c044a64ed6b8a6a07fd7bbc4be551487791ac (patch) | |
tree | 7f715b4c70473a69fae5726bd60b61196218f2e0 | |
parent | 2632475c64c20d5354ade3e3772023573dc7a500 (diff) | |
parent | b34f75dda8114ffd4245b80c188ebd4c7e775ea8 (diff) | |
download | eclipse.platform.team-492c044a64ed6b8a6a07fd7bbc4be551487791ac.tar.gz eclipse.platform.team-492c044a64ed6b8a6a07fd7bbc4be551487791ac.tar.xz eclipse.platform.team-492c044a64ed6b8a6a07fd7bbc4be551487791ac.zip |
Merge "Extra information displayed when create patch failed"
2 files changed, 30 insertions, 21 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties index d7a161817..a39440e30 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties @@ -375,7 +375,7 @@ GenerateCVSDiff_overwriteMsg=A file with that name already exists. Overwrite? GenerateCVSDiff_error=Error running the CVS diff command GenerateCVSDiff_working=Running CVS diff... GenerateCVSDiff_noDiffsFoundMsg=No differences found. -GenerateCVSDiff_noDiffsFoundTitle=CVS diff +GenerateCVSDiff_noDiffsFoundTitle=CVS diff is empty GenerateCVSDiff_1=Read-only file GenerateCVSDiff_2=The specified file is read-only and cannot be overwritten. diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java index ac78d9b09..560991bf0 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2012 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,20 +17,21 @@ import org.eclipse.compare.patch.WorkspacePatcherUI; import org.eclipse.core.resources.*; import org.eclipse.core.resources.mapping.ResourceMapping; import org.eclipse.core.runtime.*; +import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.widgets.Shell; import org.eclipse.team.internal.ccvs.core.*; import org.eclipse.team.internal.ccvs.core.client.*; import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption; import org.eclipse.team.internal.ccvs.core.client.listeners.DiffListener; import org.eclipse.team.internal.ccvs.core.connection.CVSCommunicationException; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; -import org.eclipse.team.internal.ccvs.ui.*; +import org.eclipse.team.internal.ccvs.ui.CVSUIMessages; import org.eclipse.team.internal.ccvs.ui.Policy; import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.statushandlers.*; public abstract class DiffOperation extends SingleCommandOperation { @@ -293,7 +294,12 @@ public abstract class DiffOperation extends SingleCommandOperation { try{ super.execute(provider, (IResource[]) subList.toArray(new IResource[subList.size()]), recurse, Policy.subMonitorFor(monitor, ticks)); } catch(CVSCommunicationException ex){ // see bug 123430 - CVSUIPlugin.openError(getShell(), null, null, ex, CVSUIPlugin.PERFORM_SYNC_EXEC | CVSUIPlugin.LOG_OTHER_EXCEPTIONS); + StatusAdapter adapter = new StatusAdapter(ex.getStatus()); + adapter.setProperty( + IStatusAdapterConstants.TITLE_PROPERTY, + CVSUIMessages.DiffOperation_ErrorsOccurredWhileCreatingThePatch); + StatusManager.getManager().handle(adapter, + StatusManager.SHOW | StatusManager.NONE); } catch (CVSException ex) { handleCVSException(ex); } @@ -326,12 +332,16 @@ public abstract class DiffOperation extends SingleCommandOperation { if (toShow.size() > 0) { String msg = may ? CVSUIMessages.DiffOperation_ThePatchMayNotContainAllTheChanges : CVSUIMessages.DiffOperation_ThePatchDoesNotContainAllTheChanges; - status = new MultiStatus(CVSProviderPlugin.ID, - CVSStatus.SERVER_ERROR, - (IStatus[]) toShow.toArray(new IStatus[0]), CVSUIMessages.DiffOperation_ErrorsOccurredWhileCreatingThePatch, null); - CVSUIPlugin.openError(getShell(), this.getTaskName(), msg, status, - CVSUIPlugin.PERFORM_SYNC_EXEC - | CVSUIPlugin.LOG_OTHER_EXCEPTIONS); + StatusAdapter adapter = new StatusAdapter( + new MultiStatus( + CVSProviderPlugin.ID, + CVSStatus.SERVER_ERROR, + (IStatus[]) toShow.toArray(new IStatus[toShow.size()]), + CVSUIMessages.DiffOperation_ErrorsOccurredWhileCreatingThePatch, + null)); + adapter.setProperty(IStatusAdapterConstants.TITLE_PROPERTY, msg); + StatusManager.getManager().handle(adapter, + StatusManager.SHOW | StatusManager.LOG); } } @@ -523,16 +533,15 @@ public abstract class DiffOperation extends SingleCommandOperation { } protected void reportEmptyDiff() { - CVSUIPlugin.openDialog(getShell(), new CVSUIPlugin.IOpenableInShell() { - public void open(Shell shell) { - MessageDialog.openInformation( - shell, - CVSUIMessages.GenerateCVSDiff_noDiffsFoundTitle, - CVSUIMessages.GenerateCVSDiff_noDiffsFoundMsg); - } - }, CVSUIPlugin.PERFORM_SYNC_EXEC); - } - + StatusAdapter adapter = new StatusAdapter(new Status(IStatus.INFO, + CVSProviderPlugin.ID, + CVSUIMessages.GenerateCVSDiff_noDiffsFoundMsg)); + adapter.setProperty(IStatusAdapterConstants.TITLE_PROPERTY, + CVSUIMessages.GenerateCVSDiff_noDiffsFoundTitle); + StatusManager.getManager().handle(adapter, + StatusManager.SHOW); + } + protected ICVSFolder getLocalRoot(CVSTeamProvider provider) throws CVSException { ICVSFolder root = getPatchRootFolder(); if (root != null) |