1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.xnap.gui.wizard;
21
22 import java.awt.BorderLayout;
23
24 import javax.swing.Icon;
25
26 import org.xnap.XNap;
27 import org.xnap.gui.AbstractSettingsPanel;
28 import org.xnap.gui.plugin.PluginInstallerDialog;
29 import org.xnap.gui.plugin.PluginPanel;
30 import org.xnap.gui.util.IconHelper;
31
32 /***
33 * Assumes that no plugins have been enabled prior to execution of this class.
34 */
35 public class PluginWizardPanel extends AbstractSettingsPanel {
36
37
38
39 private PluginPanel panel;
40 private boolean firstTime = true;
41
42
43
44 public PluginWizardPanel()
45 {
46 setLayout(new BorderLayout());
47
48 panel = new PluginPanel(false);
49 add(panel, BorderLayout.CENTER);
50 }
51
52
53
54 public void apply()
55 {
56 panel.apply();
57 if (!PluginInstallerDialog.commit(this)) {
58 throw new IllegalArgumentException(XNap.tr("It looks like the package file is incomplete. Deselect a plugin and try again plugin."));
59 }
60 }
61
62 public String getDescription()
63 {
64 return XNap.tr("Selects the plugins you want to install. You can always install more plugins from the plugins dialog later.");
65 }
66
67 public Icon getIcon()
68 {
69 return IconHelper.getWizardIcon("package.png");
70 }
71
72 public String getTitle()
73 {
74 return XNap.tr("Plugins");
75 }
76
77 public void shown()
78 {
79 if (firstTime) {
80 firstTime = false;
81 panel.updatePackageManager();
82 }
83 }
84
85 }