Search in sources :

Example 1 with EventBus

use of org.rstudio.studio.client.application.events.EventBus in project rstudio by rstudio.

the class SatelliteWindow method show.

// show the satellite window (subclasses shouldn't override this method,
// rather they should override the abstract onInitialize method)
public void show(JavaScriptObject params) {
    // react to font size changes
    EventBus eventBus = pEventBus_.get();
    eventBus.addHandler(ChangeFontSizeEvent.TYPE, new ChangeFontSizeHandler() {

        public void onChangeFontSize(ChangeFontSizeEvent event) {
            FontSizer.setNormalFontSize(Document.get(), event.getFontSize());
        }
    });
    FontSizeManager fontSizeManager = pFontSizeManager_.get();
    FontSizer.setNormalFontSize(Document.get(), fontSizeManager.getSize());
    // disable no handler assertions
    AppCommand.disableNoHandlerAssertions();
    // allow subclasses to initialize
    onInitialize(mainPanel_, params);
}
Also used : FontSizeManager(org.rstudio.studio.client.workbench.ui.FontSizeManager) ChangeFontSizeHandler(org.rstudio.studio.client.application.events.ChangeFontSizeHandler) EventBus(org.rstudio.studio.client.application.events.EventBus) ChangeFontSizeEvent(org.rstudio.studio.client.application.events.ChangeFontSizeEvent)

Example 2 with EventBus

use of org.rstudio.studio.client.application.events.EventBus in project rstudio by rstudio.

the class ClientStateValue method finishInit.

protected void finishInit(ClientInitState state) {
    JsObject grp = state.peek(group_);
    T obj = doGet(grp, name_);
    valueTracker_ = new ValueChangeTracker<T>(obj);
    onInit(obj);
    EventBus evt = RStudioGinjector.INSTANCE.getEventBus();
    evt.addHandler(SaveClientStateEvent.TYPE, this);
}
Also used : JsObject(org.rstudio.core.client.js.JsObject) EventBus(org.rstudio.studio.client.application.events.EventBus)

Example 3 with EventBus

use of org.rstudio.studio.client.application.events.EventBus in project rstudio by rstudio.

the class ChunkOutputWidget method unregisterConsoleEvents.

private void unregisterConsoleEvents() {
    EventBus events = RStudioGinjector.INSTANCE.getEventBus();
    events.removeHandler(ConsoleWriteOutputEvent.TYPE, this);
    events.removeHandler(ConsoleWriteErrorEvent.TYPE, this);
}
Also used : EventBus(org.rstudio.studio.client.application.events.EventBus)

Example 4 with EventBus

use of org.rstudio.studio.client.application.events.EventBus in project rstudio by rstudio.

the class ChunkOutputWidget method registerConsoleEvents.

private void registerConsoleEvents() {
    EventBus events = RStudioGinjector.INSTANCE.getEventBus();
    events.addHandler(ConsoleWriteOutputEvent.TYPE, this);
    events.addHandler(ConsoleWriteErrorEvent.TYPE, this);
}
Also used : EventBus(org.rstudio.studio.client.application.events.EventBus)

Aggregations

EventBus (org.rstudio.studio.client.application.events.EventBus)4 JsObject (org.rstudio.core.client.js.JsObject)1 ChangeFontSizeEvent (org.rstudio.studio.client.application.events.ChangeFontSizeEvent)1 ChangeFontSizeHandler (org.rstudio.studio.client.application.events.ChangeFontSizeHandler)1 FontSizeManager (org.rstudio.studio.client.workbench.ui.FontSizeManager)1