Files
HeidiSQL/extra/jheidi/createDBDialog.ajl

48 lines
1.1 KiB
Plaintext

WindowContext parentContext = argObj("windowContext");
Dialog dlg = new Dialog((Frame)parentContext.get("/"), "createDBDialog", "Create Database");
WindowContext context = dlg.getWindowContext();
context.put("db", parentContext.get("db"));
dlg.events("createDBEvents");
dlg.tabLayout()
.insets(10, 10)
.icon("images/db.gif")
.text("Name:", 90)
.setTab()
.space(10)
.field("dbName", 200)
.setTab()
.nextRow()
.tab(1)
.text("Character Set:")
.tab(2)
.combo("charSets", new String[] {"Hi", "There"}, 200)
.nextRow()
.tab(1)
.text("Collation:")
.tab(2)
.combo("collations", new String[] {"hi"}, 200)
.nextRow()
.vspace(10)
.space(42)
.button("Ok", 110)
.space(10)
.button("Cancel", 110);
dlg.setDefaultButton((Button)context.get("/Ok"));
DB db = context.get("db");
DB.Result result = db.execute("show character set");
Combo combo = context.get("/charSets");
ComboUtils.populate(combo, result, 0);
combo.select("latin1");
dlg.visible();
return context.get("dlgResult");