Search in sources :

Example 1 with RAddins

use of org.rstudio.studio.client.workbench.addins.Addins.RAddins in project rstudio by rstudio.

the class AddinsMRUList method onSessionInit.

@Override
public void onSessionInit(SessionInitEvent sie) {
    RAddins addins = session_.getSessionInfo().getAddins();
    update(addins);
    mruList_ = pListManager_.get().getAddinsMruList();
    mruList_.addListChangedHandler(new ListChangedHandler() {

        @Override
        public void onListChanged(ListChangedEvent event) {
            mruEntries_ = event.getList();
            update(addinRegistry_);
        }
    });
}
Also used : ListChangedEvent(org.rstudio.studio.client.workbench.events.ListChangedEvent) RAddins(org.rstudio.studio.client.workbench.addins.Addins.RAddins) ListChangedHandler(org.rstudio.studio.client.workbench.events.ListChangedHandler)

Example 2 with RAddins

use of org.rstudio.studio.client.workbench.addins.Addins.RAddins in project rstudio by rstudio.

the class ModifyKeyboardShortcutsWidget method collectShortcuts.

private void collectShortcuts() {
    final List<KeyboardShortcutEntry> bindings = new ArrayList<KeyboardShortcutEntry>();
    SerializedCommandQueue queue = new SerializedCommandQueue();
    // Load addins discovered as part of package exports. This registers
    // the addin, with the actual keybinding to be registered later,
    // if discovered.
    queue.addCommand(new SerializedCommand() {

        @Override
        public void onExecute(final Command continuation) {
            RAddins rAddins = addins_.getRAddins();
            for (String key : JsUtil.asIterable(rAddins.keys())) {
                RAddin addin = rAddins.get(key);
                bindings.add(new KeyboardShortcutEntry(addin.getPackage() + "::" + addin.getBinding(), addin.getName(), new KeySequence(), KeyboardShortcutEntry.TYPE_ADDIN, false, AppCommand.Context.Addin));
            }
            continuation.execute();
        }
    });
    // Load saved addin bindings
    queue.addCommand(new SerializedCommand() {

        @Override
        public void onExecute(final Command continuation) {
            addins_.loadBindings(new CommandWithArg<EditorKeyBindings>() {

                @Override
                public void execute(EditorKeyBindings addinBindings) {
                    for (String commandId : addinBindings.iterableKeys()) {
                        EditorKeyBinding addinBinding = addinBindings.get(commandId);
                        for (KeyboardShortcutEntry binding : bindings) {
                            if (binding.getId() == commandId) {
                                List<KeySequence> keys = addinBinding.getKeyBindings();
                                if (keys.size() >= 1)
                                    binding.setDefaultKeySequence(keys.get(0));
                                if (keys.size() >= 2) {
                                    for (int i = 1; i < keys.size(); i++) {
                                        bindings.add(new KeyboardShortcutEntry(binding.getId(), binding.getName(), keys.get(i), KeyboardShortcutEntry.TYPE_ADDIN, false, AppCommand.Context.Addin));
                                    }
                                }
                            }
                        }
                    }
                    continuation.execute();
                }
            });
        }
    });
    // Ace loading command
    queue.addCommand(new SerializedCommand() {

        @Override
        public void onExecute(final Command continuation) {
            // Ace Commands
            JsArray<AceCommand> aceCommands = editorCommands_.getCommands();
            for (int i = 0; i < aceCommands.length(); i++) {
                AceCommand command = aceCommands.get(i);
                JsArrayString shortcuts = command.getBindingsForCurrentPlatform();
                if (shortcuts != null) {
                    String id = command.getInternalName();
                    String name = command.getDisplayName();
                    boolean custom = command.isCustomBinding();
                    for (int j = 0; j < shortcuts.length(); j++) {
                        String shortcut = shortcuts.get(j);
                        KeySequence keys = KeySequence.fromShortcutString(shortcut);
                        int type = KeyboardShortcutEntry.TYPE_EDITOR_COMMAND;
                        bindings.add(new KeyboardShortcutEntry(id, name, keys, type, custom, AppCommand.Context.Editor));
                    }
                }
            }
            continuation.execute();
        }
    });
    // RStudio commands
    queue.addCommand(new SerializedCommand() {

        @Override
        public void onExecute(final Command continuation) {
            // RStudio Commands
            appCommands_.loadBindings(new CommandWithArg<EditorKeyBindings>() {

                @Override
                public void execute(final EditorKeyBindings customBindings) {
                    Map<String, AppCommand> commands = commands_.getCommands();
                    for (Map.Entry<String, AppCommand> entry : commands.entrySet()) {
                        AppCommand command = entry.getValue();
                        if (isExcludedCommand(command))
                            continue;
                        String id = command.getId();
                        String name = getAppCommandName(command);
                        int type = KeyboardShortcutEntry.TYPE_RSTUDIO_COMMAND;
                        boolean isCustom = customBindings.hasKey(id);
                        List<KeySequence> keySequences = new ArrayList<KeySequence>();
                        if (isCustom)
                            keySequences = customBindings.get(id).getKeyBindings();
                        else
                            keySequences.add(command.getKeySequence());
                        for (KeySequence keys : keySequences) {
                            KeyboardShortcutEntry binding = new KeyboardShortcutEntry(id, name, keys, type, isCustom, command.getContext());
                            bindings.add(binding);
                        }
                    }
                    continuation.execute();
                }
            });
        }
    });
    // Sort and finish up
    queue.addCommand(new SerializedCommand() {

        @Override
        public void onExecute(final Command continuation) {
            Collections.sort(bindings, new Comparator<KeyboardShortcutEntry>() {

                @Override
                public int compare(KeyboardShortcutEntry o1, KeyboardShortcutEntry o2) {
                    if (o1.getContext() != o2.getContext())
                        return o1.getContext().compareTo(o2.getContext());
                    return o1.getName().compareTo(o2.getName());
                }
            });
            originalBindings_ = bindings;
            updateData(bindings);
            continuation.execute();
        }
    });
    queue.addCommand(new SerializedCommand() {

        @Override
        public void onExecute(Command continuation) {
            if (initialFilterText_ != null) {
                filterWidget_.setText(initialFilterText_);
                filter();
            }
            continuation.execute();
        }
    });
    // Exhaust the queue
    queue.run();
}
Also used : SerializedCommand(org.rstudio.core.client.SerializedCommand) RAddins(org.rstudio.studio.client.workbench.addins.Addins.RAddins) SerializedCommandQueue(org.rstudio.core.client.SerializedCommandQueue) ArrayList(java.util.ArrayList) JsArrayString(com.google.gwt.core.client.JsArrayString) CommandWithArg(org.rstudio.core.client.CommandWithArg) Comparator(java.util.Comparator) EditorKeyBinding(org.rstudio.core.client.command.EditorCommandManager.EditorKeyBinding) EditorKeyBindings(org.rstudio.core.client.command.EditorCommandManager.EditorKeyBindings) JsArray(com.google.gwt.core.client.JsArray) RAddin(org.rstudio.studio.client.workbench.addins.Addins.RAddin) JsArrayString(com.google.gwt.core.client.JsArrayString) Command(com.google.gwt.user.client.Command) SerializedCommand(org.rstudio.core.client.SerializedCommand) AceCommand(org.rstudio.studio.client.workbench.views.source.editors.text.ace.AceCommand) AceCommand(org.rstudio.studio.client.workbench.views.source.editors.text.ace.AceCommand) KeySequence(org.rstudio.core.client.command.KeyboardShortcut.KeySequence) Map(java.util.Map) HashMap(java.util.HashMap)

