當前位置: 首頁>>代碼示例>>Java>>正文


Java JetBrainsProtocolHandler類代碼示例

本文整理匯總了Java中com.intellij.openapi.application.JetBrainsProtocolHandler的典型用法代碼示例。如果您正苦於以下問題:Java JetBrainsProtocolHandler類的具體用法?Java JetBrainsProtocolHandler怎麽用?Java JetBrainsProtocolHandler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


JetBrainsProtocolHandler類屬於com.intellij.openapi.application包,在下文中一共展示了JetBrainsProtocolHandler類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: execute

import com.intellij.openapi.application.JetBrainsProtocolHandler; //導入依賴的package包/類
@Nullable
@Override
public String execute(@NotNull QueryStringDecoder urlDecoder, @NotNull FullHttpRequest request, @NotNull ChannelHandlerContext context) throws IOException {
  final JsonReader reader = createJsonReader(request);
  reader.beginObject();
  final String name = reader.nextName();
  final String url = reader.nextString();
  reader.endObject();

  if (URL_PARAM_NAME.equals(name) && url != null && url.startsWith(JetBrainsProtocolHandler.PROTOCOL)) {
    JetBrainsProtocolHandler.processJetBrainsLauncherParameters(url);
    ApplicationManager.getApplication().invokeLater(new Runnable() {
      @Override
      public void run() {
        JBProtocolCommand.handleCurrentCommand();
      }
    }, ModalityState.any());
  }

  sendOk(request, context);
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:JetBrainsProtocolHandlerHttpService.java

示例2: checkForJetBrainsProtocolCommand

import com.intellij.openapi.application.JetBrainsProtocolHandler; //導入依賴的package包/類
private static String[] checkForJetBrainsProtocolCommand(String[] args) {
  final String jbUrl = System.getProperty(JetBrainsProtocolHandler.class.getName());
  if (jbUrl != null) {
    return new String[]{jbUrl};
  }
  return args;
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:8,代碼來源:SocketLock.java

示例3: getState

import com.intellij.openapi.application.JetBrainsProtocolHandler; //導入依賴的package包/類
/**
 * Plugin jar has been previously created via blaze build. This method: - copies jar to sandbox
 * environment - cracks open jar and finds plugin.xml (with ID, etc., needed for JVM args) - sets
 * up the SDK, etc. (use project SDK?) - sets up the JVM, and returns a JavaCommandLineState
 */
@Nullable
@Override
public RunProfileState getState(Executor executor, ExecutionEnvironment env)
    throws ExecutionException {
  final Sdk ideaJdk = pluginSdk;
  if (!IdeaJdkHelper.isIdeaJdk(ideaJdk)) {
    throw new ExecutionException("Choose an IntelliJ Platform Plugin SDK");
  }
  String sandboxHome = IdeaJdkHelper.getSandboxHome(ideaJdk);
  if (sandboxHome == null) {
    throw new ExecutionException("No sandbox specified for IntelliJ Platform Plugin SDK");
  }

  try {
    sandboxHome = new File(sandboxHome).getCanonicalPath();
  } catch (IOException e) {
    throw new ExecutionException("No sandbox specified for IntelliJ Platform Plugin SDK");
  }
  String buildNumber = IdeaJdkHelper.getBuildNumber(ideaJdk);
  final BlazeIntellijPluginDeployer deployer =
      new BlazeIntellijPluginDeployer(sandboxHome, buildNumber, getTarget());
  env.putUserData(BlazeIntellijPluginDeployer.USER_DATA_KEY, deployer);

  // copy license from running instance of idea
  IdeaJdkHelper.copyIDEALicense(sandboxHome);

  return new JavaCommandLineState(env) {
    @Override
    protected JavaParameters createJavaParameters() throws ExecutionException {
      List<String> pluginIds = deployer.deployNonBlocking();

      final JavaParameters params = new JavaParameters();

      ParametersList vm = params.getVMParametersList();

      fillParameterList(vm, vmParameters);
      fillParameterList(params.getProgramParametersList(), programParameters);

      IntellijWithPluginClasspathHelper.addRequiredVmParams(params, ideaJdk);

      vm.defineProperty(
          JetBrainsProtocolHandler.REQUIRED_PLUGINS_KEY, Joiner.on(',').join(pluginIds));

      if (!vm.hasProperty(PlatformUtils.PLATFORM_PREFIX_KEY) && buildNumber != null) {
        String prefix = IdeaJdkHelper.getPlatformPrefix(buildNumber);
        if (prefix != null) {
          vm.defineProperty(PlatformUtils.PLATFORM_PREFIX_KEY, prefix);
        }
      }
      return params;
    }

    @Override
    protected OSProcessHandler startProcess() throws ExecutionException {
      deployer.blockUntilDeployComplete();
      final OSProcessHandler handler = super.startProcess();
      handler.addProcessListener(
          new ProcessAdapter() {
            @Override
            public void processTerminated(ProcessEvent event) {
              deployer.deleteDeployment();
            }
          });
      return handler;
    }
  };
}
 
開發者ID:bazelbuild,項目名稱:intellij,代碼行數:73,代碼來源:BlazeIntellijPluginConfiguration.java

示例4: isShutdownCommand

import com.intellij.openapi.application.JetBrainsProtocolHandler; //導入依賴的package包/類
private static boolean isShutdownCommand() {
  return "shutdown".equals(JetBrainsProtocolHandler.getCommand());
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:4,代碼來源:SocketLock.java


注:本文中的com.intellij.openapi.application.JetBrainsProtocolHandler類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。