Guest User

Untitled

a guest
May 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. public DynamicToggleButton() {
  2. super("de.hpi3d.tracing.ui.dynamicToggleButton");
  3. comServ = (ICommandService) PlatformUI.getWorkbench()
  4. .getService(ICommandService.class);
  5. contextServ = (IContextService) PlatformUI
  6. .getWorkbench().getService(IContextService.class);
  7. ContextHelper.addListener(new ITracingContextListener() {
  8.  
  9. public void handleEvent(TracingContextEvent event) {
  10. Type type = event.getType();
  11. if (type.equals(Type.TOGGLETRACING) || type.equals(Type.DEBUGGINGSESSION)) {
  12. update();
  13. }
  14. }
  15. });
  16. }
  17.  
  18. public void fill(ToolBar bar, int index) {
  19. item = new ToolItem(bar, SWT.PUSH);
  20. com = comServ.getCommand(TOGGLETRACINGCOMMANDID);
  21. update();
  22.  
  23. item.addListener(SWT.Selection, new Listener() {
  24. public void handleEvent(Event event) {
  25. new ToggleTracingCommandUtils().toggleToggleTracingCommand();
  26. update();
  27. }
  28. });
  29.  
  30. }
Add Comment
Please, Sign In to add comment