Example 3 with RAddins

use of org.rstudio.studio.client.workbench.addins.Addins.RAddins in project rstudio by rstudio.

the class ClientEventDispatcher method dispatchEvent.

private void dispatchEvent(ClientEvent event) {
    String type = event.getType();
    try {
        if (type.equals(ClientEvent.Busy)) {
            boolean busy = event.<Bool>getData().getValue();
            eventBus_.fireEvent(new BusyEvent(busy));
        } else if (type.equals(ClientEvent.ConsoleOutput)) {
            ConsoleText output = event.getData();
            eventBus_.fireEvent(new ConsoleWriteOutputEvent(output));
        } else if (type.equals(ClientEvent.ConsoleError)) {
            ConsoleText error = event.getData();
            eventBus_.fireEvent(new ConsoleWriteErrorEvent(error));
        } else if (type.equals(ClientEvent.ConsoleWritePrompt)) {
            String prompt = event.getData();
            eventBus_.fireEvent(new ConsoleWritePromptEvent(prompt));
        } else if (type.equals(ClientEvent.ConsoleWriteInput)) {
            ConsoleText input = event.getData();
            eventBus_.fireEvent(new ConsoleWriteInputEvent(input));
        } else if (type.equals(ClientEvent.ConsolePrompt)) {
            ConsolePrompt prompt = event.getData();
            eventBus_.fireEvent(new ConsolePromptEvent(prompt));
        } else if (type.equals(ClientEvent.ShowEditor)) {
            ShowEditorData data = event.getData();
            eventBus_.fireEvent(new ShowEditorEvent(data));
        } else if (type.equals(ClientEvent.FileChanged)) {
            FileChange fileChange = event.getData();
            eventBus_.fireEvent(new FileChangeEvent(fileChange));
        } else if (type.equals(ClientEvent.WorkingDirChanged)) {
            String path = event.getData();
            eventBus_.fireEvent(new WorkingDirChangedEvent(path));
        } else if (type.equals(ClientEvent.ShowHelp)) {
            String helpUrl = event.getData();
            eventBus_.fireEvent(new ShowHelpEvent(helpUrl));
        } else if (type.equals(ClientEvent.ShowErrorMessage)) {
            ErrorMessage errorMessage = event.getData();
            eventBus_.fireEvent(new ShowErrorMessageEvent(errorMessage));
        } else if (type.equals(ClientEvent.ChooseFile)) {
            boolean newFile = event.<Bool>getData().getValue();
            eventBus_.fireEvent(new ChooseFileEvent(newFile));
        } else if (type.equals(ClientEvent.BrowseUrl)) {
            BrowseUrlInfo urlInfo = event.getData();
            eventBus_.fireEvent(new BrowseUrlEvent(urlInfo));
        } else if (type.equals(ClientEvent.PlotsStateChanged)) {
            PlotsState plotsState = event.getData();
            eventBus_.fireEvent(new PlotsChangedEvent(plotsState));
        } else if (type.equals(ClientEvent.ViewData)) {
            DataView dataView = event.getData();
            eventBus_.fireEvent(new ViewDataEvent(dataView));
        } else if (type.equals(ClientEvent.PackageStateChanged)) {
            PackageState newState = event.getData();
            eventBus_.fireEvent(new PackageStateChangedEvent(newState));
        } else if (type.equals(ClientEvent.PackageStatusChanged)) {
            PackageStatus status = event.getData();
            eventBus_.fireEvent(new PackageStatusChangedEvent(status));
        } else if (type.equals(ClientEvent.Locator)) {
            eventBus_.fireEvent(new LocatorEvent());
        } else if (type.equals(ClientEvent.ConsoleResetHistory)) {
            ConsoleResetHistory reset = event.getData();
            eventBus_.fireEvent(new ConsoleResetHistoryEvent(reset));
        } else if (type.equals(ClientEvent.SessionSerialization)) {
            SessionSerializationAction action = event.getData();
            eventBus_.fireEvent(new SessionSerializationEvent(action));
        } else if (type.equals(ClientEvent.HistoryEntriesAdded)) {
            RpcObjectList<HistoryEntry> entries = event.getData();
            eventBus_.fireEvent(new HistoryEntriesAddedEvent(entries));
        } else if (type.equals(ClientEvent.QuotaStatus)) {
            QuotaStatus quotaStatus = event.getData();
            eventBus_.fireEvent(new QuotaStatusEvent(quotaStatus));
        } else if (type.equals(ClientEvent.FileEdit)) {
            FileSystemItem file = event.getData();
            eventBus_.fireEvent(new FileEditEvent(file));
        } else if (type.equals(ClientEvent.ShowContent)) {
            ContentItem content = event.getData();
            eventBus_.fireEvent(new ShowContentEvent(content));
        } else if (type.equals(ClientEvent.ShowData)) {
            DataItem data = event.getData();
            eventBus_.fireEvent(new ShowDataEvent(data));
        } else if (type.equals(ClientEvent.AbendWarning)) {
            eventBus_.fireEvent(new SessionAbendWarningEvent());
        } else if (type.equals(ClientEvent.ShowWarningBar)) {
            WarningBarMessage message = event.getData();
            eventBus_.fireEvent(new ShowWarningBarEvent(message));
        } else if (type.equals(ClientEvent.OpenProjectError)) {
            OpenProjectError error = event.getData();
            eventBus_.fireEvent(new OpenProjectErrorEvent(error));
        } else if (type.equals(ClientEvent.VcsRefresh)) {
            JsObject data = event.getData();
            eventBus_.fireEvent(new VcsRefreshEvent(Reason.NA, data.getInteger("delay")));
        } else if (type.equals(ClientEvent.AskPass)) {
            AskPassEvent.Data data = event.getData();
            eventBus_.fireEvent(new AskPassEvent(data));
        } else if (type.equals(ClientEvent.ConsoleProcessOutput)) {
            ServerConsoleOutputEvent.Data data = event.getData();
            eventBus_.fireEvent(new ServerConsoleOutputEvent(data.getHandle(), data.getOutput(), data.isError()));
        } else if (type.equals(ClientEvent.ConsoleProcessPrompt)) {
            ServerConsolePromptEvent.Data data = event.getData();
            eventBus_.fireEvent(new ServerConsolePromptEvent(data.getHandle(), data.getPrompt()));
        } else if (type.equals(ClientEvent.ConsoleProcessCreated)) {
            ConsoleProcessCreatedEvent.Data data = event.getData();
            eventBus_.fireEvent(new ConsoleProcessCreatedEvent(data));
        } else if (type.equals(ClientEvent.ConsoleProcessExit)) {
            ServerProcessExitEvent.Data data = event.getData();
            eventBus_.fireEvent(new ServerProcessExitEvent(data.getHandle(), data.getExitCode()));
        } else if (type.equals(ClientEvent.HTMLPreviewStartedEvent)) {
            HTMLPreviewStartedEvent.Data data = event.getData();
            eventBus_.fireEvent(new HTMLPreviewStartedEvent(data));
        } else if (type.equals(ClientEvent.HTMLPreviewOutputEvent)) {
            String output = event.getData();
            eventBus_.fireEvent(new HTMLPreviewOutputEvent(output));
        } else if (type.equals(ClientEvent.HTMLPreviewCompletedEvent)) {
            HTMLPreviewResult result = event.getData();
            eventBus_.fireEvent(new HTMLPreviewCompletedEvent(result));
        } else if (type.equals(ClientEvent.CompilePdfStartedEvent)) {
            CompilePdfStartedEvent.Data data = event.getData();
            eventBus_.fireEvent(new CompilePdfStartedEvent(data));
        } else if (type.equals(ClientEvent.CompilePdfOutputEvent)) {
            CompileOutput output = event.getData();
            eventBus_.fireEvent(new CompilePdfOutputEvent(output));
        } else if (type.equals(ClientEvent.CompilePdfErrorsEvent)) {
            JsArray<SourceMarker> data = event.getData();
            eventBus_.fireEvent(new CompilePdfErrorsEvent(data));
        } else if (type.equals(ClientEvent.CompilePdfCompletedEvent)) {
            CompilePdfResult result = event.getData();
            eventBus_.fireEvent(new CompilePdfCompletedEvent(result));
        } else if (type.equals(ClientEvent.SynctexEditFile)) {
            SourceLocation sourceLocation = event.getData();
            eventBus_.fireEvent(new SynctexEditFileEvent(sourceLocation));
        } else if (type.equals(ClientEvent.FindResult)) {
            FindResultEvent.Data data = event.getData();
            eventBus_.fireEvent(new FindResultEvent(data.getHandle(), data.getResults().toArrayList()));
        } else if (type.equals(ClientEvent.FindOperationEnded)) {
            String data = event.getData();
            eventBus_.fireEvent(new FindOperationEndedEvent(data));
        } else if (type.equals(ClientEvent.RPubsUploadStatus)) {
            RPubsUploadStatusEvent.Status status = event.getData();
            eventBus_.fireEvent(new RPubsUploadStatusEvent(status));
        } else if (type.equals(ClientEvent.BuildStarted)) {
            eventBus_.fireEvent(new BuildStartedEvent());
        } else if (type.equals(ClientEvent.BuildOutput)) {
            CompileOutput data = event.getData();
            eventBus_.fireEvent(new BuildOutputEvent(data));
        } else if (type.equals(ClientEvent.BuildCompleted)) {
            BuildCompletedEvent.Data data = event.getData();
            eventBus_.fireEvent(new BuildCompletedEvent(data));
        } else if (type.equals(ClientEvent.BuildErrors)) {
            BuildErrorsEvent.Data data = event.getData();
            eventBus_.fireEvent(new BuildErrorsEvent(data));
        } else if (type.equals(ClientEvent.DirectoryNavigate)) {
            DirectoryNavigateEvent.Data data = event.getData();
            eventBus_.fireEvent(new DirectoryNavigateEvent(data));
        } else if (type.equals(ClientEvent.DeferredInitCompleted)) {
            eventBus_.fireEvent(new DeferredInitCompletedEvent());
        } else if (type.equals(ClientEvent.PlotsZoomSizeChanged)) {
            PlotsZoomSizeChangedEvent.Data data = event.getData();
            eventBus_.fireEvent(new PlotsZoomSizeChangedEvent(data));
        } else if (type.equals(ClientEvent.SourceCppStarted)) {
            eventBus_.fireEvent(new SourceCppStartedEvent());
        } else if (type.equals(ClientEvent.SourceCppCompleted)) {
            SourceCppState state = event.getData();
            eventBus_.fireEvent(new SourceCppCompletedEvent(state));
        } else if (type.equals(ClientEvent.LoadedPackageUpdates)) {
            String installCmd = event.getData();
            eventBus_.fireEvent(new LoadedPackageUpdatesEvent(installCmd));
        } else if (type.equals(ClientEvent.ActivatePane)) {
            String pane = event.getData();
            eventBus_.fireEvent(new ActivatePaneEvent(pane));
        } else if (type.equals(ClientEvent.ShowPresentationPane)) {
            PresentationState state = event.getData();
            eventBus_.fireEvent(new ShowPresentationPaneEvent(state));
        } else if (type.equals(ClientEvent.EnvironmentRefresh)) {
            eventBus_.fireEvent(new EnvironmentRefreshEvent());
        } else if (type.equals(ClientEvent.ListChanged)) {
            eventBus_.fireEvent(new ListChangedEvent(event.<JsObject>getData()));
        } else if (type.equals(ClientEvent.UiPrefsChanged)) {
            UiPrefsChangedEvent.Data data = event.getData();
            eventBus_.fireEvent(new UiPrefsChangedEvent(data));
        } else if (type.equals(ClientEvent.ContextDepthChanged)) {
            EnvironmentContextData data = event.getData();
            eventBus_.fireEvent(new ContextDepthChangedEvent(data, true));
        } else if (type.equals(ClientEvent.HandleUnsavedChanges)) {
            eventBus_.fireEvent(new HandleUnsavedChangesEvent());
        } else if (type.equals(ClientEvent.Quit)) {
            QuitEvent.Data data = event.getData();
            eventBus_.fireEvent(new QuitEvent(data));
        } else if (type.equals(ClientEvent.Suicide)) {
            // NOTE: we don't explicitly stop listening for events here
            // for the reasons cited above in ClientEvent.Quit
            // fire event
            String message = event.getData();
            eventBus_.fireEvent(new SuicideEvent(message));
        } else if (type.equals(ClientEvent.SaveActionChanged)) {
            SaveAction action = event.getData();
            eventBus_.fireEvent(new SaveActionChangedEvent(action));
        } else if (type.equals(ClientEvent.EnvironmentAssigned)) {
            RObject objectInfo = event.getData();
            eventBus_.fireEvent(new EnvironmentObjectAssignedEvent(objectInfo));
        } else if (type.equals(ClientEvent.EnvironmentRemoved)) {
            String objectName = event.getData();
            eventBus_.fireEvent(new EnvironmentObjectRemovedEvent(objectName));
        } else if (type.equals(ClientEvent.BrowserLineChanged)) {
            LineData lineData = event.getData();
            eventBus_.fireEvent(new BrowserLineChangedEvent(lineData));
        } else if (type.equals(ClientEvent.PackageLoaded)) {
            eventBus_.fireEvent(new PackageLoadedEvent((String) event.getData()));
        } else if (type.equals(ClientEvent.PackageUnloaded)) {
            eventBus_.fireEvent(new PackageUnloadedEvent((String) event.getData()));
        } else if (type.equals(ClientEvent.PresentationPaneRequestCompleted)) {
            eventBus_.fireEvent(new PresentationPaneRequestCompletedEvent());
        } else if (type.equals(ClientEvent.UnhandledError)) {
            UnhandledError err = event.getData();
            eventBus_.fireEvent(new UnhandledErrorEvent(err));
        } else if (type.equals(ClientEvent.ErrorHandlerChanged)) {
            ErrorHandlerType handlerType = event.getData();
            eventBus_.fireEvent(new ErrorHandlerChangedEvent(handlerType));
        } else if (type.equals(ClientEvent.ViewerNavigate)) {
            ViewerNavigateEvent.Data data = event.getData();
            eventBus_.fireEvent(new ViewerNavigateEvent(data));
        } else if (type.equals(ClientEvent.SourceExtendedTypeDetected)) {
            SourceExtendedTypeDetectedEvent.Data data = event.getData();
            eventBus_.fireEvent(new SourceExtendedTypeDetectedEvent(data));
        } else if (type.equals(ClientEvent.ShinyViewer)) {
            ShinyApplicationParams data = event.getData();
            eventBus_.fireEvent(new ShinyApplicationStatusEvent(data, true));
        } else if (type.equals(ClientEvent.DebugSourceCompleted)) {
            DebugSourceResult result = (DebugSourceResult) event.getData();
            eventBus_.fireEvent(new DebugSourceCompletedEvent(result));
        } else if (type.equals(ClientEvent.RmdRenderStarted)) {
            RmdRenderStartedEvent.Data data = event.getData();
            eventBus_.fireEvent(new RmdRenderStartedEvent(data));
        } else if (type.equals(ClientEvent.RmdRenderOutput)) {
            CompileOutput data = event.getData();
            eventBus_.fireEvent(new RmdRenderOutputEvent(data));
        } else if (type.equals(ClientEvent.RmdRenderCompleted)) {
            RmdRenderResult result = event.getData();
            eventBus_.fireEvent(new RmdRenderCompletedEvent(result));
        } else if (type.equals(ClientEvent.RmdShinyDocStarted)) {
            RmdShinyDocInfo docInfo = event.getData();
            eventBus_.fireEvent(new RmdShinyDocStartedEvent(docInfo));
        } else if (type.equals(ClientEvent.RSConnectDeploymentOutput)) {
            CompileOutput output = event.getData();
            eventBus_.fireEvent(new RSConnectDeploymentOutputEvent(output));
        } else if (type.equals(ClientEvent.RSConnectDeploymentCompleted)) {
            String url = event.getData();
            eventBus_.fireEvent(new RSConnectDeploymentCompletedEvent(url));
        } else if (type.equals(ClientEvent.RSConnectDeploymentFailed)) {
            RSConnectDeploymentFailedEvent.Data data = event.getData();
            eventBus_.fireEvent(new RSConnectDeploymentFailedEvent(data));
        } else if (type.equals(ClientEvent.UserPrompt)) {
            UserPrompt prompt = event.getData();
            eventBus_.fireEvent(new UserPromptEvent(prompt));
        } else if (type.equals(ClientEvent.InstallRtools)) {
            InstallRtoolsEvent.Data data = event.getData();
            eventBus_.fireEvent(new InstallRtoolsEvent(data));
        } else if (type.equals(ClientEvent.InstallShiny)) {
            String userAction = event.getData();
            eventBus_.fireEvent(new InstallShinyEvent(userAction));
        } else if (type.equals(ClientEvent.SuspendAndRestart)) {
            SuspendAndRestartEvent.Data data = event.getData();
            eventBus_.fireEvent(new SuspendAndRestartEvent(data));
        } else if (type.equals(ClientEvent.DataViewChanged)) {
            DataViewChangedEvent.Data data = event.getData();
            eventBus_.fireEvent(new DataViewChangedEvent(data));
        } else if (type.equals(ClientEvent.ViewFunction)) {
            SearchPathFunctionDefinition data = event.getData();
            eventBus_.fireEvent(new CodeBrowserNavigationEvent(data, null, false, true));
        } else if (type.equals(ClientEvent.MarkersChanged)) {
            MarkersChangedEvent.Data data = event.getData();
            eventBus_.fireEvent(new MarkersChangedEvent(data));
        } else if (type.equals(ClientEvent.EnableRStudioConnect)) {
            EnableRStudioConnectUIEvent.Data data = event.getData();
            eventBus_.fireEvent(new EnableRStudioConnectUIEvent(data));
        } else if (type.equals(ClientEvent.UpdateGutterMarkers)) {
            LintEvent.Data data = event.getData();
            eventBus_.fireEvent(new LintEvent(data));
        } else if (type.equals(ClientEvent.SnippetsChanged)) {
            SnippetsChangedEvent.Data data = event.getData();
            eventBus_.fireEvent(new SnippetsChangedEvent(data));
        } else if (type.equals(ClientEvent.JumpToFunction)) {
            JumpToFunctionEvent.Data data = event.getData();
            eventBus_.fireEvent(new JumpToFunctionEvent(data));
        } else if (type.equals(ClientEvent.CollabEditStarted)) {
            CollabEditStartParams params = event.getData();
            eventBus_.fireEvent(new CollabEditStartedEvent(params));
        } else if (type.equals(ClientEvent.SessionCountChanged)) {
            SessionCountChangedEvent.Data data = event.getData();
            eventBus_.fireEvent(new SessionCountChangedEvent(data));
        } else if (type.equals(ClientEvent.CollabEditEnded)) {
            CollabEditEndedEvent.Data data = event.getData();
            eventBus_.fireEvent(new CollabEditEndedEvent(data));
        } else if (type.equals(ClientEvent.ProjectUsersChanged)) {
            ProjectUserChangedEvent.Data data = event.getData();
            eventBus_.fireEvent(new ProjectUserChangedEvent(data));
        } else if (type.equals(ClientEvent.RVersionsChanged)) {
            RVersionsInfo versions = event.getData();
            eventBus_.fireEvent(new RVersionsChangedEvent(versions));
        } else if (type.equals(ClientEvent.ShinyGadgetDialog)) {
            ShinyGadgetDialogEvent.Data data = event.getData();
            eventBus_.fireEvent(new ShinyGadgetDialogEvent(data));
        } else if (type.equals(ClientEvent.RmdParamsReady)) {
            String paramsFile = event.getData();
            eventBus_.fireEvent(new RmdParamsReadyEvent(paramsFile));
        } else if (type.equals(ClientEvent.RegisterUserCommand)) {
            RegisterUserCommandEvent.Data data = event.getData();
            eventBus_.fireEvent(new RegisterUserCommandEvent(data));
        } else if (type.equals(ClientEvent.SendToConsole)) {
            SendToConsoleEvent.Data data = event.getData();
            eventBus_.fireEvent(new SendToConsoleEvent(data));
        } else if (type.equals(ClientEvent.UserFollowStarted)) {
            ProjectUser user = event.getData();
            eventBus_.fireEvent(new FollowUserEvent(user, true));
        } else if (type.equals(ClientEvent.UserFollowEnded)) {
            ProjectUser user = event.getData();
            eventBus_.fireEvent(new FollowUserEvent(user, false));
        } else if (type.equals(ClientEvent.ProjectAccessRevoked)) {
            eventBus_.fireEvent(new ProjectAccessRevokedEvent());
        } else if (type.equals(ClientEvent.CollabEditSaved)) {
            CollabEditSavedEvent.Data data = event.getData();
            eventBus_.fireEvent(new CollabEditSavedEvent(data));
        } else if (type.equals(ClientEvent.AddinRegistryUpdated)) {
            RAddins data = event.getData();
            eventBus_.fireEvent(new AddinRegistryUpdatedEvent(data));
        } else if (type.equals(ClientEvent.ChunkOutput)) {
            RmdChunkOutput data = event.getData();
            eventBus_.fireEvent(new RmdChunkOutputEvent(data));
        } else if (type.equals(ClientEvent.ChunkOutputFinished)) {
            RmdChunkOutputFinishedEvent.Data data = event.getData();
            eventBus_.fireEvent(new RmdChunkOutputFinishedEvent(data));
        } else if (type.equals(ClientEvent.RprofStarted)) {
            eventBus_.fireEvent(new RprofEvent(RprofEvent.RprofEventType.START, null));
        } else if (type.equals(ClientEvent.RprofStopped)) {
            eventBus_.fireEvent(new RprofEvent(RprofEvent.RprofEventType.STOP, null));
        } else if (type.equals(ClientEvent.RprofCreated)) {
            RprofEvent.Data data = event.getData();
            eventBus_.fireEvent(new RprofEvent(RprofEvent.RprofEventType.CREATE, data));
        } else if (type.equals(ClientEvent.EditorCommand)) {
            EditorCommandEvent.Data data = event.getData();
            EditorCommandEvent payload = new EditorCommandEvent(data);
            eventBus_.fireEvent(new EditorCommandDispatchEvent(payload));
        } else if (type.equals(ClientEvent.PreviewRmd)) {
            PreviewRmdEvent.Data data = event.getData();
            eventBus_.fireEvent(new PreviewRmdEvent(data));
        } else if (type.equals(ClientEvent.WebsiteFileSaved)) {
            FileSystemItem fsi = event.getData();
            eventBus_.fireEvent(new WebsiteFileSavedEvent(fsi));
        } else if (type.equals(ClientEvent.ChunkPlotRefreshed)) {
            ChunkPlotRefreshedEvent.Data data = event.getData();
            eventBus_.fireEvent(new ChunkPlotRefreshedEvent(data));
        } else if (type.equals(ClientEvent.ChunkPlotRefreshFinished)) {
            ChunkPlotRefreshFinishedEvent.Data data = event.getData();
            eventBus_.fireEvent(new ChunkPlotRefreshFinishedEvent(data));
        } else if (type.equals(ClientEvent.ReloadWithLastChanceSave)) {
            eventBus_.fireEvent(new ReloadWithLastChanceSaveEvent());
        } else if (type.equals(ClientEvent.ConnectionUpdated)) {
            ConnectionUpdatedEvent.Data data = event.getData();
            eventBus_.fireEvent(new ConnectionUpdatedEvent(data));
        } else if (type.equals(ClientEvent.EnableConnections)) {
            eventBus_.fireEvent(new EnableConnectionsEvent());
        } else if (type.equals(ClientEvent.ConnectionListChanged)) {
            JsArray<Connection> connections = event.getData();
            eventBus_.fireEvent(new ConnectionListChangedEvent(connections));
        } else if (type.equals(ClientEvent.ActiveConnectionsChanged)) {
            JsArray<ConnectionId> connections = event.getData();
            eventBus_.fireEvent(new ActiveConnectionsChangedEvent(connections));
        } else if (type.equals(ClientEvent.ConnectionOpened)) {
            Connection connection = event.getData();
            eventBus_.fireEvent(new ConnectionOpenedEvent(connection));
        } else if (type.equals(ClientEvent.NotebookRangeExecuted)) {
            NotebookRangeExecutedEvent.Data data = event.getData();
            eventBus_.fireEvent(new NotebookRangeExecutedEvent(data));
        } else if (type.equals(ClientEvent.ChunkExecStateChanged)) {
            ChunkExecStateChangedEvent.Data data = event.getData();
            eventBus_.fireEvent(new ChunkExecStateChangedEvent(data));
        } else if (type.equals(ClientEvent.NavigateShinyFrame)) {
            ShinyFrameNavigatedEvent.Data data = event.getData();
            eventBus_.fireEvent(new ShinyFrameNavigatedEvent(data));
        } else if (type.equals(ClientEvent.UpdateNewConnectionDialog)) {
            NewConnectionDialogUpdatedEvent.Data data = event.getData();
            eventBus_.fireEvent(new NewConnectionDialogUpdatedEvent(data));
        } else if (type.equals(ClientEvent.ProjectTemplateRegistryUpdated)) {
            ProjectTemplateRegistry data = event.getData();
            eventBus_.fireEvent(new ProjectTemplateRegistryUpdatedEvent(data));
        } else if (type.equals(ClientEvent.TerminalSubProcs)) {
            TerminalSubprocEvent.Data data = event.getData();
            eventBus_.fireEvent(new TerminalSubprocEvent(data));
        } else if (type.equals(ClientEvent.PackageExtensionIndexingCompleted)) {
            PackageProvidedExtensions.Data data = event.getData();
            eventBus_.fireEvent(new PackageExtensionIndexingCompletedEvent(data));
        } else if (type.equals(ClientEvent.RStudioAPIShowDialog)) {
            RStudioAPIShowDialogEvent.Data data = event.getData();
            eventBus_.fireEvent(new RStudioAPIShowDialogEvent(data));
        } else {
            GWT.log("WARNING: Server event not dispatched: " + type, null);
        }
    } catch (Throwable e) {
        GWT.log("WARNING: Exception occured dispatching event: " + type, e);
    }
}
Also used : EnableRStudioConnectUIEvent(org.rstudio.studio.client.rsconnect.events.EnableRStudioConnectUIEvent) AddinRegistryUpdatedEvent(org.rstudio.studio.client.workbench.addins.events.AddinRegistryUpdatedEvent) ConsoleText(org.rstudio.studio.client.workbench.views.console.model.ConsoleText) RmdShinyDocInfo(org.rstudio.studio.client.rmarkdown.model.RmdShinyDocInfo) RObject(org.rstudio.studio.client.workbench.views.environment.model.RObject) VcsRefreshEvent(org.rstudio.studio.client.workbench.views.vcs.common.events.VcsRefreshEvent) PreviewRmdEvent(org.rstudio.studio.client.rmarkdown.events.PreviewRmdEvent) HTMLPreviewStartedEvent(org.rstudio.studio.client.htmlpreview.events.HTMLPreviewStartedEvent) FindOperationEndedEvent(org.rstudio.studio.client.workbench.views.output.find.events.FindOperationEndedEvent) ServerProcessExitEvent(org.rstudio.studio.client.common.console.ServerProcessExitEvent) RSConnectDeploymentCompletedEvent(org.rstudio.studio.client.rsconnect.events.RSConnectDeploymentCompletedEvent) NewConnectionDialogUpdatedEvent(org.rstudio.studio.client.workbench.views.connections.events.NewConnectionDialogUpdatedEvent) ShowContentEvent(org.rstudio.studio.client.workbench.views.source.events.ShowContentEvent) PlotsChangedEvent(org.rstudio.studio.client.workbench.views.plots.events.PlotsChangedEvent) RStudioAPIShowDialogEvent(org.rstudio.studio.client.common.rstudioapi.events.RStudioAPIShowDialogEvent) FileSystemItem(org.rstudio.core.client.files.FileSystemItem) UiPrefsChangedEvent(org.rstudio.studio.client.workbench.prefs.events.UiPrefsChangedEvent) SnippetsChangedEvent(org.rstudio.studio.client.workbench.snippets.model.SnippetsChangedEvent) SourceExtendedTypeDetectedEvent(org.rstudio.studio.client.workbench.views.source.events.SourceExtendedTypeDetectedEvent) FileChangeEvent(org.rstudio.studio.client.workbench.views.files.events.FileChangeEvent) ShowDataEvent(org.rstudio.studio.client.workbench.views.source.events.ShowDataEvent) ProjectUserChangedEvent(org.rstudio.studio.client.projects.events.ProjectUserChangedEvent) ServerConsoleOutputEvent(org.rstudio.studio.client.common.console.ServerConsoleOutputEvent) CompilePdfErrorsEvent(org.rstudio.studio.client.common.compilepdf.events.CompilePdfErrorsEvent) ShowPresentationPaneEvent(org.rstudio.studio.client.workbench.views.presentation.events.ShowPresentationPaneEvent) FollowUserEvent(org.rstudio.studio.client.projects.events.FollowUserEvent) DataViewChangedEvent(org.rstudio.studio.client.workbench.views.source.events.DataViewChangedEvent) DirectoryNavigateEvent(org.rstudio.studio.client.workbench.views.files.events.DirectoryNavigateEvent) SourceCppCompletedEvent(org.rstudio.studio.client.workbench.views.output.sourcecpp.events.SourceCppCompletedEvent) FileChange(org.rstudio.studio.client.workbench.views.files.model.FileChange) AskPassEvent(org.rstudio.studio.client.workbench.views.vcs.common.events.AskPassEvent) EditorCommandEvent(org.rstudio.studio.client.events.EditorCommandEvent) EditorCommandDispatchEvent(org.rstudio.studio.client.events.EditorCommandDispatchEvent) ErrorHandlerChangedEvent(org.rstudio.studio.client.common.debugging.events.ErrorHandlerChangedEvent) Connection(org.rstudio.studio.client.workbench.views.connections.model.Connection) ShowHelpEvent(org.rstudio.studio.client.workbench.views.help.events.ShowHelpEvent) ConsoleResetHistory(org.rstudio.studio.client.workbench.views.console.model.ConsoleResetHistory) NotebookRangeExecutedEvent(org.rstudio.studio.client.rmarkdown.events.NotebookRangeExecutedEvent) InstallShinyEvent(org.rstudio.studio.client.common.dependencies.events.InstallShinyEvent) ChooseFileEvent(org.rstudio.studio.client.workbench.views.choosefile.events.ChooseFileEvent) ShinyApplicationStatusEvent(org.rstudio.studio.client.shiny.events.ShinyApplicationStatusEvent) RmdRenderCompletedEvent(org.rstudio.studio.client.rmarkdown.events.RmdRenderCompletedEvent) ConnectionUpdatedEvent(org.rstudio.studio.client.workbench.views.connections.events.ConnectionUpdatedEvent) BuildOutputEvent(org.rstudio.studio.client.workbench.views.buildtools.events.BuildOutputEvent) LintEvent(org.rstudio.studio.client.workbench.views.output.lint.events.LintEvent) ProjectAccessRevokedEvent(org.rstudio.studio.client.projects.events.ProjectAccessRevokedEvent) ErrorHandlerType(org.rstudio.studio.client.common.debugging.model.ErrorHandlerType) ShowEditorEvent(org.rstudio.studio.client.workbench.views.edit.events.ShowEditorEvent) SaveAction(org.rstudio.studio.client.application.model.SaveAction) RAddins(org.rstudio.studio.client.workbench.addins.Addins.RAddins) PresentationPaneRequestCompletedEvent(org.rstudio.studio.client.workbench.views.presentation.events.PresentationPaneRequestCompletedEvent) DebugSourceResult(org.rstudio.studio.client.workbench.views.environment.model.DebugSourceResult) ConsoleProcessCreatedEvent(org.rstudio.studio.client.common.console.ConsoleProcessCreatedEvent) OpenProjectError(org.rstudio.studio.client.projects.model.OpenProjectError) ServerConsolePromptEvent(org.rstudio.studio.client.common.console.ServerConsolePromptEvent) PlotsZoomSizeChangedEvent(org.rstudio.studio.client.workbench.views.plots.events.PlotsZoomSizeChangedEvent) JsObject(org.rstudio.core.client.js.JsObject) JsArray(com.google.gwt.core.client.JsArray) RmdRenderStartedEvent(org.rstudio.studio.client.rmarkdown.events.RmdRenderStartedEvent) ChunkPlotRefreshFinishedEvent(org.rstudio.studio.client.rmarkdown.events.ChunkPlotRefreshFinishedEvent) PackageStatusChangedEvent(org.rstudio.studio.client.workbench.views.packages.events.PackageStatusChangedEvent) RmdChunkOutputEvent(org.rstudio.studio.client.rmarkdown.events.RmdChunkOutputEvent) CompilePdfCompletedEvent(org.rstudio.studio.client.common.compilepdf.events.CompilePdfCompletedEvent) CompilePdfResult(org.rstudio.studio.client.common.compilepdf.model.CompilePdfResult) CollabEditEndedEvent(org.rstudio.studio.client.workbench.views.source.events.CollabEditEndedEvent) OpenProjectErrorEvent(org.rstudio.studio.client.projects.events.OpenProjectErrorEvent) BuildErrorsEvent(org.rstudio.studio.client.workbench.views.buildtools.events.BuildErrorsEvent) ProjectUser(org.rstudio.studio.client.projects.model.ProjectUser) RmdChunkOutput(org.rstudio.studio.client.rmarkdown.model.RmdChunkOutput) RSConnectDeploymentFailedEvent(org.rstudio.studio.client.rsconnect.events.RSConnectDeploymentFailedEvent) RprofEvent(org.rstudio.studio.client.workbench.views.source.editors.profiler.RprofEvent) ShinyFrameNavigatedEvent(org.rstudio.studio.client.shiny.events.ShinyFrameNavigatedEvent) ConnectionListChangedEvent(org.rstudio.studio.client.workbench.views.connections.events.ConnectionListChangedEvent) PresentationState(org.rstudio.studio.client.workbench.views.presentation.model.PresentationState) Bool(org.rstudio.studio.client.server.Bool) ViewerNavigateEvent(org.rstudio.studio.client.workbench.views.viewer.events.ViewerNavigateEvent) ConnectionListChangedEvent(org.rstudio.studio.client.workbench.views.connections.events.ConnectionListChangedEvent) CollabEditStartedEvent(org.rstudio.studio.client.workbench.views.source.events.CollabEditStartedEvent) TerminalSubprocEvent(org.rstudio.studio.client.workbench.views.terminal.events.TerminalSubprocEvent) HistoryEntriesAddedEvent(org.rstudio.studio.client.workbench.views.history.events.HistoryEntriesAddedEvent) UnhandledErrorEvent(org.rstudio.studio.client.common.debugging.events.UnhandledErrorEvent) HTMLPreviewResult(org.rstudio.studio.client.htmlpreview.model.HTMLPreviewResult) HTMLPreviewOutputEvent(org.rstudio.studio.client.htmlpreview.events.HTMLPreviewOutputEvent) SynctexEditFileEvent(org.rstudio.studio.client.common.synctex.events.SynctexEditFileEvent) MarkersChangedEvent(org.rstudio.studio.client.workbench.views.output.markers.events.MarkersChangedEvent) ProjectTemplateRegistry(org.rstudio.studio.client.projects.model.ProjectTemplateRegistry) HistoryEntry(org.rstudio.studio.client.workbench.views.history.model.HistoryEntry) RmdRenderResult(org.rstudio.studio.client.rmarkdown.model.RmdRenderResult) ContentItem(org.rstudio.studio.client.workbench.views.source.model.ContentItem) SourceLocation(org.rstudio.studio.client.common.synctex.model.SourceLocation) FindResultEvent(org.rstudio.studio.client.workbench.views.output.find.events.FindResultEvent) BuildStartedEvent(org.rstudio.studio.client.workbench.views.buildtools.events.BuildStartedEvent) RmdShinyDocStartedEvent(org.rstudio.studio.client.rmarkdown.events.RmdShinyDocStartedEvent) SessionSerializationAction(org.rstudio.studio.client.application.model.SessionSerializationAction) PackageState(org.rstudio.studio.client.workbench.views.packages.model.PackageState) PackageStatus(org.rstudio.studio.client.workbench.views.packages.model.PackageStatus) ViewDataEvent(org.rstudio.studio.client.workbench.views.data.events.ViewDataEvent) LoadedPackageUpdatesEvent(org.rstudio.studio.client.workbench.views.packages.events.LoadedPackageUpdatesEvent) ShinyGadgetDialogEvent(org.rstudio.studio.client.rmarkdown.events.ShinyGadgetDialogEvent) PackageExtensionIndexingCompletedEvent(org.rstudio.studio.client.packages.events.PackageExtensionIndexingCompletedEvent) CodeBrowserNavigationEvent(org.rstudio.studio.client.workbench.views.source.events.CodeBrowserNavigationEvent) HTMLPreviewCompletedEvent(org.rstudio.studio.client.htmlpreview.events.HTMLPreviewCompletedEvent) CompilePdfStartedEvent(org.rstudio.studio.client.common.compilepdf.events.CompilePdfStartedEvent) ServerConsolePromptEvent(org.rstudio.studio.client.common.console.ServerConsolePromptEvent) PackageStateChangedEvent(org.rstudio.studio.client.workbench.views.packages.events.PackageStateChangedEvent) LocatorEvent(org.rstudio.studio.client.workbench.views.plots.events.LocatorEvent) ConsolePrompt(org.rstudio.studio.client.workbench.views.console.model.ConsolePrompt) RPubsUploadStatusEvent(org.rstudio.studio.client.common.rpubs.events.RPubsUploadStatusEvent) BuildCompletedEvent(org.rstudio.studio.client.workbench.views.buildtools.events.BuildCompletedEvent) EnableConnectionsEvent(org.rstudio.studio.client.workbench.views.connections.events.EnableConnectionsEvent) RSConnectDeploymentOutputEvent(org.rstudio.studio.client.rsconnect.events.RSConnectDeploymentOutputEvent) ChunkPlotRefreshedEvent(org.rstudio.studio.client.rmarkdown.events.ChunkPlotRefreshedEvent) EnvironmentContextData(org.rstudio.studio.client.workbench.views.environment.model.EnvironmentContextData) FileEditEvent(org.rstudio.studio.client.workbench.views.source.events.FileEditEvent) DataItem(org.rstudio.studio.client.workbench.views.source.model.DataItem) PackageLoadedEvent(org.rstudio.studio.client.common.debugging.events.PackageLoadedEvent) SourceCppStartedEvent(org.rstudio.studio.client.workbench.views.output.sourcecpp.events.SourceCppStartedEvent) SearchPathFunctionDefinition(org.rstudio.studio.client.workbench.codesearch.model.SearchPathFunctionDefinition) CollabEditSavedEvent(org.rstudio.studio.client.workbench.views.source.events.CollabEditSavedEvent) RmdChunkOutputFinishedEvent(org.rstudio.studio.client.rmarkdown.events.RmdChunkOutputFinishedEvent) RmdParamsReadyEvent(org.rstudio.studio.client.rmarkdown.events.RmdParamsReadyEvent) ProjectTemplateRegistryUpdatedEvent(org.rstudio.studio.client.projects.events.ProjectTemplateRegistryUpdatedEvent) ActiveConnectionsChangedEvent(org.rstudio.studio.client.workbench.views.connections.events.ActiveConnectionsChangedEvent) SourceCppState(org.rstudio.studio.client.workbench.views.output.sourcecpp.model.SourceCppState) ChunkExecStateChangedEvent(org.rstudio.studio.client.rmarkdown.events.ChunkExecStateChangedEvent) ShowEditorData(org.rstudio.studio.client.workbench.views.edit.model.ShowEditorData) ShinyApplicationParams(org.rstudio.studio.client.shiny.model.ShinyApplicationParams) WebsiteFileSavedEvent(org.rstudio.studio.client.rmarkdown.events.WebsiteFileSavedEvent) CompilePdfOutputEvent(org.rstudio.studio.client.common.compilepdf.events.CompilePdfOutputEvent) ConnectionOpenedEvent(org.rstudio.studio.client.workbench.views.connections.events.ConnectionOpenedEvent) PlotsState(org.rstudio.studio.client.workbench.views.plots.model.PlotsState) CompileOutput(org.rstudio.studio.client.common.compile.CompileOutput) RmdRenderOutputEvent(org.rstudio.studio.client.rmarkdown.events.RmdRenderOutputEvent) EnvironmentContextData(org.rstudio.studio.client.workbench.views.environment.model.EnvironmentContextData) ShowEditorData(org.rstudio.studio.client.workbench.views.edit.model.ShowEditorData) CollabEditStartParams(org.rstudio.studio.client.workbench.views.source.events.CollabEditStartParams) UnhandledError(org.rstudio.studio.client.common.debugging.model.UnhandledError) DataView(org.rstudio.studio.client.workbench.views.data.model.DataView) PackageUnloadedEvent(org.rstudio.studio.client.common.debugging.events.PackageUnloadedEvent) RVersionsInfo(org.rstudio.studio.client.application.model.RVersionsInfo)

