1
19 package com.qasystems.qstudio.java.gui.dialog;
20
21 import com.qasystems.international.MessageResource;
22 import com.qasystems.qstudio.java.classloader.Trier;
23 import com.qasystems.swing.ButtonDialog;
24
25 import java.awt.Dialog;
26 import java.awt.Frame;
27
28 import javax.swing.JComboBox;
29
30
33 public class DebugLevelDialog extends ButtonDialog {
34 public static final int OK = 0;
35 public static final int CANCEL = 1;
36 private JComboBox BOX = new JComboBox();
37
38
41 public DebugLevelDialog(Frame parent) {
42 super(parent);
43 init();
44 }
45
46
49 public DebugLevelDialog(Dialog parent) {
50 super(parent);
51 init();
52 }
53
54 private void init() {
55 final MessageResource resources = MessageResource.getClientInstance();
56 setTitle(resources.getString("WINDOWTITLE_025"));
57 setButtons(
58 new String[] {
59 resources.getString("BUTTON_005"), resources.getString("BUTTON_001")
60 }
61 );
62 BOX.addItem(resources.getString("COMBOBOX_004"));
63 BOX.addItem(resources.getString("COMBOBOX_005"));
64 BOX.addItem(resources.getString("COMBOBOX_006"));
65 BOX.addItem(resources.getString("COMBOBOX_007"));
66 BOX.setSelectedIndex(Trier.getDefaultDebugLevel());
67 setContent(BOX);
68 pack();
69 }
70
71 protected void onActionPerformed(int action) {
72 if (action == CANCEL) {
73 dispose();
74 } else if (action == OK) {
75 Trier.setDefaultDebugLevel(BOX.getSelectedIndex());
76 dispose();
77 } else {
78 }
80 }
81 }
82