net.sf.launch4j.config.ConfigPersister Java Examples

The following examples show how to use net.sf.launch4j.config.ConfigPersister. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Main.java    From jmkvpropedit with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public static void main(String[] args) {
	try {
		Properties props = Util.getProperties();
		setDescription(props);

		if (args.length == 0) {
			ConfigPersister.getInstance().createBlank();
			MainFrame.createInstance();
		} else if (args.length == 1 && !args[0].startsWith("-")) {
			ConfigPersister.getInstance().load(new File(args[0]));
			Builder b = new Builder(Log.getConsoleLog());
			b.build();
		} else {
			System.out.println(_description
					+ Messages.getString("Main.usage")
					+ ": launch4j config.xml");
		}
	} catch (Exception e) {
		Log.getConsoleLog().append(e.getMessage());
		System.exit(1);
	} 
}
 
Example #2
Source File: Main.java    From beast-mcmc with GNU Lesser General Public License v2.1 6 votes vote down vote up
public static void main(String[] args) {
	try {
		Properties props = Util.getProperties();
		setDescription(props);

		if (args.length == 0) {
			ConfigPersister.getInstance().createBlank();
			MainFrame.createInstance();
		} else if (args.length == 1 && !args[0].startsWith("-")) {
			ConfigPersister.getInstance().load(new File(args[0]));
			Builder b = new Builder(Log.getConsoleLog());
			b.build();
		} else {
			System.out.println(_description
					+ Messages.getString("Main.usage")
					+ ": launch4j config.xml");
		}
	} catch (Exception e) {
		Log.getConsoleLog().append(e.getMessage());
		System.exit(1);
	} 
}
 
Example #3
Source File: Main.java    From PyramidShader with GNU General Public License v3.0 6 votes vote down vote up
public static void main(String[] args) {
	try {
		Properties props = Util.getProperties();
		setDescription(props);

		if (args.length == 0) {
			ConfigPersister.getInstance().createBlank();
			MainFrame.createInstance();
		} else if (args.length == 1 && !args[0].startsWith("-")) {
			ConfigPersister.getInstance().load(new File(args[0]));
			Builder b = new Builder(Log.getConsoleLog());
			b.build();
		} else {
			System.out.println(_description
					+ Messages.getString("Main.usage")
					+ ": launch4j config.xml");
		}
	} catch (Exception e) {
		Log.getConsoleLog().append(e.getMessage());
	} 
}
 
Example #4
Source File: Validator.java    From PyramidShader with GNU General Public License v3.0 5 votes vote down vote up
public static void checkFile(File f, String property, String fileDescription) {
	File cfgPath = ConfigPersister.getInstance().getConfigPath();
	if (f == null
			|| f.getPath().equals("")
			|| (!f.exists() && !Util.getAbsoluteFile(cfgPath, f).exists())) {
		signalViolation(property,
				Messages.getString("Validator.doesnt.exist", fileDescription));
	}
}
 
Example #5
Source File: RcBuilder.java    From jmkvpropedit with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void addBitmap(int id, File bitmap) {
	if (bitmap == null) {
		return;
	}

	_sb.append(id);
	_sb.append(" BITMAP \"");
	_sb.append(getPath(Util.getAbsoluteFile(
			ConfigPersister.getInstance().getConfigPath(), bitmap)));
	_sb.append("\"\n");
}
 
Example #6
Source File: RcBuilder.java    From jmkvpropedit with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void addIcon(int id, File icon) {
	if (icon == null || icon.getPath().equals("")) {
		return;
	}

	_sb.append(id);
	_sb.append(" ICON DISCARDABLE \"");
	_sb.append(getPath(Util.getAbsoluteFile(
			ConfigPersister.getInstance().getConfigPath(), icon)));
	_sb.append("\"\n");
}
 
Example #7
Source File: RcBuilder.java    From jmkvpropedit with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void addManifest(int id, File manifest) {
	if (manifest == null || manifest.getPath().equals("")) {
		return;
	}

	_sb.append(id);
	_sb.append(" 24 \"");
	_sb.append(getPath(Util.getAbsoluteFile(
			ConfigPersister.getInstance().getConfigPath(), manifest)));
	_sb.append("\"\n");
}
 
