/*
 * Perfclispe
 * 
 * 
 * Copyright (c) 2013 Jakub Knetl
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.perfclipse.ui;

import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.MessageConsole;

public class Utils {

	public static final String PERFCLIPSE_STDOUT_CONSOLE = "Perfclipse standard output:";

	/**
	 * Find eclipse console with given name. If not found then create new
	 * console with given name and append it to console view.
	 * @param name name of console
	 * @return console with given name
	 */
	public static MessageConsole findConsole(String name){
		ConsolePlugin plugin = ConsolePlugin.getDefault();
		IConsoleManager consoleManager = plugin.getConsoleManager();
		IConsole[] existing = consoleManager.getConsoles();
		for (IConsole console: existing){
			if (name.equals(console.getName())){
				return (MessageConsole) console;
			}
		}
		
		//Console was not found. Create new one.
		MessageConsole newConsole = new MessageConsole(PERFCLIPSE_STDOUT_CONSOLE, null);
		consoleManager.addConsoles(new IConsole[]{newConsole});
		return newConsole;
		
	}
}

@@ -643,16 +643,175 @@
 se.ui;%0A%0A
+import org.eclipse.jface.wizard.IWizard;%0Aimport org.eclipse.jface.wizard.WizardDialog;%0Aimport org.eclipse.swt.widgets.Shell;%0Aimport org.eclipse.ui.PlatformUI;%0A
 import o
@@ -1861,10 +1861,329 @@
 ;%0A%09%09%0A%09%7D%0A
+%09%0A%09/**%0A%09 * Shows wizard wrapped as WizardDialog.%0A%09 * @return Return value of dialog.open()%0A%09 */%0A%09%0A%09public static int showWizardDialog(IWizard wizard)%7B%0A%09%09Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();%0A%09%09WizardDialog dialog = new WizardDialog(shell, wizard);%0A%09%09%0A%09%09return dialog.open();%0A%09%7D%0A
 %7D%0A

Add ShowWizardDialog method