/** If the console view is hidden, it is put to the front and focus is set on it. */
  private void putConsoleToForeground() throws PartInitException {
    IWorkbench wb = PlatformUI.getWorkbench();
    IWorkbenchWindow win = wb.getActiveWorkbenchWindow();

    IWorkbenchPage page = win.getActivePage(); // obtain the active page
    String id = IConsoleConstants.ID_CONSOLE_VIEW;
    IConsoleView view = (IConsoleView) page.showView(id);
    view.display(console);
  }
 public static void show() {
   IWorkbench wb = PlatformUI.getWorkbench();
   IWorkbenchPage wbPage = wb.getActiveWorkbenchWindow().getActivePage();
   if (wbPage != null) {
     try {
       IConsoleView conView = (IConsoleView) wbPage.showView(IConsoleConstants.ID_CONSOLE_VIEW);
       conView.display(getRhinoConsole());
     } catch (PartInitException e) {
       PluginLogger.log("Console.show() - PartInitException: " + e.getMessage());
     }
   }
 }
Example #3
0
  private void showConsole(MessageConsole myConsole) {
    try {
      IConsoleView view;
      IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();

      String id = IConsoleConstants.ID_CONSOLE_VIEW;
      view = (IConsoleView) win.getActivePage().showView(id);
      view.display(myConsole);
    } catch (PartInitException e) {
      e.printStackTrace();
    }
  }
 public static void openARESConsole() {
   IConsole myConsole = getConsole();
   IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
   String id = IConsoleConstants.ID_CONSOLE_VIEW;
   IConsoleView view;
   try {
     view = (IConsoleView) page.showView(id, null, IWorkbenchPage.VIEW_CREATE);
     view.display(myConsole);
   } catch (PartInitException e) {
     e.printStackTrace();
   }
 }
Example #5
0
  private static void basicOpenConsole() {
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (window != null) {
      IWorkbenchPage page = window.getActivePage();
      if (page != null) {
        try {
          IConsole myConsole = findConsole(SQLPLUS_CONSOLE_VIEW);
          String id = IConsoleConstants.ID_CONSOLE_VIEW;
          IConsoleView view = (IConsoleView) page.showView(id);
          view.display(myConsole);

        } catch (PartInitException e) {
          ConsolePlugin.log(e);
        }
      }
    }
  }
 /*
  * (non-Javadoc)
  *
  * @see
  * org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener
  * #contextEvent
  * (org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
  */
 public void debugContextChanged(final DebugContextEvent event) {
   if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
     IProcess process = getProcess();
     if (fView != null && process != null && process.equals(DebugUITools.getCurrentProcess())) {
       fView.display(fConsole);
     }
   }
 }