/******************************************************************************* * Copyright (c) 2011 Softberries Krzysztof Grajek. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Softberries Krzysztof Grajek - initial API and implementation ******************************************************************************/ package com.softberries.klerk.commands; import java.util.HashMap; import java.util.Map; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.commands.IHandler; import org.eclipse.core.commands.IHandlerListener; import org.eclipse.ui.handlers.HandlerUtil; /** * Handles 'Exit' menu action * * @author krzysztof.grajek@softberries.com * */ public class ExitHandler implements IHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { HandlerUtil.getActiveWorkbenchWindow(event).close(); return null; } @Override public void addHandlerListener(IHandlerListener handlerListener) { } @Override public void dispose() { } @Override public boolean isEnabled() { //for now make it always enabled (and maybe forever) return true; } @Override public boolean isHandled() { //for now make it always return true return true; } @Override public void removeHandlerListener(IHandlerListener handlerListener) { } }