Search in sources :

Example 11 with PCGenSettings

use of pcgen.system.PCGenSettings in project pcgen by PCGen.

the class WriteDirectoryPanel method performAnalysis.

@Override
public boolean performAnalysis(CDOMObject pc) {
    TaskStrategyMessage.sendStatus(this, "Finding Data Directories");
    campaignList = pc.getListFor(ListKey.CAMPAIGN);
    path = pc.get(ObjectKey.WRITE_DIRECTORY);
    if (path != null) {
        fileLabel.setText(path.getAbsolutePath());
    } else {
        PCGenSettings context = PCGenSettings.getInstance();
        String outputPathName = context.initProperty(PCGenSettings.CONVERT_OUTPUT_SAVE_PATH, SystemUtils.USER_DIR);
        path = new File(outputPathName);
    }
    pc.put(ObjectKey.WRITE_DIRECTORY, path);
    fireProgressEvent(ProgressEvent.ALLOWED);
    return true;
}
Also used : PCGenSettings(pcgen.system.PCGenSettings) File(java.io.File)

Aggregations

PCGenSettings (pcgen.system.PCGenSettings)11 File (java.io.File)7 FileNameExtensionFilter (javax.swing.filechooser.FileNameExtensionFilter)4 PCGFile (pcgen.io.PCGFile)4 ActionEvent (java.awt.event.ActionEvent)3 ActionListener (java.awt.event.ActionListener)3 JLabel (javax.swing.JLabel)3 FileFilter (javax.swing.filechooser.FileFilter)3 JButton (javax.swing.JButton)2 JFileChooser (javax.swing.JFileChooser)2 Campaign (pcgen.core.Campaign)2 GameMode (pcgen.core.GameMode)2 Component (java.awt.Component)1 Font (java.awt.Font)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 AbstractButton (javax.swing.AbstractButton)1