Example #8
Source File: Validator.java    From jmkvpropedit with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static void checkFile(File f, String property, String fileDescription) {
	File cfgPath = ConfigPersister.getInstance().getConfigPath();
	if (f == null
			|| f.getPath().equals("")
			|| (!f.exists() && !Util.getAbsoluteFile(cfgPath, f).exists())) {
		signalViolation(property,
				Messages.getString("Validator.doesnt.exist", fileDescription));
	}
}
 
Example #9
Source File: HeaderFormImpl.java    From jmkvpropedit with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void actionPerformed(ActionEvent e) {
	if (!_headerObjectsCheck.isSelected()) {
		ConfigPersister.getInstance().getConfig().setHeaderObjects(null);
		Binding b = _bindings.getBinding("headerObjects");
		b.put(ConfigPersister.getInstance().getConfig());
	}
}
 
Example #10
Source File: HeaderFormImpl.java    From jmkvpropedit with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void actionPerformed(ActionEvent e) {
	Config c = ConfigPersister.getInstance().getConfig();
	c.setHeaderType(e.getActionCommand());

	if (!_headerObjectsCheck.isSelected()) {
		Binding b = _bindings.getBinding("headerObjects");
		b.put(c);
		updateLibs();
	}
}
 
Example #11
Source File: HeaderFormImpl.java    From jmkvpropedit with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void updateLibs() {
	if (!_libsCheck.isSelected()) {
		ConfigPersister.getInstance().getConfig().setLibs(null);
		Binding b = _bindings.getBinding("libs");
		b.put(ConfigPersister.getInstance().getConfig());
	}
}
 
Example #12
Source File: RcBuilder.java    From PyramidShader with GNU General Public License v3.0 5 votes vote down vote up
private void addBitmap(int id, File bitmap) {
	if (bitmap == null) {
		return;
	}

	_sb.append(id);
	_sb.append(" BITMAP \"");
	_sb.append(getPath(Util.getAbsoluteFile(
			ConfigPersister.getInstance().getConfigPath(), bitmap)));
	_sb.append("\"\n");
}
 
Example #13
Source File: RcBuilder.java    From PyramidShader with GNU General Public License v3.0 5 votes vote down vote up
private void addIcon(int id, File icon) {
	if (icon == null || icon.getPath().equals("")) {
		return;
	}

	_sb.append(id);
	_sb.append(" ICON DISCARDABLE \"");
	_sb.append(getPath(Util.getAbsoluteFile(
			ConfigPersister.getInstance().getConfigPath(), icon)));
	_sb.append("\"\n");
}
 
Example #14
Source File: RcBuilder.java    From PyramidShader with GNU General Public License v3.0 5 votes vote down vote up
private void addManifest(int id, File manifest) {
	if (manifest == null || manifest.getPath().equals("")) {
		return;
	}

	_sb.append(id);
	_sb.append(" 24 \"");
	_sb.append(getPath(Util.getAbsoluteFile(
			ConfigPersister.getInstance().getConfigPath(), manifest)));
	_sb.append("\"\n");
}
 
Example #15
Source File: HeaderFormImpl.java    From PyramidShader with GNU General Public License v3.0 5 votes vote down vote up
public void actionPerformed(ActionEvent e) {
	if (!_libsCheck.isSelected()) {
		ConfigPersister.getInstance().getConfig().setLibs(null);
		Binding b = _bindings.getBinding("libs");
		b.put(ConfigPersister.getInstance().getConfig());
	}
}
 
Example #16
Source File: HeaderFormImpl.java    From PyramidShader with GNU General Public License v3.0 5 votes vote down vote up
public void actionPerformed(ActionEvent e) {
	if (!_headerObjectsCheck.isSelected()) {
		ConfigPersister.getInstance().getConfig().setHeaderObjects(null);
		Binding b = _bindings.getBinding("headerObjects");
		b.put(ConfigPersister.getInstance().getConfig());
	}
}
 
