blob: 09b4471ff6f4b9abb9ec99a11e174a284b9dc239 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2010, 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
* E.D.Willink - rework of LPG OCL Console for Xtext
*******************************************************************************/
package org.eclipse.ocl.examples.xtext.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 {
@Override
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);
}
}