public CloudDebuggerToolsMenuAction() { super( CloudDebugConfigType.getInstance(), StackdriverDebuggerBundle.message("appengine.tools.menu.debug.text"), StackdriverDebuggerBundle.message("appengine.tools.menu.debug.description"), StackdriverDebuggerIcons.STACKDRIVER_DEBUGGER); } }
/** * Loads Cloud Debugger process states so that the background job can continue to monitor them. * * @param state loaded component state */ @Override public void loadState(CloudDebugProcessStateSerializer.ProjectState state) { if (CloudDebugConfigType.isFeatureEnabled() && state.configStates != null) { for (RunConfigState configState : state.configStates) { stateMap.put(configState.configName, configState.processState); } } }
private void setupDebugRunConfiguration(@NotNull Project project) { RunManager runManager = RunManager.getInstance(project); boolean hasExistingDebugConfiguration = runManager .getAllConfigurationsList() .stream() .anyMatch(config -> config instanceof CloudDebugRunConfiguration); if (!hasExistingDebugConfiguration) { CloudDebugConfigType debugConfigType = CloudDebugConfigType.getInstance(); ConfigurationFactory factory = debugConfigType.getConfigurationFactories()[0]; RunnerAndConfigurationSettings settings = runManager.createConfiguration( new CloudDebugRunConfiguration(project, factory).clone(), factory); runManager.addConfiguration(settings, false /*isShared*/); } } }
.setActionValue("CAPTURE") .setStripResults(Boolean.TRUE) .setWaitToken(CloudDebugConfigType.useWaitToken() ? tokenToSend : null) .setClientVersion( ServiceManager.getService(PluginInfoService.class) if (!CloudDebugConfigType.useWaitToken() && tokenToSend.equals(responseWaitToken)) { try {
private CloudDebugProcessStateSerializer(@NotNull Project project) { this.project = project; if (CloudDebugConfigType.isFeatureEnabled()) {
/** * Enumerates all runconfigurations in this project and returns a serialized form of their process * states. * * @return a serialized form of the debuggee state as known to the client */ @Nullable @Override public CloudDebugProcessStateSerializer.ProjectState getState() { ProjectState projectState = new ProjectState(); if (CloudDebugConfigType.isFeatureEnabled()) { RunManager manager = RunManager.getInstance(project); for (RunnerAndConfigurationSettings config : manager.getAllSettings()) { if (config.getConfiguration() == null) { continue; } if (config.getConfiguration() instanceof CloudDebugRunConfiguration) { final CloudDebugRunConfiguration cloudConfig = (CloudDebugRunConfiguration) config.getConfiguration(); final CloudDebugProcessState state = cloudConfig.getProcessState(); if (state != null) { projectState.configStates.add(new RunConfigState(cloudConfig.getName(), state)); } } } } return projectState; }