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 84945 - Add wizard for creating Palette items
Summary: Add wizard for creating Palette items
Status: NEW
Alias: None
Product: apisupport
Classification: Unclassified
Component: Templates (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Martin Kozeny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-14 21:41 UTC by jfurmankiewicz
Modified: 2013-02-14 13:17 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
example of palette item (503 bytes, text/xml)
2006-09-15 08:33 UTC, pzajac
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jfurmankiewicz 2006-09-14 21:41:24 UTC
It would be great if the wizards for Netbeans Module Development included one
for 'New Palette item' or something along those line.

it would also be amazing if that wizard could accept either two files for the
16x16 and 32x32 icon or just one SVG file and generate the two icons from that
common file automatically.
Comment 1 pzajac 2006-09-15 08:25:33 UTC
It's not so difficult to add palette item manually:
1) Create pallette item xml. I will attach example 
2) Put it to  layer.xml of your module:

 <folder name="FormDesignerPalette">
        <attr name="SystemFileSystem.localizingBundle"
stringvalue="org.netbeans.modules.form.resources.Bundle"/>
            
        <folder name="SwingContainers">
            <attr name="SystemFileSystem.localizingBundle"
stringvalue="org.netbeans.modules.form.resources.Bundle"/>
            <attr name="isExpanded" boolvalue="true" />

            <file name="JPanel.palette_item" url="palette/JPanel.palette_item" />
......

It curious that the palette_item xml doesn't contain link to eiter DTD or XML
schema. 

Comment 2 pzajac 2006-09-15 08:33:57 UTC
Created attachment 33982 [details]
example of palette item
Comment 3 jfurmankiewicz 2006-09-15 13:04:45 UTC
I fully agree that it is not complicated once you find how to do it, but when
you're trying to do NB module development for the first time it's pretty
daunting to find that little piece of info.

I thought it would be a nice easy enhancement to further promote development on
top of the NB RCP, the more little things like this are available, the easier it
is for people to explore module development.
Comment 4 Jesse Glick 2006-09-15 13:20:48 UTC
IIRC Wade Chandler was talking about something similar, may be duplicate. Could
be integrated into J2SE Library Descriptor wizard. Tim Boudreau also wrote a
standalone program to make a NB module (NBM) from some beans.
Comment 5 jfurmankiewicz 2006-09-15 13:23:45 UTC
Thank you.

An idea for some advanced options would be enhancing the wizard to implement a
PaletteFilter (something I've been trying to look into) to selectively
enable/disable palette items depending on a condition.
Comment 6 pzajac 2006-09-15 14:10:22 UTC
Are sure that someone is able find it in J2SE wrapper wizard? I am for to create
new  wizard for this purpose.  
Comment 7 jfurmankiewicz 2006-09-15 14:15:40 UTC
I would vote for that as well. Logically, I don't quite see the connection
between J2SE library wrapper and palette item (even if there is one), most
newbies (i.e. me) would know guess there is one.
Comment 8 _ wadechandler 2006-09-15 16:00:30 UTC
>Logically, I don't quite see the connection
>between J2SE library wrapper and palette item (even if there is one), most
>newbies (i.e. me) would know guess there is one.

Isn't that one of the first things a newby sees when they add palette items ...
Add from a library?  The point of putting something like this into the library
wrapper makes it easier to add things from your module to the palette and
associate a library with it.  So, not only do you have an install (module), but
you also have palette items added from your module along with a library descriptor.

What I was working on allows one to create a module directly from a library they
have defined in NB (Tools->Library Manager).  The idea that it would make
sharing libraries easier once it has been defined and completed for 3rd party
distribution.  I also planned on adding the capability to allow them to select
things which would be added to the palette when the module would be installed. 
It would allow them to select or create a new category and select the beans they
want on the palette.  I was going to initially support the Form Editor, but in
the future it could support other palettes as well.

It would be good to add the ability for a standard project as well.  There is
another issue I would have to look up I know is in IZ dealing with project level
libraries.  I think that would be best for standard projects mainly because of
the change, compile, build scenario.  You want to be able to use a library when
you are developing it and have it's items added to a palette.  That way when you
are creating an application you can separate ideas and have libraries you can
share come out of it.

So, I think there are 3 general ideas or areas each with their own way of
defining how a Library hooks into the project and where items can come from.  1)
A module 2) A Library as it's currently defined 3) A project level library or
palette item.
Comment 9 jfurmankiewicz 2006-09-15 16:29:00 UTC
I see...I was actually planning on adding Palette items that programmatically do
code generation (e.g. like the 'JSF Form' palette item that pops up a wizard for
a bean and creates a JSF form from it)...so I was not really relying on a
particular library at all.

Either way, it would be good to simplify the creation of "library" palette items
and "code generator" palette items. More ease and power for RCP development.