Eclipse Rcp4.1

18
1 Sanjay Shah Email:[email protected]

Transcript of Eclipse Rcp4.1

Page 1: Eclipse Rcp4.1

1

Sanjay Shah

Email:[email protected]

Page 2: Eclipse Rcp4.1

Adding action to view toolbar

Adding pulldown menu to view

Q/A ?

2

Page 3: Eclipse Rcp4.1

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

Page 4: Eclipse Rcp4.1

4

Page 5: Eclipse Rcp4.1

5

Page 6: Eclipse Rcp4.1

6

Page 7: Eclipse Rcp4.1

7

Page 8: Eclipse Rcp4.1

8

Page 9: Eclipse Rcp4.1

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

Page 10: Eclipse Rcp4.1

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

Page 11: Eclipse Rcp4.1

11

Page 12: Eclipse Rcp4.1

12

Page 13: Eclipse Rcp4.1

13

Page 14: Eclipse Rcp4.1

14

Page 15: Eclipse Rcp4.1

15

Page 16: Eclipse Rcp4.1

16

Page 17: Eclipse Rcp4.1

Demo & Hands On

17

Page 18: Eclipse Rcp4.1

Q/A?

18