mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
133 lines
5.1 KiB
Plaintext
133 lines
5.1 KiB
Plaintext
import com.rendion.editor.*;
|
|
|
|
HashObject profile = argObj("profile");
|
|
String vendor = arg("vendor");
|
|
Frame app = new Frame("mainWindow", "jHeidi [" + profile.get("name") + " - " + profile.get("user") + "@" + profile.get("host") + "]");
|
|
WindowContext context = app.getWindowContext();
|
|
context.put("profile", profile);
|
|
context.put("vendor", vendor);
|
|
|
|
app.events("mainWindowEventsOracle");
|
|
|
|
app.toolbarButtonInsets(100, 100, 100, 100);
|
|
|
|
//set up the menus
|
|
app.menu("&File").item("New Connection", "images/connect.gif").item("Close","images/disconnect.gif")
|
|
.item("separator", "Import Settings...", "Export Settings...", "separator").item("Exit","images/stop.gif");
|
|
app.menu("&Edit").item("Cut","images/cut.gif").item("Copy","images/copy.gif").item("Paste", "images/paste.gif");
|
|
app.menu("&Window").events("windowMenuEvents");
|
|
Menu help = app.menu("&Help");
|
|
help.events("helpMenuEvents").item("SQL Help", "images/helptopic.gif").item("separator", "Check For Updates", "separator", "Heidi SQL Website", "Downloads", "Support Forums", "Bug Tracker", "Feature Tracker",
|
|
"separator", "About");
|
|
|
|
app.toolbar("mainToolbar").events("mainWindowEventsOracle")
|
|
.button("New Connection", "images/connect.gif")
|
|
.button("Close", "images/disconnect.gif")
|
|
.separator()
|
|
.button("Cut", "images/cut.gif")
|
|
.button("Copy", "images/copy.gif")
|
|
.button("Paste", "images/paste.gif")
|
|
.button("Print", "images/print.gif")
|
|
.separator()
|
|
.button("Create Table", "images/table.gif")
|
|
.button("Drop Table", "images/deletetable.gif")
|
|
.separator()
|
|
.button("Refresh", "images/refresh.gif")
|
|
.separator()
|
|
.button("Help", "images/help.gif");
|
|
|
|
app.statusBar("statusBar", "Ready");
|
|
app.icon("images/heidi.png");
|
|
|
|
//set up the splitters and tabs
|
|
Split mainSplit = app.splitVertical("treeTabsOutput", 640);
|
|
mainSplit
|
|
.splitHorizontal("splitSchemaQuery", 300)
|
|
.tree("schemaTree")
|
|
.tabs("mainTabs");
|
|
|
|
Tree schemaTree = app.get("schemaTree");
|
|
schemaTree.events("schemaTreeEventsOracle");
|
|
|
|
Tabs consoleTabs = mainSplit.tabs("consoleTabs");
|
|
Panel consoleTab = consoleTabs.tab("SQL Log", LF.isWin? "images/vista/sqllog.gif" : "images/sqllog.gif")
|
|
.editor("outputWindow");
|
|
|
|
Tabs tabs = app.get("mainTabs");
|
|
Panel host = tabs.tab("Instance", LF.isWin? "images/vista/instance.gif" : "images/instance.gif");
|
|
host.toolbar("toolbar", 32)
|
|
.text("banner", "Oracle version etc")
|
|
.horizontalGlue();
|
|
|
|
Tabs hostTabs = host.tabs("tabs");
|
|
hostTabs.tab("Variables").table("table", new String[] {"\t"}, new String[][] {{""}});
|
|
|
|
Panel dbTab = tabs.tab("Schema", "images/schema.gif");
|
|
dbTab.toolbar("toolbar", 32)
|
|
.text("banner", "No schema selected")
|
|
.horizontalGlue();
|
|
dbTab.table("table", new String[] {"\t"}, new String[][] {{""}});
|
|
|
|
Panel tableTab = tabs.tab("Table", "images/table.gif");
|
|
tableTab.toolbar("toolbar", 32).events("tableToolbarEvents")
|
|
.text("banner", "No table selected")
|
|
.horizontalGlue()
|
|
.button("New Field", "images/newfield.gif")
|
|
.button("Edit Field", "images/editfield.gif")
|
|
.button("Delete Field", "images/deletefield.gif")
|
|
.button("Manage Indexes", "images/manageindexes.gif");
|
|
tableTab.table("table", new String[] {"\t"}, new String[][] {{""}});
|
|
|
|
Panel dataTab = tabs.tab("Data", "images/data.gif");
|
|
dataTab.toolbar("toolbar", 32)
|
|
.text("banner", "No table selected")
|
|
.horizontalGlue();
|
|
dataTab.table("table", new String[] {"\t"}, new String[][] {{""}});
|
|
|
|
((Table)dataTab.get("table")).setColumnSelectionAllowed(true);
|
|
|
|
Panel queryTab = tabs.tab("Query", "images/query.gif");
|
|
queryTab.toolbar("toolbar").events("queryToolbarEvents")
|
|
.text("banner", "SQL query for " + profile.get("user") + "@" + profile.get("host"))
|
|
.horizontalGlue()
|
|
.button("Run", "images/run.gif")
|
|
.button("Run Selection", "images/runselection.gif")
|
|
.button("Stop", "images/stop.gif")
|
|
.separator()
|
|
.button("Search", "images/search.gif")
|
|
.button("Clear", "images/clear.gif")
|
|
.separator()
|
|
.button("Open Script", "images/folder.gif")
|
|
.button("Save", "images/save.gif")
|
|
.button("Save As", "images/saveas.gif");
|
|
|
|
queryTab.splitVertical("queryResults", 180)
|
|
.editor("editor")
|
|
.table("results", new String[] {"\t"}, new String[][] {{""}});
|
|
|
|
((Table)queryTab.get("results")).setColumnSelectionAllowed(true);
|
|
|
|
AjlEditor editor = consoleTab.get("outputWindow");
|
|
editor.setEditable(false);
|
|
|
|
app.maximize();
|
|
app.visible();
|
|
|
|
DB conn = argObj("db");
|
|
DB db = new SQLLoggingDB(conn, editor);
|
|
db.useCache(true);
|
|
context.put("db", db);
|
|
context.put("vendor", vendor);
|
|
|
|
args().put("windowContext", context);
|
|
Worker w = worker("initTreeOracleWorker", args());
|
|
LongRunningTask.detect("initTreeOracleWorker", "progressWaiter", args(), w , 250);
|
|
w = worker("loadHostInfoOracleWorker", args());
|
|
LongRunningTask.detect("loadHostInfoOracleWorker", "progressWaiter", args(), w , 250);
|
|
script("initWireEvents$oracle", args());
|
|
script("addToWindowMenu", args());
|
|
|
|
|
|
|
|
|