com.intellij.openapi.editor.event.EditorMouseListener Java Examples

The following examples show how to use com.intellij.openapi.editor.event.EditorMouseListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EditorEventManager.java    From lsp4intellij with Apache License 2.0 5 votes vote down vote up
public EditorEventManager(Editor editor, DocumentListener documentListener, EditorMouseListener mouseListener,
                          EditorMouseMotionListener mouseMotionListener, LSPCaretListenerImpl caretListener,
                          RequestManager requestManager, ServerOptions serverOptions, LanguageServerWrapper wrapper) {

    this.editor = editor;
    this.documentListener = documentListener;
    this.mouseListener = mouseListener;
    this.mouseMotionListener = mouseMotionListener;
    this.requestManager = requestManager;
    this.wrapper = wrapper;
    this.caretListener = caretListener;

    this.identifier = new TextDocumentIdentifier(FileUtils.editorToURIString(editor));
    this.changesParams = new DidChangeTextDocumentParams(new VersionedTextDocumentIdentifier(),
            Collections.singletonList(new TextDocumentContentChangeEvent()));
    this.syncKind = serverOptions.syncKind;

    this.completionTriggers = (serverOptions.completionOptions != null
            && serverOptions.completionOptions.getTriggerCharacters() != null) ?
            serverOptions.completionOptions.getTriggerCharacters() :
            new ArrayList<>();

    this.signatureTriggers = (serverOptions.signatureHelpOptions != null
            && serverOptions.signatureHelpOptions.getTriggerCharacters() != null) ?
            serverOptions.signatureHelpOptions.getTriggerCharacters() :
            new ArrayList<>();

    this.project = editor.getProject();

    EditorEventManagerBase.uriToManager.put(FileUtils.editorToURIString(editor), this);
    EditorEventManagerBase.editorToManager.put(editor, this);
    changesParams.getTextDocument().setUri(identifier.getUri());

    this.currentHint = null;
}
 
Example #2
Source File: EditorWindowImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void removeEditorMouseListener(@Nonnull final EditorMouseListener listener) {
  EditorMouseListener wrapper = myEditorMouseListeners.removeWrapper(listener);
  // HintManager might have an old editor instance
  if (wrapper != null) {
    myDelegate.removeEditorMouseListener(wrapper);
  }
}
 
Example #3
Source File: TextComponentEditorImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void addEditorMouseListener(@Nonnull final EditorMouseListener listener) {
  throw new UnsupportedOperationException("Not implemented");
}
 
Example #4
Source File: TextComponentEditorImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void removeEditorMouseListener(@Nonnull final EditorMouseListener listener) {
  throw new UnsupportedOperationException("Not implemented");
}
 
Example #5
Source File: LazyEditor.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void addEditorMouseListener(@Nonnull final EditorMouseListener listener) {
  getEditor().addEditorMouseListener(listener);
}
 
Example #6
Source File: LazyEditor.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void removeEditorMouseListener(@Nonnull final EditorMouseListener listener) {
  getEditor().removeEditorMouseListener(listener);
}
 
Example #7
Source File: Editor.java    From consulo with Apache License 2.0 2 votes vote down vote up
/**
 * Adds a listener for receiving notifications about mouse clicks in the editor and
 * the mouse entering/exiting the editor.
 *
 * @param listener the listener instance.
 */
void addEditorMouseListener(@Nonnull EditorMouseListener listener);
 
Example #8
Source File: Editor.java    From consulo with Apache License 2.0 2 votes vote down vote up
/**
 * Adds a listener for receiving notifications about mouse clicks in the editor and
 * the mouse entering/exiting the editor.
 * The listener is removed when the given parent disposable is disposed.
 *
 * @param listener         the listener instance.
 * @param parentDisposable the parent Disposable instance.
 */
default void addEditorMouseListener(@Nonnull EditorMouseListener listener, @Nonnull Disposable parentDisposable) {
  addEditorMouseListener(listener);
  Disposer.register(parentDisposable, () -> removeEditorMouseListener(listener));
}
 
Example #9
Source File: Editor.java    From consulo with Apache License 2.0 2 votes vote down vote up
/**
 * Removes a listener for receiving notifications about mouse clicks in the editor and
 * the mouse entering/exiting the editor.
 *
 * @param listener the listener instance.
 */
void removeEditorMouseListener(@Nonnull EditorMouseListener listener);
 
Example #10
Source File: WebEditorImpl.java    From consulo with Apache License 2.0 2 votes vote down vote up
@Override
public void addEditorMouseListener(@Nonnull EditorMouseListener listener) {

}
 
Example #11
Source File: WebEditorImpl.java    From consulo with Apache License 2.0 2 votes vote down vote up
@Override
public void removeEditorMouseListener(@Nonnull EditorMouseListener listener) {

}