/* | |
* Copyright (c) Robert Bosch GmbH. All rights reserved. | |
*/ | |
package org.eclipse.blockchain.ui.handlers; | |
import org.eclipse.blockchain.ui.preference.SolidityCompilerPreference; | |
import org.eclipse.core.commands.AbstractHandler; | |
import org.eclipse.core.commands.ExecutionEvent; | |
import org.eclipse.core.commands.ExecutionException; | |
import org.eclipse.jface.preference.PreferenceDialog; | |
import org.eclipse.swt.widgets.Display; | |
import org.eclipse.ui.IWorkbench; | |
import org.eclipse.ui.PlatformUI; | |
import org.eclipse.ui.dialogs.PreferencesUtil; | |
/** | |
* @author DMU1COB | |
*/ | |
public class SolidityCompilerPreferenceHandler extends AbstractHandler { | |
/** | |
* {@inheritDoc} | |
*/ | |
@Override | |
public Object execute(final ExecutionEvent event) throws ExecutionException { | |
Display.getDefault().asyncExec(() -> { | |
IWorkbench workbench = PlatformUI.getWorkbench(); | |
SolidityCompilerPreference page = new SolidityCompilerPreference(); | |
page.init(workbench); | |
PreferenceDialog dialog = | |
PreferencesUtil.createPreferenceDialogOn(workbench.getActiveWorkbenchWindow().getShell(), | |
"org.eclipse.blockchain.ui.solidity.compiler.preference", null, null); | |
dialog.open(); | |
}); | |
return null; | |
} | |
} |