This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Ability to plug into semantics of F12/S-F12 | ||
---|---|---|---|
Product: | platform | Reporter: | _ pkuzel <pkuzel> |
Component: | Actions | Assignee: | Jaroslav Tulach <jtulach> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | apireviews, issues, ivan, jchalupa, johnjullion, mkleint, mmatula, tasklist-issues, tboudreau |
Priority: | P2 | Keywords: | API, API_REVIEW_FAST, UI |
Version: | 3.x | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 35917, 55782, 58018 | ||
Attachments: |
Workaround in tasklist (I have suggested to copy&paste it to Find Usages)
The changes in openide core and tasklist Includes documentation changes as well as jbecicka's fix of find usages |
Description
_ pkuzel
2004-02-17 16:40:25 UTC
please provide the use case. What you're asking for is the solution, we need to know what is the problem. BTW this is not a bug Next action is generic concept, compare to IDEA. It cannot be implemented in NetBeans because it's private in core. So no other module can set action performer without using reflection (it's hopefully on classpath :-). Impl in core/output, not core/compiler. Passing to openide/actions - the output window can certainly implement whatever Next action API is created, but it needs an API. Petr, can you explain what you would do with a generic Next action once you had it? I want to remove org.netbeans.modules.tasklist.core.TaskListView#installJumpActions workaround. Petr, since you seem to be driving this, could you propose the API you'd like to have for this and provide some demo implementation? Yes, move core/output/src/org/netbeans/core/output/NextOutJumpAction.java to openide.actions. Even better the action could be turned to CookieAction with supporting cookies: interface NextCookie { public void navigateToNext(); } and (respectively): interface PreviousCookie { public void navigateToPrevious(); } Sounds like creating a patch for it and going through dev-rev would be a good next step. It's RFE to core team. I do not plan to implement it, sorry. Fair enough. Let me restore original priority, The hack (flaky reflection to core) uncovers API deficiency that should be resolved. Cookie action is not s good idea here because it's too contextual. Setting action performer is better. It can be done indirectly (and assuring cooperation between several Next action performer providers)- excerpt from Jesses's comment on issue #35917: Better action enablement logic would probably be based on having the real action (global KB and menu binding) track open TopComponent's whose ActionMap's bind a well-known key to a performer, and delegate to the binding of the last such TC to be focussed. Or something along those lines. In any event, this would work with or without sliding mode since it does not require the TC to be visible at the time its binding is processed. The same logic could of course be used for Output Window hyperlinks, Search window hits, Where Used usages, etc Re-assigning Tim's issues to Dafe. Blocks Find Usages results navigaton (issue #55782). Created attachment 20631 [details]
Workaround in tasklist (I have suggested to copy&paste it to Find Usages)
Changing to DEFECT and reassigning to Yarda (after discussion with him). Milosi, please help! I guess the solution is similar to the "select prev/next tab", what is its issue number? Thanks. #50297 for output, similar issue was for multiview tabs, but cannot find it. Dear reviewers, I have prepared raw diff of suggested changes and I'd like you to tell me whether they are acceptable or not and Martin to try whether they work for him. I would split my changes into three categories: 1. focus change surviving CallbackSystemAction & ActionMap There was a missing implementation of communication between CallbackSystemActions that return true from surviveFocusChange and ActionMap, basically this did not work. My changes in org.openide.util.actions fix the problem, now there is special ActionMap that keeps the history of changes and is queried when the actual component does not provide own binding for the action. 2. JumpNextAction I moved the "next" action from output2 into core and as it is supposed to be useful in platform also, I registered it under Edit submenu in core/ui, in order to keep the ide state as it is now, I masked and reregistered it in core/ide to BuildProject (which is not present in platform at all). Now the strings "JumpNextAction" and "JumpPrevAction" are part of API provided by core (I'll document that before integration) and can be used by any module to register their own actions into their TopComponent action maps - this is what I did in core/output2 and tasklist. Changes in these modules in fact remove fragile reflection, focus and time dependant code and replace it with simple getActionMap().put(...) and I consider them very healthy. 3. requestVisible However during my implementation I faced unexpected problem - the output window registers its performers without getting focus. This usecase was not solved in the original proposal, so I had to invent new solution for it. I decided to use requestVisible as it was already used in output tab and fact seems to be used exactly in the situations where one wants the user to notice the window and make it functional (e.g. register global bindings). So I changed the TopComponent.requestVisible() to also "flash" the content of Utilities.actionsGlobalContext() with a new ActionMap for a while (just few ms) and let all CallbackSystemAction surviving focus know that the ActionMap now belongs to their history ActionMap. This is slightly controversial fix as it starts to use a method for new purpose, but I think it is correct and cannot break anything: until now, CallbackSystemActions with surviveFocusChange used only setActionPerformer and this still takes precedence over ActionMap, the ActionMap itself did not work for them and the CallbackSystemActions without surviveFocusChange shall not be affected as they do not use the history map for searching and thus they will get the same results as before. I'd like to provide final patch on Tuesday and it will contain tests for JumpAction's keys, changes in arch documents of tasklist, output2 and core, apichanges of openide and javadoc of TopComponent.requestVisible. If there are any objections against these changes, please let me know before then, so I do not waste the time on documentation. I'd like to integrate on Mar 24. Created attachment 20925 [details]
The changes in openide core and tasklist
> Now the strings "JumpNextAction" and "JumpPrevAction" are
> part of API provided by core.
In attached diff I do not see any manifest (project.zml) dependencies section
update. I'd expect new ugly dependency on core. Could you move to openide.actions?
Thanks for your patch, jardo! I have two issues regarding your patch: 1. (Really minor) [org.netbeans.core.projects.cache #6] Warning: layer jar:file:/d:/sources/trunk/nbbuild/netbeans/ide5/modules/org-netbeans-core-ide.jar!/org/netbeans/core/ide/resources/layer.xml contains duplicate files named Menu/Edit/org-netbeans-core-actions-JumpNextAction.shadow_hidden It is possible, that some minor bug is on my side... 2. I created patch, that fixes issue 55782. I tested my code and observed following incorrect behavior: 1. I did Find Usages - F12 correctly jumped through my usages 2. I did some errors in code and did Build leaving Find Usages opened - output window with errors appeared, but F12 still jumps through my usages. But when I use mouse and click Output Window - F12 correctly starts to jump through errors. Not sure where is the problem. Re. "Ugly dependency on core" - I do not want to introduce dependency on core, but I also do not want to introduce new subclass of NodeAction into openide/actions. It would be acceptable to add a factory method: public static ContextAwareAction jumpNext (); somewhere (however I do not know where!) and in future replace its implementation to not use NodeAction, but just some action without creating new class. But as I do not know where to put such action, I'd rather prefer to stick with it being in core. I'll update arch*actions to mention the keys and write tests in core to verify that the key really works as expected. I hope this will be acceptable. Re. patch & comments from jbecicka: I'll fix the layer warning and find out what is wrong in cooperation between usages and errors. Created attachment 21018 [details]
Includes documentation changes as well as jbecicka's fix of find usages
I'd like to integrate tomorrow. cvs ci -m "#40185: Making callback actions surviving focus change work correctly with ActionMaps, defining 'jumpNext' and 'jumpPrev' keys, using them in output2, tasklist and refactoring" Checking in ant/src/org/apache/tools/ant/module/resources/AntModuleLayer.xml; /cvs/ant/src/org/apache/tools/ant/module/resources/AntModuleLayer.xml,v <-- AntModuleLayer.xml new revision: 1.33; previous revision: 1.32 done Checking in core/ide/src/org/netbeans/core/ide/resources/layer.xml; /cvs/core/ide/src/org/netbeans/core/ide/resources/layer.xml,v <-- layer.xml new revision: 1.16; previous revision: 1.15 done Checking in core/output2/src/org/netbeans/core/output2/Bundle.properties; /cvs/core/output2/src/org/netbeans/core/output2/Bundle.properties,v <-- Bundle.properties new revision: 1.10; previous revision: 1.9 done Checking in core/output2/src/org/netbeans/core/output2/Controller.java; /cvs/core/output2/src/org/netbeans/core/output2/Controller.java,v <-- Controller.java new revision: 1.32; previous revision: 1.31 done Checking in core/output2/src/org/netbeans/core/output2/IOEvent.java; /cvs/core/output2/src/org/netbeans/core/output2/IOEvent.java,v <-- IOEvent.java new revision: 1.5; previous revision: 1.4 done Checking in core/output2/src/org/netbeans/core/output2/OutputWindow.java; /cvs/core/output2/src/org/netbeans/core/output2/OutputWindow.java,v <-- OutputWindow.java new revision: 1.14; previous revision: 1.13 done Checking in core/output2/src/org/netbeans/core/output2/layer.xml; /cvs/core/output2/src/org/netbeans/core/output2/layer.xml,v <-- layer.xml new revision: 1.13; previous revision: 1.12 done Checking in core/output2/src/org/netbeans/core/output2/ui/AbstractOutputTab.java; /cvs/core/output2/src/org/netbeans/core/output2/ui/AbstractOutputTab.java,v <-- AbstractOutputTab.java new revision: 1.5; previous revision: 1.4 done Checking in core/output2/src/org/netbeans/core/output2/ui/AbstractOutputWindow.java; /cvs/core/output2/src/org/netbeans/core/output2/ui/AbstractOutputWindow.java,v <-- AbstractOutputWindow.java new revision: 1.10; previous revision: 1.9 done Checking in core/src/org/netbeans/core/actions/Bundle.properties; /cvs/core/src/org/netbeans/core/actions/Bundle.properties,v <-- Bundle.properties new revision: 1.141; previous revision: 1.140 done RCS file: /cvs/core/src/org/netbeans/core/actions/JumpNextAction.java,v done Checking in core/src/org/netbeans/core/actions/JumpNextAction.java; /cvs/core/src/org/netbeans/core/actions/JumpNextAction.java,v <-- JumpNextAction.java initial revision: 1.1 done RCS file: /cvs/core/src/org/netbeans/core/actions/JumpPrevAction.java,v done Checking in core/src/org/netbeans/core/actions/JumpPrevAction.java; /cvs/core/src/org/netbeans/core/actions/JumpPrevAction.java,v <-- JumpPrevAction.java initial revision: 1.1 done RCS file: /cvs/core/test/unit/src/org/netbeans/core/actions/ActionMapKeysTest.java,v done Checking in core/test/unit/src/org/netbeans/core/actions/ActionMapKeysTest.java; /cvs/core/test/unit/src/org/netbeans/core/actions/ActionMapKeysTest.java,v <-- ActionMapKeysTest.java initial revision: 1.1 done Checking in core/ui/src/org/netbeans/core/ui/resources/layer.xml; /cvs/core/ui/src/org/netbeans/core/ui/resources/layer.xml,v <-- layer.xml new revision: 1.89; previous revision: 1.88 done Checking in openide/api/doc/changes/apichanges.xml; /cvs/openide/api/doc/changes/apichanges.xml,v <-- apichanges.xml new revision: 1.238; previous revision: 1.237 done Checking in openide/arch/arch-openide-actions.xml; /cvs/openide/arch/arch-openide-actions.xml,v <-- arch-openide-actions.xml new revision: 1.28; previous revision: 1.27 done Checking in openide/src/org/openide/util/actions/CallbackSystemAction.java; /cvs/openide/src/org/openide/util/actions/CallbackSystemAction.java,v <-- CallbackSystemAction.java new revision: 1.39; previous revision: 1.38 done Checking in openide/src/org/openide/windows/DelegateActionMap.java; /cvs/openide/src/org/openide/windows/DelegateActionMap.java,v <-- DelegateActionMap.java new revision: 1.7; previous revision: 1.6 done Checking in openide/src/org/openide/windows/TopComponent.java; /cvs/openide/src/org/openide/windows/TopComponent.java,v <-- TopComponent.java new revision: 1.140; previous revision: 1.139 done Checking in openide/test/unit/src/org/openide/util/actions/CallbackSystemActionTest.java; /cvs/openide/test/unit/src/org/openide/util/actions/CallbackSystemActionTest.java,v <-- CallbackSystemActionTest.java new revision: 1.12; previous revision: 1.11 done Checking in openide/test/unit/src/org/openide/windows/GlobalContextImplTest.java; /cvs/openide/test/unit/src/org/openide/windows/GlobalContextImplTest.java,v <-- GlobalContextImplTest.java new revision: 1.7; previous revision: 1.6 done Checking in openide/windows/src/org/netbeans/modules/openide/windows/GlobalActionContextImpl.java; /cvs/openide/windows/src/org/netbeans/modules/openide/windows/GlobalActionContextImpl.java,v <-- GlobalActionContextImpl.java new revision: 1.5; previous revision: 1.4 done Checking in projects/projectui/src/org/netbeans/modules/project/ui/resources/layer.xml; /cvs/projects/projectui/src/org/netbeans/modules/project/ui/resources/layer.xml,v <-- layer.xml new revision: 1.48; previous revision: 1.47 done Checking in refactoring/arch/arch-refactoring.xml; /cvs/refactoring/arch/arch-refactoring.xml,v <-- arch-refactoring.xml new revision: 1.15; previous revision: 1.14 done Checking in refactoring/nbproject/project.xml; /cvs/refactoring/nbproject/project.xml,v <-- project.xml new revision: 1.17; previous revision: 1.16 done Checking in refactoring/src/org/netbeans/modules/refactoring/ui/CheckNodeListener.java; /cvs/refactoring/src/org/netbeans/modules/refactoring/ui/CheckNodeListener.java,v <-- CheckNodeListener.java new revision: 1.11; previous revision: 1.10 done Checking in refactoring/src/org/netbeans/modules/refactoring/ui/RefactoringPanel.java; /cvs/refactoring/src/org/netbeans/modules/refactoring/ui/RefactoringPanel.java,v <-- RefactoringPanel.java new revision: 1.48; previous revision: 1.47 done Checking in refactoring/src/org/netbeans/modules/refactoring/ui/RefactoringPanelContainer.java; /cvs/refactoring/src/org/netbeans/modules/refactoring/ui/RefactoringPanelContainer.java,v <-- RefactoringPanelContainer.java new revision: 1.15; previous revision: 1.14 done Checking in tasklist/arch/arch-tasklist-core.xml; /cvs/tasklist/arch/arch-tasklist-core.xml,v <-- arch-tasklist-core.xml new revision: 1.9; previous revision: 1.8 done Checking in tasklist/core/nbproject/project.xml; /cvs/tasklist/core/nbproject/project.xml,v <-- project.xml new revision: 1.3; previous revision: 1.2 done Checking in tasklist/core/src/org/netbeans/modules/tasklist/core/TaskListView.java; /cvs/tasklist/core/src/org/netbeans/modules/tasklist/core/TaskListView.java,v <-- TaskListView.java new revision: 1.118; previous revision: 1.117 The fix from 2005-03-23 seems to cause 56986. It should be reverted and reviewed again. I believe I found and integrated simple fix for issue 56986 (I'll verify later today). If it worked and if we did not know about any other problems related to this integration I'd prefer not to rollback it. Issue #56986 is fixed now. I'm not aware of any other problems caused by the previous fix to this issue. I'm changing its status back to RESOLVED. I have been scanning this issue and can't figure out why it has a UI keyword. Is there a UI change here that needs to be documented? I think there is a UI change, though whether it needs documentation is questionable, since it should just be intuitive. Basically, F12 and S-F12 should now operate smoothly across all appropriate windows - output, refactoring, tasklist - always operating on the last such window to receive focus (or be opened). |