Example 4 with RAddins

use of org.rstudio.studio.client.workbench.addins.Addins.RAddins in project rstudio by rstudio.

the class AddinsCommandManager method registerBindings.

private void registerBindings(final EditorKeyBindings bindings, final CommandWithArg<EditorKeyBindings> afterLoad) {
    List<Pair<List<KeySequence>, CommandBinding>> commands = new ArrayList<Pair<List<KeySequence>, CommandBinding>>();
    RAddins rAddins = MainWindowObject.rAddins().get();
    for (String id : bindings.iterableKeys()) {
        List<KeySequence> keyList = bindings.get(id).getKeyBindings();
        RAddin addin = rAddins.get(id);
        if (addin == null)
            continue;
        CommandBinding binding = new AddinCommandBinding(addin);
        commands.add(new Pair<List<KeySequence>, CommandBinding>(keyList, binding));
    }
    KeyMap map = ShortcutManager.INSTANCE.getKeyMap(KeyMapType.ADDIN);
    for (int i = 0; i < commands.size(); i++) {
        map.setBindings(commands.get(i).first, commands.get(i).second);
    }
    if (afterLoad != null)
        afterLoad.execute(bindings);
}
Also used : RAddin(org.rstudio.studio.client.workbench.addins.Addins.RAddin) RAddins(org.rstudio.studio.client.workbench.addins.Addins.RAddins) ArrayList(java.util.ArrayList) AddinCommandBinding(org.rstudio.core.client.command.AddinCommandBinding) CommandBinding(org.rstudio.core.client.command.KeyMap.CommandBinding) AddinCommandBinding(org.rstudio.core.client.command.AddinCommandBinding) ArrayList(java.util.ArrayList) List(java.util.List) KeySequence(org.rstudio.core.client.command.KeyboardShortcut.KeySequence) Pair(org.rstudio.core.client.Pair) KeyMap(org.rstudio.core.client.command.KeyMap)

