Examples of PythonConsoleLineTracker


Examples of org.python.pydev.debug.ui.PythonConsoleLineTracker

                };
            }
            presentation.addStyleRange(range);
        }

        PythonConsoleLineTracker lineTracker = new PythonConsoleLineTracker();
        lineTracker.init(new ILinkContainer() {

            public void addLink(IHyperlink link, int offset, int length) {
                StyleRangeWithCustomData range = new StyleRangeWithCustomData();
                range.underline = true;
                try {
                    range.underlineStyle = SWT.UNDERLINE_LINK;
                } catch (Throwable e) {
                    //Ignore (not available on earlier versions of eclipse)
                }

                //Set the proper color if it's available -- we don't do that here because our background is
                //the default (usually yellow), so, there's no point in changing it to the theme. An option
                //could be setting the theme for the popup, but we're not doing that now.
                //                TextAttribute textAttribute = ColorManager.getDefault().getHyperlinkTextAttribute();
                //                if (textAttribute != null) {
                //                    range.foreground = textAttribute.getForeground();
                //                }
                range.start = offset;
                range.length = length + 1;
                range.customData = link;
                presentation.addStyleRange(range);
            }

            public String getContents(int lineOffset, int lineLength) throws BadLocationException {
                if (lineLength <= 0) {
                    return "";
                }
                return hoverInfo.substring(lineOffset, lineOffset + lineLength + 1);
            }
        });
        lineTracker.splitInLinesAndAppendToLineTracker(hoverInfo);
    }
View Full Code Here

Examples of org.python.pydev.debug.ui.PythonConsoleLineTracker

     * Overridden to get the line trackers that'll add hyperlinks to the console.
     */
    @Override
    public List<IConsoleLineTracker> getLineTrackers() {
        List<IConsoleLineTracker> lineTrackers = new ArrayList<IConsoleLineTracker>();
        PythonConsoleLineTracker lineTracker = new PythonConsoleLineTracker();

        //The IConsole we implement in this class is not the same IConsole that's needed in the
        //lineTracker, so, let's create a wrapper for this with the interfaces requested.
        lineTracker.init(new IConsole() {

            //IMPLEMENTATIONS FORWARDED TO OUTER CLASS
            public void addLink(IConsoleHyperlink link, int offset, int length) {
                PydevConsole.this.addLink(link, offset, length);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.