Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Add button to Console toolbar(How to add a button to the Console toolbar.)
Add button to Console toolbar [message #1279202] Fri, 28 March 2014 11:37 Go to next message
Peter Robertson is currently offline Peter RobertsonFriend
Messages: 16
Registered: April 2012
Location: Scotland
Junior Member
I wish to add a button to an application's Console toolbar.

Putting the following in the relevant plugin.xml successfully puts a working button on the Console toolbar:

<extension point="org.eclipse.ui.viewActions">
      <action label="Expand"

However, the extension point, viewContribution, and action are marked as deprecated.

I have tried to get the same effect using the extension point org.eclipse.ui.commands (as indicated in the deprecated message) like this,
where expand.button has been defined as a command:

<extension point="org.eclipse.ui.menus">
   <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar">
      <toolbar id="toolbar1">
         <command commandId="expand.button"/>
   <menuContribution locationURI="toolbar:org.eclipse.ui.console.ConsoleView">
      <toolbar id="toolbar2">
         <command commandId="expand.button"/> 

This correctly puts a working 'expand' button on the main toolbar, but one does not appear on the Console toolbar.

Can anyone suggest what is wrong with this?
Re: Add button to Console toolbar [message #1313376 is a reply to message #1279202] Thu, 24 April 2014 21:27 Go to previous message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 463
Registered: July 2009
Senior Member

Hi Peter,

You cannot put a toolbar in the toolbar of a view. Put a command directly on the view toolbar like so:

<menuContribution locationURI="toolbar:org.eclipse.ui.console.ConsoleView">
<command commandId="expand.button"/>


Previous Topic:Eclipse 4 contributions to the IDE
Next Topic:Persist selection on tree viewer on restart of application using memento
Goto Forum:

Current Time: Sat Jul 24 01:28:40 GMT 2021

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

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

Back to the top