if (dataObject.getPrimaryFile() != null) {
WizardDescriptor.Panel[] _panels = getPanels();
WizardDescriptor wizardDescriptor = new WizardDescriptor(_panels);
// {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
wizardDescriptor.setTitleFormat(new MessageFormat(_panels[0].getComponent().getName()));
wizardDescriptor.setTitle(_panels[0].getComponent().getName());
//set initial properties
FileObject primaryFile = dataObject.getPrimaryFile();
String archiveName = primaryFile.getNameExt();
FileObject destinationFolder = primaryFile.getParent();
wizardDescriptor.putProperty("ARCHIVE_OPTIONS_ARCHIVE_NAME", archiveName);
wizardDescriptor.putProperty("ARCHIVE_OPTIONS_ARCHIVE_DESTINATION", destinationFolder);
Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
dialog.setVisible(true);
dialog.toFront();
boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
if (!cancelled) {
// do something
try {
//First get the archive name. (ArchiveName + ext)
archiveName = wizardDescriptor.getProperty("ARCHIVE_OPTIONS_ARCHIVE_NAME") + "";
String archiveExt = wizardDescriptor.getProperty("ARCHIVE_OPTIONS_ARCHIVE_EXTENSION") + "";
//second get the destination folder
destinationFolder = (FileObject) wizardDescriptor.getProperty("ARCHIVE_OPTIONS_ARCHIVE_DESTINATION");
createAndExecuteAntScript(primaryFile, destinationFolder, archiveName + archiveExt);
//third create and execute ant script passing the above as parameters
} catch (IOException ex) {
Exceptions.printStackTrace(ex);