The first step is to add the toolbar icons, which are the informational icons in the top right. In the original implementation, these were direct Action
elements inserted into a ToolBar
, which is part of the Eclipse 3.x interface. To achieve this with Eclipse 4.x, models using MDirectToolItem
will be created and added to an MToolBar
.
Create a
private
methodcreateToolBar
in theSampleView
class. Add a call to the bottom of thecreatePartControl
method to ensure that it is called at view creation time.Inside the
createToolBar
method, create an instance of anMDirectToolItem
object using theMMenuFactory.INSTANCE.createDirectToolItem()
expression. It may be necessary to follow the quick-fix to addorg.eclipse.e4.ui.model.workbench
to allow the automatic import to find the class. Assign it to a local variableone
.Add a tooltip
Action 1 tooltip
by callingone.setTooltip()
.To show the informational icon, a
platform
URI must be created. This uses the fully qualified...