How can I load a Buffer
Submitted by Thursday, 27 April, 2006 - 13:40
on
I'm writing a plugin for jEdit. In the plugin, I need to get File content by path, My code like this:
Buffer _buffer = jEdit.getBuffer(path);
String content = _buffer.getText(0, _buffer.getLength());
but this code caught NullPointException.
Then I found that the _buffer is unload:
_buffer.isLoad() = false;
so my question is how can I get a Buffer by path and load it,
or how can I get File content with the file path.
I'm the beginner in JEdit plugin develop, I hope if some kind man can help me with this problem, SOS, whoever you are, thank you very much!
Buffer _buffer = jEdit.getBuffer(path);
String content = _buffer.getText(0, _buffer.getLength());
but this code caught NullPointException.
Then I found that the _buffer is unload:
_buffer.isLoad() = false;
so my question is how can I get a Buffer by path and load it,
or how can I get File content with the file path.
I'm the beginner in JEdit plugin develop, I hope if some kind man can help me with this problem, SOS, whoever you are, thank you very much!