sticky documentation popup [take 1]
[fedora-idea.git] / platform / platform-impl / src / com / intellij / ui / wizard / WizardAction.java
blobfdb653e0cd306a3940dc07a2470aee453d1ae73b
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.intellij.ui.wizard;
18 import javax.swing.*;
19 import java.awt.event.ActionEvent;
21 public abstract class WizardAction extends AbstractAction {
23 protected WizardModel myModel;
25 public WizardAction(String name, WizardModel model) {
26 super(name);
27 myModel = model;
30 protected void setMnemonic(char value) {
31 putValue(Action.MNEMONIC_KEY, new Integer(value));
34 public final void setName(String name) {
35 putValue(Action.NAME, name);
38 public static class Next extends WizardAction {
40 public Next(WizardModel model) {
41 super("Next >", model);
42 setMnemonic('N');
45 public void actionPerformed(ActionEvent e) {
46 myModel.next();
50 public static class Previous extends WizardAction {
52 public Previous(WizardModel model) {
53 super("< Previous", model);
54 setMnemonic('P');
57 public void actionPerformed(ActionEvent e) {
58 myModel.previous();
62 public static class Finish extends WizardAction {
64 public Finish(WizardModel model) {
65 super("Finish", model);
66 setMnemonic('F');
69 public void actionPerformed(ActionEvent e) {
70 myModel.finish();
74 public static class Cancel extends WizardAction {
76 public Cancel(WizardModel model) {
77 super("Cancel", model);
78 setMnemonic('C');
81 public void actionPerformed(ActionEvent e) {
82 myModel.cancel();