Package net.datacrow.console.wizards

Examples of net.datacrow.console.wizards.WizardException


   
    @Override
    public Object apply() throws WizardException {

        if (target.getFile() == null || Utilities.isEmpty(target.getFilename()))
            throw new WizardException(DcResources.getText("msgNoFileSelected"));
       
        String filename = target.getFilename();
        filename = filename.endsWith(definition.getExporter().getFileType()) ? filename : filename + "." + definition.getExporter().getFileType();
       
        target.getFile().delete();
        File file = new File(filename);
       
        try {
            file.createNewFile();
       
            definition.setFile(file);
            settingsPanel.saveSettings(definition.getSettings(), false);
        } catch (IOException ie) {
            throw new WizardException(DcResources.getText("msgFileCannotBeUsed"));
        }
           
        return definition;
    }
View Full Code Here


            ModuleJar mjChild = new ModuleJar(childModule);
            mjChild.save();
           
            close();
        } catch (Exception e) {
            throw new WizardException(DcResources.getText("msgCouldNotWriteModuleFile", e.getMessage()));
        }
    }
View Full Code Here

      settingsPanel.saveSettings();
     
      String path = group.getSettings().get(_PATH).getValueAsString();
     
      if (Utilities.isEmpty(path)) {
        throw new WizardException(DcResources.getText("msgSelectDirFirst"));
      } else {
        definition.setExportDataRelatedModules(((Boolean) group.getSettings().get(_EXPORT_DATA_RELATED_MODULES).getValue()).booleanValue());
        definition.setExportDataMainModule(((Boolean) group.getSettings().get(_EXPORT_DATA_MAIN_MODULE).getValue()).booleanValue());
        definition.setPath(path);
      }
View Full Code Here

            }

            close();
           
        } catch (Exception e) {
            throw new WizardException(DcResources.getText("msgCouldNotWriteModuleFile", e.getMessage()));
        }
    }
View Full Code Here

  }

  @Override
    public Object apply() throws WizardException {
        if (source.getFile() == null)
            throw new WizardException(DcResources.getText("msgNoFileSelected"));
       
        if (!source.getFile().exists() || !source.getFile().canRead())
            throw new WizardException(DcResources.getText("msgFileCannotBeUsed"));
       
        wizard.getDefinition().getImporter().clearMappings();
       
        // store the settings
        // note: I have made sure this works for both module and application settings
        for (String key : settings.keySet()) {
            Setting setting = DcSettings.getSetting(key) != null ? DcSettings.getSetting(key) : wizard.getModule().getSettings().getSetting(key);
            setting.setValue(settings.get(key).getValue());
        }       
       
        try {
            wizard.getDefinition().getImporter().setFile(source.getFile());
        } catch (Exception e) {
            throw new WizardException(e.getMessage());
        }
           
        wizard.getDefinition().setFile(source.getFile());
        return wizard.getDefinition();
    }
View Full Code Here

      settingsPanel.saveSettings();
     
      String filename = group.getSettings().get(_IMPORT_FILE).getValueAsString();
     
      if (Utilities.isEmpty(filename)) {
        throw new WizardException(DcResources.getText("msgNoFileSelected"));
      } else {
        definition.setFile(filename);
      }
     
        return definition;
View Full Code Here

            DcModules.register(DcModules.convert(module));
            DcModules.registerPropertyModules(DcModules.convert(module));
           
            close();
        } catch (Exception e) {
            throw new WizardException(DcResources.getText("msgCouldNotWriteModuleFile", e.getMessage()));
        }    
    }
View Full Code Here

            }
           
            close();
        } catch (Exception e) {
            logger.error(e, e);
            throw new WizardException(DcResources.getText("msgCouldNotDeleteModule", e.getMessage()));
        }
    }
View Full Code Here

            settings.set(DcRepository.ModuleSettings.stEnabled, Boolean.TRUE);
            settings.save();
           
            close();
        } catch (Exception e) {
            throw new WizardException(DcResources.getText("msgCouldNotWriteModuleFile", e.getMessage()));
        }
    }
View Full Code Here

            BufferedOutputStream bos = new BufferedOutputStream(fos);
            bos.write(bytes);
            bos.flush();
            bos.close();
       } catch (Exception e) {
            throw new WizardException("Error while saving icon " + (file != null ? file.toString() : ""));
       }
      
       return (file != null ? file.toString() : null);
    }
View Full Code Here

TOP

Related Classes of net.datacrow.console.wizards.WizardException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.