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

Java MessageActionItem类代码示例

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

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



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

示例1: sendShowMessageRequest

import org.eclipse.lsp4j.MessageActionItem; //导入依赖的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.MessageActionItem; //导入依赖的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.MessageActionItem; //导入依赖的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: configureShowMessageRequestReceiver

import org.eclipse.lsp4j.MessageActionItem; //导入依赖的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


示例5: show

import org.eclipse.lsp4j.MessageActionItem; //导入依赖的package包/类
public void show(
    String content,
    String title,
    List<MessageActionItem> actions,
    Consumer<MessageActionItem> callback) {
  this.callback = callback;
  view.setContent(content);
  view.setTitle(title);
  view.setActions(actions);
  view.showDialog();
}
 
开发者ID:eclipse,项目名称:che,代码行数:12,代码来源:MessageDialogPresenter.java


示例6: setActions

import org.eclipse.lsp4j.MessageActionItem; //导入依赖的package包/类
public void setActions(List<MessageActionItem> actions) {
  actions.forEach(
      action -> {
        Button button = new Button();
        button.setText(action.getTitle());
        button.addClickHandler(clickEvent -> actionDelegate.onAction(action));
        button.addStyleName(style.actionButton());
        rootPanel.add(button);
      });
}
 
开发者ID:eclipse,项目名称:che,代码行数:11,代码来源:MessageDialogFooter.java


示例7: showMessageRequest

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


示例8: ShowMessageRequestParams

import org.eclipse.lsp4j.MessageActionItem; //导入依赖的package包/类
public ShowMessageRequestParams(final List<MessageActionItem> actions) {
  this.actions = actions;
}
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:4,代码来源:ShowMessageRequestParams.java


示例9: getActions

import org.eclipse.lsp4j.MessageActionItem; //导入依赖的package包/类
/**
 * The message action items to present.
 */
@Pure
public List<MessageActionItem> getActions() {
  return this.actions;
}
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:8,代码来源:ShowMessageRequestParams.java


示例10: setActions

import org.eclipse.lsp4j.MessageActionItem; //导入依赖的package包/类
/**
 * The message action items to present.
 */
public void setActions(final List<MessageActionItem> actions) {
  this.actions = actions;
}
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:7,代码来源:ShowMessageRequestParams.java


示例11: showMessageRequest

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


示例12: showMessageRequest

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


示例13: showMessageRequest

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


示例14: onAction

import org.eclipse.lsp4j.MessageActionItem; //导入依赖的package包/类
@Override
public void onAction(MessageActionItem actionItem) {
  view.closeDialog();
  callback.accept(actionItem);
}
 
开发者ID:eclipse,项目名称:che,代码行数:6,代码来源:MessageDialogPresenter.java


示例15: setActions

import org.eclipse.lsp4j.MessageActionItem; //导入依赖的package包/类
@Override
public void setActions(List<MessageActionItem> actions) {
  footer.setActions(actions);
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:MessageDialogViewImpl.java


示例16: showNotificationMessageRequest

import org.eclipse.lsp4j.MessageActionItem; //导入依赖的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


示例17: showMessageRequest

import org.eclipse.lsp4j.MessageActionItem; //导入依赖的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


示例18: setActions

import org.eclipse.lsp4j.MessageActionItem; //导入依赖的package包/类
void setActions(List<MessageActionItem> actions); 
开发者ID:eclipse,项目名称:che,代码行数:2,代码来源:MessageDialogView.java


示例19: onAction

import org.eclipse.lsp4j.MessageActionItem; //导入依赖的package包/类
void onAction(MessageActionItem actionItem); 
开发者ID:eclipse,项目名称:che,代码行数:2,代码来源:MessageDialogView.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java Device类代码示例发布时间:2022-05-22
下一篇:
Java Endpoint类代码示例发布时间: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