00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 package org.objectweb.cjdbc.console.wizard;
00026
00027 import java.awt.GridBagConstraints;
00028 import java.awt.GridBagLayout;
00029 import java.util.ResourceBundle;
00030 import java.util.StringTokenizer;
00031
00032 import javax.swing.BorderFactory;
00033 import javax.swing.JOptionPane;
00034 import javax.swing.JPanel;
00035 import javax.swing.border.BevelBorder;
00036
00037 import org.objectweb.cjdbc.common.i18n.WizardTranslate;
00038 import org.objectweb.cjdbc.console.wizard.listeners.WizardListener;
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 public abstract class WizardTab extends JPanel implements WizardListener
00049 {
00050 protected WizardTabs tabs;
00051 protected GridBagConstraints constraints;
00052 protected static ResourceBundle types;
00053
00054 public WizardTab(WizardTabs tabs, String name)
00055 {
00056 super();
00057 this.tabs = tabs;
00058 this.setName(WizardTranslate.get(name));
00059 this.setLayout(new GridBagLayout());
00060 this.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
00061 constraints = new GridBagConstraints();
00062 constraints.gridy = 0;
00063
00064 constraints.fill = GridBagConstraints.BOTH;
00065 constraints.weightx = 1.0;
00066 constraints.weighty = 1.0;
00067 }
00068
00069
00070
00071
00072 public void backendListChanged()
00073 {
00074
00075 }
00076
00077
00078
00079
00080 public void distributionChanged()
00081 {
00082 }
00083
00084
00085
00086
00087 public void usersChanged()
00088 {
00089
00090 }
00091
00092 public static final String[] getDatabasesTypes()
00093 {
00094 if (types == null)
00095 types = ResourceBundle.getBundle("database");
00096 String typestring = types.getString("database.types");
00097
00098 StringTokenizer token = new StringTokenizer(typestring, ",");
00099 int tokens = token.countTokens();
00100 String[] databases = new String[tokens];
00101 int count = 0;
00102 while (token.hasMoreTokens())
00103 {
00104 databases[count] = token.nextToken();
00105 count++;
00106 }
00107
00108 return databases;
00109 }
00110
00111
00112
00113
00114
00115
00116 public static String showBackendSelectDialog()
00117 {
00118 return (String) JOptionPane.showInputDialog(null, WizardTranslate
00119 .get("label.backend.select"), WizardTranslate
00120 .get("label.backend.select"), JOptionPane.QUESTION_MESSAGE, null,
00121 getDatabasesTypes(), null);
00122 }
00123 }