use of org.rstudio.core.client.dom.WindowEx in project rstudio by rstudio.
the class SavePlotAsHandler method webSavePlotAs.
private void webSavePlotAs(final FileSystemItem targetPath, final boolean overwrite, final boolean viewAfterSave, final Operation onCompleted) {
globalDisplay_.openProgressWindow("_blank", "Converting Plot...", new OperationWithInput<WindowEx>() {
public void execute(final WindowEx window) {
savePlotAs(targetPath, overwrite, viewAfterSave, onCompleted, new PlotSaveAsUIHandler() {
@Override
public void onSuccess() {
// redirect window to view file
final String url = server_.getFileUrl(targetPath);
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
window.replaceLocationHref(url);
}
});
}
@Override
public void onError(ServerError error) {
window.close();
globalDisplay_.showErrorMessage("Error Saving Plot", error.getUserMessage());
}
@Override
public void onOverwritePrompt() {
window.close();
}
});
}
});
}
use of org.rstudio.core.client.dom.WindowEx in project rstudio by rstudio.
the class ChunkWindowManager method forwardEventToSatelliteAllChunks.
private void forwardEventToSatelliteAllChunks(String docId, CrossWindowEvent<?> event) {
for (Pair<String, String> chunkPair : satelliteChunks_) {
if (chunkPair.first != docId)
continue;
String chunkId = chunkPair.second;
String windowName = getName(docId, chunkId);
if (pSatelliteManager_.get().satelliteWindowExists(windowName)) {
WindowEx satelliteWindow = pSatelliteManager_.get().getSatelliteWindowObject(windowName);
events_.fireEventToSatellite(event, satelliteWindow);
}
}
}
use of org.rstudio.core.client.dom.WindowEx in project rstudio by rstudio.
the class ChunkWindowManager method onChunkSatelliteCloseAllWindow.
@Override
public void onChunkSatelliteCloseAllWindow(ChunkSatelliteCloseAllWindowEvent event) {
ArrayList<Pair<String, String>> newSatelliteChunks = new ArrayList<Pair<String, String>>();
for (Pair<String, String> chunkPair : satelliteChunks_) {
String docId = chunkPair.first;
String chunkId = chunkPair.second;
if (docId != event.getDocId()) {
newSatelliteChunks.add(chunkPair);
continue;
}
String windowName = getName(docId, chunkId);
if (pSatelliteManager_.get().satelliteWindowExists(windowName)) {
WindowEx satelliteWindow = pSatelliteManager_.get().getSatelliteWindowObject(windowName);
satelliteWindow.close();
}
}
satelliteChunks_ = newSatelliteChunks;
}
use of org.rstudio.core.client.dom.WindowEx in project rstudio by rstudio.
the class ViewerPresenter method onViewerZoom.
@Handler
public void onViewerZoom() {
Size windowSize = ZoomUtils.getZoomWindowSize(display_.getViewerFrameSize(), zoomWindowDefaultSize_);
// open and activate window
NewWindowOptions options = new NewWindowOptions();
options.setName("_rstudio_viewer_zoom");
options.setFocus(true);
options.setCallback(new OperationWithInput<WindowEx>() {
@Override
public void execute(WindowEx input) {
zoomWindow_ = input;
}
});
globalDisplay_.openMinimalWindow(display_.getUrl(), false, windowSize.width, windowSize.height, options);
}
Aggregations