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
;
17 * Base wizard page class for pages that need support for inter-pages
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
;
29 * Create base wizard with specified name. Listeners list is empty.
31 * @see WizardPage#WizardPage(String)
35 public BaseWizardPage(final String pageName
) {
37 selectionListeners
= new LinkedList
<SelectionChangeListener
>();
41 * Add {@link SelectionChangeListener} to list of listeners notified on
42 * selection change on this page.
45 * listener that will be notified about changes.
47 public void addSelectionListener(final SelectionChangeListener l
) {
48 selectionListeners
.add(l
);
52 * Notifies registered listeners about selection change.
54 protected void notifySelectionChanged() {
55 for (final SelectionChangeListener l
: selectionListeners
)