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.

Bug 44576 - Close icon is missing on Find Usages tabs
Summary: Close icon is missing on Find Usages tabs
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 4.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Jan Becicka
URL:
Keywords: API_REVIEW_FAST, UI
Depends on: 55845
Blocks:
  Show dependency tree
 
Reported: 2004-06-08 18:04 UTC by Jesse Glick
Modified: 2005-03-14 10:05 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Patch with copy/pasted CloseButtonTabbedPane (19.54 KB, patch)
2005-03-04 08:39 UTC, Jan Becicka
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2004-06-08 18:04:33 UTC
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.
Comment 1 Martin Matula 2004-06-19 10:12:26 UTC
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.

Comment 2 dpavlica 2004-06-21 12:55:12 UTC
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.
Comment 3 Jesse Glick 2004-06-21 18:39:23 UTC
Tim should know how to make the right close buttons appear on the tabs.
Comment 4 Jan Becicka 2004-06-22 14:16:29 UTC
Tim, can you help us with those close buttons? Thanks
Comment 5 _ tboudreau 2004-06-22 21:21:56 UTC
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.
Comment 6 Jesse Glick 2004-06-22 22:29:40 UTC
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?
Comment 7 Jan Becicka 2004-06-25 12:20:53 UTC
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

Comment 8 _ tboudreau 2004-06-26 02:42:26 UTC
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.
Comment 9 Martin Matula 2004-07-18 23:56:40 UTC
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? 
Comment 10 Jan Becicka 2004-07-27 12:31:20 UTC
No objections? Closing as fixed. "Where used" and search windows
behavior will be reviewed in promo-E.
Comment 11 Jan Becicka 2005-03-03 12:43:16 UTC
Reopening as an ENHANCEMENT - close icons is still missing. Simplest
solution is to use CloseButtonTabbedPane, which is unfortunately not
public.
Comment 12 _ tboudreau 2005-03-04 04:25:02 UTC
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.
Comment 13 Jan Becicka 2005-03-04 08:39:29 UTC
Created attachment 20670 [details]
Patch with copy/pasted CloseButtonTabbedPane
Comment 14 Martin Matula 2005-03-04 08:50:20 UTC
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.
Comment 15 _ rkubacki 2005-03-04 09:25:32 UTC
see also issue #55128 - VCS ouptup has similar problem with their tabs
Comment 16 Jaroslav Tulach 2005-03-05 16:32:30 UTC
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" />.
Comment 17 Jan Becicka 2005-03-14 10:05:46 UTC
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