![JAR search and dependency download from the Maven repository](/logo.png)
com.intellij.ide.browsers.JavaScriptDebuggerStarter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xml Show documentation
Show all versions of xml Show documentation
A packaging of the IntelliJ Community Edition xml library.
This is release number 1 of trunk branch 142.
The newest version!
package com.intellij.ide.browsers;
import com.intellij.execution.configurations.RunConfiguration;
import com.intellij.openapi.extensions.ExtensionPointName;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Don't implement - consider to implement {@link com.jetbrains.javascript.debugger.FileUrlMapper} instead of providing mappings directly
* If you still want to implement - don't implement directly, use {@link com.intellij.javascript.debugger.execution.BaseJavaScriptDebuggerStarter}
*/
public interface JavaScriptDebuggerStarter {
boolean isApplicable(@NotNull RunConfiguration runConfiguration);
void start(@NotNull String url, @NotNull RC runConfiguration, @NotNull U userData, @Nullable WebBrowser browser);
final class Util {
static final ExtensionPointName EP_NAME = ExtensionPointName.create("org.jetbrains.javaScriptDebuggerStarter");
private static final Object NULL_OBJECT = new Object();
@Nullable
public static JavaScriptDebuggerStarter get(@NotNull RC runConfiguration) {
for (JavaScriptDebuggerStarter, ?> starter : EP_NAME.getExtensions()) {
if (starter.isApplicable(runConfiguration)) {
//noinspection unchecked
return (JavaScriptDebuggerStarter)starter;
}
}
return null;
}
public static boolean start(@NotNull RC runConfiguration, @NotNull String url) {
return start(runConfiguration, url, null);
}
public static boolean start(@NotNull RC runConfiguration, @NotNull String url, @Nullable WebBrowser browser) {
JavaScriptDebuggerStarter starter = get(runConfiguration);
if (starter == null) {
return false;
}
starter.start(url, runConfiguration, NULL_OBJECT, browser);
return true;
}
public static void startDebugOrLaunchBrowser(@NotNull RC runConfiguration, @NotNull StartBrowserSettings settings) {
String url = settings.getUrl();
assert url != null;
startDebugOrLaunchBrowser(runConfiguration, url, settings.getBrowser(), settings.isStartJavaScriptDebugger());
}
public static void startDebugOrLaunchBrowser(@NotNull RC runConfiguration,
@NotNull String url,
@Nullable WebBrowser browser,
boolean startDebugger) {
if (!startDebugger || !start(runConfiguration, url, browser)) {
BrowserLauncher.getInstance().browse(url, browser, runConfiguration.getProject());
}
}
public static boolean hasStarters() {
return EP_NAME.getExtensions().length > 0;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy