public static void setTreeReaderFactory(TreeReaderFactory trf) { prefs.put(PREF_TREE_READER_FACTORY, trf.getClass().getSimpleName()); }
public static void setHeadFinder(HeadFinder hf) { prefs.put(PREF_HEAD_FINDER, hf.getClass().getSimpleName()); }
public void valueChanged (ListSelectionEvent evt) { if (evt.getValueIsAdjusting()) return; prefs.put("system.font", (String)fontList.getSelectedValue()); updateFont(); } });
public void valueChanged (ListSelectionEvent evt) { if (evt.getValueIsAdjusting()) return; prefs.put("system.font", (String)fontList.getSelectedValue()); updateFont(); } });
private void changed () { File file = new File(fontFileText.getText()); if (fontList.isEnabled() && (!file.exists() || !file.isFile())) return; prefs.put("font.file", fontFileText.getText()); updateFont(); } });
private void changed () { File file = new File(fontFileText.getText()); if (fontList.isEnabled() && (!file.exists() || !file.isFile())) return; prefs.put("font.file", fontFileText.getText()); updateFont(); } });
public static void store(JadxSettings settings) { try { String jsonSettings = makeString(settings); LOG.debug("Saving settings: {}", jsonSettings); PREFS.put(JADX_GUI_KEY, jsonSettings); PREFS.sync(); } catch (Exception e) { LOG.error("Error store settings", e); } }
public void updateValues () { prefs.put("foreground", EffectUtil.toString(colorEffect.getColor())); valuesPanel.removeAll(); values = effect.getValues(); for (Iterator iter = values.iterator(); iter.hasNext();) addValue((Value)iter.next()); }
public void updateValues () { prefs.put("foreground", EffectUtil.toString(colorEffect.getColor())); valuesPanel.removeAll(); values = effect.getValues(); for (Iterator iter = values.iterator(); iter.hasNext();) addValue((Value)iter.next()); }
public void mouseClicked (MouseEvent evt) { java.awt.Color color = JColorChooser.showDialog(null, "Choose a background color", EffectUtil.fromString(prefs.get("background", "000000"))); if (color == null) return; renderingBackgroundColor = new Color(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, 1); backgroundColorLabel.setIcon(getColorIcon(color)); prefs.put("background", EffectUtil.toString(color)); } });
public void mouseClicked (MouseEvent evt) { java.awt.Color color = JColorChooser.showDialog(null, "Choose a background color", EffectUtil.fromString(prefs.get("background", "000000"))); if (color == null) return; renderingBackgroundColor = new Color(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, 1); backgroundColorLabel.setIcon(getColorIcon(color)); prefs.put("background", EffectUtil.toString(color)); } });
public void actionPerformed (ActionEvent evt) { FileDialog dialog = new FileDialog(Hiero.this, "Choose TrueType font file", FileDialog.LOAD); dialog.setLocationRelativeTo(null); dialog.setFile("*.ttf"); dialog.setDirectory(prefs.get("dir.font", "")); dialog.setVisible(true); if (dialog.getDirectory() != null) { prefs.put("dir.font", dialog.getDirectory()); } String fileName = dialog.getFile(); if (fileName == null) return; fontFileText.setText(new File(dialog.getDirectory(), fileName).getAbsolutePath()); } });
public void actionPerformed (ActionEvent evt) { FileDialog dialog = new FileDialog(Hiero.this, "Choose TrueType font file", FileDialog.LOAD); dialog.setLocationRelativeTo(null); dialog.setFile("*.ttf"); dialog.setDirectory(prefs.get("dir.font", "")); dialog.setVisible(true); if (dialog.getDirectory() != null) { prefs.put("dir.font", dialog.getDirectory()); } String fileName = dialog.getFile(); if (fileName == null) return; fontFileText.setText(new File(dialog.getDirectory(), fileName).getAbsolutePath()); } });
public void actionPerformed (ActionEvent evt) { FileDialog dialog = new FileDialog(Hiero.this, "Save BMFont files", FileDialog.SAVE); dialog.setLocationRelativeTo(null); dialog.setFile("*.fnt"); dialog.setDirectory(prefs.get("dir.savebm", "")); if (lastSaveBMFilename.length() > 0) { dialog.setFile(lastSaveBMFilename); } else if (lastOpenFilename.length() > 0) { dialog.setFile(lastOpenFilename.replace(".hiero", ".fnt")); } dialog.setVisible(true); if (dialog.getDirectory() != null) { prefs.put("dir.savebm", dialog.getDirectory()); } String fileName = dialog.getFile(); if (fileName == null) return; lastSaveBMFilename = fileName; saveBm(new File(dialog.getDirectory(), fileName)); } });
public void actionPerformed (ActionEvent evt) { FileDialog dialog = new FileDialog(Hiero.this, "Save BMFont files", FileDialog.SAVE); dialog.setLocationRelativeTo(null); dialog.setFile("*.fnt"); dialog.setDirectory(prefs.get("dir.savebm", "")); if (lastSaveBMFilename.length() > 0) { dialog.setFile(lastSaveBMFilename); } else if (lastOpenFilename.length() > 0) { dialog.setFile(lastOpenFilename.replace(".hiero", ".fnt")); } dialog.setVisible(true); if (dialog.getDirectory() != null) { prefs.put("dir.savebm", dialog.getDirectory()); } String fileName = dialog.getFile(); if (fileName == null) return; lastSaveBMFilename = fileName; saveBm(new File(dialog.getDirectory(), fileName)); } });
public void actionPerformed (ActionEvent evt) { FileDialog dialog = new FileDialog(Hiero.this, "Open Hiero settings file", FileDialog.LOAD); dialog.setLocationRelativeTo(null); dialog.setFile("*.hiero"); dialog.setDirectory(prefs.get("dir.open", "")); dialog.setVisible(true); if (dialog.getDirectory() != null) { prefs.put("dir.open", dialog.getDirectory()); } String fileName = dialog.getFile(); if (fileName == null) return; lastOpenFilename = fileName; open(new File(dialog.getDirectory(), fileName)); } });
public void actionPerformed (ActionEvent evt) { FileDialog dialog = new FileDialog(Hiero.this, "Open Hiero settings file", FileDialog.LOAD); dialog.setLocationRelativeTo(null); dialog.setFile("*.hiero"); dialog.setDirectory(prefs.get("dir.open", "")); dialog.setVisible(true); if (dialog.getDirectory() != null) { prefs.put("dir.open", dialog.getDirectory()); } String fileName = dialog.getFile(); if (fileName == null) return; lastOpenFilename = fileName; open(new File(dialog.getDirectory(), fileName)); } });
@Test public void testPreferencesPlaceholderConfigurerWithPathInPlaceholder() { factory.registerBeanDefinition("tb", genericBeanDefinition(TestBean.class) .addPropertyValue("name", "${mypath/myName}") .addPropertyValue("age", "${myAge}") .addPropertyValue("touchy", "${myotherpath/myTouchy}") .getBeanDefinition()); PreferencesPlaceholderConfigurer ppc = new PreferencesPlaceholderConfigurer(); Properties props = new Properties(); props.put("myAge", "99"); ppc.setProperties(props); ppc.setSystemTreePath("mySystemPath"); ppc.setUserTreePath("myUserPath"); Preferences.systemRoot().node("mySystemPath").node("mypath").put("myName", "myNameValue"); Preferences.systemRoot().node("mySystemPath/myotherpath").put("myTouchy", "myTouchyValue"); Preferences.userRoot().node("myUserPath/myotherpath").put("myTouchy", "myOtherTouchyValue"); ppc.afterPropertiesSet(); ppc.postProcessBeanFactory(factory); TestBean tb = (TestBean) factory.getBean("tb"); assertEquals("myNameValue", tb.getName()); assertEquals(99, tb.getAge()); assertEquals("myOtherTouchyValue", tb.getTouchy()); Preferences.userRoot().node("myUserPath/myotherpath").remove("myTouchy"); Preferences.systemRoot().node("mySystemPath/myotherpath").remove("myTouchy"); Preferences.systemRoot().node("mySystemPath/mypath").remove("myName"); }
@Test public void testPreferencesPlaceholderConfigurerWithCustomTreePaths() { factory.registerBeanDefinition("tb", genericBeanDefinition(TestBean.class) .addPropertyValue("name", "${myName}") .addPropertyValue("age", "${myAge}") .addPropertyValue("touchy", "${myTouchy}") .getBeanDefinition()); PreferencesPlaceholderConfigurer ppc = new PreferencesPlaceholderConfigurer(); Properties props = new Properties(); props.put("myAge", "99"); ppc.setProperties(props); ppc.setSystemTreePath("mySystemPath"); ppc.setUserTreePath("myUserPath"); Preferences.systemRoot().node("mySystemPath").put("myName", "myNameValue"); Preferences.systemRoot().node("mySystemPath").put("myTouchy", "myTouchyValue"); Preferences.userRoot().node("myUserPath").put("myTouchy", "myOtherTouchyValue"); ppc.afterPropertiesSet(); ppc.postProcessBeanFactory(factory); TestBean tb = (TestBean) factory.getBean("tb"); assertEquals("myNameValue", tb.getName()); assertEquals(99, tb.getAge()); assertEquals("myOtherTouchyValue", tb.getTouchy()); Preferences.userRoot().node("myUserPath").remove("myTouchy"); Preferences.systemRoot().node("mySystemPath").remove("myTouchy"); Preferences.systemRoot().node("mySystemPath").remove("myName"); }
@Test public void testPreferencesPlaceholderConfigurer() { factory.registerBeanDefinition("tb", genericBeanDefinition(TestBean.class) .addPropertyValue("name", "${myName}") .addPropertyValue("age", "${myAge}") .addPropertyValue("touchy", "${myTouchy}") .getBeanDefinition()); PreferencesPlaceholderConfigurer ppc = new PreferencesPlaceholderConfigurer(); Properties props = new Properties(); props.put("myAge", "99"); ppc.setProperties(props); Preferences.systemRoot().put("myName", "myNameValue"); Preferences.systemRoot().put("myTouchy", "myTouchyValue"); Preferences.userRoot().put("myTouchy", "myOtherTouchyValue"); ppc.afterPropertiesSet(); ppc.postProcessBeanFactory(factory); TestBean tb = (TestBean) factory.getBean("tb"); assertEquals("myNameValue", tb.getName()); assertEquals(99, tb.getAge()); assertEquals("myOtherTouchyValue", tb.getTouchy()); Preferences.userRoot().remove("myTouchy"); Preferences.systemRoot().remove("myTouchy"); Preferences.systemRoot().remove("myName"); }