Menu

#6 Create Script from popup

2.1
closed
None
fixed
ch.sahits.codegen.sql
minor
1.1.1
enhancement
2009-09-30
2009-07-15
Sahits GmbH
No

Provide the functionality in the popup menu of the table of the data source
explorer.

Discussion

  • Sahits GmbH

    Sahits GmbH - 2009-07-15
    • status changed from new to accepted

    Fragment by Brian Fitzpartick:
    Create a new IObjectActionDelegate class and reference it in your plug-in
    something like the following...
    The class might look like:

    package blah;

    import ...;
    public class MyAction implements IObjectActionDelegate {

    private ISelection mStashedSelection = null;

    /
    Constructor for Action1.
    /
    public MyAction() {
    super();
    }

    /
    @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
    /
    public void setActivePart(IAction action, IWorkbenchPart targetPart) {
    }

    /
    @see IActionDelegate#run(IAction)
    /
    public void run(IAction action) {
    if (mStashedSelection != null && !mStashedSelection.isEmpty()) {
    if (mStashedSelection instanceof IStructuredSelection) {
    IStructuredSelection ssel = (IStructuredSelection) mStashedSelection;
    if (ssel.getFirstElement() instanceof IConnectionProfile) {
    //do something
    }
    }
    }
    }
    public void selectionChanged(IAction action, ISelection selection) {
    mStashedSelection = selection;
    }
    }

    And then your extension point in your plugin.xml looks something like
    this:
    <extension
    point="org.eclipse.ui.popupMenus">
    <objectContribution
    objectClass="org.eclipse.datatools.connectivity.IConnectionProfile"
    id="my.action.contribution">
    <action
    label="My Action Label"
    class="my.action.class"
    menubarPath="slot3"
    enablesFor="1"
    id="my.action.id">
    </action>
    </objectContribution>
    </extension>

     
  • Sahits GmbH

    Sahits GmbH - 2009-09-30
    • status changed from accepted to closed
    • version set to 1.1.1
    • resolution set to fixed
    • milestone set to 2.1

    With [2527] this feature is implemented

     

    Related

    Commit: [r2527]


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.