View Javadoc

1   package org.catacomb.druid.dialog;
2   
3   import org.catacomb.druid.gui.base.DruInfoPanel;
4   import org.catacomb.druid.gui.edit.DruButton;
5   import org.catacomb.interlish.annotation.IOPoint;
6   import org.catacomb.report.E;
7   
8   
9   public class QuestionDialogController extends DialogController {
10  
11      @IOPoint(xid="message")
12      public DruInfoPanel infoPanel;
13  
14  
15      @IOPoint(xid="but1")
16      public DruButton but1;
17  
18      @IOPoint(xid="but2")
19      public DruButton but2;
20  
21      @IOPoint(xid="but3")
22      public DruButton but3;
23  
24      int retval;
25  
26  
27  
28      public void button1() {
29          retval = 0;
30          hideDialog();
31      }
32  
33  
34      public void button2() {
35          retval = 1;
36          hideDialog();
37      }
38  
39  
40      public void button3() {
41          retval = 2;
42          hideDialog();
43      }
44  
45  
46  
47  
48      public int getResponse(String msg, String[] aa) {
49          checkInit();
50          retval = -1;
51  
52          if (aa.length == 3) {
53              but1.setLabelText(aa[0]);
54              but2.setLabelText(aa[1]);
55              but3.setLabelText(aa[2]);
56  
57          } else {
58              E.error("only handle 3 responses as yet!!!");
59          }
60          infoPanel.setReplaceMode();
61          infoPanel.showInfo(msg);
62          infoPanel.revalidate();
63          showModalAt(400, 300);
64  
65          return retval;
66      }
67  
68  
69  }