mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
72 lines
1.7 KiB
Plaintext
72 lines
1.7 KiB
Plaintext
|
|
String event = arg("source");
|
|
NodeInfo node = argObj("node");
|
|
WindowContext context = argObj("windowContext");
|
|
|
|
log.debug("event received: " + event);
|
|
|
|
if ( node != null )
|
|
{
|
|
String nodeType = node.getType();
|
|
log.debug("node type = " + nodeType);
|
|
if ( "helpitem".equals(nodeType) )
|
|
{
|
|
String itemName = node.getText();
|
|
log.debug("itemName: " + itemName + " clicked");
|
|
|
|
DB db = context.get("db");
|
|
DB.Result items = db.execute("select info from system.help where topic=upper('" + itemName + "') and seq > 4 order by seq");
|
|
if ( !items.isEmpty() )
|
|
{
|
|
HashObject item = items.first();
|
|
((Text)context.get("/No Topic Selected")).setText(itemName);
|
|
TextArea helpText = context.get("/helpText");
|
|
TextArea exampleText = context.get("/exampleText");
|
|
String itemText = "";
|
|
for (HashObject h: items)
|
|
{
|
|
if ( h.get("info") != null )
|
|
itemText+=h.get("info") + "\n";
|
|
else
|
|
itemText+="\n";
|
|
}
|
|
|
|
helpText.setText(itemText);
|
|
helpText.setCaretPosition(0);
|
|
//exampleText.setText(item.get("example"));
|
|
//exampleText.setCaretPosition(0);
|
|
}
|
|
}
|
|
}
|
|
else if ( event == "Search MySQL" )
|
|
{
|
|
String query = ((Text)context.get("/No Topic Selected")).getText();
|
|
query = "No Topic Selected".equals(query) ? "" : query.replace(" ", "+");
|
|
|
|
BareBonesBrowserLaunch.openURL("http://dev.mysql.com/doc/mysql/search.php?version=5.1&q=" + query + "&lang=en");
|
|
}
|
|
else if ( event == "Close" )
|
|
{
|
|
Dialog d = context.get("/");
|
|
d.dispose();
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|