Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Contributing editor actions to specific place in the toolbar
Contributing editor actions to specific place in the toolbar [message #512915] Mon, 08 February 2010 10:59 Go to next message
blutkind  is currently offline blutkind Friend
Messages: 25
Registered: July 2009
Junior Member
Hi,

I have problems with placing editor contributions at specified place in the toolbar. Here is toolbar definition:

<menuContribution
locationURI="toolbar:org.eclipse.ui.main.toolbar">
<toolbar
id="toolbar.1file">
<command
commandId="de.ids.acos.et.client.app.commands.NewProject"
icon="icons/createNewModel.gif"
id="createnewmodel"
label="%NewProject.label"
style="push">
</command>
<command
commandId="de.ids.acos.et.client.app.commands.OpenProject"
icon="icons/open_project.gif"
id="openproject"
label="%OpenProject.label"
style="push">
</command>
<separator
name="additions">
</separator>
.....

And this is editor contribution:
<extension
point="org.eclipse.ui.editorActions">
<editorContribution
id="de.ids.acos.et.client.app.editorContribution"
targetID="de.ids.ctrlc.primary.ui.editors.GenericEditor">
<action
class="de.ids.acos.et.client.ui.eclipse.actions.EditorApplyAction "
definitionId="org.eclipse.ui.file.save"
icon="icons/disc.gif"
id="de.ids.acos.et.client.actions.EditorApplyAction"
label="%ApplyEditor.label"
menubarPath="file/seperator"
toolbarPath="toolbar.1file/additions"
tooltip="%ApplyEditor.label">
</action>
......
</editorContribution>
</extension>

As you can see, I'm trying to put EditorApply(save) action at the toolbar by specifying path 'toolbar1.file/additions'. The same action is contributed to the 'File' menu without problems, but doesn't appear in the toolbar at the specified path, rather showing to the right of all toolbars as a separate toolbar with editor contributed actions. I'm pretty sure I'm missing something, can you enlighten me?

Thanks in advance,
Stanislav
Re: Contributing editor actions to specific place in the toolbar [message #513006 is a reply to message #512915] Mon, 08 February 2010 14:54 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Editor actions in the coolbar must not be "merged" properly with any
contributions that exist there (AFAICT your toolbarPath looks correct).

I would open a bug at
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform &component=UI

You might be better served by using a command and a menuContribution
that has a visibleWhen:
<with variable="activeWEditorId">
<equals value="your.editor.id"/>
</with>

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:perform URL resource loading inside IElementUpdater.updateElement(UIElement, Map)
Next Topic:file format of .project
Goto Forum:
  


Current Time: Thu Dec 26 13:40:35 GMT 2024

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

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

Back to the top