Package org.openide.text

Examples of org.openide.text.Line


                boolean isQuorum = DebuggerUtils.isQuorumSource(fo);
                if (!isQuorum) {
                    return;
                }

                Line line = DebuggerUtils.getCurrentLine();

                Breakpoint[] breakpoints = DebuggerManager.getDebuggerManager().getBreakpoints();
                int i, k = breakpoints.length;

                for (i = 0; i < k; i++) {
                    if (breakpoints[i] instanceof QuorumBreakpoint
                            && (((QuorumBreakpoint) breakpoints[i]).getLine() != null)
                            && ((QuorumBreakpoint) breakpoints[i]).getLine().equals(line)) {
                        //Remove a breakpoint
                        QuorumBreakpoint bp = (QuorumBreakpoint)breakpoints[i];
                        if (!TODUtils.isTODEnabled()) {
                            if (compiler != null) {
                                compiler.toggleBreakpoint(bp.getLine().getLineNumber() + 1, bp.getFileObject());
                            }
                        } else {
                            if (TextToSpeechOptions.isScreenReading()) {
                                speech.speak("Removed breakpoint at line " + (line.getLineNumber() + 1) + " in " + fo.getNameExt(), SpeechPriority.MEDIUM);
                            }
                            DebuggerManager.getDebuggerManager().removeBreakpoint(bp);
                        }

                        break;
                    }
                }
                if (i == k) { //add a breakpoint
                    QuorumBreakpoint bp = DebuggerUtils.getBreakpointAtLine();
                    if (!TODUtils.isTODEnabled()) {
                        if (compiler != null) {
                            compiler.toggleBreakpoint(bp.getLine().getLineNumber() + 1, bp.getFileObject());
                        }
                    } else {
                        if (TextToSpeechOptions.isScreenReading()) {
                            speech.speak("Added Breakpoint at line " + (line.getLineNumber() + 1) + " in " + fo.getNameExt(), SpeechPriority.MEDIUM);
                        }
                        DebuggerManager.getDebuggerManager().addBreakpoint(bp);
                    }
                }
            }
View Full Code Here


                            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

                   
                    Element e = document.getDefaultRootElement();
                    if (e != null && lineNumber != -1) {
                        e = e.getElement(lineNumber);
                        final int startOfLine = e.getStartOffset();
                        Line myLine = NbEditorUtilities.getLine(document, startOfLine, false);
                        updateLine(myLine);
                        jumpToLine(dataObject, lineNumber);
                    } else {
                        if (dataObject != null) {
                            openEditor(dataObject);
View Full Code Here

        }

        QuorumBreakpoint hb = (QuorumBreakpoint) b;
        addAnnotation(hb);
        FileObject fo = hb.getFileObject();
        Line line = hb.getLine();


        // Add the new breakpoint in TOD.
        if (TODUtils.isTODEnabled() && compiler != null) {
            CompilerFileDescriptor fileDescriptor = compiler.getFileDescriptor(fo);
            int targetLine = line.getLineNumber() + 1;
            String name = TODCompilerUtils.findJVMClassName(fileDescriptor, targetLine);
            if (name != null) {
                QuorumDebuggerUtils.addLineBreakpoint(name, targetLine);
            }
        }
View Full Code Here

            return;
        }

        QuorumBreakpoint hb = (QuorumBreakpoint) b;
        removeAnnotation(hb);
        Line line = hb.getLine();
        FileObject fo = hb.getFileObject();
       
        // Remove the breakpoint in TOD.
        if (TODUtils.isTODEnabled() && compiler != null) {
            CompilerFileDescriptor fileDescriptor = compiler.getFileDescriptor(fo);
            int targetLine = line.getLineNumber() + 1;
            String name = TODCompilerUtils.findJVMClassName(fileDescriptor, targetLine);
            if (name != null) {
                QuorumDebuggerUtils.removeLineBreakpoint(name, targetLine);
            }
        }
View Full Code Here

                        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() + " "
                                + n.getShortDescription() + " " + n.getDisplayName(),
View Full Code Here

                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);
                            }
                        });
                        lineFound = true;
                    } catch (final IndexOutOfBoundsException ex) {
                        // lineFound = false;
View Full Code Here

TOP

Related Classes of org.openide.text.Line

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.