### Eclipse Workspace Patch 1.0 #P org.eclipse.wst.common.emf Index: wtpemf/org/eclipse/wst/common/internal/emf/utilities/ICommand2.java =================================================================== RCS file: wtpemf/org/eclipse/wst/common/internal/emf/utilities/ICommand2.java diff -N wtpemf/org/eclipse/wst/common/internal/emf/utilities/ICommand2.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ wtpemf/org/eclipse/wst/common/internal/emf/utilities/ICommand2.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2010 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.wst.common.internal.emf.utilities; + +import java.util.List; + +import org.eclipse.core.resources.IProject; + +public interface ICommand2 extends ICommand { + + /** + * Accessor for a {@link List} of {@link IProject} that were modified by the execution of this command. + * + * @return A {@link List} of {@link IProject} that were modified by the execution of this command. + */ + public List getAffectedProjects(); +} #P org.eclipse.jst.j2ee Index: j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/J2EEDeployOperation.java =================================================================== RCS file: /cvsroot/webtools/jeetools/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/J2EEDeployOperation.java,v retrieving revision 1.19.10.2.4.1 diff -u -r1.19.10.2.4.1 J2EEDeployOperation.java --- j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/J2EEDeployOperation.java 5 Oct 2009 22:48:55 -0000 1.19.10.2.4.1 +++ j2eeplugin/org/eclipse/jst/j2ee/internal/deploy/J2EEDeployOperation.java 6 Aug 2010 20:55:31 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2006 IBM Corporation and others. + * Copyright (c) 2003, 2010 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 @@ -17,7 +17,9 @@ package org.eclipse.jst.j2ee.internal.deploy; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.resources.IProject; @@ -44,6 +46,7 @@ import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; import org.eclipse.wst.common.internal.emf.utilities.CommandContext; import org.eclipse.wst.common.internal.emf.utilities.ICommand; +import org.eclipse.wst.common.internal.emf.utilities.ICommand2; import org.eclipse.wst.common.internal.emf.utilities.ICommandContext; import org.eclipse.wst.server.core.IRuntime; @@ -59,6 +62,7 @@ private IStatus multiStatus; private IProject currentProject; private boolean wasAutoBuilding; + private Set affectedProjects; /** * @@ -66,6 +70,7 @@ public J2EEDeployOperation(Object[] deployableObjects) { super(); selection = deployableObjects; + affectedProjects = new HashSet(); // TODO Auto-generated constructor stub } @@ -172,6 +177,12 @@ ICommandContext ctx = new CommandContext(monitor, null, eObject.eResource().getResourceSet()); dep.execute(proj, null, ctx); + if (dep instanceof ICommand2) { + List changedProjects = ((ICommand2) dep).getAffectedProjects(); + if (changedProjects != null) { + this.affectedProjects.addAll(changedProjects); + } + } addOKStatus(dep.getClass().getName()); } catch (CoreException ex) { Logger.getLogger().logError(ex); @@ -268,4 +279,9 @@ } return components; } -} + + public Set getAffectedProjects() { + + return this.affectedProjects; + } +} \ No newline at end of file