Package org.eclipse.ui.console

Examples of org.eclipse.ui.console.IConsole


      public Object[] getPages() {
        return getConsoleManager().getConsoles();
      }
     
      public int getCurrentPageIndex() {
        IConsole currentConsole= getConsole();
        IConsole[] consoles= getConsoleManager().getConsoles();
        for (int i= 0; i < consoles.length; i++) {
          if (consoles[i].equals(currentConsole))
            return i;
        }
View Full Code Here


  }
 
    public Object getAdapter(Class key) {
        Object adpater = super.getAdapter(key);
        if (adpater == null) {
            IConsole console = getConsole();
            if (console != null) {
                ListenerList listeners = getParticipants(console);
                // an adapter can be asked for before the console participants are created
                if (listeners != null) {
                  Object[] participants = listeners.getListeners();
View Full Code Here

   */
  protected void showPageRec(PageRec pageRec) {
        // don't show the page when pinned, unless this is the first console to be added
        // or its the default page
        if (fActiveConsole != null && pageRec.page != getDefaultPage() && fPinned && fConsoleToPart.size() > 1) {
            IConsole console = (IConsole)fPartToConsole.get(pageRec.part);
            if (!fStack.contains(console)) {
                fStack.add(console);
            }
            return;
        }
       
        IConsole recConsole = (IConsole)fPartToConsole.get(pageRec.part);
        if (recConsole!=null && recConsole.equals(fActiveConsole)) {
            return;
        }
       
      super.showPageRec(pageRec);
      fActiveConsole = recConsole;
      IConsole tos = null;
      if (!fStack.isEmpty()) {
          tos = (IConsole) fStack.get(0);
      }
      if (tos != null && !tos.equals(fActiveConsole) && fActive) {
          deactivateParticipants(tos);
      }
      if (fActiveConsole != null && !fActiveConsole.equals(tos)) {
          fStack.remove(fActiveConsole);
          fStack.add(0,fActiveConsole);
View Full Code Here

  /**
   * Updates the view title based on the active console
   */
    protected void updateTitle() {
        IConsole console = getConsole();
        if (console == null) {
            setContentDescription(ConsoleMessages.ConsoleView_0);
        } else {
            String newName = console.getName();
            String oldName = getContentDescription();
            if (newName!=null && !(newName.equals(oldName))) {
                setContentDescription(console.getName());
            }
        }
    }
View Full Code Here

            }
        }
    }
   
    protected void updateHelp() {
      IConsole console = getConsole();
      String helpContextId = null;
    if (console instanceof AbstractConsole) {
      AbstractConsole abs = (AbstractConsole) console;
      helpContextId = abs.getHelpContextId();
    }
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.ui.part.PageBookView#doDestroyPage(org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.part.PageBookView.PageRec)
   */
  protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
      IConsole console = (IConsole)fPartToConsole.get(part);
     
    // dispose page participants
    ListenerList listeners = (ListenerList) fConsoleToPageParticipants.remove(console);
    if (listeners != null) {
      Object[] participants = listeners.getListeners();
      for (int i = 0; i < participants.length; i++) {
              final IConsolePageParticipant participant = (IConsolePageParticipant) participants[i];
              SafeRunner.run(new ISafeRunnable() {
          public void run() throws Exception {
            participant.dispose();
          }
          public void handleException(Throwable exception) {
            ConsolePlugin.log(exception);
          }
        });
          }
    }

    IPage page = pageRecord.page;
    page.dispose();
    pageRecord.dispose();
    console.removePropertyChangeListener(this);
           
    // empty cross-reference cache
    fPartToConsole.remove(part);
    fConsoleToPart.remove(console);
        if (fPartToConsole.isEmpty()) {
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.ui.part.PageBookView#doCreatePage(org.eclipse.ui.IWorkbenchPart)
   */
  protected PageRec doCreatePage(IWorkbenchPart dummyPart) {
    ConsoleWorkbenchPart part = (ConsoleWorkbenchPart)dummyPart;
    final IConsole console = part.getConsole();
    final IPageBookViewPage page = console.createPage(this);
    initPage(page);
    page.createControl(getPageBook());
    console.addPropertyChangeListener(this);
   
    // initialize page participants
    IConsolePageParticipant[] consoleParticipants = ((ConsoleManager)getConsoleManager()).getPageParticipants(console);
    final ListenerList participants = new ListenerList();
    for (int i = 0; i < consoleParticipants.length; i++) {
View Full Code Here

    if (isAvailable()) {
      Runnable r = new Runnable() {
        public void run() {
          for (int i = 0; i < consoles.length; i++) {
            if (isAvailable()) {
              IConsole console = consoles[i];
              // ensure it's still registered since this is done asynchronously
              IConsole[] allConsoles = getConsoleManager().getConsoles();
              for (int j = 0; j < allConsoles.length; j++) {
                                IConsole registered = allConsoles[j];
                                if (registered.equals(console)) {
                      ConsoleWorkbenchPart part = new ConsoleWorkbenchPart(console, getSite());
                      fConsoleToPart.put(console, part);
                      fPartToConsole.put(part, console);
                      partActivated(part);
                      break;
View Full Code Here

    /* (non-Javadoc)
     * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
     */
    public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
        IConsole console = (IConsole) receiver;
        String type = console.getType();
        return type != null ? type.equals(expectedValue) : false;
    }
View Full Code Here

            if (!isKarafLaunch(launch)) {
                return;
            }

            for (final IProcess process : launch.getProcesses()) {
                final IConsole console = findConsole(process);

                if (console != null) {
                    final IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
                    manager.removeConsoles(new IConsole[] { console });
                }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.console.IConsole

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.