Search in sources :

Example 11 with FSPath

use of org.apache.cayenne.modeler.pref.FSPath in project cayenne by apache.

the class CodeTemplateManager method updateCustomTemplates.

/**
 * Updates custom templates from preferences.
 */
public void updateCustomTemplates(Preferences preference) {
    String[] keys = {};
    try {
        keys = preference.childrenNames();
    } catch (BackingStoreException e) {
        logger.warn("Error reading preferences");
    }
    this.customTemplates = new HashMap<>(keys.length, 1);
    for (String key : keys) {
        FSPath path = new FSPath(preference.node(key));
        customTemplates.put(key, path.getPath());
    }
}
Also used : BackingStoreException(java.util.prefs.BackingStoreException) FSPath(org.apache.cayenne.modeler.pref.FSPath)

Aggregations

FSPath (org.apache.cayenne.modeler.pref.FSPath)11 File (java.io.File)7 JFileChooser (javax.swing.JFileChooser)2 BufferedImage (java.awt.image.BufferedImage)1 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 URL (java.net.URL)1 BackingStoreException (java.util.prefs.BackingStoreException)1 Preferences (java.util.prefs.Preferences)1 JTextField (javax.swing.JTextField)1 AbstractTableModel (javax.swing.table.AbstractTableModel)1 DataMap (org.apache.cayenne.map.DataMap)1 BindingBuilder (org.apache.cayenne.swing.BindingBuilder)1 EOModelProcessor (org.apache.cayenne.wocompat.EOModelProcessor)1 JGraph (org.jgraph.JGraph)1