Create/Modify file silently in background
Submitted by Sunday, 23 September, 2012 - 09:06
on
How can i create/modify file in the background? I have this:
private final String filePath = "c:/dummy.txt";
void updateFile()
{
jEdit.newFile(view);
Calendar rightNow = Calendar.getInstance();
textArea.setText(Calendar.getInstance().getTime().toString());
Buffer scratchBuffer = view.getBuffer();
scratchBuffer.save(view, filePath);
jEdit.closeBuffer(view, scratchBuffer);
}
updateFile();
It creates/modifies file dummy.txt, writes to it current date. It is opening new buffer so it is visible for a brief time, until the macro closes it.
Can I make this in the background?
private final String filePath = "c:/dummy.txt";
void updateFile()
{
jEdit.newFile(view);
Calendar rightNow = Calendar.getInstance();
textArea.setText(Calendar.getInstance().getTime().toString());
Buffer scratchBuffer = view.getBuffer();
scratchBuffer.save(view, filePath);
jEdit.closeBuffer(view, scratchBuffer);
}
updateFile();
It creates/modifies file dummy.txt, writes to it current date. It is opening new buffer so it is visible for a brief time, until the macro closes it.
Can I make this in the background?