blob: bdbcab3bfa8665a40d6de261bdb0902924239123 [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2000, 2020 IBM Corporation and others.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0.
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# IBM Corporation - org.eclipse.jdt: initial API and implementation
# Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.ltk.buildpaths.ui.wizards;
import org.eclipse.statet.jcommons.collections.ImList;
import org.eclipse.statet.internal.ltk.buildpaths.ui.Messages;
import org.eclipse.statet.ltk.buildpaths.core.IBuildpathAttribute;
import org.eclipse.statet.ltk.buildpaths.ui.BuildpathListElement;
import org.eclipse.statet.ltk.buildpaths.ui.BuildpathsUIDescription;
public class EditFilterWizard extends BuildPathWizard {
private FilterWizardPage filterPage;
public EditFilterWizard(final ImList<BuildpathListElement> existingEntries,
final BuildpathListElement newEntry, final BuildpathsUIDescription uiDescription) {
super(existingEntries, newEntry, Messages.ExclusionInclusion_Dialog_title, null,
uiDescription);
}
@Override
public void addPages() {
super.addPages();
this.filterPage= new FilterWizardPage(getEntryToEdit(), getUIDescription());
addPage(this.filterPage);
}
public void setFocus(final String attributeName) {
switch (attributeName) {
case IBuildpathAttribute.FILTER_INCLUSIONS:
case IBuildpathAttribute.FILTER_EXCLUSIONS:
this.filterPage.setFocus(attributeName);
break;
default:
break;
}
}
@Override
public boolean performFinish() {
final BuildpathListElement entryToEdit= getEntryToEdit();
entryToEdit.setAttribute(IBuildpathAttribute.FILTER_INCLUSIONS, this.filterPage.getInclusionPatterns());
entryToEdit.setAttribute(IBuildpathAttribute.FILTER_EXCLUSIONS, this.filterPage.getExclusionPatterns());
return true;
}
}