mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
[jcef] Make Restart JCEF action text more user readable
GitOrigin-RevId: 90c8aeb4fa46fb5ac92e3bc18e786336f511e90e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1e36673a9e
commit
5918045c9b
@@ -107,6 +107,7 @@ public final class JBCefApp {
|
||||
if (SettingsHelper.isDebugMode()) {
|
||||
// Init VERBOSE java logging
|
||||
LOG.info("Use verbose CefLog to stderr.");
|
||||
//noinspection UseOfSystemOutOrSystemErr
|
||||
System.err.println("Use verbose CefLog to stderr.");
|
||||
CefLog.init(null, CefSettings.LogSeverity.LOGSEVERITY_VERBOSE);
|
||||
|
||||
@@ -179,13 +180,15 @@ public final class JBCefApp {
|
||||
|
||||
if (IS_REMOTE_ENABLED) {
|
||||
StartupTest.checkBrowserCreation(myCefApp, () -> restartJCEF(true, true));
|
||||
ActionManagerEx.getInstanceEx().registerAction("RestartJCEFActionId", new AnAction("Restart JCEF") {
|
||||
//noinspection UnresolvedPluginConfigReference
|
||||
ActionManagerEx.getInstanceEx().registerAction("RestartJCEFActionId", new AnAction(JcefBundle.message("action.RestartJCEFActionId.text")) {
|
||||
@Override
|
||||
public void actionPerformed(@NotNull AnActionEvent e) {
|
||||
restartJCEF(false, true);
|
||||
}
|
||||
});
|
||||
ActionManagerEx.getInstanceEx().registerAction("RestartJCEFWithDebugActionId", new AnAction("Restart JCEF with verbose logging") {
|
||||
//noinspection UnresolvedPluginConfigReference
|
||||
ActionManagerEx.getInstanceEx().registerAction("RestartJCEFWithDebugActionId", new AnAction(JcefBundle.message("action.RestartJCEFWithDebugActionId.text")) {
|
||||
@Override
|
||||
public void actionPerformed(@NotNull AnActionEvent e) {
|
||||
restartJCEF(true, true);
|
||||
@@ -198,8 +201,9 @@ public final class JBCefApp {
|
||||
}
|
||||
|
||||
private boolean restartJCEF(boolean withVerboseLogging, boolean withNewCachePath) {
|
||||
if (!IS_REMOTE_ENABLED)
|
||||
if (!IS_REMOTE_ENABLED) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean result = false;
|
||||
// Temporary use reflection to avoid jcef-version increment
|
||||
|
||||
25
platform/ui.jcef/jcef/JcefBundle.kt
Normal file
25
platform/ui.jcef/jcef/JcefBundle.kt
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ui.jcef
|
||||
|
||||
import com.intellij.DynamicBundle
|
||||
import org.jetbrains.annotations.Nls
|
||||
import org.jetbrains.annotations.NonNls
|
||||
import org.jetbrains.annotations.PropertyKey
|
||||
import java.util.function.Supplier
|
||||
|
||||
@NonNls
|
||||
private const val BUNDLE = "messages.JcefBundle"
|
||||
|
||||
internal object JcefBundle {
|
||||
private val instance = DynamicBundle(JcefBundle::class.java, BUNDLE)
|
||||
|
||||
@JvmStatic
|
||||
fun message(key: @PropertyKey(resourceBundle = BUNDLE) String, vararg params: Any): @Nls String {
|
||||
return instance.getMessage(key, *params)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun lazyMessage(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): Supplier<@Nls String> {
|
||||
return instance.getLazyMessage(key, *params)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
action.RestartJCEFActionId.text=Restart Web Browser (JCEF)
|
||||
action.RestartJCEFWithDebugActionId.text=Restart Web Browser with Verbose Logging (JCEF)
|
||||
Reference in New Issue
Block a user