@Override
  public void getCompletion(boolean insert, final CompletionCallback callback) {
    client.applyProposal(
        sessionId,
        id,
        insert,
        new AsyncCallback<ProposalApplyResult>() {
          @Override
          public void onFailure(Throwable caught) {
            Log.error(JavaCompletionProposal.class, caught);
          }

          @Override
          public void onSuccess(ProposalApplyResult result) {
            callback.onCompletion(
                new CompletionImpl(
                    result.getChanges(), result.getSelection(), result.getLinkedModeModel()));

            final VirtualFile file = editorAgent.getActiveEditor().getEditorInput().getFile();

            if (file instanceof Resource) {
              final ChangeInfo changeInfo = result.getChangeInfo();
              if (changeInfo != null) {
                refactoringUpdater.updateAfterRefactoring(singletonList(changeInfo));
              }
            }
          }
        });
  }
  private void setupProposals(
      final CodeAssistCallback callback,
      final TextEditor textEditor,
      final int offset,
      final List<Problem> annotations) {
    final VirtualFile file = textEditor.getEditorInput().getFile();
    final String projectPath = file.getProject().getProjectConfig().getPath();
    String fqn = JavaSourceFolderUtil.getFQNForFile(file);
    Unmarshallable<Proposals> unmarshaller = unmarshallerFactory.newUnmarshaller(Proposals.class);
    client.computeAssistProposals(
        projectPath,
        fqn,
        offset,
        annotations,
        new AsyncRequestCallback<Proposals>(unmarshaller) {
          @Override
          protected void onSuccess(Proposals proposals) {
            showProposals(callback, proposals, textEditor);
          }

          @Override
          protected void onFailure(Throwable throwable) {
            Log.error(JavaCodeAssistProcessor.class, throwable);
          }
        });
  }
 /** {@inheritDoc} */
 @Override
 public void getAdditionalProposalInfo(AsyncCallback<Widget> callback) {
   Frame frame = new Frame();
   frame.setSize("100%", "100%");
   frame.getElement().getStyle().setBorderStyle(Style.BorderStyle.NONE);
   frame.getElement().setAttribute("sandbox", ""); // empty value, not null
   frame.getElement().getStyle().setProperty("resize", "both");
   frame.setUrl(client.getProposalDocUrl(id, sessionId));
   callback.onSuccess(frame);
 }