mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
Use JBCefApp.isEnabled() where applicable
GitOrigin-RevId: 43cc537dcaf34f2dd4e646d01531f44d8e4c6f32
This commit is contained in:
committed by
intellij-monorepo-bot
parent
494fa6f1d8
commit
1eba352a3f
@@ -97,7 +97,9 @@ public abstract class JBCefApp {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated temporary
|
||||
* Should be used to check if JCEF is enabled in the platform, until it is enabled by default.
|
||||
*
|
||||
* @deprecated should not be used after JCEF is enabled by default
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean isEnabled() {
|
||||
@@ -120,6 +122,7 @@ public abstract class JBCefApp {
|
||||
@NotNull
|
||||
protected abstract CefAppConfig getCefAppConfig();
|
||||
|
||||
@SuppressWarnings("HardCodedStringLiteral")
|
||||
private static class JBCefAppMac extends JBCefApp {
|
||||
@NotNull
|
||||
@Override
|
||||
@@ -133,6 +136,7 @@ public abstract class JBCefApp {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("HardCodedStringLiteral")
|
||||
private static class JBCefAppWindows extends JBCefApp {
|
||||
@NotNull
|
||||
@Override
|
||||
@@ -146,6 +150,7 @@ public abstract class JBCefApp {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("HardCodedStringLiteral")
|
||||
private static class JBCefAppLinux extends JBCefApp {
|
||||
@NotNull
|
||||
@Override
|
||||
@@ -179,7 +184,6 @@ public abstract class JBCefApp {
|
||||
ourSchemeHandlerFactoryList.add(factory);
|
||||
}
|
||||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
public interface JBCefSchemeHandlerFactory extends CefSchemeHandlerFactory {
|
||||
/**
|
||||
* A callback to register the scheme handler via calling:
|
||||
|
||||
@@ -6,8 +6,8 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.wm.impl.IdeFrameImpl;
|
||||
import com.intellij.ui.jcef.JBCefApp;
|
||||
import com.intellij.ui.jcef.JBCefBrowser;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -27,7 +27,7 @@ public class WebBrowser extends AnAction implements DumbAware {
|
||||
Window activeFrame = IdeFrameImpl.getActiveFrame();
|
||||
if (activeFrame == null) return;
|
||||
|
||||
if (!Registry.is("ide.browser.jcef.enabled")) {
|
||||
if (!JBCefApp.isEnabled()) {
|
||||
JBPopupFactory.getInstance().createComponentPopupBuilder(
|
||||
new JTextArea("Set the reg key to enable JCEF:\n\"ide.browser.jcef.enabled=true\""), null).
|
||||
setTitle("JCEF web browser is not available").
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.intellij.openapi.extensions.PluginId;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.jcef.JBCefApp;
|
||||
import com.intellij.util.loader.NativeLibraryLoader;
|
||||
import com.intellij.util.ui.ImageUtil;
|
||||
import com.sun.javafx.application.PlatformImpl;
|
||||
@@ -217,7 +218,7 @@ public final class GlobalMenuLinux implements LinuxGlobalMenuEventHandler, Dispo
|
||||
};
|
||||
|
||||
// JCEF/JBR11 is not compliant with JFX
|
||||
if (!Registry.is("ide.browser.jcef.enabled")) {
|
||||
if (!JBCefApp.isEnabled()) {
|
||||
// NOTE: linux implementation of javaFX starts native main loop with GtkApplication._runLoop()
|
||||
try {
|
||||
PlatformImpl.startup(() -> ourLib.startWatchDbus(ourGLogger, ourOnAppmenuServiceAppeared, ourOnAppmenuServiceVanished));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.intellij.plugins.markdown.settings;
|
||||
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.ui.jcef.JBCefApp;
|
||||
import com.intellij.util.xmlb.annotations.Attribute;
|
||||
import com.intellij.util.xmlb.annotations.Property;
|
||||
import com.intellij.util.xmlb.annotations.Tag;
|
||||
@@ -21,7 +21,7 @@ public final class MarkdownPreviewSettings {
|
||||
@Property(surroundWithTag = false)
|
||||
@NotNull
|
||||
private MarkdownHtmlPanelProvider.ProviderInfo myHtmlPanelProviderInfo =
|
||||
Registry.is("ide.browser.jcef.enabled") ? new JCEFHtmlPanelProvider().getProviderInfo() : new JavaFxHtmlPanelProvider().getProviderInfo();
|
||||
JBCefApp.isEnabled() ? new JCEFHtmlPanelProvider().getProviderInfo() : new JavaFxHtmlPanelProvider().getProviderInfo();
|
||||
|
||||
@Attribute("UseGrayscaleRendering")
|
||||
private boolean myUseGrayscaleRendering = true;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.intellij.plugins.markdown.ui.preview.jcef;
|
||||
|
||||
import com.intellij.application.options.RegistryManager;
|
||||
import com.intellij.ui.jcef.JBCefApp;
|
||||
import com.intellij.ui.jcef.JBCefFileSchemeHandler;
|
||||
import org.cef.browser.CefBrowser;
|
||||
@@ -20,7 +19,7 @@ final class JCEFCustomSchemeInstaller {
|
||||
private static final String MD_FILE_SCHEME_NAME = "jcef-md-image";
|
||||
|
||||
JCEFCustomSchemeInstaller() {
|
||||
if (!RegistryManager.getInstance().is("ide.browser.jcef.enabled")) {
|
||||
if (!JBCefApp.isEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user