Eclipse Rcp4.1
-
Upload
sanjay-shah -
Category
Documents
-
view
686 -
download
1
Transcript of Eclipse Rcp4.1
Adding action to view toolbar
Adding pulldown menu to view
Q/A ?
2
Go to the Projects Manifest.MF file
Select the extensions tab and add “viewActions” extension .
Right click and from context menu select
viewerContribution and in targetID provide the id of view where contribution is to be made.
Add new action to the contribution from contextmenu.
Override run method of the Action class which
Implements IViewActionDelegate
3
4
5
6
7
8
public class ProfileViewActionDelegate implements IViewActionDelegate{
public void init(IViewPart view) {
// TODO Auto-generated method stub
}
@Override
public void run(IAction action) {
}
@Override
public void selectionChanged(IAction action, ISelection selection) {
// TODO Auto-generated method stub
}
}
9
public void run(IAction action) {
// TODO Auto-generated method stub
MessageBox box = new MessageBox(view.getSite().getShell(),SWT.ICON_INFORMATION);
box.setMessage("Hello! You clicked view action!");
box.open();
}
10
11
12
13
14
15
16
Demo & Hands On
17
Q/A?
18