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.repo;
import  org.eclipse.swt.widgets.Shell;
Action for creating a CVS Date tag.
public class NewDateTagAction extends CVSRepoViewAction {
	/* (non-Javadoc)
	 * @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#execute(org.eclipse.jface.action.IAction)
	 */
	protected void execute(IAction actionthrows InvocationTargetExceptionInterruptedException {
		if (locations.length != 1) return;
		CVSTag tag = getDateTag(getShell(), locations[0]);
		CVSUIPlugin.getPlugin().getRepositoryManager().addDateTag(locations[0], tag);
	}
	public static CVSTag getDateTag(Shell shellICVSRepositoryLocation location) {
		DateTagDialog dialog = new DateTagDialog(shell);
		if (dialog.open() == .) {
			Date date = dialog.getDate();		
			CVSTag tag = new CVSTag(date);			
			return tag;
		}
		return null;
	}
	/* (non-Javadoc)
	 * @see org.eclipse.team.internal.ui.actions.TeamAction#isEnabled()
	 */
	public boolean isEnabled() {
		if (locations.length != 1) return false;
		return true;
	}
New to GrepCode? Check out our FAQ X