Package org.openide.cookies

Examples of org.openide.cookies.EditorCookie.openDocument()


        DataObject dataObject = getDataObject(url);
        if (dataObject != null) {
            EditorCookie ec = dataObject.getLookup().lookup(EditorCookie.class);
            if (ec != null) {
                try {
                    StyledDocument doc = ec.openDocument();
                    JEditorPane[] eps = ec.getOpenedPanes();
                    if (eps != null && eps.length > 0) {
                        JumpList.addEntry(eps[0], NbDocument.findLineOffset(doc, l.getLineNumber()) + column);
                    }
                } catch (java.io.IOException ioex) {
View Full Code Here


        if (ec == null) {
            return "";
        }
        StyledDocument doc;
        try {
            doc = ec.openDocument();
        } catch (IOException ex) {
            ErrorManager.getDefault().notify(ex);
            return "";
        }
        try {
View Full Code Here

        if (ec == null) {
            return ops[0];
        }
        final StyledDocument doc;
        try {
            doc = ec.openDocument();
        } catch (IOException ex) {
            ErrorManager.getDefault().notify(ex);
            return ops[0];
        }
        final int offset = findLineOffset(doc, (int) lineNumber);
View Full Code Here

        if (ec == null) {
            return null;
        }
        final StyledDocument doc;
        try {
            doc = ec.openDocument();
        } catch (IOException ex) {
            ErrorManager.getDefault().notify(ex);
            return null;
        }
        final int offset = findLineOffset(doc, methodLineNumber);
View Full Code Here

                EditorCookie ec = (EditorCookie) dobj.getCookie(EditorCookie.class);
                if (ec == null) {
                    return;
                }
                try {
                    doc = ec.openDocument();
                } catch (IOException ex) {
                    ErrorManager.getDefault().notify(ex);
                    return;
                }
            } catch (DataObjectNotFoundException ex) {
View Full Code Here

            EditorCookie ed = dob.getLookup().lookup(EditorCookie.class);
            if (ed != null && file == dob.getPrimaryFile()) {
                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);
                        }
View Full Code Here

            DataObject dob = DataEditorSupport.findDataObject(line);
            EditorCookie ec = (EditorCookie) dob.getCookie(EditorCookie.class);

            if (ec != null) { // Only for editable dataobjects
                try {
                    doc = ec.openDocument ();                   
                    RequestProcessor.getDefault().post(this);                   
                } catch (IOException e) {
                }
            }
        }
View Full Code Here

        if (ec != null) {
            RP.post(new Runnable() {
                @Override
                public void run() {
                    try {
                        final StyledDocument localSourceDoc = ec.openDocument();
                        setSourceDocument(localSourceDoc);
                        doUpdatePreview();
                    }
                    catch (IOException ex) {
                        Exceptions.printStackTrace(ex);
View Full Code Here

            Lookup lookup = config.getLookup();
            EditorCookie ec = lookup.lookup(EditorCookie.class);
            if (ec == null) {
                return;
            }
            final StyledDocument docment = ec.openDocument();
            if (docment == null) {
                return;
            }
            List<String> lines = config.asLines(Charset.UTF8);
            Pattern pattern = Pattern.compile(DEBUG_REGEX);
View Full Code Here

            //Bug fix: now actually make sure it's open in the editor
            openEditor(dob);

            EditorCookie ck = dob.getCookie(EditorCookie.class);
            if (ck != null) {
                ck.openDocument();
                JEditorPane[] p = ck.getOpenedPanes();
                if (p.length > 0) {
                    //Need to do this since we're disabling the window system's
                    //auto focus mechanism
                    p[0].requestFocus();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.