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 Contributors: IBM Corporation - initial API and implementation /
Operation that divides the resources by location
public abstract class RepositoryLocationOperation extends RemoteOperation {
	protected RepositoryLocationOperation(IWorkbenchPart partICVSRemoteResource[] remoteResources) {
	/* (non-Javadoc)
	 * @see
	public void execute(IProgressMonitor monitorthrows CVSExceptionInterruptedException {
		Set keySet = table.keySet();
		monitor.beginTask(nullkeySet.size() * 100);
		Iterator iterator = keySet.iterator();
		while (iterator.hasNext()) {
			List list = (List)table.get(location);
			ICVSRemoteResource[] remoteResources = (ICVSRemoteResource[])list.toArray(new ICVSRemoteResource[list.size()]);
			execute(locationremoteResources, Policy.subMonitorFor(monitor, 100));

Perform the operation for the given resources found on the given repository.

location the repository location
resources the resources of this operation found in the repository
monitor a progres monitor
	protected abstract void execute(ICVSRepositoryLocation locationICVSRemoteResource[] resourcesIProgressMonitor monitorthrows CVSException;
	 * Return a map that maps a location to all the resources
	 * from the given list that are located in that repository.
	private Map getLocationMapping(ICVSRemoteResource[] remoteResources) {
		Map locationsMap = new HashMap();
		for (int i = 0; i < remoteResources.lengthi++) {
			ICVSRemoteResource resource = remoteResources[i];
			ICVSRepositoryLocation location = resource.getRepository();
			List resources = (List)locationsMap.get(location);
			if (resources == null) {
				resources = new ArrayList();
		return locationsMap;
New to GrepCode? Check out our FAQ X