Package org.erlide.ui.editors.erl.handlers

Source Code of org.erlide.ui.editors.erl.handlers.ToggleMarkOccurrencesHandler

package org.erlide.ui.editors.erl.handlers;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.ui.handlers.HandlerUtil;
import org.erlide.ui.internal.ErlideUIPlugin;

public class ToggleMarkOccurrencesHandler extends AbstractHandler {

    @Override
    public Object execute(final ExecutionEvent event) throws ExecutionException {
        final boolean oldValue = HandlerUtil.toggleCommandState(event.getCommand());
        final IEclipsePreferences prefsNode = ErlideUIPlugin.getPrefsNode();
        prefsNode.putBoolean("markingOccurences", !oldValue);
        return null;
    }

}
TOP

Related Classes of org.erlide.ui.editors.erl.handlers.ToggleMarkOccurrencesHandler

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.