Package org.openide.cookies

Examples of org.openide.cookies.LineCookie


                        if (p.length > 0) {
                            //Need to do this since we're disabling the window system's
                            //auto focus mechanism
                            p[0].requestFocus();
                            if (dataObj != null) {
                                LineCookie lc = dataObj.getCookie(LineCookie.class);
                                if (lc == null) {
                                    return;
                                }
                                Line l = lc.getLineSet().getOriginal(line);
                                l.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);
                            }
                        }
                    }
                } catch (Exception exception) {
View Full Code Here


                if (p.length > 0) {
                    //Need to do this since we're disabling the window system's
                    //auto focus mechanism
                    p[0].requestFocus();
                    if (dob != null) {
                        LineCookie lc = dob.getCookie(LineCookie.class);
                        if (lc == null) {
                            return;
                        }
                        lineNumber = n.getLine() - 1;
                        Line l = lc.getLineSet().getOriginal(lineNumber);
                        l.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);
                       
                        if (TextToSpeechOptions.isScreenReading()) {
                            speech.speak("Focussed to " + fileObjectToOpen.getName()
                                    + " dot " + fileObjectToOpen.getExt() + " "
View Full Code Here

                        if (p.length > 0) {
                            //Need to do this since we're disabling the window system's
                            //auto focus mechanism
                            p[0].requestFocus();
                            if (dataObj != null) {
                                LineCookie lc = dataObj.getCookie(LineCookie.class);
                                if (lc == null) {
                                    return;
                                }
                                Line l = lc.getLineSet().getOriginal(line);
                                l.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);
                            }
                        }
                    }
                } catch (Exception exception) {
View Full Code Here

                        if (p.length > 0) {
                            //Need to do this since we're disabling the window system's
                            //auto focus mechanism
                            p[0].requestFocus();
                            if (dataObj != null) {
                                LineCookie lc = dataObj.getCookie(LineCookie.class);
                                if (lc == null) {
                                    return;
                                }
                                Line l = lc.getLineSet().getOriginal(line);
                                l.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);
                            }
                        }

                        //highlight the line
View Full Code Here

            return null;
        }
        if (!isQuorumSource(fo)) {
            return null;
        }
        LineCookie lineCookie = (LineCookie) n.getCookie(LineCookie.class);
        if (lineCookie == null) {
            return null;
        }
        EditorCookie editorCookie = (EditorCookie) n.getCookie(EditorCookie.class);
        if (editorCookie == null) {
            return null;
        }
        JEditorPane jEditorPane = getEditorPane(editorCookie);
        if (jEditorPane == null) {
            return null;
        }
        StyledDocument document = editorCookie.getDocument();
        if (document == null) {
            return null;
        }
        Caret caret = jEditorPane.getCaret();
        if (caret == null) {
            return null;
        }
        int lineNumber = NbDocument.findLineNumber(document, caret.getDot());
        try {
            Line.Set lineSet = lineCookie.getLineSet();
            assert lineSet != null : lineCookie;
            return lineSet.getCurrent(lineNumber);
        } catch (IndexOutOfBoundsException ex) {
            return null;
        }
View Full Code Here

        if (dataObject == null) {
            return null;
        }

        LineCookie lineCookie = dataObject.getLookup().lookup(LineCookie.class);
        if (lineCookie == null) {
            return null;
        }

        Line.Set ls = lineCookie.getLineSet();
        if (ls == null) {
            return null;
        }

        try {
View Full Code Here

                        if (p.length > 0) {
                            //Need to do this since we're disabling the window system's
                            //auto focus mechanism
                            p[0].requestFocus();
                            if (dataObj != null) {
                                LineCookie lc = dataObj.getCookie(LineCookie.class);
                                if (lc == null) {
                                    return;
                                }
                                Line l = lc.getLineSet().getOriginal(line);
                                l.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);
                            }
                        }

                        //highlight the line
View Full Code Here

                        if (p.length > 0) {
                            //Need to do this since we're disabling the window system's
                            //auto focus mechanism
                            p[0].requestFocus();
                            if (dataObj != null) {
                                LineCookie lc = dataObj.getCookie(LineCookie.class);
                                if (lc == null) {
                                    return;
                                }
                                Line l = lc.getLineSet().getOriginal(line);
                                l.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);
                            }
                        }
                    }
                } catch (Exception exception) {
View Full Code Here

                if (p.length > 0) {
                    //Need to do this since we're disabling the window system's
                    //auto focus mechanism
                    p[0].requestFocus();
                    if (dob != null) {
                        LineCookie lc = (LineCookie) dob.getCookie(LineCookie.class);
                        if (lc == null) {
                            return;
                        }
                        lineNumber = n.getDescriptor().getLine() - 1;
                        Line l = lc.getLineSet().getOriginal(lineNumber);
                        l.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);

                        if (TextToSpeechOptions.isScreenReading()) {
                        speech.speak("Focussed to " + currentFileInEditor.getName()
                                + " dot " + currentFileInEditor.getExt() + " "
View Full Code Here

                //Exceptions.printStackTrace(ioex);
            }

            if ((0 < lineNumber) && (lineNumber <= fileLineCount)) {

                final LineCookie lineCookie = dataObject.getLookup().lookup(LineCookie.class);
                if (lineCookie == null) {
                    /* cannot do it */
                } else {
                    try {
                        final Line line = lineCookie.getLineSet().getOriginal(lineNumber - 1);
                        WindowManager.getDefault().invokeWhenUIReady(new Runnable() {

                            public void run() {

                                line.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);
View Full Code Here

TOP

Related Classes of org.openide.cookies.LineCookie

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.