Bug 162893 - [Tool] AbstractConnectionCreationTool should consider executability of current command when calculating Cursor
Summary: [Tool] AbstractConnectionCreationTool should consider executability of curren...
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-10-31 08:23 EST by Andreas Walter CLA
Modified: 2010-11-04 07:41 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Walter CLA 2006-10-31 08:23:08 EST
In org.eclipse.gef.tools.AbstractConnectionCreationTool, method 

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

should be replaced by

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

Reason: Treatment of unexecutable commands and null commands should be the 
same across EditParts and Tools. Method getCommand() in org.eclipse.gef.editparts.AbstractEditPart returns an unexecutable command
when one of the EditPart's installed EditPoliciys returns an unexecutable
command, and ignores 'null commands' returned by installed EditPolicys (by chaining them which doesn't have any effect on an existing chain of commands). 
Method calculateCursor() in org.eclipse.gef.tools.AbstractConnectionCreationTool
returns a default cursor (in state STATE_INITIAL) even if the current command is unexecutable, which contradicts the semantics of treating unexecutable commands in AbstractEditPart. Method calculateCursor() in AbstractTool also considers
executability of the current command.