Ad Designer on the NetBeans Platform (Part 1)

Here's a new NetBeans Platform sample that puts many typical things together and gets you jump started when creating some kind of designer.

The movie above is silent. It shows how to create a new XML file of the type managed by the application. It shows you can drag items into certain regions of the visual designer, i.e., items in the Header category of the Palette can only be dropped in the top of the three widgets, items in the Body category only in the middle, etc. Then right-click anywhere to serialize into the XML file.

Source code:

https://java.net/projects/nb-api-samples/sources/api-samples/show/versions/7.4/misc/GraphicHTMLEditor

Even though it's got HTML in the name, it's simply a visual designer for XML files. After that, the idea is that the XML files get converted to HTML.

Now see part 2.

Comments:

Thanks for the post. I was just researching how to re-use the netbeans pallete and visual designer. I'm looking forward to investigating the source. I find it curious that you "export xml" every time before switching to the source tab - is there a reason the two tabs aren't always in-sync? I also notice that the user can adjust the layout in the graphical editor but the xml representation only includes width and height, nothing about vertical or horizontal positioning. This precludes round-triping from xml back to visual design - right?
Not too different from the Swing gui designer displaying java in the source tab and gui components in the visual tab but utilizing a .form file behind the scenes.
IReport appears to reuse the visual designer but generate (and round-trip) jrxml directly.
Are there any other open-source re-uses of the Pallete and Visual Designer/gui builder?

Posted by guest on January 24, 2014 at 10:46 AM PST #

Listen, it's a starting point, OK? :-) Feel free to fork it and make it do whatever you need.

Posted by Geertjan on January 24, 2014 at 11:05 AM PST #

Thank you for providing and sharing the example!
My comments weren't meant as criticism.
I want to do something close to what you demo'd so I'm very excited to have an example to study. Re-using the visual designer was an idea I was considering. Now I suspect its an idea I'll be prototyping. The next step for me is to figure out why java.net hates my svn - but thats not your problem. Keep up the great work!

svn: E175002: Unexpected HTTP status 500 'Internal Server Error' on '/projects/nb-api-samples/sources/api-samples/show/versions/7.4/misc/GraphicHTMLEditor%3Frev
=674%23'

Posted by ryan on January 24, 2014 at 11:34 AM PST #

Great to hear. And I added automatic synchronization, and checked it in, at least, from the view to the source, not the other way round yet. Working on the x and y now. Also, make sure to sign up for this book, where this precise topic will be addressed too: https://leanpub.com/nbp4beginners

Posted by Geertjan on January 24, 2014 at 11:40 AM PST #

OK, x and y are now added. Now need to find a way to update the x and y after a move and the width and height after a resize.

Posted by Geertjan on January 24, 2014 at 12:16 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today