Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2011 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;
 
 import java.util.Set;
 
 
 public class TagInRepositoryOperation extends RemoteOperation implements ITagOperation {
 
 	private Set localOptions = new HashSet();
 	private CVSTag tag;
 
 	public TagInRepositoryOperation(IWorkbenchPart partICVSRemoteResource[] remoteResource) {
 		super(partremoteResource);
 	}
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
 	 */
 	public void execute(IProgressMonitor monitorthrows CVSExceptionInterruptedException {
 		monitor.beginTask(null, 1000 * resources.length);
 		for (int i = 0; i < resources.lengthi++) {
 			IStatus status = resources[i].tag(getTag(), getLocalOptions(), new SubProgressMonitor(monitor, 1000));
 			collectStatus(status);
 		}
 		if (!errorsOccurred()) {
 			try {
 			} catch (InvocationTargetException e) {
 				throw CVSException.wrapException(e);
 			}
 		}
 	}

Override to dislay the number of tag operations that succeeded
 
 	protected String getErrorMessage(IStatus[] problemsint operationCount) {
 		if(operationCount == 1) {
 		} else {
 			return NLS.bind(.new String[] { Integer.toString(operationCount - problems.length), Integer.toString(problems.length) });
 		}
 	}
 
 	private LocalOption[] getLocalOptions() {
 	}
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.team.internal.ccvs.ui.operations.ITagOperation#getTag()
 	 */
 	public CVSTag getTag() {
 		return ;
 	}
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.team.internal.ccvs.ui.operations.ITagOperation#setTag(org.eclipse.team.internal.ccvs.core.CVSTag)
 	 */
 	public void setTag(CVSTag tag) {
 		this. = tag;
 	}
 
 	public void addLocalOption(LocalOption option)  {
 		.add(option);
 	}
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.team.internal.ccvs.ui.operations.ITagOperation#moveTag()
 	 */
 	public void moveTag() {
 		if ( != null && .getType() == .) {
 		}
 	}
 
 	/* (non-Javadoc)
	 * @see org.eclipse.team.internal.ccvs.ui.operations.ITagOperation#recurse()
	 */
	public void doNotRecurse() {
	}
	protected String getTaskName() {
	}
    /* (non-Javadoc)
     * @see org.eclipse.team.internal.ccvs.ui.operations.ITagOperation#getTagSource()
     */
    public TagSource getTagSource() {
        return TagSource.create(getCVSResources());
    }
    
    protected boolean isReportableError(IStatus status) {
        return super.isReportableError(status)
        	|| status.getCode() == .;
    }
    /* (non-Javadoc)
     * @see org.eclipse.team.internal.ccvs.ui.operations.ITagOperation#isEmpty()
     */
    public boolean isEmpty() {
        return getCVSResources().length == 0;
    }
New to GrepCode? Check out our FAQ X