• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ShowMessageRequestParams类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.lsp4j.ShowMessageRequestParams的典型用法代码示例。如果您正苦于以下问题:Java ShowMessageRequestParams类的具体用法?Java ShowMessageRequestParams怎么用?Java ShowMessageRequestParams使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ShowMessageRequestParams类属于org.eclipse.lsp4j包,在下文中一共展示了ShowMessageRequestParams类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: sendShowMessageRequest

import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
public CompletableFuture<MessageActionItem> sendShowMessageRequest(
    ShowMessageRequestParams requestParams) {
  CompletableFuture<MessageActionItem> result = new CompletableFuture<>();
  if (showMessageRequestEndpointIds.isEmpty()) {
    result.complete(null);
  }
  for (String endpointId : endpointIds) {
    requestTransmitter
        .newRequest()
        .endpointId(endpointId)
        .methodName("window/showMessageRequest")
        .paramsAsDto(requestParams)
        .sendAndReceiveResultAsDto(MessageActionItem.class)
        .onSuccess(
            actionItem -> {
              if (!result.isDone()) {
                result.complete(actionItem);
              }
            })
        .onFailure(
            jsonRpcError ->
                result.completeExceptionally(new Exception(jsonRpcError.getMessage())));
  }

  return result;
}
 
开发者ID:eclipse,项目名称:che,代码行数:27,代码来源:ShowMessageJsonRpcTransmitter.java


示例2: testName

import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
@Test
public void testName() throws Exception {
  CompletableFuture<MessageActionItem> future = new CompletableFuture<>();
  when(transmitter.sendShowMessageRequest(any())).thenReturn(future);

  ServerInitializerImpl initializer = new ServerInitializerImpl();
  CheLanguageClient client = new CheLanguageClient(eventService, transmitter, "id");
  CompletableFuture<Pair<LanguageServer, InitializeResult>> initialize =
      initializer.initialize(launcher, client, "/tmp");
  Pair<LanguageServer, InitializeResult> resultPair = initialize.get();
  server = resultPair.first;
  ArgumentCaptor<ShowMessageRequestParams> captor =
      ArgumentCaptor.forClass(ShowMessageRequestParams.class);
  verify(transmitter, timeout(1500)).sendShowMessageRequest(captor.capture());

  ShowMessageRequestParams value = captor.getValue();
  assertNotNull(value);
  assertEquals(value.getType(), MessageType.Error);
  assertEquals(value.getMessage(), "Error Message!!!!");
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:ShowMessageRequestTest.java


示例3: processNotificationRequest

import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
public JsonRpcPromise<MessageActionItem> processNotificationRequest(
    ShowMessageRequestParams params) {
  JsonRpcPromise<MessageActionItem> result = new JsonRpcPromise<>();

  MessageDialogPresenter dialogPresenter = provider.get();
  dialogPresenter.show(
      params.getMessage(),
      params.getType().toString(),
      params.getActions(),
      actionItem -> {
        result
            .getSuccessConsumer()
            .ifPresent(consumer -> consumer.accept("ws-agent", actionItem));
      });

  return result;
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:ShowMessageRequestProcessor.java


示例4: configureReceiver

import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
@Inject
private void configureReceiver(
    Provider<ShowMessageProcessor> provider, RequestHandlerConfigurator configurator) {
  configurator
      .newConfiguration()
      .methodName("window/showMessage")
      .paramsAsDto(ShowMessageRequestParams.class)
      .noResult()
      .withConsumer(params -> provider.get().processNotification(params));
}
 
开发者ID:eclipse,项目名称:che,代码行数:11,代码来源:ShowMessageJsonRpcReceiver.java


示例5: configureShowMessageRequestReceiver

import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
@Inject
private void configureShowMessageRequestReceiver(
    Provider<ShowMessageRequestProcessor> provider, RequestHandlerConfigurator configurator) {
  configurator
      .newConfiguration()
      .methodName("window/showMessageRequest")
      .paramsAsDto(ShowMessageRequestParams.class)
      .resultAsPromiseDto(MessageActionItem.class)
      .withPromise(params -> provider.get().processNotificationRequest(params));
}
 
开发者ID:eclipse,项目名称:che,代码行数:11,代码来源:ShowMessageJsonRpcReceiver.java


示例6: showMessageRequest

import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
@Override
public CompletableFuture<MessageActionItem> showMessageRequest(ShowMessageRequestParams requestParams) {
	return null;
}
 
开发者ID:lhein,项目名称:camel-language-server,代码行数:5,代码来源:AbstractCamelLanguageServerTest.java


示例7: showMessageRequest

import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
public CompletableFuture<MessageActionItem> showMessageRequest(final ShowMessageRequestParams requestParams) {
  return this.noImpl3.showMessageRequest(requestParams);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:CommandRegistryTest.java


示例8: showMessageRequest

import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
@Override
public CompletableFuture<MessageActionItem> showMessageRequest(ShowMessageRequestParams requestParams) {
	throw new UnsupportedOperationException();
}
 
开发者ID:eclipse,项目名称:lsp4j,代码行数:5,代码来源:MockLanguageClient.java


示例9: showMessageRequest

import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
@Override
public CompletableFuture<MessageActionItem> showMessageRequest(
    ShowMessageRequestParams requestParams) {
  return transmitter.sendShowMessageRequest(requestParams);
}
 
开发者ID:eclipse,项目名称:che,代码行数:6,代码来源:CheLanguageClient.java


示例10: showNotificationMessageRequest

import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
/**
 * Sends the message to the client, to be displayed on a UI element.
 * Waits for an answer from the user and returns the selected
 * action.
 *
 * @param type
 * @param msg
 * @return
 */
public MessageActionItem showNotificationMessageRequest(MessageType type, String msg, List<MessageActionItem> actions){
	ShowMessageRequestParams $ = new ShowMessageRequestParams();
	$.setMessage(msg);
	$.setType(type);
	$.setActions(actions);
	return client.showMessageRequest($).join();
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:17,代码来源:JavaClientConnection.java


示例11: showMessageRequest

import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
/**
 * The show message request is sent from a server to a client to ask the
 * client to display a particular message in the user interface. In addition
 * to the show message notification the request allows to pass actions and
 * to wait for an answer from the client.
 */
@JsonRequest("window/showMessageRequest")
CompletableFuture<MessageActionItem> showMessageRequest(ShowMessageRequestParams requestParams);
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:9,代码来源:LanguageClient.java



注:本文中的org.eclipse.lsp4j.ShowMessageRequestParams类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AddCachePoolOp类代码示例发布时间:2022-05-22
下一篇:
Java EasyRecyclerView类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap