private static String resolveJsonResponseToMessage(GoogleJsonResponseException reason) { switch (reason.getStatusCode()) { case 403: return StackdriverDebuggerBundle.message("clouddebug.debug.targets.accessdenied"); default: return StackdriverDebuggerBundle.getString( "clouddebug.debug.targets.error", reason.getDetails().getMessage()); } }
public CloudDebugRunConfigurationPanel(Project ideProject) { this.ideProject = ideProject; docsLink.setHyperlinkText( StackdriverDebuggerBundle.message("clouddebug.runconfig.formoredetails"), StackdriverDebuggerBundle.message("clouddebug.runconfig.documentation.url.text"), "."); docsLink.setHyperlinkTarget( StackdriverDebuggerBundle.message("clouddebug.runconfig.documentation.url")); description.setText(StackdriverDebuggerBundle.message("clouddebug.runconfig.description")); }
public ReactivateBreakpointAction() { super( StackdriverDebuggerBundle.getString("clouddebug.reactivatesnapshotlocation"), StackdriverDebuggerIcons.CLOUD_DEBUG_REACTIVATE_BREAKPOINT); }
public static String getString( @NotNull @PropertyKey(resourceBundle = BUNDLE_NAME) String key, @NotNull Object... params) { return message(key, params); } }
public CloudLineBreakpointType() { super( "cloud-snapshotlocation", StackdriverDebuggerBundle.getString("clouddebug.breakpoint.description")); }
private void handleBreakpointQueryError(@NotNull CloudDebugProcessState state, String message) { state.setListenInBackground(false); String title = StackdriverDebuggerBundle.message("clouddebug.background.listener.error.title"); Notification notification = new Notification( CLOUD_DEBUGGER_ERROR_NOTIFICATIONS_DISPLAY_GROUP, title, message, NotificationType.ERROR); Notifications.Bus.notify(notification, state.getProject()); } }
RemoveAllBreakpointsAction() { super( StackdriverDebuggerBundle.getString("clouddebug.delete.all"), StackdriverDebuggerIcons.CLOUD_DEBUG_DELETE_ALL_BREAKPOINTS); }
private void handleBreakpointQueryError( @NotNull CloudDebugProcessState state, @NotNull Exception ex) { String message; String projectName = state.getProject().getName(); if (ex instanceof GoogleJsonResponseException) { GoogleJsonResponseException jsonResponseException = (GoogleJsonResponseException) ex; if (jsonResponseException.getStatusCode() == HttpURLConnection.HTTP_FORBIDDEN || jsonResponseException.getStatusCode() == HttpURLConnection.HTTP_UNAUTHORIZED) { message = StackdriverDebuggerBundle.message( "clouddebug.background.listener.access.error.message", projectName); } else { message = StackdriverDebuggerBundle.message( "clouddebug.background.listener.general.error.message", projectName, jsonResponseException.getDetails().getMessage()); } } else { message = StackdriverDebuggerBundle.message( "clouddebug.background.listener.general.error.message", projectName, ex.getLocalizedMessage()); } handleBreakpointQueryError(state, message); }
handleBreakpointQueryError( state, StackdriverDebuggerBundle.message( "clouddebug.background.listener.access.error.message", state.getProject().getName()));
@Override public String getConfigurationTypeDescription() { return StackdriverDebuggerBundle.getString("clouddebug.text"); }
@Override public String getDisplayName() { return StackdriverDebuggerBundle.getString("clouddebug.text"); }
protected CustomWatchGroup() { super(StackdriverDebuggerBundle.getString("clouddebug.watchexpressiongrouptitle")); }
@NotNull @Override public String getTabTitle() { return StackdriverDebuggerBundle.getString("clouddebug.snapshots"); }
private static String resolveErrorToMessage(Throwable reason) { if (reason instanceof GoogleJsonResponseException) { return resolveJsonResponseToMessage((GoogleJsonResponseException) reason); } else { return StackdriverDebuggerBundle.getString( "clouddebug.debug.targets.error", reason.getLocalizedMessage()); } }
@Override public void actionPerformed(AnActionEvent event) { int result = Messages.showOkCancelDialog( StackdriverDebuggerBundle.getString("clouddebug.remove.all"), StackdriverDebuggerBundle.getString("clouddebug.delete.snapshots"), StackdriverDebuggerBundle.getString("clouddebug.buttondelete"), StackdriverDebuggerBundle.getString("clouddebug.cancelbutton"), Messages.getQuestionIcon()); if (result == Messages.OK) { // pressed remove all SnapshotsModel model = getModel(); fireDeleteBreakpoints(model.getBreakpoints()); } } }
private void setOkText(boolean showForcedWording) { if (showForcedWording) { setOKButtonText( isContinued() && targetMatchesCurrentState() ? StackdriverDebuggerBundle.getString("clouddebug.continueanyway") : StackdriverDebuggerBundle.getString("clouddebug.attach.anyway")); } else { setOKButtonText( isContinued() && targetMatchesCurrentState() ? StackdriverDebuggerBundle.getString("clouddebug.continuesession") : StackdriverDebuggerBundle.getString("clouddebug.attach")); } }
/** This is a helper routine that converts a server {@link StatusMessage} to descriptive text. */ @Nullable public static String getUserErrorMessage(@Nullable StatusMessage statusMessage) { if (statusMessage == null || !Boolean.TRUE.equals(statusMessage.getIsError())) { return null; } String errorDescription = getUserMessage(statusMessage); return !Strings.isNullOrEmpty(errorDescription) ? errorDescription : StackdriverDebuggerBundle.getString("clouddebug.fallbackerrormessage"); }