Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2006 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 http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
package org.eclipse.team.internal.ccvs.ui.operations;
public abstract class CheckoutOperation extends RemoteOperation {
	public CheckoutOperation(IWorkbenchPart partICVSRemoteFolder[] remoteFolders) {
		super(partremoteFolders);
	}
	/* (non-Javadoc)
	 * @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
	 */
	public void execute(IProgressMonitor monitorthrows CVSExceptionInterruptedException {
		checkout(foldersmonitor);
	}

This method invokes checkout(ICVSRemoteFolder, IProgressMonitor) for each remote folder of the operation.

Parameters:
folders the remote folders for the operation
monitor the progress monitor
Throws:
org.eclipse.team.internal.ccvs.core.CVSException if an error occured that should prevent the remaining folders from being checked out
	protected void checkout(ICVSRemoteFolder[] foldersIProgressMonitor monitorthrows CVSException {
		monitor.beginTask(nullfolders.length * 100);
		for (int i = 0; i < folders.lengthi++) {
			ICVSRemoteFolder folder = folders[i];
			IStatus result = checkout(folder, Policy.subMonitorFor(monitor, 100));
			collectStatus(result);
			Policy.checkCanceled(monitor);
		}
		monitor.done();
	}
	}

Checkout the selected remote folders in a form appropriate for the operation subclass.

Parameters:
folders
monitor
	protected abstract IStatus checkout(ICVSRemoteFolder folderIProgressMonitor monitor)  throws CVSException;
	/* (non-Javadoc)
	 * @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#canRunAsJob()
	 */
	public boolean canRunAsJob() {
		return true;
	}
	/* (non-Javadoc)
     * @see org.eclipse.team.ui.TeamOperation#isKeepOneProgressServiceEntry()
     */
    public boolean isKeepOneProgressServiceEntry() {
        // Keep the last repository provider operation in the progress service
        return true;
    }
    
    /* (non-Javadoc)
     * @see org.eclipse.team.ui.TeamOperation#getGotoAction()
     */
    protected IAction getGotoAction() {
        return getShowConsoleAction();
    }
New to GrepCode? Check out our FAQ X