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.
040608. 1. A new Find Usages window, i.e. TopComponent, is displayed for each search. This is inconsistent with all other "utility" windows; should be a single TopComponent, possibly with a JTabbedPane to hold individual results, and a Window menu item to display it (useless IMHO, but that's how other such windows work). 2. There is already a Search Results window which it would make some sense for refactoring usage results to be docked into somehow. 3. The Close button should be removed. There is already a window close button; that is enough. 4. The Find Usages window has no icon so it looks strange if made into a sliding window and slid out. Generally the current UI is quite inconsistent with Search Results and other utility window. To the user, Find Usages is just a variant of search; it should look the same.
First part of this issue is done (by jbecicka). Dusane, please decide how to proceed with the rest of the suggestions and let us know.
My comments: 3. We have a one Find Usages window with more inner output TABs now. Ideal is to have the same close icons on each TAB like on Editor's TABs. To be consistent through all IDE, I recommend these close icons for each window in output area (It will be done in Promo E...I hope so). Then that Close button from current implementation should be removed. And notice please, that there is a area for Progress indication at the right side from Close button. Then this progress indication should be substituted somehow too (move it to the Dialog before invocation of Previrew or show it in Preview main area). 4. We can reuse icon of Search result window temporarily and our icon- graphic designer could create some special one.
Tim should know how to make the right close buttons appear on the tabs.
Tim, can you help us with those close buttons? Thanks
If you are now using JTabbedPane: The output window is using the old window system's CloseButtonTabbedPane - you can copy it from core/output2/src/org/netbeans/core/output2/ui. You might want to also copy AbstractOutputWindow - it has a convenient way of managing no tabs (only one child) vs. tabs, by overriding addImpl() to tranparently add/remove the tabbed pane as needed. So client code just adds/removes child components, and it handles the tab mgmt.
Surely we should not advise that people copy such fragile code as Swing components, especially knowing how many bugfixes we still need in that code to e.g. support GTK properly? Shouldn't this be in some core/swing/* library or something?
Thanks for your hints! But we are not going to copy/paste significant amount of code from anywhere. Can we use some API or library for it? If there is no such API, I'm afraid there will be no X buttons. Jesse, Tim, do you have additional hints? Thanks
Some one of the UIs in core/swing/tabcontrol would work, but the tabs would look like a nested editor or explorer view inside your window, which HIE probably would not like. There are several UI variants available but only the top level winsys ones have close buttons.
It seems that now it is up to core guys to provide a generic support for close buttons on tabs. The rest of this issue should already be resolved. Can we close this?
No objections? Closing as fixed. "Where used" and search windows behavior will be reviewed in promo-E.
Reopening as an ENHANCEMENT - close icons is still missing. Simplest solution is to use CloseButtonTabbedPane, which is unfortunately not public.
Recommend copying it as suggested. Ugly, yes, but it's well tested code. If someone were going to API-ify this, I'd suggest starting from core.output2.ui.AbstractOutputWindow (I think that's it) - it's actually a little more abstract - it's a JPanel subclass with an overridden addImpl() - when you add more than one component you get tabs, one component and no tabs - so the tabbed pane part is completely transparent. If you want that, you should probably file it and make this issue depend on that one, otherwise this isn't going to go anywhere.
Created attachment 20670 [details] Patch with copy/pasted CloseButtonTabbedPane
To DevRev: Please approve (by not objecting :)) that we can use the copy-pasted code from core or please advise how to resolve this more cleanly. Thanks.
see also issue #55128 - VCS ouptup has similar problem with their tabs
You shall not refer to icon in another module, if the icon is not part of the modules API. And I am sure it is not. We've been discussing sharing icons with Jesse and he suggested to created an "icon repository". Right now, we do not have any, so we agreed that the best solution right now is to modify your build script to copy the icon during build. That will ensure that: 1. the icons stay in sync 2. unwanted runtime dependencies between modules will not be established 3. as soon as someone deletes the original icon, the build will fail That is why please modify your patch to include changes to your build.xml to do <copy file="org/netbeans/core/output2/resources/tabclose.gif" tofile="build/classes/refactoring/RefCloseTab.gif" />.
Checking in build.xml; /cvs/refactoring/build.xml,v <-- build.xml new revision: 1.10; previous revision: 1.9 done RCS file: /cvs/refactoring/src/org/netbeans/modules/refactoring/ui/CloseButtonTabbedPane.java,v done Checking in src/org/netbeans/modules/refactoring/ui/CloseButtonTabbedPane.java; /cvs/refactoring/src/org/netbeans/modules/refactoring/ui/CloseButtonTabbedPane.java,v <-- CloseButtonTabbedPane.java initial revision: 1.1 done Checking in src/org/netbeans/modules/refactoring/ui/RefactoringPanelContainer.java; /cvs/refactoring/src/org/netbeans/modules/refactoring/ui/RefactoringPanelContainer.java,v <-- RefactoringPanelContainer.java new revision: 1.13; previous revision: 1.12 done