jEdit Community - Resources for users of the jEdit Text Editor
Create/Modify file silently in background
Submitted by JanciB on Sunday, 23 September, 2012 - 09:06
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?
User login
Browse archives
« January 2018  
MoTuWeThFrSaSu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
33%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1092
Syndication
file   ver   dls
German Localization light   4.4.2.1   50947
Context Free Art (*.cfdg)   0.31   41170
JBuilder scheme   .001   16999
BBEdit scheme   1.0   16599
ColdFusion scheme   1.0   16584
R Edit Mode - extensive version   0.1   14866
Advanced HTML edit mode   1.0   14045
Matlab Edit Mode   1.0   13983
jEdit XP icons   1.0   13414
XP icons for jEdit   1.1   12438