-
Notifications
You must be signed in to change notification settings - Fork 32
Description
This method is only used in the TreeEventManager to skip all events that are fired when clicking on the expand/collapse button.
windowbuilder/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/tree/TreeEventManager.java
Lines 107 to 116 in eb09fe5
| @Override | |
| public void mouseDown(MouseEvent event) { | |
| if (isPlusMinusClick(m_tree, event.x, event.y)) { | |
| return; | |
| } | |
| // OK, send to domain | |
| if (m_domain != null) { | |
| m_domain.mouseDown(event, m_viewer); | |
| } | |
| } |
This method is not implemented on MacOS:
windowbuilder/org.eclipse.wb.os.macosx/src/org/eclipse/wb/internal/os/macosx/OSSupportMacOSX.java
Lines 334 to 337 in eb09fe5
| @Override | |
| public boolean isPlusMinusTreeClick(Tree tree, int x, int y) { | |
| return false; | |
| } |
This method is implemented on Linux, but doesn't actually work:
windowbuilder/org.eclipse.wb.os.linux/src/org/eclipse/wb/internal/os/linux/OSSupportLinux.java
Lines 560 to 585 in eb09fe5
| @Override | |
| public boolean isPlusMinusTreeClick(Tree tree, int x, int y) { | |
| int[] cell_x = new int[1]; | |
| int[] cell_y = new int[1]; | |
| long[] /* GtkTreePath */ path = new long[1]; | |
| long[] /* GtkTreeViewColumn */ column = new long[1]; | |
| long /* GtkTreeView */ tree_view = getHandleValue(tree, "handle"); | |
| // | |
| try { | |
| if (_gtk_tree_view_get_path_at_pos(tree_view, x, y, path, column, cell_x, cell_y)) { | |
| long expanderColumn = _gtk_tree_view_get_expander_column(tree_view); | |
| if (expanderColumn == column[0]) { | |
| GdkRectangle rect = new GdkRectangle(); | |
| _gtk_tree_view_get_cell_area(tree_view, path[0], column[0], rect); | |
| if (x < rect.x) { | |
| return true; | |
| } | |
| } | |
| } | |
| return false; | |
| } finally { | |
| if (path[0] != 0) { | |
| _gtk_tree_path_free(path[0]); | |
| } | |
| } | |
| } |
It works on Windows, but I really don't see why it's needed and the lack of documentation doesn't really help.