Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2005 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.ant.internal.ui.views.actions;
Action that removes selected build files from an AntView
public class RemoveProjectAction extends Action implements IUpdate {
	private AntView view;
	public RemoveProjectAction(AntView view) {
		this.view;
	}

	public void run() {
		Iterator iterselection.iterator();
		Object element;
		List projectNodesnew ArrayList();
		while (iter.hasNext()) {
			elementiter.next();
			if (element instanceof AntProjectNode) {
				projectNodes.add(element);
			}
		}
		.removeProjects(projectNodes);
	}

	public void update() {
		if (selection.isEmpty()) {
			setEnabled(false);
			return;
		}
		Object element;
		Iterator iterselection.iterator();
		while (iter.hasNext()) {
			elementiter.next();
			if (!(element instanceof AntProjectNode)) {
				setEnabled(false);
				return;
			}
		}
		setEnabled(true);
	}
New to GrepCode? Check out our FAQ X