Example #17
Source File: HeaderFormImpl.java    From PyramidShader with GNU General Public License v3.0 5 votes vote down vote up
public void stateChanged(ChangeEvent e) {
	Config c = ConfigPersister.getInstance().getConfig();
	c.setHeaderType(_guiHeaderRadio.isSelected() ? Config.GUI_HEADER
												: Config.CONSOLE_HEADER);
	if (!_headerObjectsCheck.isSelected()) {
		Binding b = _bindings.getBinding("headerObjects");
		b.put(c);
	}
}
 
Example #18
Source File: RcBuilder.java    From beast-mcmc with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void addBitmap(int id, File bitmap) {
	if (bitmap == null) {
		return;
	}

	_sb.append(id);
	_sb.append(" BITMAP \"");
	_sb.append(getPath(Util.getAbsoluteFile(
			ConfigPersister.getInstance().getConfigPath(), bitmap)));
	_sb.append("\"\n");
}
 
Example #19
Source File: RcBuilder.java    From beast-mcmc with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void addIcon(int id, File icon) {
	if (icon == null || icon.getPath().equals("")) {
		return;
	}

	_sb.append(id);
	_sb.append(" ICON DISCARDABLE \"");
	_sb.append(getPath(Util.getAbsoluteFile(
			ConfigPersister.getInstance().getConfigPath(), icon)));
	_sb.append("\"\n");
}
 
Example #20
Source File: RcBuilder.java    From beast-mcmc with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void addManifest(int id, File manifest) {
	if (manifest == null || manifest.getPath().equals("")) {
		return;
	}

	_sb.append(id);
	_sb.append(" 24 \"");
	_sb.append(getPath(Util.getAbsoluteFile(
			ConfigPersister.getInstance().getConfigPath(), manifest)));
	_sb.append("\"\n");
}
 
Example #21
Source File: Validator.java    From beast-mcmc with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static void checkFile(File f, String property, String fileDescription) {
	File cfgPath = ConfigPersister.getInstance().getConfigPath();
	if (f == null
			|| f.getPath().equals("")
			|| (!f.exists() && !Util.getAbsoluteFile(cfgPath, f).exists())) {
		signalViolation(property,
				Messages.getString("Validator.doesnt.exist", fileDescription));
	}
}
 
Example #22
Source File: HeaderFormImpl.java    From beast-mcmc with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void actionPerformed(ActionEvent e) {
	if (!_headerObjectsCheck.isSelected()) {
		ConfigPersister.getInstance().getConfig().setHeaderObjects(null);
		Binding b = _bindings.getBinding("headerObjects");
		b.put(ConfigPersister.getInstance().getConfig());
	}
}
 
Example #23
Source File: HeaderFormImpl.java    From beast-mcmc with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void actionPerformed(ActionEvent e) {
	Config c = ConfigPersister.getInstance().getConfig();
	c.setHeaderType(e.getActionCommand());

	if (!_headerObjectsCheck.isSelected()) {
		Binding b = _bindings.getBinding("headerObjects");
		b.put(c);
		updateLibs();
	}
}
 
Example #24
Source File: HeaderFormImpl.java    From beast-mcmc with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void updateLibs() {
	if (!_libsCheck.isSelected()) {
		ConfigPersister.getInstance().getConfig().setLibs(null);
		Binding b = _bindings.getBinding("libs");
		b.put(ConfigPersister.getInstance().getConfig());
	}
}
 
Example #25
Source File: MainFrame.java    From beast-mcmc with GNU Lesser General Public License v2.1 4 votes vote down vote up
private void clearConfig() {
	ConfigPersister.getInstance().createBlank();
	_configForm.clear(ConfigPersister.getInstance().getConfig());
}
 
Example #26
Source File: MainFrame.java    From jmkvpropedit with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private void clearConfig() {
	ConfigPersister.getInstance().createBlank();
	_configForm.clear(ConfigPersister.getInstance().getConfig());
}
 
Example #27
Source File: MainFrame.java    From PyramidShader with GNU General Public License v3.0 4 votes vote down vote up
private void clearConfig() {
	ConfigPersister.getInstance().createBlank();
	_configForm.clear(ConfigPersister.getInstance().getConfig());
}