1 11 package org.eclipse.jdt.internal.ui.wizards.buildpaths; 12 13 import org.eclipse.core.runtime.IPath; 14 15 import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; 16 17 public class EditFilterWizard extends BuildPathWizard { 18 19 private SetFilterWizardPage fFilterPage; 20 private final IPath[] fOrginalInclusion, fOriginalExclusion; 21 22 public EditFilterWizard(CPListElement[] existingEntries, CPListElement newEntry, IPath outputLocation) { 23 super(existingEntries, newEntry, outputLocation, NewWizardMessages.ExclusionInclusionDialog_title, null); 24 25 IPath[] inc= (IPath[])newEntry.getAttribute(CPListElement.INCLUSION); 26 fOrginalInclusion= new IPath[inc.length]; 27 System.arraycopy(inc, 0, fOrginalInclusion, 0, inc.length); 28 29 IPath[] excl= (IPath[])newEntry.getAttribute(CPListElement.EXCLUSION); 30 fOriginalExclusion= new IPath[excl.length]; 31 System.arraycopy(excl, 0, fOriginalExclusion, 0, excl.length); 32 } 33 34 37 public void addPages() { 38 super.addPages(); 39 40 fFilterPage= new SetFilterWizardPage(getEntryToEdit(), getExistingEntries(), getOutputLocation()); 41 addPage(fFilterPage); 42 } 43 44 47 public boolean performFinish() { 48 CPListElement entryToEdit= getEntryToEdit(); 49 entryToEdit.setAttribute(CPListElement.INCLUSION, fFilterPage.getInclusionPattern()); 50 entryToEdit.setAttribute(CPListElement.EXCLUSION, fFilterPage.getExclusionPattern()); 51 52 return super.performFinish(); 53 } 54 55 58 public void cancel() { 59 CPListElement entryToEdit= getEntryToEdit(); 60 entryToEdit.setAttribute(CPListElement.INCLUSION, fOrginalInclusion); 61 entryToEdit.setAttribute(CPListElement.EXCLUSION, fOriginalExclusion); 62 } 63 } 64 | Popular Tags |