Package org.openide.cookies

Examples of org.openide.cookies.LineCookie


        l.setLogResult(rs);
        fo.addFileChangeListener(l);
       
        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);
            }

            for (int i = 0; i < rs.getCsWarnings().size(); i++) {
                lineSet = cookie.getLineSet();
                line = lineSet.getOriginal(rs.getCsWarnings().get(i).getLineNum());
                rs.getCsWarnings().get(i).attach(line);
            }
        } catch (DataObjectNotFoundException ex) {
            Exceptions.printStackTrace(ex);
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

  try {
      String text;
     
      // Find editor
      DataObject dObj = DataObject.find(file);
      LineCookie cLine = null;
      StyledDocument currentDocument = null;
      if (null != dObj) {
    EditorCookie cEditor = dObj.getCookie(EditorCookie.class);
    cLine = dObj.getCookie(LineCookie.class);
    currentDocument = cEditor.getDocument();
View Full Code Here

            dataObject = DataObject.find(fo);
        } catch (DataObjectNotFoundException donfex) {
            donfex.printStackTrace();
            return ;
        }
        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

                }
            }
        }
       
        // get current
        LineCookie lineCookie = dataObject.getCookie(LineCookie.class);
        if (lineCookie == null) return null;
        return lineCookie.getLineSet ();
    }
View Full Code Here

    private static class Registry {
       
        private Map<DataObject, Line.Set> dataObjectToLineSet = new HashMap<DataObject, Line.Set>();
       
        synchronized void register (DataObject dataObject) {
            LineCookie lc = dataObject.getCookie (LineCookie.class);
            if (lc == null) return;
            dataObjectToLineSet.put (dataObject, lc.getLineSet ());
        }
View Full Code Here

                dobj = DataObject.find(fobj);
            } catch (DataObjectNotFoundException ex) {
                ex.printStackTrace();
            }
            if (dobj != null) {
                LineCookie lc = (LineCookie) dobj.getCookie(LineCookie.class);
                if (lc == null) {/* cannot do it */
                    return;
                }
                Line l = lc.getLineSet().getOriginal(line);
                l.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);
            }
    }
View Full Code Here

                    dobj = DataObject.find(fobj);
                } catch (DataObjectNotFoundException ex) {
                    ex.printStackTrace();
                }
                if (dobj != null) {
                    LineCookie lc = (LineCookie) dobj.getCookie(LineCookie.class);
                    if (lc != null) {
                        Line l = lc.getLineSet().getOriginal(Integer.parseInt(lineNumber));
                        l.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);
                    }

                }
            }
View Full Code Here

                FileObject fo = FileUtil.toFileObject( f );
                try {
                    DataObject dob = DataObject.find( fo );
                    EditorCookie ck = dob.getLookup().lookup( EditorCookie.class );
                    if (ck != null) {
                        LineCookie l = dob.getLookup().lookup( LineCookie.class );
                        if (l != null) {
                            Line goTo = l.getLineSet().getCurrent( Math.max (0, line -1) );
                            if (goTo == null) {
                                goTo =  l.getLineSet().getOriginal(line -1);
                            }
                            if (goTo != null) {
                                String txt = goTo.getText();
                                int length = txt == null ? -1 : txt.length();
                                int position = charPos >= length && txt != null ? 0 : charPos;
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

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.