View Javadoc

1   package org.catacomb.druid.dialog;
2   
3   import org.catacomb.druid.gui.base.DruInfoPanel;
4   import org.catacomb.interlish.annotation.Editable;
5   import org.catacomb.interlish.annotation.IOPoint;
6   import org.catacomb.interlish.content.StringValue;
7   
8   
9   
10  public class NamingDialogController extends DialogController {
11  
12      @Editable(xid="nameTF")
13      public StringValue nameSV;
14  
15      @IOPoint(xid="info")
16      public DruInfoPanel infoPanel;
17  
18      String returnValue;
19  
20  
21      public NamingDialogController() {
22          super();
23          nameSV = new StringValue("");
24      }
25  
26  
27  
28      public void OK() {
29          returnValue = nameSV.getString();
30          hideDialog();
31      }
32  
33      public void cancel() {
34          returnValue = null;
35          hideDialog();
36      }
37  
38  
39      public String getNewName(int[] xy, String msg, String initValue) {
40          checkInit();
41          returnValue = null;
42          nameSV.reportableSetString(initValue, this);
43          infoPanel.showInfo(msg);
44          infoPanel.revalidate();
45          showModalAt(xy[0], xy[1]);
46  
47          return returnValue;
48      }
49  
50  }