Package org.eclipse.ui.console

Examples of org.eclipse.ui.console.TextConsole


  }

  @Override
  public void matchFound(PatternMatchEvent event) {
    if (event.getSource() instanceof TextConsole) {
      TextConsole console = (TextConsole) event.getSource();
      IDocument doc =  console.getDocument();
      int off = event.getOffset();
      int lenght = event.getLength();

      String fn = null;
      int ln = 1;

      try {
        String str = doc.get(off,lenght);
        Matcher m = _p.matcher(str);
        m.matches();
        fn = m.group(1);
        ln = Integer.parseInt(m.group(2));
      } catch (BadLocationException e1) {
        e1.printStackTrace();
      }
     
      IWorkspace ws = ResourcesPlugin.getWorkspace();
      IWorkspaceRoot root = ws.getRoot();
      String active_prj_name = null;
      try {
        active_prj_name = root.getPersistentProperty(QN_PREFERENCES_ACTIVE_PRJ);
      } catch (CoreException e1) {
        e1.printStackTrace();
        return;
      }

      if(active_prj_name == null)
        return;
     
      IHyperlink link = null;
      IProject p = root.getProject(active_prj_name);

      File f = new File(fn);
     
      if(f.exists())
        link = (IHyperlink) new URLLink(f.toURI(), ln);
      else
        link = new FileLink(p.getFile(fn), null, -1, -1, ln);

      try {
        console.addHyperlink(link, event.getOffset(), event.getLength());
      } catch (BadLocationException e) {
        e.printStackTrace();
      }
    }
  }
View Full Code Here


          }
        }
        return cm;
      }
    });
    final TextConsole console = new TextConsole("console",
        "javaStackTraceConsole", null, false) {

     
      public String getType() {
        return super.getType();
      }

     
      protected IConsoleDocumentPartitioner getPartitioner() {
        return new MM(this);
      }
    };
    final TextConsoleViewer sv = new TextConsoleViewer(owner, console);
    ConsolePlugin.getDefault().getConsoleManager()
        .createPatternMatchListeners(console);
    IDocument document = console.getDocument();
    document.setDocumentPartitioner(new MM(console));
    logViewer.setFilter(new IFilter(){

      public boolean accept(Object o) {
        return true;
View Full Code Here

      int offset = event.getOffset();
      int length = event.getLength();
     
      Object object = event.getSource();
      if(! (object instanceof TextConsole)) return;
      TextConsole console = (TextConsole)object;
     
      String consolecontent = console.getDocument().get();
      String matchedstring = consolecontent.substring(offset, offset+length);
     
      ParseErrorString parser = new ParseErrorString(regex);
      boolean success = parser.parse(matchedstring);
      if (!success) return;
       
      setProblemMarker(parser.filename, problemlevel, parser.linenr, parser.message);     
     
      IResource resource = getFile(parser.filename);
      if(resource instanceof IFile) {
        IFile file = (IFile) resource;
        FileLink hyperlink = new FileLink(file,null,-1,-1,parser.linenr);
        try {
          console.addHyperlink(hyperlink, offset+parser.startinmatchedstring,
              parser.endinmatchedstring-parser.startinmatchedstring+1);
        } catch (BadLocationException e) {
        }
      } else {
        //VerilogPlugin.println("Not a filename!");
View Full Code Here

    List added = new ArrayList(consoles.length);
    synchronized (fConsoles) {
      for (int i = 0; i < consoles.length; i++) {
          IConsole console = consoles[i];
          if(console instanceof TextConsole) {
              TextConsole ioconsole = (TextConsole)console;
              createPatternMatchListeners(ioconsole);
          }
        if (!fConsoles.contains(console)) {
          fConsoles.add(console);
          added.add(console);
View Full Code Here

                        i.remove();
                        continue;
                    }
           
                if (console instanceof TextConsole && extension.isEnabledFor(console)) {
                        TextConsole textConsole = (TextConsole) console;
                    PatternMatchListener patternMatchListener = new PatternMatchListener(extension);
                        try {
                            textConsole.addPatternMatchListener(patternMatchListener);
                            list.add(patternMatchListener);
                        } catch (PatternSyntaxException e) {
                            ConsolePlugin.log(e);
                            i.remove();
                        }
View Full Code Here

TOP

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

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.