Bug 146109

Summary: [Tool] AbstractConnectionCreationTool#calculateCursor should call canExecute()
Product: [Tools] GEF Reporter: Gleb Sturov <gsturov>
Component: GEF-Legacy GEF (MVC)Assignee: gef-inbox <gef-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: nyssen
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Gleb Sturov CLA 2006-06-08 16:21:35 EDT
AbstractConnectionCreationTool#calculateCursor currently looks like that:

protected Cursor calculateCursor() {
	if (isInState(STATE_INITIAL)) {
		if (getCurrentCommand() != null)
			return getDefaultCursor();
	}
	return super.calculateCursor();
}

It sets the cursor to Default even if the command is not actually executable.
This can mislead User into thinking that a Connection is supported when it's not. A better implementation would be:

protected Cursor calculateCursor() {
	if (isInState(STATE_INITIAL)) {
                Command command = getCurrentCommand();
		if (command != null && command.isExecutable())
			return getDefaultCursor();
	}
	return super.calculateCursor();
}

(BTW, super.calculateCursor() does call canExecute())
Comment 1 Randy Hudson CLA 2006-06-08 16:46:02 EDT
We assume that the command can not execute at that point because it contains only partial imformation.

We need to add a new style setting for the connection creation tool that indicates that the command will answer canExecute() correctly, even though it is incomplete. You can then enable that style from the palette entry.