| Summary: | Key events on creation tool being sent to selection tool. | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Ravi Ranjan <ravs53> |
| Component: | GEF-Legacy GEF (MVC) | Assignee: | gef-inbox <gef-inbox> |
| Status: | RESOLVED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 3.1.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 2000 | ||
| Whiteboard: | |||
|
Description
Ravi Ranjan
Are you sure the tool was active? Which key event? The keyup event probably will go to the selection tool since it is loaded on keydown. I have a creation tool on the palette. Once i click on the palette and move to the editor (note: this is not DND but click on palette and click on editor) it shows the add feedback. Now if the user wants to cancel the operation he presses ESC, but this keyup event for ESC is processed by the handleKeyUp of the selection tool, which should not happen. OK, and what is happening on keyup that is bothering you? Usually, keyups are ignored, which keydown being the interesting event. I will detail the steps.
1. I have a class "CustomTemplateCreationLibrary extends CombinedTemplateCreationEntry".
2. This creates a tool "ElementCreationTool extends CreationTool".
3. Inside the ElementCreationTool i have the following methods overridden.
@Override
protected boolean handleKeyDown(KeyEvent e) {
return super.handleKeyDown(e);
}
@Override
protected void handleKeyTraversed(TraverseEvent event) {
super.handleKeyTraversed(event);
}
@Override
protected boolean handleKeyUp(KeyEvent e) {
return super.handleKeyUp(e);
}
4. Once select the tool in the palette and move over the graphical editor, it shows the correct add feedback.
5. Now two things happen:
a. I want to cancel the operation. So i press ESC.
The public void keyUp(KeyEvent evt, EditPartViewer viewer) method of the AbstractTool is called. Once i start debugging through the method and i reach the following line -> handleKeyUp(evt); this should call the same method in the abstract tool or one of its overridden methods in the creation tool.
but the handleKeyUp(evt) method of the selection tool is called. Hence i am not able to cancel the selection of the tool by pressing ESC key.
This used to work before 3.0 correctly.
b. I press the space bar twice. The feedback is hidden but the tool is still selected. I am not sure whether this is a bug or expected behavior.
The selection tool that is getting ESC is the selection tool for the palette itself, which is not your editor's active tool. You are not getting ESC because the graphical viewer does not have focus, so the key goes to the palette (which is itself a graphical viewer). What does the logic example do in this case? Do you have a default entry defined for the palette? Okie - Resolved. |