StringBuffer sbuf = (StringBuffer)getProperty( IORequest.LOAD_DATA); if(sbuf != null) { getDocumentProperties().remove(IORequest.LOAD_DATA);  try {  remove(0,getLength()); insertString(0,sbuf.toString(),null);   Element map = getDefaultRootElement(); for(int i = 0; i < Math.min(10,map.getElementCount()); i++) { Element line = map.getElement(i); String text = getText(line.getStartOffset(), line.getEndOffset() - line.getStartOffset() - 1); processProperty(text); } } catch(BadLocationException bl) { bl.printStackTrace(); } }
	public boolean load(final View view, final boolean reload)	{		setFlag(LOADING,true);		undo = null;		final boolean loadAutosave;		if(!getFlag(NEW_FILE))		{			if(file != null)				modTime = file.lastModified();			// Only on initial load			if(!reload && autosaveFile != null && autosaveFile.exists())				loadAutosave = recoverAutosave(view);			else			{				if(autosaveFile != null)					autosaveFile.delete();				loadAutosave = false;			}			if(!loadAutosave)			{				// this returns false if initial sanity				// checks (if the file is a directory, etc)				// fail				if(!vfs.load(view,this,path))				{					setFlag(LOADING,false);					return false;				}			}		}		else			loadAutosave = false;		// Do some stuff once loading is finished		VFSManager.runInAWTThread(new Runnable()		{			public void run()			{				undo = new UndoManager();				setFlag(LOADING,false);				// if reloading a file, clear dirty flag				if(reload)					setDirty(false);				// if loadAutosave is false, we loaded an				// autosave file, so we set 'dirty' to true				// note that we don't use setDirty(),				// because a) that would send an unnecessary				// message, b) it would also set the				// AUTOSAVE_DIRTY flag, which will make				// the autosave thread write out a				// redundant autosave file				if(loadAutosave)					setFlag(DIRTY,true);				if(getFlag(TEMPORARY))					return;				View _view = jEdit.getFirstView();				while(_view != null)				{					EditPane[] editPanes = _view						.getEditPanes();					for(int i = 0; i < editPanes.length; i++)					{						EditPane editPane = editPanes[i];						if(editPane.getBuffer() == Buffer.this)						{							editPane.getTextArea().setCaretPosition(0);							editPane.getTextArea().repaint();						}					}						_view = _view.getNext();				}				setMode();				propertiesChanged();				EditBus.addToBus(Buffer.this);				// send some EditBus messages				EditBus.send(new BufferUpdate(Buffer.this,					BufferUpdate.LOADED));				EditBus.send(new BufferUpdate(Buffer.this,					BufferUpdate.MARKERS_CHANGED));			}		});		return true;	}