Bug 146109 - [Tool] AbstractConnectionCreationTool#calculateCursor should call canExecute()
Summary: [Tool] AbstractConnectionCreationTool#calculateCursor should call canExecute()
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-08 16:21 EDT by Gleb Sturov CLA
Modified: 2010-11-04 06:38 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.