use of net.sf.launch4j.config.ConfigPersisterException in project cogtool by cogtool.
the class MainFrame method save.
private boolean save() {
// XXX
try {
_configForm.get(ConfigPersister.getInstance().getConfig());
if (_fileChooser.showSaveDialog(MainFrame.this) == JOptionPane.YES_OPTION) {
File f = _fileChooser.getSelectedFile();
if (!f.getPath().endsWith(".xml")) {
f = new File(f.getPath() + ".xml");
}
ConfigPersister.getInstance().save(f);
_saved = true;
showConfigName(f);
return true;
}
return false;
} catch (InvariantViolationException ex) {
warn(ex);
return false;
} catch (BindingException ex) {
warn(ex.getMessage());
return false;
} catch (ConfigPersisterException ex) {
warn(ex.getMessage());
return false;
}
}
use of net.sf.launch4j.config.ConfigPersisterException in project SIMRacingApps by SIMRacingApps.
the class Launch4jTask method execute.
public void execute() throws BuildException {
try {
if (tmpdir != null) {
System.setProperty("launch4j.tmpdir", tmpdir.getPath());
}
if (bindir != null) {
System.setProperty("launch4j.bindir", bindir.getPath());
}
if (_configFile != null && _config != null) {
throw new BuildException(Messages.getString("Launch4jTask.specify.config"));
} else if (_configFile != null) {
ConfigPersister.getInstance().load(_configFile);
Config c = ConfigPersister.getInstance().getConfig();
if (jar != null) {
c.setJar(jar);
}
if (outfile != null) {
c.setOutfile(outfile);
}
if (fileVersion != null) {
c.getVersionInfo().setFileVersion(fileVersion);
}
if (txtFileVersion != null) {
c.getVersionInfo().setTxtFileVersion(txtFileVersion);
}
if (productVersion != null) {
c.getVersionInfo().setProductVersion(productVersion);
}
if (txtProductVersion != null) {
c.getVersionInfo().setTxtProductVersion(txtProductVersion);
}
} else if (_config != null) {
_config.unwrap();
ConfigPersister.getInstance().setAntConfig(_config, getProject().getBaseDir());
} else {
throw new BuildException(Messages.getString("Launch4jTask.specify.config"));
}
final Builder b = new Builder(Log.getAntLog());
b.build();
} catch (ConfigPersisterException e) {
throw new BuildException(e);
} catch (BuilderException e) {
throw new BuildException(e);
}
}
use of net.sf.launch4j.config.ConfigPersisterException in project beast-mcmc by beast-dev.
the class Launch4jTask method execute.
public void execute() throws BuildException {
try {
if (tmpdir != null) {
System.setProperty("launch4j.tmpdir", tmpdir.getPath());
}
if (bindir != null) {
System.setProperty("launch4j.bindir", bindir.getPath());
}
if (_configFile != null && _config != null) {
throw new BuildException(Messages.getString("Launch4jTask.specify.config"));
} else if (_configFile != null) {
ConfigPersister.getInstance().load(_configFile);
Config c = ConfigPersister.getInstance().getConfig();
if (jar != null) {
c.setJar(jar);
}
if (outfile != null) {
c.setOutfile(outfile);
}
if (fileVersion != null) {
c.getVersionInfo().setFileVersion(fileVersion);
}
if (txtFileVersion != null) {
c.getVersionInfo().setTxtFileVersion(txtFileVersion);
}
if (productVersion != null) {
c.getVersionInfo().setProductVersion(productVersion);
}
if (txtProductVersion != null) {
c.getVersionInfo().setTxtProductVersion(txtProductVersion);
}
} else if (_config != null) {
_config.unwrap();
ConfigPersister.getInstance().setAntConfig(_config, getProject().getBaseDir());
} else {
throw new BuildException(Messages.getString("Launch4jTask.specify.config"));
}
final Builder b = new Builder(Log.getAntLog());
b.build();
} catch (ConfigPersisterException e) {
throw new BuildException(e);
} catch (BuilderException e) {
throw new BuildException(e);
}
}
use of net.sf.launch4j.config.ConfigPersisterException in project beast-mcmc by beast-dev.
the class MainFrame method save.
private boolean save() {
try {
_configForm.get(ConfigPersister.getInstance().getConfig());
if (_fileChooser.showSaveDialog(MainFrame.this) == JOptionPane.YES_OPTION) {
File f = _fileChooser.getSelectedFile();
if (!f.getPath().endsWith(".xml")) {
f = new File(f.getPath() + ".xml");
}
ConfigPersister.getInstance().save(f);
_saved = true;
showConfigName(f);
return true;
}
return false;
} catch (InvariantViolationException ex) {
warn(ex);
return false;
} catch (BindingException ex) {
warn(ex.getMessage());
return false;
} catch (ConfigPersisterException ex) {
warn(ex.getMessage());
return false;
}
}
use of net.sf.launch4j.config.ConfigPersisterException in project chipKIT32-MAX by chipKIT32.
the class MainFrame method save.
private boolean save() {
// XXX
try {
_configForm.get(ConfigPersister.getInstance().getConfig());
if (_fileChooser.showSaveDialog(MainFrame.this) == JOptionPane.YES_OPTION) {
File f = _fileChooser.getSelectedFile();
if (!f.getPath().endsWith(".xml")) {
f = new File(f.getPath() + ".xml");
}
ConfigPersister.getInstance().save(f);
_saved = true;
showConfigName(f);
return true;
}
return false;
} catch (InvariantViolationException ex) {
warn(ex);
return false;
} catch (BindingException ex) {
warn(ex.getMessage());
return false;
} catch (ConfigPersisterException ex) {
warn(ex.getMessage());
return false;
}
}
Aggregations