use of com.igormaznitsa.nbmindmap.nb.editor.MMDEditorSupport in project netbeans-mmd-plugin by raydac.
the class MMDNavigator method extractDataFromContextAndUpdate.
private void extractDataFromContextAndUpdate() {
final Lookup.Result<? extends MMDEditorSupport> ctx = this.context;
if (ctx == null) {
this.currentSupport = null;
} else {
Collection<? extends MMDEditorSupport> clct = ctx.allInstances();
if (clct.isEmpty()) {
final TopComponent active = TopComponent.getRegistry().getActivated();
if (active != null) {
clct = active.getLookup().lookupAll(MMDEditorSupport.class);
}
}
if (clct.isEmpty()) {
this.currentSupport = null;
} else {
this.currentSupport = clct.iterator().next();
if (this.currentSupport != null) {
this.currentSupport.getDataObject().getPrimaryFile().removeFileChangeListener(this);
this.currentSupport.getDataObject().getPrimaryFile().addFileChangeListener(this);
}
}
}
updateContent();
}
use of com.igormaznitsa.nbmindmap.nb.editor.MMDEditorSupport in project netbeans-mmd-plugin by raydac.
the class MMDNavigator method getDocumentText.
private String getDocumentText() {
String result = null;
if (this.currentSupport != null) {
final MMDEditorSupport editor = this.currentSupport;
result = editor.getDocumentText();
}
return result;
}
Aggregations