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 to add a root remote folder to a branch
public class AddToBranchAction extends CVSAction {
		public String isValid(String newText) {
			IStatus status = CVSTag.validateTagName(newText);
			if (status.isOK()) return null;
			return status.getMessage();
		}
	};

See also:
org.eclipse.team.internal.ccvs.ui.actions.CVSAction.execute(org.eclipse.jface.action.IAction)
	protected void execute(IAction actionthrows InvocationTargetExceptionInterruptedException {
			public void run(IProgressMonitor monitorthrows InvocationTargetException {
				if (folder == nullreturn;
				Shell shell = getShell();
				final CVSException[] exception = new CVSException[] { null };
				shell.getDisplay().syncExec(new Runnable() {
					public void run() {
						if (dialog.open() == .) {
							CVSTag tag = new CVSTag(dialog.getValue(), .);
							try {
								CVSUIPlugin.getPlugin().getRepositoryManager().addTags(foldernew CVSTag[] {tag});
catch (CVSException e) {
								exception[0] = e;
							}
						}
					}
				});
				if (exception[0] != null)
					throw new InvocationTargetException(exception[0]);
			}
		}, false); 
	}

See also:
org.eclipse.team.internal.ui.actions.TeamAction.isEnabled()
	public boolean isEnabled() {
		return getSelectedRootFolder() != null;
	}
		ICVSRemoteFolder selectedFolder = null;
		for (int i = 0; i < folders.lengthi++) {
			ICVSRemoteFolder folder = folders[i];
			if (folder.isDefinedModule() || new Path(nullfolder.getRepositoryRelativePath()).segmentCount()==1) {
				// only return a folder if one valid one is selected.
				if (selectedFolder != nullreturn null;
				selectedFolder = folder;
			}
		}
		return selectedFolder;
	}
New to GrepCode? Check out our FAQ X