Package org.openide.text

Examples of org.openide.text.Line


        try {
            DataObject d = DataObject.find(fo);
            LineCookie cookie = d.getCookie(LineCookie.class);
           
            Line.Set lineSet = null;
            Line line = null;
            for (int i = 0; i < rs.getCsErrors().size(); i++) {
                lineSet = cookie.getLineSet();
                line = lineSet.getOriginal(rs.getCsErrors().get(i).getLineNum());
                rs.getCsErrors().get(i).attach(line);
            }
View Full Code Here


        public void outputLineSelected(OutputEvent evt) {
        }

        public void outputLineAction(OutputEvent evt) {
            LineCookie lc = dObj.getCookie(org.openide.cookies.LineCookie.class);
            Line line = lc.getLineSet().getOriginal(realLineNo);
            line.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS, pos);
        }
View Full Code Here

    public static void createAnnotation(final DataObject dObj, final LineCookie cLine, final String reason, final int line, final int character, final int length)
            throws IndexOutOfBoundsException, NumberFormatException {
       
 
        try {
      Line currentLine = cLine.getLineSet().getCurrent(line-1);
      final Line.Part currentPartLine = currentLine.createPart(character - 1, length);
            final JSLintIssueAnnotation annotation = JSLintIssueAnnotation.create(dObj, character, reason);
     
            annotation.attach(currentPartLine);
     
            currentPartLine.addPropertyChangeListener(new PropertyChangeListener() {
View Full Code Here

     * @param lineNumber a number of line to be shown
     * @param timeStamp a time stamp to be used
     */
    @Override
    public boolean showSource(String url, int lineNumber, Object timeStamp) {
        Line l = showSourceLine(url, lineNumber, timeStamp);
        if (l != null) {
            addPositionToJumpList(url, l, 0);
        }
        return l != null;
    }
View Full Code Here

        }
        return l != null;
    }

    static Line showSourceLine(String url, int lineNumber, Object timeStamp) {
        Line l = LineTranslations.getTranslations().getLine(url, lineNumber, timeStamp); // false = use original ln
        if (l == null) {
            ErrorManager.getDefault().log(ErrorManager.WARNING,
                    "Show Source: Have no line for URL = " + url + ", line number = " + lineNumber);
            return null;
        }
        if ("true".equalsIgnoreCase(fronting) || Utilities.isWindows()) {
            l.show(Line.SHOW_REUSE);
            l.show(Line.SHOW_TOFRONT); //FIX 47825
        } else {
            l.show(Line.SHOW_REUSE);
        }
        return l;
    }
View Full Code Here

     * @param url a url of source to be shown
     * @param lineNumber a number of line to be shown
     * @param timeStamp a time stamp to be used
     */
    public boolean showSource(String url, int lineNumber, int column, int length, Object timeStamp) {
        Line l = LineTranslations.getTranslations().getLine(url, lineNumber, timeStamp); // false = use original ln
        if (l == null) {
            ErrorManager.getDefault().log(ErrorManager.WARNING,
                    "Show Source: Have no line for URL = " + url + ", line number = " + lineNumber);
            return false;
        }
        if ("true".equalsIgnoreCase(fronting) || Utilities.isWindows()) {
            l.show(Line.SHOW_TOFRONT, column); //FIX 47825
        } else {
            l.show(Line.SHOW_GOTO, column);
        }
        addPositionToJumpList(url, l, column);
        return true;
    }
View Full Code Here

        Object[] urlLine = (Object[]) annotation;
        String url = (String) urlLine[0];
        int line = ((Integer) urlLine[1]).intValue();
        return LineTranslations.getTranslations().getOriginalLineNumber(url, line, timeStamp);
        }*/
        Line line;
        if (annotation instanceof DebuggerBreakpointAnnotation) {
            line = ((DebuggerBreakpointAnnotation) annotation).getLine();
        } else {
            line = ((DebuggerAnnotation) annotation).getLine();
        }
        if (timeStamp == null) {
            return line.getLineNumber() + 1;
        }
        String url = (String) annotationToURL.get(annotation);
        Line.Set lineSet = LineTranslations.getTranslations().getLineSet(url, timeStamp);
        return lineSet.getOriginalLineNumber(line) + 1;
    }
View Full Code Here

        LineCookie lc = dataObject.getCookie(LineCookie.class);
        if (lc == null) return;
        List<DebuggerBreakpointAnnotation> annotations = new ArrayList<DebuggerBreakpointAnnotation>();
        for (int l : lines) {
            try {
                Line line = lc.getLineSet().getCurrent(l - 1);
                DebuggerBreakpointAnnotation annotation = new DebuggerBreakpointAnnotation (annotationType, line, b);
                annotations.add(annotation);
            } catch (IndexOutOfBoundsException e) {
            } catch (IllegalArgumentException e) {
            }
View Full Code Here

        JPDADebugger d = currentEngine.lookupFirst(null, JPDADebugger.class);
        if (d == null) return null;

        Part lp = (Part) getAttachedAnnotatable();
        if (lp == null) return null;
        Line line = lp.getLine ();
        DataObject dob = DataEditorSupport.findDataObject (line);
        if (dob == null) return null;
        EditorCookie ec = dob.getCookie(EditorCookie.class);
        if (ec == null)
            return null;
View Full Code Here

                if (lineNum == -1) {
                    ed.open();
                } else {
                    ed.openDocument();
                    try {
                        Line l = ed.getLineSet().getOriginal(lineNum - 1);
                        if (! l.isDeleted()) {
                            l.show(Line.ShowOpenType.REUSE, Line.ShowVisibilityType.FOCUS);
                        }
                    } catch (IndexOutOfBoundsException ioobe) {
                        // Probably harmless. Bogus line number.
                        ed.open();
                    }
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.