MouseEvent - content area
Is it possible to determine if a MouseEvent is within the editor/content
portion of a window? I have a problem with the Selector plugin - it's
prevent breakpoint clicks in the gray area of the window.
--
Jordan Zimmerman
Altura International
Catalog City
Please sign in to leave a comment.
As you subscribe to EditorMouseEvents via Editor.addEditorMouseListener(),
Editor.addEditorMouseMotionListener() you have a getArea() in
EditorMouseEvent which returns an enumeration item specifying what you need:
public static final EditorMouseEventArea EDITING_AREA = new
EditorMouseEventArea("EDITING_AREA");
public static final EditorMouseEventArea LINE_NUMBERS_AREA = new
EditorMouseEventArea("LINE_NUMBERS_AREA");
public static final EditorMouseEventArea LINE_MARKERS_AREA = new
EditorMouseEventArea("LINE_MARKERS_AREA");
public static final EditorMouseEventArea FOLDING_OUTLINE_AREA = new
EditorMouseEventArea("FOLDING_OUTLINE_AREA");
--
Best regards,
Maxim Shafirov
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"
"Jordan Zimmerman" <jordanz@altura.com> wrote in message
news:asom19$v3r$1@is.intellij.net...
>
>
>
Thanks - that worked.
Now - how can I determine if the mouse click is in a message window?
--
Jordan Zimmerman
Altura International
Catalog City
You mean Run/Debug console? Actually compiler messages window is not an
editor.
Nevertheless, if you subscribe to mouse events via EditorEventMulticaster
you'll receive events from all the editors instantiated in this IDEA
instance in a time. This includes file editing, console windows or even
preview pages in code style/color schemes.
--
Best regards,
Maxim Shafirov
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"
"Jordan Zimmerman" <jordanz@altura.com> wrote in message
news:asrf8q$hl1$1@is.intellij.net...
>
>
>
>
This is the problem. How do I know what type of window/pane the Mouse event
is for? For the Selector plugin, I don't want to do anything for message
windows, etc. - only code editor windows.
--
Jordan Zimmerman
Altura International
Catalog City
"Maxim Shafirov" <max@intellij.net> wrote in message
news:ast78o$pd4$1@is.intellij.net...
The following might be a criterion:
if
(FileEditorManager.getInstance(project).documentToFile(editor.getDocument())
!= null) {
// We have one of the files being edited in } else { // We have some other project's file or a document that does not belong to any editor. } Would that be satisfactory? -- Best regards, Maxim Shafirov JetBrains, Inc / IntelliJ Software http://www.intellij.com "Develop with pleasure!" "Jordan Zimmerman" ]]> wrote in message
news:astc4j$v79$1@is.intellij.net...
event
>
EditorEventMulticaster
>
>