List of usage examples for org.eclipse.jgit.lib StoredConfig fromText
public void fromText(String text) throws ConfigInvalidException
From source file:com.chungkwong.jgitgui.GitTreeItem.java
License:Open Source License
private void gitConfig() { try {//from w w w . j a v a 2 s.com StoredConfig config = ((Git) getValue()).getRepository().getConfig(); Dialog dialog = new Dialog(); dialog.setTitle( java.util.ResourceBundle.getBundle("com/chungkwong/jgitgui/text").getString("CONFIGURE")); TextArea area = new TextArea(config.toText()); dialog.getDialogPane().setContent(area); dialog.getDialogPane().getButtonTypes().addAll(ButtonType.CANCEL, ButtonType.APPLY); dialog.showAndWait(); if (dialog.getResult().equals(ButtonType.APPLY)) { config.fromText(area.getText()); config.save(); } } catch (Exception ex) { Logger.getLogger(GitTreeItem.class.getName()).log(Level.SEVERE, null, ex); Util.informUser(ex); } }