Package org.python.pydev.core.tooltips.presenter

Examples of org.python.pydev.core.tooltips.presenter.StyleRangeWithCustomData


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


                StyledText styledText = (StyledText) w;
                int offset = styledText.getCaretOffset();
                if (offset >= 0 && offset < styledText.getCharCount()) {
                    StyleRange styleRangeAtOffset = styledText.getStyleRangeAtOffset(offset);
                    if (styleRangeAtOffset instanceof StyleRangeWithCustomData) {
                        StyleRangeWithCustomData styleRangeWithCustomData = (StyleRangeWithCustomData) styleRangeAtOffset;
                        Object l = styleRangeWithCustomData.customData;
                        if (l instanceof IHyperlink) {
                            ((IHyperlink) l).linkActivated();
                        }
                    }
View Full Code Here

                } catch (IllegalArgumentException e1) {
                    return; //Yes, in this case we clicked out of the possible range (i.e.: if we had no contents).
                }
                StyleRange r = text.getStyleRangeAtOffset(offset);
                if (r instanceof StyleRangeWithCustomData) {
                    StyleRangeWithCustomData styleRangeWithCustomData = (StyleRangeWithCustomData) r;
                    Object o = styleRangeWithCustomData.customData;
                    if (o instanceof FileNode) {
                        FileNode fileNode = (FileNode) o;
                        if (fileNode.node != null && fileNode.node.exists()) {
                            openFileWithCoverageMarkers(fileNode.node);
View Full Code Here

        //(the first line is: TestName Status: status Time: time\n\n)
        //See: org.python.pydev.debug.pyunit.PyUnitView.notifyTest(PyUnitTestResult, boolean)
        int firstSpace = hoverInfo.indexOf(' ');
        if (firstSpace > 0) {
            StyleRangeWithCustomData range = new StyleRangeWithCustomData();
            range.fontStyle = SWT.BOLD;
            range.underline = true;
            try {
                range.underlineStyle = SWT.UNDERLINE_LINK;
            } catch (Throwable e) {
                //Ignore (not available on earlier versions of eclipse)
            }
            range.start = 0;
            range.length = firstSpace;
            if (this.data instanceof PyUnitTestResult) {
                final PyUnitTestResult pyUnitTestResult = (PyUnitTestResult) this.data;
                range.customData = new IHyperlink() {

                    public void linkExited() {
                    }

                    public void linkEntered() {
                    }

                    public void linkActivated() {
                        pyUnitTestResult.open();
                    }
                };
            }
            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)
View Full Code Here

                if (element instanceof FileNode) { //it may have been an error node...
                    FileNode fileNode = (FileNode) element;
                    int start = buffer.length();
                    fileNode.appendToBuffer(buffer, baseLocation, nameNumberOfColumns).append("\n");
                    int len = buffer.indexOf(' ', start) - start;
                    StyleRangeWithCustomData styleRange = new StyleRangeWithCustomData(start, len, null, null);
                    styleRange.underline = true;
                    try {
                        styleRange.underlineStyle = SWT.UNDERLINE_LINK;
                    } catch (Throwable e) {
                        //Ignore (not available on earlier versions of eclipse)
View Full Code Here

TOP

Related Classes of org.python.pydev.core.tooltips.presenter.StyleRangeWithCustomData

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.