use of org.eclipse.core.commands.Command in project yamcs-studio by yamcs.
the class ScrollLockHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchPart part = HandlerUtil.getActivePartChecked(event);
EventLogView view = (EventLogView) part;
ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
Command command = service.getCommand(EventLog.CMD_SCROLL_LOCK);
boolean oldState = HandlerUtil.toggleCommandState(command);
view.getEventLog().enableScrollLock(!oldState);
return null;
}
Aggregations