01: /*******************************************************************************
02: * Copyright (c) 2004, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM - Initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.ide.actions;
11:
12: import org.eclipse.core.resources.IProject;
13: import org.eclipse.jface.action.Action;
14: import org.eclipse.ui.IWorkbenchWindow;
15: import org.eclipse.ui.actions.ActionFactory;
16: import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
17: import org.eclipse.ui.internal.ide.dialogs.CleanDialog;
18:
19: /**
20: * The clean action replaces the rebuild actions. Clean will discard all built
21: * state for all projects in the workspace, and deletes all problem markers.
22: * The next time a build is run, projects will have to be built from scratch.
23: * Technically this is only necessary if an incremental builder misbehaves.
24: *
25: * @since 3.0
26: */
27: public class BuildCleanAction extends Action implements
28: ActionFactory.IWorkbenchAction {
29: private IWorkbenchWindow window;
30:
31: /**
32: * Creates a new BuildCleanAction
33: *
34: * @param window The window for parenting this action
35: */
36: public BuildCleanAction(IWorkbenchWindow window) {
37: super (IDEWorkbenchMessages.Workbench_buildClean);
38: setActionDefinitionId("org.eclipse.ui.project.cleanAction"); //$NON-NLS-1$
39: this .window = window;
40: }
41:
42: /* (non-Javadoc)
43: * @see org.eclipse.ui.actions.ActionFactory.IWorkbenchAction#dispose()
44: */
45: public void dispose() {
46: //nothing to dispose
47: }
48:
49: public void run() {
50: IProject[] selected = BuildUtilities
51: .findSelectedProjects(window);
52: new CleanDialog(window, selected).open();
53: }
54: }
|