use of org.rstudio.studio.client.workbench.views.source.editors.data.DataEditingTarget in project rstudio by rstudio.
the class Source method onShowData.
public void onShowData(ShowDataEvent event) {
// ignore if we're a satellite
if (!SourceWindowManager.isMainSourceWindow())
return;
DataItem data = event.getData();
for (int i = 0; i < editors_.size(); i++) {
String path = editors_.get(i).getPath();
if (path != null && path.equals(data.getURI())) {
((DataEditingTarget) editors_.get(i)).updateData(data);
ensureVisible(false);
view_.selectTab(i);
return;
}
}
ensureVisible(true);
server_.newDocument(FileTypeRegistry.DATAFRAME.getTypeId(), null, (JsObject) data.cast(), new SimpleRequestCallback<SourceDocument>("Show Data Frame") {
@Override
public void onResponseReceived(SourceDocument response) {
addTab(response, OPEN_INTERACTIVE);
}
});
}
Aggregations