blob: 275db130ae7b2e4ef5ea589fe83fc8d4ff0907b0 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2006, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* IBM - Initial API and implementation
*******************************************************************************/
package org.eclipse.ocl.examples.interpreter.console;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsoleFactory;
import org.eclipse.ui.console.IConsoleManager;
/**
* Console factory for the Interactive OCL console, to enable it on any
* editor that supports EObject selections.
*
* @author Christian W. Damus (cdamus)
*/
public class OCLConsoleFactory implements IConsoleFactory {
public void openConsole() {
OCLConsole console = OCLConsole.getInstance();
IConsoleManager mgr = ConsolePlugin.getDefault().getConsoleManager();
// must do this twice due to a bug in the Console API
mgr.showConsoleView(console);
mgr.showConsoleView(console);
}
}