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 19602 - incorrect toolbar height and contents
Summary: incorrect toolbar height and contents
Status: CLOSED WORKSFORME
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: _ tboudreau
URL:
Keywords:
Depends on: 42146
Blocks: 25396
  Show dependency tree
 
Reported: 2002-01-19 00:49 UTC by rrochat
Modified: 2008-12-22 20:55 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
zip file with test module layer.xml, .jarContents, & .jar file (3.76 KB, application/octet-stream)
2002-01-22 21:21 UTC, rrochat
Details
layer file that includes a toolbar config reference (8.24 KB, text/plain)
2002-01-24 19:49 UTC, rrochat
Details
Toolbar Configuration xml file (516 bytes, text/plain)
2002-01-24 19:50 UTC, rrochat
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rrochat 2002-01-19 00:49:15 UTC
If a module totally replaces the toolbar items, 
the toolbar is only about half as high as it should be and you
can't manually resize it larger than the first row of buttons. 
Even when the layer file has explictly ordered contents,
1) the explicit ordering is ignored (it uses alphabetical ordering) and
2) only the toolbars that can fit in the first toolbar row are visible.

http://www.netbeans.org/issues/show_bug.cgi?id=17439 is also 
an ordering problem; I don't know whether it's related.
Comment 1 _ ttran 2002-01-21 07:48:18 UTC
Dafe, UI/Swing bugs are yours :-)
Comment 2 rrochat 2002-01-21 22:04:50 UTC
It may be a problem with the layer file.  See thread:
http://www.netbeans.org/servlets/ReadMsg?msgId=240644&listNam
e=nbdev 

This is a top-priority problem for me. I'll try to recreate 
the problem with a test module and would appreciate any 
pointers you may have for fixing this.
Comment 3 David Simonek 2002-01-22 11:45:07 UTC
Accepting, please if you have test module attach it, it will help me
to reproduce and understand what's going on.
Comment 4 rrochat 2002-01-22 21:21:54 UTC
Created attachment 4347 [details]
zip file with test module layer.xml, .jarContents, & .jar file
Comment 5 rrochat 2002-01-22 21:25:00 UTC
The test module I just attached has a layer file 
with ordered toolbars to demonstrate these problems:
- ordering is ignored
- at most one row of toolbars is added
- if you remove the TOolbars contents in mf-initializer.xml,
the toolbar is only half-height.
- sometimes you can't reorder them by dragging.

The module has a layer file with toolbars 
ordered as follows:
	SSystem01
	VView02
	MMemory03
	EEdit04
	DData05
	BBuild06
	Misc07
	Misc08

They require at least two rows.
The layer file also hides all of the standard toolbars.

1) If you mount the directory for this module and
'execute' the .jarContents file to
add this as a test module in NB 3.3.1RC2 (with
OpenAPIs Support [org.netbeans.modules.apisupport 2.10.2),
one row of toolbars are displayed, in alphabetical order:
BBuild06, DData05, EEdit04, MMemory03, Misc07, Misc08 (partial).
(order is ignored, only one row appears).
You can reorder them onto a 2nd row by dragging.

2) If you do a NB3.3.1RC2 build using
	ant -f build.xml -Dmodules=
then copy the module jar to nbbuild\modules,
and do
	ant tryme
you see the toolbars named BBuild06, DData05, and EEdit04.  

3) If you remove or comment out all of the Toolbars section of
org/netbeans/core/resources/mf-initializer.xml, copy
the test module jar as above, and do a tryme, you'll get
the half-height toolbars, with only BBuild06 & DData05.
You can't reorder by dragging.
Comment 6 rrochat 2002-01-24 19:47:56 UTC
I tried to create a Toolbar Configuration to see if that
would honor the ordering and row assignments.  It appeared
to be ignored also.  I'm attaching the modified files,
in case there's something wrong or missing in them that
was really the problem.
Comment 7 rrochat 2002-01-24 19:49:23 UTC
Created attachment 4409 [details]
layer file that includes a toolbar config reference
Comment 8 rrochat 2002-01-24 19:50:04 UTC
Created attachment 4410 [details]
Toolbar Configuration xml file
Comment 9 rrochat 2002-01-26 01:43:59 UTC
Apparently the WKSPNAME.wswksp line that names
the toolbar configuration is required.  If I 
create a Configuration file in my module named
Standard.xml and the Editing.wswksp file contains:
        <toolbar configuration="Standard" />
then the order and rows here are respected.
So I don't know whether this is a bug or feature,
since I can't find it documented anywhere,
but I think I can configure my toolbars now
correctly.
Comment 10 mslama 2002-01-28 09:30:58 UTC
I take this issue.
Comment 11 mslama 2002-01-28 13:04:23 UTC
It seems to me that toolbar configuration file is missing like
Standard.xml. This file contains list of toolbars available in given
configuration. For example Standard.xml describes toolbars used as
standard and Debugging.xml for debugging. (Debugging.xml can be found
in debuggercore module.) These configurations are then used in
workspace to activate currently selected configuration. Can you tell
me where did you find description how to add your own toolbars?
(Perhaps something is missing or not clear there. I will check it.)

I think you must have at least one toolbar configuration file. It will
appear in popup menu in toolbar area. Let me know how it works when
you add configuration file.

