Yser
Yser

Reputation: 2106

NetBeans Platform: Updating editor window content

I'm writing a plugin for the NetBeans Platform and would like to know if it's possible to force an editor window to update it's content from harddrive. I'm in the situation that I know some file on the HDD has changed but NetBeans doesn't recognize that.

dataObject.getLookup().lookup(EditorCookie.class);
StyledDocument document = cookie.getDocument();
JEditorPane editor = cookie.getOpenedPanes()[0];

// Looking for something like
document.forceUpdate();
//or
editor.forceUpdate();
//or
dataObject.forceUpdate();

Upvotes: 0

Views: 109

Answers (1)

Radim
Radim

Reputation: 4808

FileObject.refresh() is what you're looking for. The editor should listen to its changes (through layers that you've mentioned).

Upvotes: 0

Related Questions