/******************************************************************************* * Copyright (c) 2000, 2011 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.jdt.internal.ui.wizards.buildpaths; import java.util.ArrayList; import org.eclipse.core.runtime.IPath; import org.eclipse.core.resources.IResource; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.corext.buildpath.BuildpathDelta; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.EditFilterAction; public class EditFilterWizard extends BuildPathWizard { SetFilterWizardPage fFilterPage; final IPath[] fOrginalInclusion; final IPath[] fOriginalExclusion; public EditFilterWizard(CPListElement[] existingEntries, CPListElement newEntry, IPath outputLocation) { super(existingEntries, newEntry, outputLocation, NewWizardMessages.ExclusionInclusionDialog_title, null); IPath[] inc= (IPath[])newEntry.getAttribute(CPListElement.INCLUSION); fOrginalInclusion= new IPath[inc.length]; System.arraycopy(inc, 0, fOrginalInclusion, 0, inc.length); IPath[] excl= (IPath[])newEntry.getAttribute(CPListElement.EXCLUSION); fOriginalExclusion= new IPath[excl.length]; System.arraycopy(excl, 0, fOriginalExclusion, 0, excl.length); } /* * @see Wizard#addPages */ @Override public void addPages() { super.addPages(); fFilterPage= new SetFilterWizardPage(getEntryToEdit(), getExistingEntries(), getOutputLocation()); addPage(fFilterPage); } /* (non-Javadoc) * @see org.eclipse.jface.wizard.IWizard#performFinish() */ @Override public boolean performFinish() { CPListElement entryToEdit= getEntryToEdit(); fFilterPage.generated_4961782323986829573(entryToEdit); return super.performFinish(); } /** * {@inheritDoc} */ @Override public void cancel() { CPListElement entryToEdit= getEntryToEdit(); entryToEdit.generated_2038744591920628318(this); } public BuildpathDelta generated_4795514865538398845(EditFilterAction editfilteraction) throws JavaModelException { BuildpathDelta delta= new BuildpathDelta(editfilteraction.getToolTipText()); ArrayList newEntries= getExistingEntries(); delta.setNewEntries(newEntries.toArray(new CPListElement[newEntries.size()])); IResource resource= getCreatedElement().getCorrespondingResource(); delta.addCreatedResource(resource); delta.setDefaultOutputLocation(getOutputLocation()); return delta; } }