Created
April 30, 2010 12:45
-
-
Save GarstgerUnhold/385137 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment