Correct reference to EPL in source headers
[egit/chris.git] / org.eclipse.egit.ui / src / org / eclipse / egit / ui / internal / components / BaseWizardPage.java
blob41fbb8b218eea7553fba18d45709ce240f1432f0
1 /*******************************************************************************
2 * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9 package org.eclipse.egit.ui.internal.components;
11 import java.util.LinkedList;
12 import java.util.List;
14 import org.eclipse.jface.wizard.WizardPage;
16 /**
17 * Base wizard page class for pages that need support for inter-pages
18 * dependencies.
19 * <p>
20 * This abstract class maintains list of selection change listeners and provides
21 * method to notify them about selection change.
23 * @see SelectionChangeListener
25 public abstract class BaseWizardPage extends WizardPage {
26 private final List<SelectionChangeListener> selectionListeners;
28 /**
29 * Create base wizard with specified name. Listeners list is empty.
31 * @see WizardPage#WizardPage(String)
32 * @param pageName
33 * page name.
35 public BaseWizardPage(final String pageName) {
36 super(pageName);
37 selectionListeners = new LinkedList<SelectionChangeListener>();
40 /**
41 * Add {@link SelectionChangeListener} to list of listeners notified on
42 * selection change on this page.
44 * @param l
45 * listener that will be notified about changes.
47 public void addSelectionListener(final SelectionChangeListener l) {
48 selectionListeners.add(l);
51 /**
52 * Notifies registered listeners about selection change.
54 protected void notifySelectionChanged() {
55 for (final SelectionChangeListener l : selectionListeners)
56 l.selectionChanged();