Replies: 1 comment 5 replies
-
Yes, the cursor is set on a per-control basis which, as far as I can tell, is managed via protected void setCursor(Cursor cursor) {
if (getCurrentViewer() != null) {
getCurrentViewer().setCursor(cursor);
}
} I just tried out a very primitive proof-of-concept using the LogicEditor with a static EditDomain that is shared between both editors, where a connection is added from the right editor to the left editor. Even though the connection is obviously broken, the cursor is nonetheless updated correctly. So at least in principle, this should work. The only thing I had to do was to override the handleMove() method because both viewers were in the "connection started" state, which prevents the command from being updated, and therefore the cursor. @Override
protected boolean handleMove() {
if (isInState(STATE_CONNECTION_STARTED) && viewer != getCurrentViewer()) {
// return false;
}
if (isInState(STATE_CONNECTION_STARTED | STATE_INITIAL | STATE_ACCESSIBLE_DRAG_IN_PROGRESS)) {
updateTargetRequest();
updateTargetUnderMouse();
showSourceFeedback();
showTargetFeedback();
setCurrentCommand(getCommand());
}
return true;
} I assume something similar is going on in your editor? Can you check whether |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have the special situation that we would like to allow to drag connections between two different GEF Classic editors (e.g., split editor setup for large diagrams). While we manged to get it mostly working by setting the correct target viewer in the edit domain we still have one issue. When dragging the connection into the second editor and we hit a valid connection endpoint the mouse cursor is not correctly updated to give feedback to the user that connection creation is allowed. What I could debug sofar is that the correct mouse cursor would be set. Also connection creation is working.
I googled a bit and what I found is that I need to set the mouse cursor for the correct control. I tried the following controls: source viewer (the one with the focus), target viewer, the cursor control of the current display. But in all cases I see no change in the mouse cursor.
This leaves me a bit puzzled. Is the problem that I would like to change the mouse cursor but the mouse is outside the focus control, or do I oversee something obvious.
Beta Was this translation helpful? Give feedback.
All reactions