Files
HeidiSQL/extra/jheidi/resetTabsMySQL.ajl

46 lines
1.2 KiB
Plaintext

import javax.swing.table.*;
WindowContext context = argObj("windowContext");
HashObject profile = context.get("profile");
Text banner = null;
Table table = null;
if ( "Host".equals(arg("selectedTab")) )
{
banner = context.get("/mainTabs/Database/toolbar/banner");
banner.setText("No database selected");
table = context.get("/mainTabs/Database/table");
table.clear();
banner = context.get("/mainTabs/Query/toolbar/banner");
banner.setText("SQL query on " + profile.get("user") + "@" + profile.get("host"));
}
else
{
banner = context.get("/mainTabs/Query/toolbar/banner");
banner.setText("SQL query on database: " + context.get("currentDB"));
}
banner = context.get("/mainTabs/Table/toolbar/banner");
banner.setText("No table selected");
table = context.get("/mainTabs/Table/table");
table.clear();
banner = context.get("/mainTabs/Data/toolbar/banner");
banner.setText("No table selected");
table = context.get("/mainTabs/Data/table");
table.clear();
ToolbarButton btn = context.get("/mainTabs/Table/toolbar/New Field");
btn.setEnabled(false);
btn = context.get("/mainTabs/Table/toolbar/Manage Indexes");
btn.setEnabled(false);