Invoke an extension based worksheet text
craibuc opened this issue · comments
I'd like to create an extension that could receive input from text selected in a query worksheet.
Usage-case:
- a table name is selected; the extension is invoked via a context menu; the selected text is passed to the extension; the text is assigned to an argument (e.g.
#0#
); the extension processes another query (e.g.SELECT ... FROM ... WHERE table_name = '#0#'
) and returns a grid of values
Does the JDeveloper-SDK extension offer this level of control? If so, is there an example of this usage case?
Hi Craig,
I think this can be done sewing a couple of things together.
The first is something like the ContextMenuAction
<https://github.com/oracle/oracle-db-examples/tree/master/sqldeveloper/extension/java/ContextMenuAction>
example to recognize a worksheet, grab the selected text, and compose
the query for a grid.
The second is to open a grid display for that query
I'm on vacation until the end of next week but I'll try to take a look
at this tomorrow.
…-Brian.
On 8/28/2017 1:21 PM, Craig Buchanan wrote:
I'd like to create an extension that could receive input from text
selected in a query worksheet.
Usage-case:
* a table name is selected; the extension is invoked via a context
menu; the selected text is passed to the extension; the text is
assigned to an argument (e.g. |#0#|); the extension processes
another query (e.g. |SELECT ... FROM ... WHERE table_name =
'#0#'|) and returns a grid of values
Does the JDeveloper-SDK extension offer this level of control? If so,
is there an example of this usage case?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_oracle_oracle-2Ddb-2Dexamples_issues_19&d=DwMCaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=VtLxf_yHZYkv4NwnwKHPIS3_BlIqgYZIzJz105wjZs0&m=WkJPVkX7OiKBmPYn9nyCQxRlBc9dXlOGiVxPncKGmPo&s=HiUvdADwUKK5oVC3uMDc7BqywwexhWKTBq9F34KHZ_0&e=>,
or mute the thread
<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AXTgxlgipRRAJsy-2DBa6-2DPR7hxNVBG9izks5scvcZgaJpZM4PEzyu&d=DwMCaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=VtLxf_yHZYkv4NwnwKHPIS3_BlIqgYZIzJz105wjZs0&m=WkJPVkX7OiKBmPYn9nyCQxRlBc9dXlOGiVxPncKGmPo&s=24d2akS7uuDNxLIppjmnbCLXxBdEGSY5IGZjGUvzs5Q&e=>.
Hi Craig,
From your post, it appears the query is static aside from the object
indicated by the text selection. Another idea would be to create an
object viewer similar to the DependencyViewerExample
<https://github.com/oracle/oracle-db-examples/blob/master/sqldeveloper/extension/xml/individual/DependencyViewerExample.xml>
for whatever object types are of interest. This would be much easier
than creating an extension that has to determine if the selected text is
a recognizable object & fire a custom viewer on. XML based extensions
have a number of distribution / integration methods
<https://github.com/oracle/oracle-db-examples/tree/master/sqldeveloper/extension/xml>
which allow development and testing with much less overhead than a
custom java extension.
If you care to share more details on what you are specifically trying to
accomplish (either here or in private mail), I would be happy to help
further.
…-Brian.
On 8/30/2017 9:10 PM, Brian Jeffries wrote:
Hi Craig,
I think this can be done sewing a couple of things together.
The first is something like the ContextMenuAction
<https://github.com/oracle/oracle-db-examples/tree/master/sqldeveloper/extension/java/ContextMenuAction>
example to recognize a worksheet, grab the selected text, and compose
the query for a grid.
The second is to open a grid display for that query
I'm on vacation until the end of next week but I'll try to take a look
at this tomorrow.
-Brian.
On 8/28/2017 1:21 PM, Craig Buchanan wrote:
>
> I'd like to create an extension that could receive input from text
> selected in a query worksheet.
>
> Usage-case:
>
> * a table name is selected; the extension is invoked via a context
> menu; the selected text is passed to the extension; the text is
> assigned to an argument (e.g. |#0#|); the extension processes
> another query (e.g. |SELECT ... FROM ... WHERE table_name =
> '#0#'|) and returns a grid of values
>
> Does the JDeveloper-SDK extension offer this level of control? If so,
> is there an example of this usage case?
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_oracle_oracle-2Ddb-2Dexamples_issues_19&d=DwMCaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=VtLxf_yHZYkv4NwnwKHPIS3_BlIqgYZIzJz105wjZs0&m=WkJPVkX7OiKBmPYn9nyCQxRlBc9dXlOGiVxPncKGmPo&s=HiUvdADwUKK5oVC3uMDc7BqywwexhWKTBq9F34KHZ_0&e=>,
> or mute the thread
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AXTgxlgipRRAJsy-2DBa6-2DPR7hxNVBG9izks5scvcZgaJpZM4PEzyu&d=DwMCaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=VtLxf_yHZYkv4NwnwKHPIS3_BlIqgYZIzJz105wjZs0&m=WkJPVkX7OiKBmPYn9nyCQxRlBc9dXlOGiVxPncKGmPo&s=24d2akS7uuDNxLIppjmnbCLXxBdEGSY5IGZjGUvzs5Q&e=>.
>
@bjeffrie, can we close this issue or is there still something outstanding?
I guess I expected the person posing the issue to close it but it's been 6+ months.