Search in sources :

Example 1 with SatelliteFocusedEvent

use of org.rstudio.studio.client.common.satellite.events.SatelliteFocusedEvent in project rstudio by rstudio.

the class Satellite method initialize.

public void initialize(String name, CommandWithArg<JavaScriptObject> onReactivated) {
    onReactivated_ = onReactivated;
    initializeNative(name);
    // to notifyRStudioSatelliteClosing
    if (!Desktop.isDesktop()) {
        Window.addWindowClosingHandler(new ClosingHandler() {

            @Override
            public void onWindowClosing(ClosingEvent event) {
                fireCloseEvent();
            }
        });
    }
    // let main window know when we get focus
    WindowEx.addFocusHandler(new FocusHandler() {

        @Override
        public void onFocus(FocusEvent arg0) {
            events_.fireEvent(new SatelliteFocusedEvent(getSatelliteName()));
        }
    });
}
Also used : SatelliteFocusedEvent(org.rstudio.studio.client.common.satellite.events.SatelliteFocusedEvent) FocusHandler(com.google.gwt.event.dom.client.FocusHandler) ClosingEvent(com.google.gwt.user.client.Window.ClosingEvent) ClosingHandler(com.google.gwt.user.client.Window.ClosingHandler) FocusEvent(com.google.gwt.event.dom.client.FocusEvent)

Aggregations

FocusEvent (com.google.gwt.event.dom.client.FocusEvent)1 FocusHandler (com.google.gwt.event.dom.client.FocusHandler)1 ClosingEvent (com.google.gwt.user.client.Window.ClosingEvent)1 ClosingHandler (com.google.gwt.user.client.Window.ClosingHandler)1 SatelliteFocusedEvent (org.rstudio.studio.client.common.satellite.events.SatelliteFocusedEvent)1