Search in sources :

Example 1 with EnabledChangedHandler

use of org.rstudio.core.client.command.EnabledChangedHandler in project rstudio by rstudio.

the class RSConnectPublishButton method initialize.

@Inject
public void initialize(RSConnectServerOperations server, RMarkdownServerOperations rmdServer, EventBus events, Commands commands, GlobalDisplay display, Provider<UIPrefs> pUiPrefs, Session session, PlotPublishMRUList plotMru) {
    server_ = server;
    rmdServer_ = rmdServer;
    events_ = events;
    commands_ = commands;
    display_ = display;
    session_ = session;
    pUiPrefs_ = pUiPrefs;
    plotMru_ = plotMru;
    // initialize visibility if requested
    if (boundCommand_ != null) {
        boundCommand_.addVisibleChangedHandler(new VisibleChangedHandler() {

            @Override
            public void onVisibleChanged(AppCommand command) {
                applyVisiblity();
            }
        });
        boundCommand_.addEnabledChangedHandler(new EnabledChangedHandler() {

            @Override
            public void onEnabledChanged(AppCommand command) {
                applyVisiblity();
            }
        });
    }
    events_.addHandler(RSConnectDeploymentCompletedEvent.TYPE, this);
    events_.addHandler(RPubsUploadStatusEvent.TYPE, this);
    events_.addHandler(RmdRenderCompletedEvent.TYPE, this);
    events_.addHandler(HTMLPreviewCompletedEvent.TYPE, this);
}
Also used : AppCommand(org.rstudio.core.client.command.AppCommand) VisibleChangedHandler(org.rstudio.core.client.command.VisibleChangedHandler) EnabledChangedHandler(org.rstudio.core.client.command.EnabledChangedHandler) Inject(com.google.inject.Inject)

Aggregations

Inject (com.google.inject.Inject)1 AppCommand (org.rstudio.core.client.command.AppCommand)1 EnabledChangedHandler (org.rstudio.core.client.command.EnabledChangedHandler)1 VisibleChangedHandler (org.rstudio.core.client.command.VisibleChangedHandler)1