コード例 #1
0
 public void showMessage(final String message) {
   final CMDialogOptionsOverlay options = JavaScriptObject.createObject().cast();
   options.setBottom(true);
   final CMDialogOverlay dialog = this.editorOverlay.getDialog();
   if (dialog != null) {
     dialog.openNotification(message, options);
   } else {
     Log.info(CodeMirrorEditorWidget.class, message);
   }
 }
コード例 #2
0
  private void openFile(VirtualFile result, final OpenDeclarationDescriptor descriptor) {
    final Map<String, EditorPartPresenter> openedEditors = editorAgent.getOpenedEditors();
    Log.info(getClass(), result.getPath());
    if (openedEditors.containsKey(result.getPath())) {
      EditorPartPresenter editorPartPresenter = openedEditors.get(result.getPath());
      editorAgent.activateEditor(editorPartPresenter);
      fileOpened(editorPartPresenter, descriptor.getOffset());
    } else {
      editorAgent.openEditor(
          result,
          new EditorAgent.OpenEditorCallback() {
            @Override
            public void onEditorOpened(EditorPartPresenter editor) {
              fileOpened(editor, descriptor.getOffset());
            }

            @Override
            public void onEditorActivated(EditorPartPresenter editor) {}
          });
    }
  }