1 11 package org.eclipse.team.internal.ccvs.ui.operations; 12 13 import org.eclipse.core.resources.mapping.ResourceMapping; 14 import org.eclipse.core.resources.mapping.ResourceMappingContext; 15 import org.eclipse.core.runtime.IProgressMonitor; 16 import org.eclipse.core.runtime.IStatus; 17 import org.eclipse.osgi.util.NLS; 18 import org.eclipse.team.core.subscribers.SubscriberResourceMappingContext; 19 import org.eclipse.team.internal.ccvs.core.*; 20 import org.eclipse.team.internal.ccvs.core.client.*; 21 import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption; 22 import org.eclipse.team.internal.ccvs.ui.CVSUIMessages; 23 import org.eclipse.ui.IWorkbenchPart; 24 25 28 public class CommitOperation extends SingleCommandOperation { 29 30 public CommitOperation(IWorkbenchPart part, ResourceMapping[] mappers, LocalOption[] options, String comment) { 31 super(part, mappers, options); 32 addLocalOption(Command.makeArgumentOption(Command.MESSAGE_OPTION, comment)); 33 } 34 35 38 protected IStatus executeCommand(Session session, CVSTeamProvider provider, ICVSResource[] resources, boolean recurse, IProgressMonitor monitor) throws CVSException, InterruptedException { 39 return Command.COMMIT.execute(session, 40 Command.NO_GLOBAL_OPTIONS, 41 getLocalOptions(recurse), 42 resources, 43 null, 44 monitor); 45 } 46 47 50 protected String getTaskName() { 51 return CVSUIMessages.RepositoryManager_committing; 52 } 53 54 57 protected String getTaskName(CVSTeamProvider provider) { 58 return NLS.bind(CVSUIMessages.CommitOperation_0, new String [] { provider.getProject().getName() }); 59 } 60 61 64 protected String getErrorMessage(IStatus[] failures, int totalOperations) { 65 return CVSUIMessages.CommitAction_commitFailed; 66 } 67 68 71 protected boolean isServerModificationOperation() { 72 return true; 73 } 74 75 78 protected ResourceMappingContext getResourceMappingContext() { 79 return SubscriberResourceMappingContext.createContext(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber()); 80 } 81 } 82 | Popular Tags |