JAL-1807 includes ?j2sdebug flag and DebugJS._(msg)
[jalviewjs.git] / bin / jalview / appletgui / EditNameDialog.js
1 Clazz.declarePackage ("jalview.appletgui");
2 Clazz.load (["jalview.appletgui.JVDialog"], "jalview.appletgui.EditNameDialog", ["awt2swing.Label", "$.Panel", "$.TextField", "java.awt.BorderLayout", "$.Font"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.id = null;
5 this.description = null;
6 Clazz.instantialize (this, arguments);
7 }, jalview.appletgui, "EditNameDialog", jalview.appletgui.JVDialog);
8 Clazz.overrideMethod (c$, "getName", 
9 function () {
10 return this.id.getText ();
11 });
12 Clazz.defineMethod (c$, "getDescription", 
13 function () {
14 if (this.description.getText ().length < 1) {
15 return null;
16 } else {
17 return this.description.getText ();
18 }});
19 Clazz.makeConstructor (c$, 
20 function (name, desc, label1, label2, owner, title, width, height, display) {
21 Clazz.superConstructor (this, jalview.appletgui.EditNameDialog, [owner, title, true, width, height]);
22 var mono =  new java.awt.Font ("Monospaced", 0, 12);
23 var panel =  new awt2swing.Panel ( new java.awt.BorderLayout ());
24 var panel2 =  new awt2swing.Panel ( new java.awt.BorderLayout ());
25 this.id =  new awt2swing.TextField (name, 40);
26 this.id.setFont (mono);
27 var label =  new awt2swing.Label (label1);
28 label.setFont (mono);
29 panel2.add (label, "West");
30 panel2.add (this.id, "Center");
31 panel.add (panel2, "North");
32 if (label2 != null) {
33 panel2 =  new awt2swing.Panel ( new java.awt.BorderLayout ());
34 this.description =  new awt2swing.TextField (desc, 40);
35 this.description.setFont (mono);
36 label =  new awt2swing.Label (label2);
37 label.setFont (mono);
38 panel2.add (label, "West");
39 panel2.add (this.description, "Center");
40 panel.add (panel2, "Center");
41 }this.setMainPanel (panel);
42 this.setVisible (display);
43 }, "~S,~S,~S,~S,awt2swing.Frame,~S,~N,~N,~B");
44 });