 |
Wizard project updates
Posted by timboudreau on September 24, 2006 at 08:33 PM | Comments (21)
I spent part of the weekend adding some needed features to the Wizard library on java.net. If you need to do wizard-style UIs in Swing, this library makes it pretty easy to do something slick.
The Wizard library now supports JLF-spec summary panels - so you can easily display a final page which lists what the wizard has done. I also added background completion support with a progress bar and proper threading handling - so if what the wizard will create is slow, you can show progress while it is going.
Something I added some time ago that is fairly useful for speeding up the Wizard creation process is a class called WizardPage - you simply add components to this panel, and set the name of each component; the framework will automatically listen for changes and put whatever the user inputs into the settings map. If you want validation, that is easy to implement as well.
There's also a new Quick Start Guide and a WebStart™ demo (BeanNetter)
Sunrise over Denver airport
(yes it's a real photo - it was quite a sunrise)
Bookmark blog post: del.icio.us Digg DZone Furl Reddit
Comments
Comments are listed in date ascending order (oldest first)
-
Hello Tim, the new features are very welcome.
However, when using the Summary, I would like to let all the buttons remain enabled, not only the "Close" one. How can I do that?
Thanks
Posted by: bitog on September 25, 2006 at 10:10 AM
-
You can specify that the Prev button remains enabled; Finish makes no sense since it was already done, and Next doesn't make sense because there is no next page.
Posted by: timboudreau on September 25, 2006 at 10:33 AM
-
It seems that the webstart demo didn't handle the close window(or wizard finish,wizard cancel) event to exit the app, when the wizard window has been set to be unvisible, but the app is still running in the bg(there is no way to exit then, except kill javaws). Or may be there is sth wrong with my javaws env?
Posted by: blader on September 25, 2006 at 11:09 AM
-
Sorry about that; I do need to update the JAR - it's using a slightly older version of Wizard. I updated the source for the demo last night; it just needs some testing before I make it live.
Posted by: timboudreau on September 25, 2006 at 11:20 AM
-
Tim, I haven't tried this release yet, since I had to make some hacks made to the Wizard source for my application.
However I wonder if a couple things have been fixed. First, I believe cancel() was getting called regardless of how the Wizard exited. I think it was due to the window listener, since it and event fires regardless of how the window is closed.
Second, it was not possible to use JavaHelp with a Wizard without a hack. Because of all the modal issues in 1.5 and prior, you have to call DefaultHelpBroker.setActivationWindow(frame/dialog). But, the dialog component of a Wizard isn't accessible externally via an API call. I believe the problem I had was that you couldn't even manually get the window ancestor using SwingUtils because the dialog hadn't been created at the time you need to pass in the help Action.
Thanks, Brian
Posted by: bwy on September 26, 2006 at 04:55 PM
-
Tim;
I keep getting this webstart error (I'm using the latest 1.6 beta)
java.lang.ClassNotFoundException: beans2nbm.Main
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Posted by: augusto on September 26, 2006 at 06:00 PM
-
Augusto: Try getting a more recent JDK 6 build (daily or whatever) - I've seen this behavior in other WebStart apps with JDK builds from a month or two ago.
Brian: Generally there should be an API for providing your own container/dialog for a wizard rather than having to use one from the framework - that's in the works.
Posted by: timboudreau on September 26, 2006 at 09:50 PM
-
hi Tim! thx for this great wizard! Is there a way to localize the navigation buttons' text, and the String "Steps" on the sidebar image?
Posted by: emankcin on October 16, 2006 at 04:44 AM
-
Long since fixed - it's all internationalized - just provide your resource bundles.
Posted by: timboudreau on October 17, 2006 at 02:19 AM
-
Great work, Tim. I just used wizard library for one of my applications.
Please note that when I was developing my application, I discovered that I was losing my dialog titles so I had to fix class org.netbeans.spi.wizard.WizardPage:
Line 227:
return new CWPP(wizardPageClasses, finisher).createWizard();
Should be:
return new CWPP(title, wizardPageClasses, finisher).createWizard();
Line 235:
return new CWPP(wizardPageClasses,
WizardResultProducer.NO_OP).createWizard();
Should be:
return new CWPP(title, wizardPageClasses,
WizardResultProducer.NO_OP).createWizard();
Please see if you agree with my fixes.
Thanks,
-Joseph
Posted by: josephhu on November 08, 2006 at 10:02 AM
-
Hi Tim. Great work there. Had a quick question. I have a requirement to customize the sidebar. I need to add in addition to the steps a JList which would be getting its input from elsewhere. I understand I need to subclass either the wizard displayer or something. Any pointers there?
Posted by: sathya_sayee on February 21, 2007 at 10:00 PM
-
See org.netbeans.modules.wizard.InstructionsPanel and the contents of org.netbeans.api.wizard.displayer (note that package is intentionally omitted from the Javadoc as it is not currently intended to be API).The right way, such as it is, is to inject your own implementation of the default WizardDisplayer - just copy the classes from the current version. Eventually there will probably be an API to allow you to do a custom side panel, but not for 1.0.
Posted by: timboudreau on February 21, 2007 at 10:34 PM
-
Thanks Tim for the quick reply. I am not able to access the CVs repository to download the source. Any way thanks once again. I used to work for the Java Tools Group in Sun Microsystems. :)
Posted by: sathya_sayee on February 22, 2007 at 12:27 AM
-
See the login instructions here. I notice you applied for the CVS write access in the project - if you want that, join the dev list and provide a few quality patches and I'll approve it.
Posted by: timboudreau on February 22, 2007 at 12:38 AM
-
Tim. Unable to access the CVs even after being granted the observer role.
C:\Documents and Settings\ssayee>cvs -d :pserver:sathya_sayee@cvs.dev.java.net:/
cvs login
Logging in to :pserver:sathya_sayee@cvs.dev.java.net:2401:/cvs
CVS password: ***********
cvs [login aborted]: connect to cvs.dev.java.net:2401 failed: No connection coul
d be made because the target machine actively refused it.
Posted by: sathya_sayee on February 22, 2007 at 09:22 PM
-
Can you access other java.net projects CVS? I know a few things have been hosed up on java.net lately - all webstart demos fail with bad URLs and stuff like that, so the problem could be on the server side. Also try using :pserver:wizard.dev.java.net - should be equivalent to cvs... but who knows...
Posted by: timboudreau on February 22, 2007 at 09:29 PM
-
bitog: By the time you are using the summary, the wizard has already done what it will do - you would be going back and invoking it again, which in many cases could be very dangerous, or at best, the wizard would be unfinishable a second time. If you want a summary page, e.g. "This is what I'm about to do", just have a page in your wizard that doesn't have any enablement logic and shows this info - Summary doesn't do anything terribly exciting, just spits out a JList of strings, or a JTextArea with some text, or whatever component you choose to use - it wouldn't really add anything to have Summary objects be usable before the end of the wizard, and moreover there's no method to return them from.
Posted by: timboudreau on February 22, 2007 at 10:37 PM
-
Hello Tim! Thx for answering on my earlier October 16, 2006 problem! Meantime :), I've managed to localize wizard's navigation buttons, but I didn't found entry for the "Steps" string in Bundle.properties. Is there a way to change this? E.g. in a way similar to sidebar image?
Posted by: emankcin on April 16, 2007 at 12:40 PM
-
Hi! My problem is solved! I have found the other properties file.
Posted by: emankcin on April 20, 2007 at 11:59 AM
-
Hi Tim,
Is there an active discussion forum for the SwingLabs Wizard Project? I'm using it happily but need to know if there is a programmatic means of sending the user back to a previous page. They enter a URL on one page (which is syntactically checked on that page) but then actually used on the next page. If the URL cannot be connected, I want to show an error popup and then send them back to the previous page. Is this possible?
Thanks!
Posted by: dsearles on June 26, 2007 at 03:23 PM
-
Hi, Tim. I just ran into this project. Works very nicely. There's one caveat (or I may be doing something wrong). If I implement WizardPanelNavResult (namely start() ) and I'm not at my last panel, it jumps to "Summary" on the left side even though i can still navigate to my remaining panels. The left side no longer reflects the current panel. Any ideas on this one?
Posted by: cappicard on January 07, 2008 at 08:41 PM
|