Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [text] actionSetPartAssociations deprecated -> how to replace this with commands?
[text] actionSetPartAssociations deprecated -> how to replace this with commands? [message #892731] Fri, 29 June 2012 07:39 Go to next message
Eclipse UserFriend
Hi all,

I use org.eclipse.ui.actionSetPartAssociations to contribute the org.eclipse.ui.edit.text.actionSet.presentation to my custom text editor. This ensured that the 'Toggle block selection mode' and 'Show whitespace characters' toolbar buttons are shown when my editor is active.

This worked fine in Eclipse 3.7 (Indigo) and still seems to work in Eclipse 4.2 (Juno). However, it seems the extension point is now deprecated, and I should use the org.eclipse.ui.commands extension point instead. I could not find a replacement for the block selection mode action in the form of a block selection mode command, nor could I find a command variant of the action sets concept.

Is there a way to get rid of this warning by switching to commands, or are these actions not yet (re)implemented in the commands framework?

Thanks,
Dennis
Re: [text] actionSetPartAssociations deprecated -> how to replace this with commands? [message #983024 is a reply to message #892731] Tue, 13 November 2012 11:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi Dennis,
Did you find a solution ? I have the same problem.
For now I found no solution. (The best workaround I found is to associate org.eclipse.ui.edit.text.actionSet.presentation group to my perspective but I would like to link this to my editor like you)

Any idea ?
Re: [text] actionSetPartAssociations deprecated -> how to replace this with commands? [message #983901 is a reply to message #983024] Wed, 14 November 2012 03:32 Go to previous messageGo to next message
Eclipse UserFriend
No, I never found a solution that allows me to use commands.

Instead, I now have the following code in my text editor class:

    @Override
    public void init(IEditorSite site, IEditorInput input)
    throws PartInitException
    {
        // Perform normal initialization.
        super.init(site, input);

        // Show the 'presentation' action set with the 'Toggle Block Selection
        // Mode' and 'Show Whitespace Characters' actions.
        IWorkbenchPage page = site.getPage();
        page.showActionSet("org.eclipse.ui.edit.text.actionSet.presentation");
    }

which overrides org.eclipse.ui.texteditor.AbstractTextEditor.init(IEditorSite, IEditorInput).

One of the problems with this 'solution', is that I show the action set, but never hide it. As such, the buttons are now always visible in the toolbar. They are however disabled if the current editor (the one with the focus) does not support them.

It works good enough for me, although I would probably prefer a proper commands solution, if one were available.
Re: [text] actionSetPartAssociations deprecated -> how to replace this with commands? [message #984044 is a reply to message #983901] Wed, 14 November 2012 06:01 Go to previous message
Eclipse UserFriend
thx Denis
Previous Topic:"Toggle Source/Header" interferes with "Next Editor" in Juno
Next Topic:Question about Java intra-project build order
Goto Forum:
  


Current Time: Wed Jul 09 09:06:46 EDT 2025

Powered by FUDForum. Page generated in 0.04490 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top