use of org.rstudio.core.client.dom.WindowEx in project rstudio by rstudio.
the class GridViewerFrame method setOption.
public void setOption(String option, String value) {
WindowEx gridViewerFrameWindow = getIFrame().getContentWindow();
setOptionNative(gridViewerFrameWindow, option, value);
}
use of org.rstudio.core.client.dom.WindowEx in project rstudio by rstudio.
the class GridViewerFrame method setData.
public void setData(JavaScriptObject data) {
WindowEx gridViewerFrameWindow = getIFrame().getContentWindow();
setDataNative(gridViewerFrameWindow, data);
}
use of org.rstudio.core.client.dom.WindowEx in project rstudio by rstudio.
the class GridViewerFrame method setColumnDefinitionsUIVisible.
public void setColumnDefinitionsUIVisible(boolean value, Operation onColumnOpen, Operation onColumnDismiss) {
WindowEx gridViewerFrameWindow = getIFrame().getContentWindow();
setColumnDefinitionsUIVisibleNative(gridViewerFrameWindow, value, onColumnOpen, onColumnDismiss);
}
use of org.rstudio.core.client.dom.WindowEx in project rstudio by rstudio.
the class SatelliteManager method openSatellite.
// open a satellite window (optionally activate existing)
public void openSatellite(String name, JavaScriptObject params, Size preferredSize, boolean adjustSize, Point position, boolean activate) {
// if we don't need to.
if (isCurrentWindowSatellite()) {
Debug.log("Satellite windows can't launch other satellites");
assert false;
return;
}
// check for a re-activation of an existing window
for (ActiveSatellite satellite : satellites_) {
if (satellite.getName().equals(name)) {
WindowEx window = satellite.getWindow();
if (!window.isClosed()) {
// it that it has been reactivated, then exit.
if (!Desktop.isDesktop()) {
// window will be reloaded)
if (!BrowseCap.isChrome() || !activate) {
if (activate)
window.focus();
callNotifyReactivated(window, params);
return;
} else {
// for Chrome, let the window know it's about to be
// closed and reopened
callNotifyPendingReactivate(window);
}
} else // desktop mode: activate and return
{
if (activate) {
Desktop.getFrame().activateSatelliteWindow(SatelliteUtils.getSatelliteWindowName(satellite.getName()));
}
callNotifyReactivated(window, params);
return;
}
}
}
}
// anything while the satellite is being loaded/reactivated
if (!pendingEventsBySatelliteName_.containsKey(name)) {
pendingEventsBySatelliteName_.put(name, new ArrayList<JavaScriptObject>());
}
// by the satellite within the call to registerAsSatellite)
if (params != null)
satelliteParams_.put(name, params);
// set size and position, if desired
Size windowSize = adjustSize ? ScreenUtils.getAdjustedWindowSize(preferredSize) : preferredSize;
NewWindowOptions options = new NewWindowOptions();
options.setFocus(activate);
if (position != null)
options.setPosition(position);
// open the satellite - it will call us back on registerAsSatellite
// at which time we'll call setSessionInfo, setParams, etc.
RStudioGinjector.INSTANCE.getGlobalDisplay().openSatelliteWindow(name, windowSize.width, windowSize.height, options);
}
use of org.rstudio.core.client.dom.WindowEx in project rstudio by rstudio.
the class SatelliteManager method registerAsSatellite.
// called by satellites to connect themselves with the main window
private void registerAsSatellite(final String name, JavaScriptObject wnd) {
// get the satellite and add it to our list. in some cases (such as
// the Ctrl+R reload of an existing satellite window) we actually
// already have a reference to this satellite in our list so in that
// case we make sure not to add a duplicate
WindowEx satelliteWnd = wnd.<WindowEx>cast();
ActiveSatellite satellite = new ActiveSatellite(name, satelliteWnd);
if (!satellites_.contains(satellite))
satellites_.add(satellite);
// augment the current session info with an up-to-date set of source
// documents
SessionInfo sessionInfo = session_.getSessionInfo();
sessionInfo.setSourceDocuments(pSourceWindowManager_.get().getSourceDocs());
// clone the session info so the satellites aren't reading/writing the
// same copy as the main window; pass the cloned copy along
JsObject sessionInfoJs = session_.getSessionInfo().cast();
callSetSessionInfo(satelliteWnd, sessionInfoJs.clone());
// call setParams
JavaScriptObject params = satelliteParams_.get(name);
if (params != null)
callSetParams(satelliteWnd, params);
}
Aggregations