Re: Database Explorer: custom shortcut or action

Benno Markiewicz <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <CAA_aP4jEjfdeNrGqnA45Eu_AA2gfazCyUQgvPLvgtzATuwb5PA@mail.gmail.com>
Hej Kovi,

> I don't know how to register a keyboard shortcut for an action that
Database Explorer provides. Action is called "Execute Command" and it opens
an SQL Editor.

Register it via layer.xml

I documented it at http://wiki.netbeans.org/DevFaqAddShortCutForAction


> if I create my own action and put a keyboard shortcut on it I don't know
how to open the SQL Editor. I imagine it is done via SQLEditorSupport
class, but the package that this class is in seens to be private.

here it is the action
http://hg.netbeans.org/core-main/file/tip/db/src/org/netbeans/modules/db/explorer/action/ExecuteCommandAction.java

At http://wiki.netbeans.org/DevFaqInvokeActionProgrammatically you will
find several ways to invoke the action. Make sure to provide correct
objects in the lookup. See the source code above.

With kind regards, markiewb

2016-08-05 15:43 GMT+02:00 Gregor Kovač <[email protected]>:

> Hi!
>
> I'm creating an application that uses Database Explorer functionality to
> register database drivers, connections, ...
> I have two problems with it:
> - I don't know how to register a keyboard shortcut for an action that
> Database Explorer provides. Action is called "Execute Command" and it opens
> an SQL Editor.
> - if I create my own action and put a keyboard shortcut on it I don't know
> how to open the SQL Editor. I imagine it is done via SQLEditorSupport
> class, but the package that this class is in seens to be private.
>
> Best regards,
>     Kovi
>
> --
> -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
> |  In A World Without Fences Who Needs Gates?  |
> |              Experience Linux.               |
> -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.