Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public DynamicToggleButton() {
- super("de.hpi3d.tracing.ui.dynamicToggleButton");
- comServ = (ICommandService) PlatformUI.getWorkbench()
- .getService(ICommandService.class);
- contextServ = (IContextService) PlatformUI
- .getWorkbench().getService(IContextService.class);
- ContextHelper.addListener(new ITracingContextListener() {
- public void handleEvent(TracingContextEvent event) {
- Type type = event.getType();
- if (type.equals(Type.TOGGLETRACING) || type.equals(Type.DEBUGGINGSESSION)) {
- update();
- }
- }
- });
- }
- public void fill(ToolBar bar, int index) {
- item = new ToolItem(bar, SWT.PUSH);
- com = comServ.getCommand(TOGGLETRACINGCOMMANDID);
- update();
- item.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- new ToggleTracingCommandUtils().toggleToggleTracingCommand();
- update();
- }
- });
- }
Add Comment
Please, Sign In to add comment