@Override public Lookup getLookup() { return lineNew.getLookup(); } });
@Override public Lookup getLookup() { return lineNew.getLookup(); } });
/** Support method that extracts a DataObject from a Line. If the * line is created by a DataEditorSupport then associated DataObject * can be accessed by this method. * * @param l line object * @return data object or null * * @since 4.3 */ public static DataObject findDataObject (Line l) { if (l == null) throw new NullPointerException(); return (DataObject)l.getLookup ().lookup (DataObject.class); }
public static DataObject dataObjectForLine(Line l) { // 6502318 if (l == null) return null; org.openide.util.Lookup lineLookup = l.getLookup(); DataObject dao = lineLookup.lookup(DataObject.class); if (dao == null) return null; if (dao instanceof DataShadow) dao = ((DataShadow) dao).getOriginal (); return dao; }
@Override public URL getURL() { if (line instanceof FutureLine) { return ((FutureLine) line).getURL(); } return line.getLookup().lookup(FileObject.class).toURL(); }
if (lb != null) { Line line = JSUtils.getLine(lb); FileObject fo = line.getLookup().lookup(FileObject.class); if (fo != null) { File file = FileUtil.toFile(fo);
@Override public void setLineNumber(int lineNumber) { lineNumber--; // Line works with 0-based lines. if (line.getLineNumber() == lineNumber) { return ; } LineCookie lineCookie = line.getLookup().lookup(LineCookie.class); Line.Set lineSet = lineCookie.getLineSet(); List<? extends Line> lines = lineSet.getLines(); if (lines.size() > 0) { int lastLineNumber = lines.get(lines.size() - 1).getLineNumber(); if (lineNumber > lastLineNumber) { lineNumber = lastLineNumber; } } Line cline; try { cline = lineSet.getCurrent(lineNumber); } catch (IndexOutOfBoundsException ioobex) { cline = lineSet.getCurrent(0); } setLine(cline); }
private static Pair<Line.Part, FileObject> getContext(EditorContextProvider ecp) { Line.Part lp = ecp.getContext(); if (lp == null) { Line line = EditorContextDispatcher.getDefault().getMostRecentLine(); if (line != null) { lp = line.createPart(0, 0); } } FileObject file; if (lp != null) { file = lp.getLine().getLookup().lookup(FileObject.class); } else { file = null; } return Pair.of(lp, file); }
@Override public FileObject getFileObject() { if (line instanceof FutureLine) { URL url = getURL(); FileObject fo = URLMapper.findFileObject(url); if (fo != null) { try { DataObject dobj = DataObject.find(fo); LineCookie lineCookie = dobj.getLookup().lookup(LineCookie.class); if (lineCookie == null) { return null; } Line l = lineCookie.getLineSet().getCurrent(getLineNumber() - 1); setLine(l); } catch (DataObjectNotFoundException ex) { } } return fo; } else { return line.getLookup().lookup(FileObject.class); } }
EditorCookie ec = curentLine.getLookup().lookup(EditorCookie.class); if (ec != null) { ec.prepareDocument().waitFinished();
return; final FileObject fo = line.getLookup().lookup(FileObject.class); if (isFunctionPtr[0]) {
final FileObject fo = line.getLookup().lookup(FileObject.class);
private void evalExpression(final Part lp) { try { Line line = lp.getLine(); Lookup lineLookup = line.getLookup(); DataObject dobj = lineLookup.lookup(DataObject.class);