Now description of wswksp file is available in description of Window
System API. Definitely in description of toolbars there should be note
about this. In wswksp file <toolbar configuration="" /> sets active
toolbar configuration for given workspace. I do not know what happens
when it is missing.

Comment 12 mslama 2002-01-28 13:44:35 UTC
When there is no or unknown toolbar configuration set in workspace
default toolbar configuration is activated. Default is "Standard" -
this is hardcoded in ToolbarPool. If "Standard" is not found any
available is set. When no toolbar configuration is found no one is
activated ...
It is in org.openide.awt.ToolbarPool.setConfiguration().

You can create some simple toolbar configuration, then create using ui
custom, save it and use in module layer.

Comment 13 rrochat 2002-01-28 18:48:49 UTC
Yes, if you have a .wswksp file that names a toolbar configuration, 
the order is respected.  I find this anti-intuitive -- why isn't the 
toolbar ordering used from the layer file just like the menubars?  

Now that I understand all of this, yes, 
http://www.netbeans.org/download/apis/org/openide/actions/doc-files/ap
i.html#adv-install
explains that you need a toolbar configuration, but I sure didn't 
understand it before.  An explicit example would really help here, and 
also in other places toolbars are mentioned:
http://www.netbeans.org/download/apis/org/openide/modules/doc-files/ap
i.html#how-layer

http://core.netbeans.org/tutorial/toolbars.html is the only place I 
can find that gives an example of a toolbar configuration, but doesn't 
say what to do with it.  I don't think this document is linked from 
the other two above, it needs to be.

I think the half-height problem stems from some sort of XML parsing 
error.  Sometimes these errors are quietly ignored (when the layer
file is sytactically but not semantically correct?), but once I saw it 
when I had a mis-placed "<" in my toolbar configuration file and it 
generated an exception.

So I think this may be more of a documentation issue rather than a 
coding issue.  I don't know where the information needs to go,
exactly, but I definitely think it needs to be more explicit 
and more examples are needed somewhere.

Thanks for looking into it.
Comment 14 mslama 2002-01-28 19:24:20 UTC
I will cc Jesse, he can decide what and where to add.

Please Jesse can you look at it? As you can see from last two comments
some link(s) would be probably helpfull to make connection between
toolbars and window system doc. What do you think?
Comment 15 Jesse Glick 2002-01-29 10:55:27 UTC
I guess layer ordering could be respected in the absence of a toolbar
configuration, though I am not sure it is all that helpful.

Roxie's original (2) "only the toolbars that can fit in the first
toolbar row are visible." sounds like a clear bug to me, was this
resolved? I am getting lost in all the comments here.

Re. why toolbar configurations are not described completely in the
Actions API: last I checked with Yarda, the XML toolbar configuration
syntax is not supported by the Actions API. It happens to work now but
is not guaranteed, i.e. is a core feature. Creating an instance of
org.openide.awt.ToolbarConfiguration *is* supported (and is what the
XML file in fact does); but of course no one in their right mind would
hand-code a custom ToolbarConfiguration when the normal XML syntax
works and has worked for several releases. Yarda should we just decide
that this XML syntax is supported now, and document it properly?
Comment 16 rrochat 2002-01-30 00:52:02 UTC
With NB3.3.1 RC3, I tested the first module again and only see
one row of toolbars.

Comment 17 mslama 2002-06-26 10:45:54 UTC
Assigning to Dafe
Comment 18 Marek Grummich 2002-07-22 08:51:56 UTC
Target milestone was changed from '3.4' to TBD.
Comment 19 Marek Grummich 2002-07-22 08:57:55 UTC
Target milestone was changed from '3.4' to TBD.
Comment 20 Marek Grummich 2002-07-22 08:59:43 UTC
Target milestone was changed from '3.4' to TBD.
Comment 21 Marek Grummich 2002-07-22 08:59:46 UTC
Target milestone was changed from '3.4' to TBD.
Comment 22 Marek Grummich 2002-07-22 09:02:57 UTC
Target milestone was changed from '3.4' to TBD.
Comment 23 Marek Grummich 2002-07-22 09:27:52 UTC
Target milestone was changed from '3.4' to TBD.
Comment 24 Marian Mirilovic 2002-11-13 15:32:24 UTC
changed owner Dafe -> Peter Z.
Comment 25 Peter Zavadsky 2002-12-02 14:24:07 UTC
See also issue #17439
Comment 26 Marian Mirilovic 2002-12-06 18:19:53 UTC
reassign to Tim, new owner of AWT/Swing
Comment 27 _ tboudreau 2002-12-11 01:25:32 UTC
Passing toolbar XML issues back to Marek per Dafe's request.
Comment 28 mslama 2004-04-19 14:53:39 UTC
Assigning to Tim
Comment 29 _ tboudreau 2004-04-26 12:46:03 UTC
Trying the attached module, I saw no half height toolbars; interestingly I was able to install 
it once and the toolbars changed; the second time I installed it there was a message that 
core compiler was missing, but that's another issue.

Given that workspaces are gone and the toolbars appeared correctly, and it appears the 
filer solved the problem by using a toolbar configuration file, closing as works for me.  If 
there is still urgent interest here, reopen.
Comment 30 Marian Mirilovic 2005-07-14 07:53:04 UTC
verified/closed