mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
63 lines
1.4 KiB
Plaintext
63 lines
1.4 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("help '" + itemName + "'");
|
|
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");
|
|
helpText.setText(item.get("description"));
|
|
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();
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|