Example 5 with RAddins

use of org.rstudio.studio.client.workbench.addins.Addins.RAddins in project rstudio by rstudio.

the class PackageProvidedExtensions method update.

private void update(PackageProvidedExtensions.Data data) {
    // update addins
    RAddins addinRegistry = data.getAddinsRegistry();
    if (addinRegistry != null)
        events_.fireEvent(new AddinRegistryUpdatedEvent(addinRegistry));
    // update project templates
    ProjectTemplateRegistry ptRegistry = data.getProjectTemplateRegistry();
    if (ptRegistry != null)
        events_.fireEvent(new ProjectTemplateRegistryUpdatedEvent(ptRegistry));
}
Also used : AddinRegistryUpdatedEvent(org.rstudio.studio.client.workbench.addins.events.AddinRegistryUpdatedEvent) ProjectTemplateRegistry(org.rstudio.studio.client.projects.model.ProjectTemplateRegistry) RAddins(org.rstudio.studio.client.workbench.addins.Addins.RAddins) ProjectTemplateRegistryUpdatedEvent(org.rstudio.studio.client.projects.events.ProjectTemplateRegistryUpdatedEvent)

Aggregations

RAddins (org.rstudio.studio.client.workbench.addins.Addins.RAddins)5 JsArray (com.google.gwt.core.client.JsArray)2 ArrayList (java.util.ArrayList)2 KeySequence (org.rstudio.core.client.command.KeyboardShortcut.KeySequence)2 ProjectTemplateRegistryUpdatedEvent (org.rstudio.studio.client.projects.events.ProjectTemplateRegistryUpdatedEvent)2 ProjectTemplateRegistry (org.rstudio.studio.client.projects.model.ProjectTemplateRegistry)2 RAddin (org.rstudio.studio.client.workbench.addins.Addins.RAddin)2 AddinRegistryUpdatedEvent (org.rstudio.studio.client.workbench.addins.events.AddinRegistryUpdatedEvent)2 JsArrayString (com.google.gwt.core.client.JsArrayString)1 Command (com.google.gwt.user.client.Command)1 Comparator (java.util.Comparator)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 CommandWithArg (org.rstudio.core.client.CommandWithArg)1 Pair (org.rstudio.core.client.Pair)1 SerializedCommand (org.rstudio.core.client.SerializedCommand)1 SerializedCommandQueue (org.rstudio.core.client.SerializedCommandQueue)1 AddinCommandBinding (org.rstudio.core.client.command.AddinCommandBinding)1 EditorKeyBinding (org.rstudio.core.client.command.EditorCommandManager.EditorKeyBinding)1