Search in sources :

Example 11 with WindowEx

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);
}
Also used : WindowEx(org.rstudio.core.client.dom.WindowEx)

Example 12 with WindowEx

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);
}
Also used : WindowEx(org.rstudio.core.client.dom.WindowEx)

Example 13 with WindowEx

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);
}
Also used : WindowEx(org.rstudio.core.client.dom.WindowEx)

Example 14 with WindowEx

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);
}
Also used : JavaScriptObject(com.google.gwt.core.client.JavaScriptObject) NewWindowOptions(org.rstudio.studio.client.common.GlobalDisplay.NewWindowOptions) Size(org.rstudio.core.client.Size) WindowEx(org.rstudio.core.client.dom.WindowEx)

Example 15 with WindowEx

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);
}
Also used : JsObject(org.rstudio.core.client.js.JsObject) JavaScriptObject(com.google.gwt.core.client.JavaScriptObject) SessionInfo(org.rstudio.studio.client.workbench.model.SessionInfo) WindowEx(org.rstudio.core.client.dom.WindowEx)

Aggregations

WindowEx (org.rstudio.core.client.dom.WindowEx)34 JsArrayString (com.google.gwt.core.client.JsArrayString)5 Size (org.rstudio.core.client.Size)5 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)3 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)3 Document (com.google.gwt.dom.client.Document)3 KeyDownEvent (com.google.gwt.event.dom.client.KeyDownEvent)3 KeyDownHandler (com.google.gwt.event.dom.client.KeyDownHandler)3 ArrayList (java.util.ArrayList)3 Point (org.rstudio.core.client.Point)3 FindTextBox (org.rstudio.core.client.widget.FindTextBox)3 NewWindowOptions (org.rstudio.studio.client.common.GlobalDisplay.NewWindowOptions)3 Command (com.google.gwt.user.client.Command)2 ElementEx (org.rstudio.core.client.dom.ElementEx)2 JsObject (org.rstudio.core.client.js.JsObject)2 CanFocus (org.rstudio.core.client.widget.CanFocus)2 Operation (org.rstudio.core.client.widget.Operation)2 ToolbarButton (org.rstudio.core.client.widget.ToolbarButton)2 ToolbarLabel (org.rstudio.core.client.widget.ToolbarLabel)2 SatelliteWindowGeometry (org.rstudio.studio.client.common.satellite.model.SatelliteWindowGeometry)2