1 11 package org.eclipse.ui.internal.console; 12 13 import org.eclipse.ui.IWorkbenchPage; 14 import org.eclipse.ui.IWorkbenchWindow; 15 import org.eclipse.ui.PartInitException; 16 import org.eclipse.ui.PlatformUI; 17 import org.eclipse.ui.console.ConsolePlugin; 18 import org.eclipse.ui.console.IConsoleConstants; 19 import org.eclipse.ui.console.IConsoleFactory; 20 21 public class ConsoleViewConsoleFactory implements IConsoleFactory { 22 23 int counter = 1; 24 25 30 public void openConsole() { 31 IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); 32 if (window != null) { 33 IWorkbenchPage page = window.getActivePage(); 34 if (page != null) { 35 try { 36 String secondaryId = "Console View #" + counter; page.showView(IConsoleConstants.ID_CONSOLE_VIEW, secondaryId, 1); 38 counter++; 39 } catch (PartInitException e) { 40 ConsolePlugin.log(e); 41 } 42 } 43 } 44 } 45 46 } 47 | Popular Tags |